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
36#ifndef vtkCornerAnnotation_h
37#define vtkCornerAnnotation_h
38
39#include "vtkActor2D.h"
40#include "vtkRenderingAnnotationModule.h" // For export macro
41
42VTK_ABI_NAMESPACE_BEGIN
43class vtkTextMapper;
45class vtkImageActor;
46class vtkTextProperty;
47
48class VTKRENDERINGANNOTATION_EXPORT vtkCornerAnnotation : public vtkActor2D
49{
50public:
52 void PrintSelf(ostream& os, vtkIndent indent) override;
53
59
61
64 int RenderOpaqueGeometry(vtkViewport* viewport) override;
66 int RenderOverlay(vtkViewport* viewport) override;
68
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
117
119
124 {
125 LowerLeft = 0,
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);
147
149
153 vtkGetObjectMacro(ImageActor, vtkImageActor);
155
157
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
186 vtkGetObjectMacro(TextProperty, vtkTextProperty);
188
190
193 vtkBooleanMacro(ShowSliceAndImage, vtkTypeBool);
194 vtkSetMacro(ShowSliceAndImage, vtkTypeBool);
195 vtkGetMacro(ShowSliceAndImage, vtkTypeBool);
197
198protected:
201
203
205
211
212 char* CornerText[NumTextPositions];
213
215 vtkActor2D* TextActor[NumTextPositions];
217 int LastSize[2];
218 vtkTextMapper* TextMapper[NumTextPositions];
219
222
225
227
232
234
237 virtual void SetTextActorsPosition(const int vsize[2]);
240
241private:
243 void operator=(const vtkCornerAnnotation&) = delete;
244};
245
246VTK_ABI_NAMESPACE_END
247#endif
a actor that draws 2D data
Definition vtkActor2D.h:44
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:38
2D text annotation
represent text properties.
record modification and/or execution time
abstract specification for Viewports
Definition vtkViewport.h:54
window superclass for vtkRenderWindow
Definition vtkWindow.h:34
int vtkTypeBool
Definition vtkABI.h:64