All files / packages/core/src/RenderingEngine VolumeViewport3D.ts

88.88% Statements 24/27
77.77% Branches 14/18
66.66% Functions 4/6
86.36% Lines 19/22

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51                      2x 1x 1x   1x   1x   1x       1x 1x 1x 1x     2x 2x 2x   2x 2x 2x 1x   4x       1x                
import { OrientationAxis } from '../enums';
import type { ViewportInput } from '../types/IViewport';
import BaseVolumeViewport from './BaseVolumeViewport';
 
/**
 * An object representing a 3-dimensional volume viewport. VolumeViewport3Ds are used to render
 * 3D volumes in their entirety, and not just load a single slice at a time.
 *
 * For setting volumes on viewports you need to use {@link addVolumesToViewports}
 * which will add volumes to the specified viewports.
 */
class VolumeViewport3D extends BaseVolumeViewport {
  constructor(props: ViewportInput) {
    super(props);
 
    const { parallelProjection, orientation } = this.options;
 
    const activeCamera = this.getVtkActiveCamera();
 
    Iif (parallelProjection != null) {
      activeCamera.setParallelProjection(parallelProjection);
    }
 
    Eif (orientation && orientation !== OrientationAxis.ACQUISITION) {
      this.applyViewOrientation(orientation);
    }
  }
 
  public resetCamera(
    resetPan = true,
    resetZoom = true,
    resetToCenter = true
  ): boolean {
    super.resetCamera(resetPan, resetZoom, resetToCenter);
    this.resetVolumeViewportClippingRange();
    return;
  }
 
  getRotation = (): number => 0;
 
  public getCurrentImageIdIndex = (): number | undefined => {
    return undefined;
  };
 
  public getCurrentImageId = (): string => {
    return null;
  };
}
 
export default VolumeViewport3D;