VTK  9.2.6
vtkCornerAnnotation.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkCornerAnnotation.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
39#ifndef vtkCornerAnnotation_h
40#define vtkCornerAnnotation_h
41
42#include "vtkActor2D.h"
43#include "vtkRenderingAnnotationModule.h" // For export macro
44
45class vtkTextMapper;
47class vtkImageActor;
48class vtkTextProperty;
49
50class VTKRENDERINGANNOTATION_EXPORT vtkCornerAnnotation : public vtkActor2D
51{
52public:
54 void PrintSelf(ostream& os, vtkIndent indent) override;
55
61
63
66 int RenderOpaqueGeometry(vtkViewport* viewport) override;
68 int RenderOverlay(vtkViewport* viewport) override;
70
75
77
82 vtkSetMacro(MaximumLineHeight, double);
83 vtkGetMacro(MaximumLineHeight, double);
85
87
91 vtkSetMacro(MinimumFontSize, int);
92 vtkGetMacro(MinimumFontSize, int);
93 vtkSetMacro(MaximumFontSize, int);
94 vtkGetMacro(MaximumFontSize, int);
96
98
107 vtkSetMacro(LinearFontScaleFactor, double);
108 vtkGetMacro(LinearFontScaleFactor, double);
109 vtkSetMacro(NonlinearFontScaleFactor, double);
110 vtkGetMacro(NonlinearFontScaleFactor, double);
112
119
121
136 static const int NumTextPositions = 8;
138
140
144 void SetText(int i, const char* text);
145 const char* GetText(int i);
149
151
155 vtkGetObjectMacro(ImageActor, vtkImageActor);
157
159
164 vtkGetObjectMacro(WindowLevel, vtkImageMapToWindowLevelColors);
166
168
171 vtkSetMacro(LevelShift, double);
172 vtkGetMacro(LevelShift, double);
174
176
179 vtkSetMacro(LevelScale, double);
180 vtkGetMacro(LevelScale, double);
182
184
188 vtkGetObjectMacro(TextProperty, vtkTextProperty);
190
192
195 vtkBooleanMacro(ShowSliceAndImage, vtkTypeBool);
196 vtkSetMacro(ShowSliceAndImage, vtkTypeBool);
197 vtkGetMacro(ShowSliceAndImage, vtkTypeBool);
199
200protected:
203
205
207
213
214 char* CornerText[NumTextPositions];
215
217 vtkActor2D* TextActor[NumTextPositions];
219 int LastSize[2];
220 vtkTextMapper* TextMapper[NumTextPositions];
221
224
227
229
234
236
239 virtual void SetTextActorsPosition(const int vsize[2]);
242
243private:
245 void operator=(const vtkCornerAnnotation&) = delete;
246};
247
248#endif
a actor that draws 2D data
Definition vtkActor2D.h:46
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:40
2D text annotation
represent text properties.
record modification and/or execution time
abstract specification for Viewports
Definition vtkViewport.h:56
window superclass for vtkRenderWindow
Definition vtkWindow.h:39
int vtkTypeBool
Definition vtkABI.h:69