15 #include "vtkCamera.h" 24 m_Renderer(nullptr), m_FocalLength(10.0)
46 itkExceptionMacro(<<
"Renderer was not properly set");
49 unsigned int numberOfInputs = this->GetNumberOfInputs();
50 for (
unsigned int i = 0; i < numberOfInputs ; ++i)
69 static itk::QuaternionRigidTransform<double>::Pointer quatTransform = itk::QuaternionRigidTransform<double>::New();
73 vnl_quaternion<double> doubleQuaternion(orientation.x(), orientation.y(), orientation.z(), orientation.r());
74 quatTransform->SetIdentity();
75 quatTransform->SetRotation(doubleQuaternion);
76 quatTransform->Modified();
80 static AffineTransform3D::MatrixType m;
86 directionOfProjection.Normalize();
91 m_Renderer->GetVtkRenderer()->GetActiveCamera()->SetPosition(cameraPosition[0],cameraPosition[1],cameraPosition[2]);
92 m_Renderer->GetVtkRenderer()->GetActiveCamera()->SetFocalPoint(focalPoint[0],focalPoint[1],focalPoint[2]);
93 m_Renderer->GetVtkRenderer()->GetActiveCamera()->SetViewUp(viewUp[0],viewUp[1],viewUp[2]);
94 m_Renderer->GetVtkRenderer()->ResetCameraClippingRange();
123 if (p->
GetPropertyValue<
float>(
"CameraVisualization_FocalLength", fL) ==
true)
126 if (p->
GetPropertyValue<
float>(
"CameraVisualization_ViewAngle", vA) ==
true)
virtual mitk::Vector3D GetDirectionOfProjectionInToolCoordinates() const
returns the direction of projection of the camera of the renderer in tool coordinates ...
ScalarType m_FocalLength
focal length of the camera: distance between camera position and focal point.
NavigationData * GetOutput(void)
return the output (output with id 0) of the filter
NavigationDataToNavigationDataFilter is the base class of all filters that receive NavigationDatas as...
Organizes the rendering process.
Key-value list holding instances of BaseProperty.
mitk::Quaternion OrientationType
Type that holds the orientation part of the tracking data.
void SetParameters(const mitk::PropertyList *p) override
Set all filter parameters as the PropertyList p.
mitk::BaseRenderer::Pointer m_Renderer
renderer that visualizes the navigation data-
virtual PositionType GetPosition() const
returns position of the NavigationData object
const NavigationData * GetInput(void) const
Get the input of this filter.
void GenerateData() override
filter execute method
bool GetPropertyValue(const char *propertyKey, T &value) const
Convenience access method for GenericProperty<T> properties (T being the type of the second parameter...
mitk::PropertyList::ConstPointer GetParameters() const override
Get all filter parameters as a PropertyList.
virtual void SetViewUpInToolCoordinates(mitk::Vector3D _arg)
sets the view up vector of the camera of the renderer in tool coordinates
virtual void SetDirectionOfProjectionInToolCoordinates(mitk::Vector3D _arg)
sets the direction of projection of the camera of the renderer in tool coordinates ...
virtual const mitk::BaseRenderer * GetRenderer()
returns the renderer that visualizes the navigation data
itk::SmartPointer< const Self > ConstPointer
virtual void SetFocalLength(float _arg)
sets the focal length of the camera
virtual void SetRenderer(mitk::BaseRenderer *renderer)
sets renderer that visualizes the navigation data
Vector3D m_ViewUpInToolCoordinates
view up vector in tool coordinates
void Graft(const DataObject *data) override
Graft the data and information from one NavigationData to another.
~CameraVisualization() override
virtual float GetFocalLength() const
returns the focal length of the camera
virtual OrientationType GetOrientation() const
returns the orientation of the NavigationData object
virtual bool IsDataValid() const
returns true if the object contains valid data
Vector3D m_DirectionOfProjectionInToolCoordinates
vector of the direction of projection in tool coordinates
virtual mitk::Vector3D GetViewUpInToolCoordinates() const
returns the view up vector of the camera of the renderer in tool coordinates