VTK
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 "vtkRenderingAnnotationModule.h" // For export macro
43#include "vtkActor2D.h"
44
45class vtkTextMapper;
47class vtkImageActor;
48class vtkTextProperty;
49
50class VTKRENDERINGANNOTATION_EXPORT vtkCornerAnnotation : public vtkActor2D
51{
52public:
54 void PrintSelf(ostream& os, vtkIndent indent);
55
61
63
68 int RenderOverlay(vtkViewport* viewport);
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
126 {
127 LowerLeft = 0,
134 UpperEdge
135 };
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, int);
196 vtkSetMacro(ShowSliceAndImage, int);
197 vtkGetMacro(ShowSliceAndImage, int);
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
233 virtual void TextReplace(
235
237
240 virtual void SetTextActorsPosition(int vsize[2]);
243
244private:
245 vtkCornerAnnotation(const vtkCornerAnnotation&) VTK_DELETE_FUNCTION;
246 void operator=(const vtkCornerAnnotation&) VTK_DELETE_FUNCTION;
247};
248
249
250#endif
251
252
253
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,...
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
virtual void SetTextActorsJustification()
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.
virtual void SetTextProperty(vtkTextProperty *p)
Set/Get the text property of all corners.
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 replacable tokens and replace.
virtual void SetTextActorsPosition(int vsize[2])
Set text actor positions given a viewport size and justification.
virtual int HasTranslucentPolygonalGeometry()
Does this prop have some translucent polygonal geometry?
virtual void ReleaseGraphicsResources(vtkWindow *)
Release any graphics resources that are being consumed by this actor.
int RenderOpaqueGeometry(vtkViewport *viewport)
Draw the scalar bar and annotation text to the screen.
void SetImageActor(vtkImageActor *)
Set an image actor to look at for slice information.
int RenderOverlay(vtkViewport *viewport)
Support the standard render methods.
const char * GetText(int i)
vtkTextProperty * TextProperty
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
vtkImageActor * LastImageActor
void CopyAllTextsFrom(vtkCornerAnnotation *ca)
draw an image in a rendered 3D scene
Definition: vtkImageActor.h:50
map the input image through a lookup table and window / level it
a simple class to control print indentation
Definition: vtkIndent.h:40
2D text annotation
Definition: vtkTextMapper.h:54
represent text properties.
record modification and/or execution time
Definition: vtkTimeStamp.h:36
abstract specification for Viewports
Definition: vtkViewport.h:48
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.