Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit

Controls the camera used by the associated BaseRenderer. More...

#include <mitkCameraController.h>

Inheritance diagram for mitk::CameraController:
Collaboration diagram for mitk::CameraController:

Public Types

enum  StandardView {
  ANTERIOR , POSTERIOR , SINISTER , DEXTER ,
  CRANIAL , CAUDAL
}
 Enumeration of standard anatomical viewing directions. More...
 

Public Member Functions

 mitkClassMacro (CameraController, BaseController)
 
void SetRenderer (const BaseRenderer *renderer)
 Set the renderer whose camera this controller manages. More...
 
virtual const BaseRenderer * GetRenderer () const
 
virtual void SetViewToAnterior ()
 Set the camera to an anterior (front) view. More...
 
virtual void SetViewToPosterior ()
 Set the camera to a posterior (back) view. More...
 
virtual void SetViewToSinister ()
 Set the camera to a sinister (left) view. More...
 
virtual void SetViewToDexter ()
 Set the camera to a dexter (right) view. More...
 
virtual void SetViewToCranial ()
 Set the camera to a cranial (top) view. More...
 
virtual void SetViewToCaudal ()
 Set the camera to a caudal (bottom) view. More...
 
virtual void SetStandardView (StandardView view)
 Set the camera to one of the standard anatomical views. More...
 
void Fit ()
 Adjust the camera so that the world bounding box is fully visible. More...
 
void SetScaleFactorInMMPerDisplayUnit (ScalarType scale)
 Set the desired zoom level to an absolute value. More...
 
void MoveCameraToPoint (const Point2D &planePoint)
 Move the camera so that the given point on the plane is in the view center. More...
 
void MoveBy (const Vector2D &moveVectorInMM)
 Move the camera by the given vector (in mm). More...
 
void Zoom (ScalarType factor, const Point2D &zoomPointInMM)
 Zoom the camera by the given factor around the specified point. More...
 
Point2D GetCameraPositionOnPlane ()
 Get the current camera position projected onto the plane. More...
 
void AdjustCameraToPlane ()
 Adjust the camera orientation to match the current plane without panning or zooming. More...
 
- Public Member Functions inherited from mitk::BaseController
 mitkClassMacroItkParent (BaseController, OperationActor)
 
Stepper * GetStepper ()
 Get the stepper for stepping through the controlled dimension. More...
 
const Stepper * GetStepper () const
 Get the stepper for stepping through the controlled dimension (const). More...
 
- Public Member Functions inherited from mitk::OperationActor
 itkTypeMacroNoParent (OperationActor) virtual ~OperationActor()
 

Static Public Member Functions

static Pointer New ()
 
- Static Public Member Functions inherited from mitk::BaseController
static Pointer New ()
 

Protected Member Functions

 CameraController ()
 Default constructor. More...
 
 ~CameraController () override
 Destructor. More...
 
ScalarType ComputeMaxParallelScale ()
 Compute the maximum parallel scale that fits the entire plane into the viewport. More...
 
- Protected Member Functions inherited from mitk::BaseController
 BaseController ()
 Default constructor. More...
 
 ~BaseController () override
 Destructor. More...
 
void ExecuteOperation (Operation *) override
 Execute an undo/redo operation. More...
 

Protected Attributes

const BaseRenderer * m_Renderer
 The renderer whose camera is controlled. More...
 
- Protected Attributes inherited from mitk::BaseController
Stepper::Pointer m_Stepper
 Stepper through the controlled dimension. More...
 
unsigned long m_LastUpdateTime
 Timestamp of the last update. More...
 

Detailed Description

Controls the camera used by the associated BaseRenderer.

Subclass of BaseController. Provides methods for setting standard anatomical views, fitting the view to the world bounding box, zooming, panning, and adjusting the camera to the current plane geometry.

See also
BaseController BaseRenderer

Definition at line 33 of file mitkCameraController.h.

Member Enumeration Documentation

◆ StandardView

Enumeration of standard anatomical viewing directions.

Enumerator
ANTERIOR 

View from the front (ventral).

POSTERIOR 

View from the back (dorsal).

SINISTER 

View from the left.

DEXTER 

View from the right.

