VTK  9.3.0
vtkCornerAnnotation.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
27#ifndef vtkCornerAnnotation_h
28#define vtkCornerAnnotation_h
29
30#include "vtkActor2D.h"
31#include "vtkRenderingAnnotationModule.h" // For export macro
32
33VTK_ABI_NAMESPACE_BEGIN
34class vtkTextMapper;
36class vtkImageActor;
37class vtkTextProperty;
38
39class VTKRENDERINGANNOTATION_EXPORT vtkCornerAnnotation : public vtkActor2D
40{
41public:
43 void PrintSelf(ostream& os, vtkIndent indent) override;
44
50
52
55 int RenderOpaqueGeometry(vtkViewport* viewport) override;
57 int RenderOverlay(vtkViewport* viewport) override;
59
64
66
71 vtkSetMacro(MaximumLineHeight, double);
72 vtkGetMacro(MaximumLineHeight, double);
74
76
80 vtkSetMacro(MinimumFontSize, int);
81 vtkGetMacro(MinimumFontSize, int);
82 vtkSetMacro(MaximumFontSize, int);
83 vtkGetMacro(MaximumFontSize, int);
85
87
96 vtkSetMacro(LinearFontScaleFactor, double);
97 vtkGetMacro(LinearFontScaleFactor, double);
98 vtkSetMacro(NonlinearFontScaleFactor, double);
99 vtkGetMacro(NonlinearFontScaleFactor, double);
101
108
110
115 {
116 LowerLeft = 0,
123 UpperEdge
124 };
125 static const int NumTextPositions = 8;
127
129
133 void SetText(int i, const char* text);
134 const char* GetText(int i);
138
140
144 vtkGetObjectMacro(ImageActor, vtkImageActor);
146
148
153 vtkGetObjectMacro(WindowLevel, vtkImageMapToWindowLevelColors);
155
157
160 vtkSetMacro(LevelShift, double);
161 vtkGetMacro(LevelShift, double);
163
165
168 vtkSetMacro(LevelScale, double);
169 vtkGetMacro(LevelScale, double);
171
173
177 vtkGetObjectMacro(TextProperty, vtkTextProperty);
179
181
184 vtkBooleanMacro(ShowSliceAndImage, vtkTypeBool);
185 vtkSetMacro(ShowSliceAndImage, vtkTypeBool);
186 vtkGetMacro(ShowSliceAndImage, vtkTypeBool);
188
189protected:
192
194
196
202
203 char* CornerText[NumTextPositions];
204
206 vtkActor2D* TextActor[NumTextPositions];
208 int LastSize[2];
209 vtkTextMapper* TextMapper[NumTextPositions];
210
213
216
218
223
225
228 virtual void SetTextActorsPosition(const int vsize[2]);
231
232private:
234 void operator=(const vtkCornerAnnotation&) = delete;
235};
236
237VTK_ABI_NAMESPACE_END
238#endif
a actor that draws 2D data
Definition vtkActor2D.h:35
text annotation in four corners
static vtkCornerAnnotation * New()
Instantiate object with a rectangle in normaled view coordinates of (0.2,0.85, 0.8,...
int RenderTranslucentPolygonalGeometry(vtkViewport *) override
Draw the scalar bar and annotation text to the screen.
virtual void SetTextActorsPosition(const int vsize[2])
Set text actor positions given a viewport size and justification.
virtual void SetTextActorsJustification()
Set text actor positions given a viewport size and justification.
TextPosition
Position used to get or set the corner annotation text.
@ LowerEdge
Uses the lower edge center.
@ UpperLeft
Uses the upper left corner.
@ LeftEdge
Uses the left edge center.
@ UpperRight
Uses the upper right corner.
@ RightEdge
Uses the right edge center.
@ LowerRight
Uses the lower right corner.
~vtkCornerAnnotation() override
virtual void SetTextProperty(vtkTextProperty *p)
Set/Get the text property of all corners.
int RenderOpaqueGeometry(vtkViewport *viewport) override
Draw the scalar bar and annotation text to the screen.
vtkImageMapToWindowLevelColors * WindowLevel
void SetWindowLevel(vtkImageMapToWindowLevelColors *)
Set an instance of vtkImageMapToWindowLevelColors to use for looking at window level changes.
void SetText(int i, const char *text)
Set/Get the text to be displayed for each corner.
virtual void TextReplace(vtkImageActor *ia, vtkImageMapToWindowLevelColors *wl)
Search for replaceable tokens and replace.
void SetImageActor(vtkImageActor *)
Set an image actor to look at for slice information.
const char * GetText(int i)
Set/Get the text to be displayed for each corner.
vtkTextProperty * TextProperty
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkImageActor * LastImageActor
void ClearAllTexts()
Set/Get the text to be displayed for each corner.
vtkTypeBool HasTranslucentPolygonalGeometry() override
Does this prop have some translucent polygonal geometry?
int RenderOverlay(vtkViewport *viewport) override
Draw the scalar bar and annotation text to the screen.
void CopyAllTextsFrom(vtkCornerAnnotation *ca)
Set/Get the text to be displayed for each corner.
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this actor.
draw an image in a rendered 3D scene
Map an image through a lookup table and/or a window/level.
a simple class to control print indentation
Definition vtkIndent.h:29
2D text annotation
represent text properties.
record modification and/or execution time
abstract specification for Viewports
Definition vtkViewport.h:45
window superclass for vtkRenderWindow
Definition vtkWindow.h:25
int vtkTypeBool
Definition vtkABI.h:64