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 =========================================================================*/
36 #ifndef vtkCornerAnnotation_h
37 #define vtkCornerAnnotation_h
38 
39 #include "vtkRenderingAnnotationModule.h" // For export macro
40 #include "vtkActor2D.h"
41 
42 class vtkTextMapper;
44 class vtkImageActor;
45 class vtkTextProperty;
46 
47 class VTKRENDERINGANNOTATION_EXPORT vtkCornerAnnotation : public vtkActor2D
48 {
49 public:
51  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
52 
57  static vtkCornerAnnotation *New();
58 
60 
63  int RenderOpaqueGeometry(vtkViewport* viewport) VTK_OVERRIDE;
64  int RenderTranslucentPolygonalGeometry(vtkViewport* ) VTK_OVERRIDE {return 0;};
65  int RenderOverlay(vtkViewport* viewport) VTK_OVERRIDE;
67 
71  int HasTranslucentPolygonalGeometry() VTK_OVERRIDE;
72 
74 
79  vtkSetMacro(MaximumLineHeight,double);
80  vtkGetMacro(MaximumLineHeight,double);
82 
84 
88  vtkSetMacro(MinimumFontSize,int);
89  vtkGetMacro(MinimumFontSize,int);
90  vtkSetMacro(MaximumFontSize,int);
91  vtkGetMacro(MaximumFontSize,int);
93 
95 
104  vtkSetMacro( LinearFontScaleFactor, double );
105  vtkGetMacro( LinearFontScaleFactor, double );
106  vtkSetMacro( NonlinearFontScaleFactor, double );
107  vtkGetMacro( NonlinearFontScaleFactor, double );
109 
115  void ReleaseGraphicsResources(vtkWindow *) VTK_OVERRIDE;
116 
118 
123  {
124  LowerLeft = 0,
131  UpperEdge
132  };
133  static const int NumTextPositions = 8;
135 
137 
141  void SetText(int i, const char *text);
142  const char* GetText(int i);
143  void ClearAllTexts();
144  void CopyAllTextsFrom(vtkCornerAnnotation *ca);
146 
148 
151  void SetImageActor(vtkImageActor*);
152  vtkGetObjectMacro(ImageActor,vtkImageActor);
154 
156 
160  void SetWindowLevel(vtkImageMapToWindowLevelColors*);
161  vtkGetObjectMacro(WindowLevel,vtkImageMapToWindowLevelColors);
163 
165 
168  vtkSetMacro(LevelShift, double);
169  vtkGetMacro(LevelShift, double);
171 
173 
176  vtkSetMacro(LevelScale, double);
177  vtkGetMacro(LevelScale, double);
179 
181 
184  virtual void SetTextProperty(vtkTextProperty *p);
185  vtkGetObjectMacro(TextProperty,vtkTextProperty);
187 
189 
192  vtkBooleanMacro(ShowSliceAndImage, int);
193  vtkSetMacro(ShowSliceAndImage, int);
194  vtkGetMacro(ShowSliceAndImage, int);
196 
197 protected:
199  ~vtkCornerAnnotation() VTK_OVERRIDE;
200 
201  double MaximumLineHeight;
202 
203  vtkTextProperty *TextProperty;
204 
206  double LevelShift;
207  double LevelScale;
208  vtkImageActor *ImageActor;
209  vtkImageActor *LastImageActor;
210 
211  char *CornerText[NumTextPositions];
212 
213  int FontSize;
214  vtkActor2D *TextActor[NumTextPositions];
216  int LastSize[2];
217  vtkTextMapper *TextMapper[NumTextPositions];
218 
219  int MinimumFontSize;
220  int MaximumFontSize;
221 
222  double LinearFontScaleFactor;
223  double NonlinearFontScaleFactor;
224 
225  int ShowSliceAndImage;
226 
230  virtual void TextReplace(
232 
234 
237  virtual void SetTextActorsPosition(int vsize[2]);
238  virtual void SetTextActorsJustification();
240 
241 private:
242  vtkCornerAnnotation(const vtkCornerAnnotation&) VTK_DELETE_FUNCTION;
243  void operator=(const vtkCornerAnnotation&) VTK_DELETE_FUNCTION;
244 };
245 
246 
247 #endif
248 
249 
250 
text annotation in four corners
vtkTimeStamp BuildTime
int RenderTranslucentPolygonalGeometry(vtkViewport *) override
Draw the scalar bar and annotation text to the screen.
int RenderOverlay(vtkViewport *viewport) override
Support the standard render methods.
Uses the left edge center.
Uses the lower edge center.
abstract specification for Viewports
Definition: vtkViewport.h:44
Uses the upper left corner.
map the input image through a lookup table and window / level it
a actor that draws 2D data
Definition: vtkActor2D.h:39
record modification and/or execution time
Definition: vtkTimeStamp.h:32
2D text annotation
Definition: vtkTextMapper.h:47
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
TextPosition
Position used to get or set the corner annotation text.
draw an image in a rendered 3D scene
Definition: vtkImageActor.h:43
a simple class to control print indentation
Definition: vtkIndent.h:33
int HasTranslucentPolygonalGeometry() override
Does this prop have some translucent polygonal geometry?
static vtkActor2D * New()
Creates an actor2D with the following defaults: position (0,0) (coordinate system is viewport); at la...
Uses the upper right corner.
represent text properties.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
int RenderOpaqueGeometry(vtkViewport *viewport) override
Support the standard render methods.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
Uses the right edge center.
Uses the lower right corner.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.