CRANIAL 

View from above (superior).

CAUDAL 

View from below (inferior).

Definition at line 37 of file mitkCameraController.h.

Constructor & Destructor Documentation

◆ CameraController()

mitk::CameraController::CameraController ( )
protected

Default constructor.

◆ ~CameraController()

mitk::CameraController::~CameraController ( )
overrideprotected

Destructor.

Member Function Documentation

◆ AdjustCameraToPlane()

void mitk::CameraController::AdjustCameraToPlane ( )

Adjust the camera orientation to match the current plane without panning or zooming.

This rotates the camera so it is aligned with the current world plane geometry.

◆ ComputeMaxParallelScale()

ScalarType mitk::CameraController::ComputeMaxParallelScale ( )
protected

Compute the maximum parallel scale that fits the entire plane into the viewport.

Returns
The maximum parallel scale value in mm.

◆ Fit()

void mitk::CameraController::Fit ( )

Adjust the camera so that the world bounding box is fully visible.

◆ GetCameraPositionOnPlane()

Point2D mitk::CameraController::GetCameraPositionOnPlane ( )

Get the current camera position projected onto the plane.

Returns
The camera position in plane coordinates (mm).

◆ GetRenderer()

virtual const BaseRenderer* mitk::CameraController::GetRenderer ( ) const
virtual

◆ mitkClassMacro()

mitk::CameraController::mitkClassMacro ( CameraController  ,
BaseController   
)

◆ MoveBy()

void mitk::CameraController::MoveBy ( const Vector2D &  moveVectorInMM)

Move the camera by the given vector (in mm).

Parameters
moveVectorInMMThe translation vector in millimeters.

◆ MoveCameraToPoint()

void mitk::CameraController::MoveCameraToPoint ( const Point2D &  planePoint)

Move the camera so that the given point on the plane is in the view center.

Parameters
planePointThe target point in plane coordinates (mm).

◆ New()

static Pointer mitk::CameraController::New ( )
static

◆ SetRenderer()

void mitk::CameraController::SetRenderer ( const BaseRenderer *  renderer)
inline

Set the renderer whose camera this controller manages.

Definition at line 52 of file mitkCameraController.h.

◆ SetScaleFactorInMMPerDisplayUnit()

void mitk::CameraController::SetScaleFactorInMMPerDisplayUnit ( ScalarType  scale)

Set the desired zoom level to an absolute value.

Parameters
scaleThe scale factor in millimeters per display unit.

◆ SetStandardView()

virtual void mitk::CameraController::SetStandardView ( StandardView  view)
virtual

Set the camera to one of the standard anatomical views.

Parameters
viewThe StandardView direction to apply.

◆ SetViewToAnterior()

virtual void mitk::CameraController::SetViewToAnterior ( )
virtual

Set the camera to an anterior (front) view.

◆ SetViewToCaudal()

virtual void mitk::CameraController::SetViewToCaudal ( )
virtual

Set the camera to a caudal (bottom) view.

◆ SetViewToCranial()

virtual void mitk::CameraController::SetViewToCranial ( )
virtual

Set the camera to a cranial (top) view.

◆ SetViewToDexter()

virtual void mitk::CameraController::SetViewToDexter ( )
virtual

Set the camera to a dexter (right) view.

◆ SetViewToPosterior()

virtual void mitk::CameraController::SetViewToPosterior ( )
virtual

Set the camera to a posterior (back) view.

◆ SetViewToSinister()

virtual void mitk::CameraController::SetViewToSinister ( )
virtual

Set the camera to a sinister (left) view.

◆ Zoom()

void mitk::CameraController::Zoom ( ScalarType  factor,
const Point2D &  zoomPointInMM 
)

Zoom the camera by the given factor around the specified point.

Parameters
factorThe zoom factor (>1 zooms in, <1 zooms out, <=0 is ignored).
zoomPointInMMThe point around which to zoom, in plane coordinates (mm).

Member Data Documentation

◆ m_Renderer

const BaseRenderer* mitk::CameraController::m_Renderer
protected

The renderer whose camera is controlled.

Definition at line 125 of file mitkCameraController.h.


The documentation for this class was generated from the following file: