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 =========================================================================*/
38 #ifndef vtkCornerAnnotation_h
39 #define vtkCornerAnnotation_h
40 
41 #include "vtkRenderingAnnotationModule.h" // For export macro
42 #include "vtkActor2D.h"
43 
44 class vtkTextMapper;
46 class vtkImageActor;
47 class vtkTextProperty;
48 
50 {
51 public:
53  void PrintSelf(ostream& os, vtkIndent indent);
54 
57  static vtkCornerAnnotation *New();
58 
60 
61  int RenderOpaqueGeometry(vtkViewport* viewport);
62  virtual int RenderTranslucentPolygonalGeometry(vtkViewport* ) {return 0;};
63  int RenderOverlay(vtkViewport* viewport);
65 
67  virtual int HasTranslucentPolygonalGeometry();
68 
70 
72  vtkSetMacro(MaximumLineHeight,double);
73  vtkGetMacro(MaximumLineHeight,double);
75 
77 
79  vtkSetMacro(MinimumFontSize,int);
80  vtkGetMacro(MinimumFontSize,int);
81  vtkSetMacro(MaximumFontSize,int);
82  vtkGetMacro(MaximumFontSize,int);
84 
86 
92  vtkSetMacro( LinearFontScaleFactor, double );
93  vtkGetMacro( LinearFontScaleFactor, double );
94  vtkSetMacro( NonlinearFontScaleFactor, double );
95  vtkGetMacro( NonlinearFontScaleFactor, double );
97 
101  virtual void ReleaseGraphicsResources(vtkWindow *);
102 
104 
107  {
108  LowerLeft = 0,
115  UpperEdge
116  };
117  static const int NumTextPositions = 8;
119 
121 
122  void SetText(int i, const char *text);
123  const char* GetText(int i);
124  void ClearAllTexts();
125  void CopyAllTextsFrom(vtkCornerAnnotation *ca);
127 
129 
130  void SetImageActor(vtkImageActor*);
131  vtkGetObjectMacro(ImageActor,vtkImageActor);
133 
135 
137  void SetWindowLevel(vtkImageMapToWindowLevelColors*);
138  vtkGetObjectMacro(WindowLevel,vtkImageMapToWindowLevelColors);
140 
142 
143  vtkSetMacro(LevelShift, double);
144  vtkGetMacro(LevelShift, double);
146 
148 
149  vtkSetMacro(LevelScale, double);
150  vtkGetMacro(LevelScale, double);
152 
154 
155  virtual void SetTextProperty(vtkTextProperty *p);
156  vtkGetObjectMacro(TextProperty,vtkTextProperty);
158 
160 
162  vtkBooleanMacro(ShowSliceAndImage, int);
163  vtkSetMacro(ShowSliceAndImage, int);
164  vtkGetMacro(ShowSliceAndImage, int);
166 
167 protected:
170 
172 
174 
176  double LevelShift;
177  double LevelScale;
180 
181  char *CornerText[NumTextPositions];
182 
183  int FontSize;
184  vtkActor2D *TextActor[NumTextPositions];
186  int LastSize[2];
187  vtkTextMapper *TextMapper[NumTextPositions];
188 
191 
194 
196 
198 
199  virtual void TextReplace(
202 
204 
205  virtual void SetTextActorsPosition(int vsize[2]);
206  virtual void SetTextActorsJustification();
208 
209 private:
210  vtkCornerAnnotation(const vtkCornerAnnotation&); // Not implemented.
211  void operator=(const vtkCornerAnnotation&); // Not implemented.
212 };
213 
214 
215 #endif
216 
217 
218 
text annotation in four corners
Uses the left edge center.
vtkTextProperty * TextProperty
Uses the lower edge center.
virtual void ReleaseGraphicsResources(vtkWindow *)
abstract specification for Viewports
Definition: vtkViewport.h:46
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:44
record modification and/or execution time
Definition: vtkTimeStamp.h:34
vtkImageMapToWindowLevelColors * WindowLevel
2D text annotation
Definition: vtkTextMapper.h:52
#define VTKRENDERINGANNOTATION_EXPORT
window superclass for vtkRenderWindow
Definition: vtkWindow.h:36
virtual int HasTranslucentPolygonalGeometry()
draw an image in a rendered 3D scene
Definition: vtkImageActor.h:48
virtual int RenderOpaqueGeometry(vtkViewport *viewport)
vtkImageActor * ImageActor
a simple class to control print indentation
Definition: vtkIndent.h:38
void PrintSelf(ostream &os, vtkIndent indent)
static vtkActor2D * New()
Uses the upper right corner.
represent text properties.
virtual int RenderOverlay(vtkViewport *viewport)
Uses the right edge center.
Uses the lower right corner.
vtkImageActor * LastImageActor
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)