18 #include <vtkCamera.h>
19 #include <vtkFollower.h>
21 #include <vtkPolyDataMapper.h>
22 #include <vtkProperty.h>
23 #include <vtkTextActor3D.h>
24 #include <vtkTextProperty.h>
25 #include <vtkVectorText.h>
53 mapper->SetInputConnection(m_textSource->GetOutputPort());
57 m_follower->SetMapper(mapper);
58 m_follower->GetProperty()->SetColor(1, 0, 0);
59 m_follower->SetScale(1);
64 LocalStorage *ls = this->m_LSH.GetLocalStorage(renderer);
67 Point3D pos3d = GetPosition3D(renderer);
71 vtkCamera *camera = vtkRender->GetActiveCamera();
73 if (camera !=
nullptr)
79 camera->GetViewUp(viewUp.GetDataPointer());
81 camera->GetDirectionOfProjection(cameraDirection.GetDataPointer());
83 vtkMath::Cross(cameraDirection.GetDataPointer(), viewUp.GetDataPointer(), viewRight.GetDataPointer());
85 pos3d = pos3d + viewRight * offset[0] + viewUp * offset[1] + cameraDirection * offset[2];
88 ls->
m_follower->SetPosition(pos3d.GetDataPointer());
90 float color[3] = {1, 1, 1};
92 GetColor(color, renderer);
93 GetOpacity(opacity, renderer);
94 ls->
m_follower->GetProperty()->SetColor(color[0], color[1], color[2]);
95 ls->
m_follower->GetProperty()->SetOpacity(opacity);
103 LocalStorage *ls = this->m_LSH.GetLocalStorage(renderer);
virtual vtkProp * GetVtkProp(BaseRenderer *renderer) const override
This method is implemented by the specific VTKOverlays in order to create the element as a vtkProp...
Organizes the rendering process.
void SetPosition3D(const Point3D &position3D, mitk::BaseRenderer *renderer=NULL)
Internal class holding the mapper, actor, etc. for each of the render windows.
void SetColor(const mitk::Color &color, mitk::BaseRenderer *renderer=nullptr, const std::string &propertyKey="color")
Convenience method for setting color properties (instances of ColorProperty)
~LocalStorage()
Default deconstructor of the local storage.
vtkSmartPointer< vtkVectorText > m_textSource
void UpdateVtkOverlay(mitk::BaseRenderer *renderer) override
void SetFontSize(int fontSize, mitk::BaseRenderer *renderer=nullptr)
vtkSmartPointer< vtkFollower > m_follower
Actor of a 2D render window.
void SetOffsetVector(const Point3D &OffsetVector, mitk::BaseRenderer *renderer=NULL)
void UpdateGenerateDataTime()
TextOverlay3D()
explicit constructor which disallows implicit conversions
bool IsGenerateDataRequired(mitk::BaseRenderer *renderer, mitk::Overlay *overlay)
void SetText(std::string text, mitk::BaseRenderer *renderer=nullptr)
vtkRenderer * GetVtkRenderer() const
LocalStorage()
Default constructor of the local storage.
virtual ~TextOverlay3D()
virtual destructor in order to derive from this class
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.