VTK: Rendering/Annotation/vtkCornerAnnotation.h Source File

| VTK 9.3.1

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
36 #ifndef vtkCornerAnnotation_h
37 #define vtkCornerAnnotation_h
38
39 #include "vtkActor2D.h"
40 #include "vtkRenderingAnnotationModule.h" // For export macro
41
42 VTK_ABI_NAMESPACE_BEGIN
43 class vtkTextMapper;
44 class vtkImageMapToWindowLevelColors;
45 class vtkImageActor;
46 class vtkTextProperty;
47
48 class VTKRENDERINGANNOTATION_EXPORT vtkCornerAnnotation : public vtkActor2D
49 {
50 public:
51 vtkTypeMacro(vtkCornerAnnotation, vtkActor2D);
52 void PrintSelf(ostream& os, vtkIndent indent) override;
53
58 static vtkCornerAnnotation* New();
59
61
64 int RenderOpaqueGeometry(vtkViewport* viewport) override;
65 int RenderTranslucentPolygonalGeometry(vtkViewport*) override { return 0; }
66 int RenderOverlay(vtkViewport* viewport) override;
68
72 vtkTypeBool HasTranslucentPolygonalGeometry() override;
73
75
80 vtkSetMacro(MaximumLineHeight, double);
81 vtkGetMacro(MaximumLineHeight, double);
83
85
89 vtkSetMacro(MinimumFontSize, int);
90 vtkGetMacro(MinimumFontSize, int);
91 vtkSetMacro(MaximumFontSize, int);
92 vtkGetMacro(MaximumFontSize, int);
94
96
105 vtkSetMacro(LinearFontScaleFactor, double);
106 vtkGetMacro(LinearFontScaleFactor, double);
107 vtkSetMacro(NonlinearFontScaleFactor, double);
108 vtkGetMacro(NonlinearFontScaleFactor, double);
110
116 void ReleaseGraphicsResources(vtkWindow*) override;
117
119
123 enum TextPosition
124 {
125 LowerLeft = 0,
126 LowerRight,
127 UpperLeft,
128 UpperRight,
129 LowerEdge,
130 RightEdge,
131 LeftEdge,
132 UpperEdge
133 };
134 static const int NumTextPositions = 8;
136
138
142 void SetText(int i, const char* text);
143 const char* GetText(int i);
144 void ClearAllTexts();
145 void CopyAllTextsFrom(vtkCornerAnnotation* ca);
147
149
152 void SetImageActor(vtkImageActor*);
153 vtkGetObjectMacro(ImageActor, vtkImageActor);
155
157
161 void SetWindowLevel(vtkImageMapToWindowLevelColors*);
162 vtkGetObjectMacro(WindowLevel, vtkImageMapToWindowLevelColors);
164
166
169 vtkSetMacro(LevelShift, double);
170 vtkGetMacro(LevelShift, double);
172
174
177 vtkSetMacro(LevelScale, double);
178 vtkGetMacro(LevelScale, double);
180
182
185 virtual void SetTextProperty(vtkTextProperty* p);
186 vtkGetObjectMacro(TextProperty, vtkTextProperty);
188
190
193 vtkBooleanMacro(ShowSliceAndImage, vtkTypeBool);
194 vtkSetMacro(ShowSliceAndImage, vtkTypeBool);
195 vtkGetMacro(ShowSliceAndImage, vtkTypeBool);
197
198 protected:
199 vtkCornerAnnotation();
200 ~vtkCornerAnnotation() override;
201
202 double MaximumLineHeight;
203
204 vtkTextProperty* TextProperty;
205
206 vtkImageMapToWindowLevelColors* WindowLevel;
207 double LevelShift;
208 double LevelScale;
209 vtkImageActor* ImageActor;
210 vtkImageActor* LastImageActor;
211
212 char* CornerText[NumTextPositions];
213
214 int FontSize;
215 vtkActor2D* TextActor[NumTextPositions];
216 vtkTimeStamp BuildTime;
217 int LastSize[2];
218 vtkTextMapper* TextMapper[NumTextPositions];
219
220 int MinimumFontSize;
221 int MaximumFontSize;
222
223 double LinearFontScaleFactor;
224 double NonlinearFontScaleFactor;
225
226 vtkTypeBool ShowSliceAndImage;
227
231 virtual void TextReplace(vtkImageActor* ia, vtkImageMapToWindowLevelColors* wl);
232
234
237 virtual void SetTextActorsPosition(const int vsize[2]);
238 virtual void SetTextActorsJustification();
240
241 private:
242 vtkCornerAnnotation(const vtkCornerAnnotation&) = delete;
243 void operator=(const vtkCornerAnnotation&) = delete;
244 };
245
246 VTK_ABI_NAMESPACE_END
247 #endif
vtkActor2D
a actor that draws 2D data
Definition: vtkActor2D.h:44
vtkCornerAnnotation
text annotation in four corners
Definition: vtkCornerAnnotation.h:49
vtkCornerAnnotation::RenderTranslucentPolygonalGeometry
int RenderTranslucentPolygonalGeometry(vtkViewport *) override
Draw the scalar bar and annotation text to the screen.
Definition: vtkCornerAnnotation.h:65
vtkCornerAnnotation::ShowSliceAndImage
vtkTypeBool ShowSliceAndImage
Definition: vtkCornerAnnotation.h:226
vtkCornerAnnotation::SetTextActorsPosition
virtual void SetTextActorsPosition(const int vsize[2])
Set text actor positions given a viewport size and justification.
vtkCornerAnnotation::MaximumLineHeight
double MaximumLineHeight
Definition: vtkCornerAnnotation.h:202
vtkCornerAnnotation::SetTextActorsJustification
virtual void SetTextActorsJustification()
Set text actor positions given a viewport size and justification.
vtkCornerAnnotation::TextPosition
TextPosition
Position used to get or set the corner annotation text.
Definition: vtkCornerAnnotation.h:124
vtkCornerAnnotation::LowerEdge
@ LowerEdge
Uses the lower edge center.
Definition: vtkCornerAnnotation.h:129
vtkCornerAnnotation::UpperLeft
@ UpperLeft
Uses the upper left corner.
Definition: vtkCornerAnnotation.h:127
vtkCornerAnnotation::LeftEdge
@ LeftEdge
Uses the left edge center.
Definition: vtkCornerAnnotation.h:131
vtkCornerAnnotation::UpperRight
@ UpperRight
Uses the upper right corner.
Definition: vtkCornerAnnotation.h:128
vtkCornerAnnotation::RightEdge
@ RightEdge
Uses the right edge center.
Definition: vtkCornerAnnotation.h:130
vtkCornerAnnotation::LowerRight
@ LowerRight
Uses the lower right corner.
Definition: vtkCornerAnnotation.h:126
vtkCornerAnnotation::MinimumFontSize
int MinimumFontSize
Definition: vtkCornerAnnotation.h:220
vtkCornerAnnotation::New
static vtkCornerAnnotation * New()
Instantiate object with a rectangle in normaled view coordinates of (0.2,0.85, 0.8,...
vtkCornerAnnotation::~vtkCornerAnnotation
~vtkCornerAnnotation() override
vtkCornerAnnotation::SetTextProperty
virtual void SetTextProperty(vtkTextProperty *p)
Set/Get the text property of all corners.
vtkCornerAnnotation::RenderOpaqueGeometry
int RenderOpaqueGeometry(vtkViewport *viewport) override
Draw the scalar bar and annotation text to the screen.
vtkCornerAnnotation::ImageActor
vtkImageActor * ImageActor
Definition: vtkCornerAnnotation.h:209
vtkCornerAnnotation::WindowLevel
vtkImageMapToWindowLevelColors * WindowLevel
Definition: vtkCornerAnnotation.h:206
vtkCornerAnnotation::FontSize
int FontSize
Definition: vtkCornerAnnotation.h:214
vtkCornerAnnotation::SetWindowLevel
void SetWindowLevel(vtkImageMapToWindowLevelColors *)
Set an instance of vtkImageMapToWindowLevelColors to use for looking at window level changes.
vtkCornerAnnotation::LinearFontScaleFactor
double LinearFontScaleFactor
Definition: vtkCornerAnnotation.h:223
vtkCornerAnnotation::SetText
void SetText(int i, const char *text)
Set/Get the text to be displayed for each corner.
vtkCornerAnnotation::TextReplace
virtual void TextReplace(vtkImageActor *ia, vtkImageMapToWindowLevelColors *wl)
Search for replaceable tokens and replace.
vtkCornerAnnotation::NonlinearFontScaleFactor
double NonlinearFontScaleFactor
Definition: vtkCornerAnnotation.h:224
vtkCornerAnnotation::SetImageActor
void SetImageActor(vtkImageActor *)
Set an image actor to look at for slice information.
vtkCornerAnnotation::LevelShift
double LevelShift
Definition: vtkCornerAnnotation.h:207
vtkCornerAnnotation::BuildTime
vtkTimeStamp BuildTime
Definition: vtkCornerAnnotation.h:216
vtkCornerAnnotation::LevelScale
double LevelScale
Definition: vtkCornerAnnotation.h:208
vtkCornerAnnotation::TextProperty
vtkTextProperty * TextProperty
Definition: vtkCornerAnnotation.h:204
vtkCornerAnnotation::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkCornerAnnotation::LastImageActor
vtkImageActor * LastImageActor
Definition: vtkCornerAnnotation.h:210
vtkCornerAnnotation::ClearAllTexts
void ClearAllTexts()
Set/Get the text to be displayed for each corner.
vtkCornerAnnotation::HasTranslucentPolygonalGeometry
vtkTypeBool HasTranslucentPolygonalGeometry() override
Does this prop have some translucent polygonal geometry?
vtkCornerAnnotation::vtkCornerAnnotation
vtkCornerAnnotation()
vtkCornerAnnotation::RenderOverlay
int RenderOverlay(vtkViewport *viewport) override
Draw the scalar bar and annotation text to the screen.
vtkCornerAnnotation::CopyAllTextsFrom
void CopyAllTextsFrom(vtkCornerAnnotation *ca)
Set/Get the text to be displayed for each corner.
vtkCornerAnnotation::GetText
const char * GetText(int i)
Set/Get the text to be displayed for each corner.
vtkCornerAnnotation::MaximumFontSize
int MaximumFontSize
Definition: vtkCornerAnnotation.h:221
vtkCornerAnnotation::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this actor.
vtkImageActor
draw an image in a rendered 3D scene
Definition: vtkImageActor.h:47
vtkImageMapToWindowLevelColors
Map an image through a lookup table and/or a window/level.
Definition: vtkImageMapToWindowLevelColors.h:50
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkTextMapper
2D text annotation
Definition: vtkTextMapper.h:49
vtkTextProperty
represent text properties.
Definition: vtkTextProperty.h:35
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:34
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:54
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:64
vtkActor2D.h