14 #include "vtkUnicodeString.h" 15 #include <vtkPropAssembly.h> 16 #include <vtkTextActor.h> 17 #include <vtkTextProperty.h> 22 position[0] = position[1] = 0;
53 bounds.
Size[0] = size[0];
54 bounds.
Size[1] = size[1];
65 posS[0] = posT[0] + 1;
66 posS[1] = posT[1] - 1;
68 ls->
m_TextActor->SetDisplayPosition(posT[0], posT[1]);
78 m_TextActor = vtkSmartPointer<vtkTextActor>::New();
79 m_TextProp = vtkSmartPointer<vtkTextProperty>::New();
80 m_STextActor = vtkSmartPointer<vtkTextActor>::New();
81 m_STextProp = vtkSmartPointer<vtkTextProperty>::New();
82 m_TextActor->SetTextProperty(m_TextProp);
83 m_STextActor->SetTextProperty(m_STextProp);
84 m_Assembly = vtkSmartPointer<vtkPropAssembly>::New();
85 m_Assembly->AddPart(m_STextActor);
86 m_Assembly->AddPart(m_TextActor);
95 float color[3] = {0.0, 1.0, 0.0};
99 ls->
m_TextProp->SetColor(color[0], color[1], color[2]);
106 std::string fontFamilyAsString;
109 fontFamilyAsString =
"Arial";
111 ls->
m_TextProp->SetFontFamilyAsString(fontFamilyAsString.c_str());
112 ls->
m_STextProp->SetFontFamilyAsString(fontFamilyAsString.c_str());
114 bool boldFont(
false);
119 bool italicFont(
false);
136 posS[0] = posT[0] + 1;
137 posS[1] = posT[1] - 1;
139 ls->
m_TextActor->SetDisplayPosition(posT[0], posT[1]);
L * GetLocalStorage(mitk::BaseRenderer *forRenderer)
Retrieves a LocalStorage for a specific BaseRenderer.
void SetPosition2D(const Point2D &position2D)
void SetText(std::string text)
Point2D GetOffsetVector() const
std::vector< mitk::BaseRenderer * > GetRegisteredBaseRenderer()
Container for position and size on the display.
vtkRenderer * GetVtkRenderer() const
TextAnnotation2D()
explicit constructor which disallows implicit conversions
Point2D GetPosition2D() const
vtkSmartPointer< vtkTextActor > m_TextActor
Actor of a 2D render window.
itk::Point< double, 2 > Size
Organizes the rendering process.
bool IsGenerateDataRequired(mitk::BaseRenderer *renderer, mitk::Annotation *Annotation)
LocalStorage()
Default constructor of the local storage.
vtkProp * GetVtkProp(BaseRenderer *renderer) const override
This method is implemented by the specific VTKAnnotation in order to create the element as a vtkProp...
void SetBoundsOnDisplay(BaseRenderer *renderer, const Bounds &bounds) override
Sets position and size of the Annotation on the display.
void UpdateVtkAnnotation2D(mitk::BaseRenderer *renderer) override
void SetColor(const mitk::Color &color, const std::string &propertyKey="color")
Convenience method for setting color properties (instances of ColorProperty)
itk::Point< double, 2 > Position
Annotation::Bounds GetBoundsOnDisplay(BaseRenderer *renderer) const override
Returns position and size of the Annotation on the display.
~LocalStorage()
Default deconstructor of the local storage.
mitk::LocalStorageHandler< LocalStorage > m_LSH
The LocalStorageHandler holds all LocalStorages for the render windows.
bool GetColor(float rgb[], const std::string &propertyKey="color") const
Convenience access method for color properties (instances of ColorProperty)
void SetStringProperty(const std::string &propertyKey, const std::string &string)
Convenience method for setting int properties (instances of IntProperty)
vtkActor2D * GetVtkActor2D(BaseRenderer *renderer) const override
void RemoveFromBaseRenderer(BaseRenderer *renderer) override
Removes the Annotation from the specified renderer. It is not visible anymore then.
void SetBoolProperty(const std::string &propertyKey, bool boolValue)
Convenience method for setting int properties (instances of IntProperty)
std::string GetText() const
vtkSmartPointer< vtkTextProperty > m_STextProp
bool GetOpacity(float &opacity, const std::string &propertyKey="opacity") const
Convenience access method for opacity properties (instances of FloatProperty)
bool GetBoolProperty(const std::string &propertyKey, bool &boolValue) const
Convenience access method for bool properties (instances of BoolProperty)
bool GetStringProperty(const std::string &propertyKey, std::string &string) const
Convenience access method for string properties (instances of StringProperty)
vtkSmartPointer< vtkTextActor > m_STextActor
~TextAnnotation2D() override
virtual destructor in order to derive from this class
void UpdateGenerateDataTime()
void SetFontSize(int fontSize)
vtkSmartPointer< vtkPropAssembly > m_Assembly
void SetOffsetVector(const Point2D &OffsetVector)
vtkSmartPointer< vtkTextProperty > m_TextProp