19 #include "vtkCamera.h"
28 m_Renderer(NULL), m_FocalLength(10.0)
49 if (m_Renderer.IsNull())
50 itkExceptionMacro(<<
"Renderer was not properly set");
53 unsigned int numberOfInputs = this->GetNumberOfInputs();
54 for (
unsigned int i = 0; i < numberOfInputs ; ++i)
77 vnl_quaternion<double> doubleQuaternion(orientation.x(), orientation.y(), orientation.z(), orientation.r());
78 quatTransform->SetIdentity();
79 quatTransform->SetRotation(doubleQuaternion);
80 quatTransform->Modified();
84 static AffineTransform3D::MatrixType m;
89 Vector3D directionOfProjection = m*m_DirectionOfProjectionInToolCoordinates;
90 directionOfProjection.Normalize();
91 Point3D focalPoint = cameraPosition + m_FocalLength*directionOfProjection;
93 Vector3D viewUp = m*m_ViewUpInToolCoordinates;
95 m_Renderer->GetVtkRenderer()->GetActiveCamera()->SetPosition(cameraPosition[0],cameraPosition[1],cameraPosition[2]);
96 m_Renderer->GetVtkRenderer()->GetActiveCamera()->SetFocalPoint(focalPoint[0],focalPoint[1],focalPoint[2]);
97 m_Renderer->GetVtkRenderer()->GetActiveCamera()->SetViewUp(viewUp[0],viewUp[1],viewUp[2]);
98 m_Renderer->GetVtkRenderer()->ResetCameraClippingRange();
100 m_Renderer->RequestUpdate();
106 m_Renderer = renderer;
122 this->SetDirectionOfProjectionInToolCoordinates(doP);
125 this->SetViewUpInToolCoordinates(vUp);
127 if (p->
GetPropertyValue<
float>(
"CameraVisualization_FocalLength", fL) ==
true)
128 this->SetFocalLength(fL);
130 if (p->
GetPropertyValue<
float>(
"CameraVisualization_ViewAngle", vA) ==
true)
131 this->SetFocalLength(vA);
138 p->SetProperty(
"CameraVisualization_DirectionOfProjectionInToolCoordinates",
mitk::Vector3DProperty::New(this->GetDirectionOfProjectionInToolCoordinates()));
itk::SmartPointer< Self > Pointer
NavigationDataToNavigationDataFilter is the base class of all filters that receive NavigationDatas as...
Organizes the rendering process.
virtual ~CameraVisualization()
virtual OrientationType GetOrientation() const
returns the orientation of the NavigationData object
Key-value list holding instances of BaseProperty.
mitk::Quaternion OrientationType
Type that holds the orientation part of the tracking data.
virtual void SetParameters(const mitk::PropertyList *p) override
Set all filter parameters as the PropertyList p.
virtual void GenerateData() override
filter execute method
mitk::PropertyList::ConstPointer GetParameters() const override
Get all filter parameters as a PropertyList.
virtual const mitk::BaseRenderer * GetRenderer()
returns the renderer that visualizes the navigation data
itk::SmartPointer< const Self > ConstPointer
bool GetPropertyValue(const char *propertyKey, T &value) const
Convenience access method for GenericProperty properties (T being the type of the second parameter...
virtual void SetRenderer(mitk::BaseRenderer *renderer)
sets renderer that visualizes the navigation data
virtual bool IsDataValid() const
returns true if the object contains valid data
virtual PositionType GetPosition() const
returns position of the NavigationData object
Vector3D m_ViewUpInToolCoordinates
view up vector in tool coordinates
virtual void Graft(const DataObject *data) override
Graft the data and information from one NavigationData to another.
Vector3D m_DirectionOfProjectionInToolCoordinates
vector of the direction of projection in tool coordinates
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.