VTK  9.1.0
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=========================================================================*/
45#ifndef vtkCornerAnnotation_h
46#define vtkCornerAnnotation_h
47
48#include "vtkActor2D.h"
49#include "vtkRenderingAnnotationModule.h" // For export macro
50
51class vtkTextMapper;
53class vtkImageActor;
54class vtkTextProperty;
55
56class VTKRENDERINGANNOTATION_EXPORT vtkCornerAnnotation : public vtkActor2D
57{
58public:
60 void PrintSelf(ostream& os, vtkIndent indent) override;
61
67
69
72 int RenderOpaqueGeometry(vtkViewport* viewport) override;
74 int RenderOverlay(vtkViewport* viewport) override;
76
81
83
88 vtkSetMacro(MaximumLineHeight, double);
89 vtkGetMacro(MaximumLineHeight, double);
91
93
97 vtkSetMacro(MinimumFontSize, int);
98 vtkGetMacro(MinimumFontSize, int);
99 vtkSetMacro(MaximumFontSize, int);
100 vtkGetMacro(MaximumFontSize, int);
102
104
113 vtkSetMacro(LinearFontScaleFactor, double);
114 vtkGetMacro(LinearFontScaleFactor, double);
115 vtkSetMacro(NonlinearFontScaleFactor, double);
116 vtkGetMacro(NonlinearFontScaleFactor, double);
118
125
127
132 {
133 LowerLeft = 0,
140 UpperEdge
141 };
142 static const int NumTextPositions = 8;
144
146
150 void SetText(int i, const char* text);
151 const char* GetText(int i);
155
157
161 vtkGetObjectMacro(ImageActor, vtkImageActor);
163
165
170 vtkGetObjectMacro(WindowLevel, vtkImageMapToWindowLevelColors);
172
174
177 vtkSetMacro(LevelShift, double);
178 vtkGetMacro(LevelShift, double);
180
182
185 vtkSetMacro(LevelScale, double);
186 vtkGetMacro(LevelScale, double);
188
190
194 vtkGetObjectMacro(TextProperty, vtkTextProperty);
196
198
201 vtkBooleanMacro(ShowSliceAndImage, vtkTypeBool);
202 vtkSetMacro(ShowSliceAndImage, vtkTypeBool);
203 vtkGetMacro(ShowSliceAndImage, vtkTypeBool);
205
206protected:
209
211
213
219
220 char* CornerText[NumTextPositions];
221
223 vtkActor2D* TextActor[NumTextPositions];
225 int LastSize[2];
226 vtkTextMapper* TextMapper[NumTextPositions];
227
230
233
235
240
242
245 virtual void SetTextActorsPosition(const int vsize[2]);
248
249private:
251 void operator=(const vtkCornerAnnotation&) = delete;
252};
253
254#endif
a actor that draws 2D data
Definition: vtkActor2D.h:49
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.
vtkImageActor * ImageActor
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
Definition: vtkImageActor.h:52
Map an image through a lookup table and/or a window/level.
a simple class to control print indentation
Definition: vtkIndent.h:43
2D text annotation
Definition: vtkTextMapper.h:57
represent text properties.
record modification and/or execution time
Definition: vtkTimeStamp.h:42
abstract specification for Viewports
Definition: vtkViewport.h:56
window superclass for vtkRenderWindow
Definition: vtkWindow.h:45
int vtkTypeBool
Definition: vtkABI.h:69