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 =========================================================================*/
25 #ifndef __vtkCornerAnnotation_h
26 #define __vtkCornerAnnotation_h
27 
28 #include "vtkActor2D.h"
29 
30 class vtkTextMapper;
32 class vtkImageActor;
33 class vtkTextProperty;
34 
36 {
37 public:
39  void PrintSelf(ostream& os, vtkIndent indent);
40 
43  static vtkCornerAnnotation *New();
44 
46 
47  int RenderOpaqueGeometry(vtkViewport* viewport);
48  virtual int RenderTranslucentPolygonalGeometry(vtkViewport* ) {return 0;};
49  int RenderOverlay(vtkViewport* viewport);
51 
53  virtual int HasTranslucentPolygonalGeometry();
54 
56 
58  vtkSetMacro(MaximumLineHeight,double);
59  vtkGetMacro(MaximumLineHeight,double);
61 
63 
65  vtkSetMacro(MinimumFontSize,int);
66  vtkGetMacro(MinimumFontSize,int);
67  vtkSetMacro(MaximumFontSize,int);
68  vtkGetMacro(MaximumFontSize,int);
70 
72 
78  vtkSetMacro( LinearFontScaleFactor, double );
79  vtkGetMacro( LinearFontScaleFactor, double );
80  vtkSetMacro( NonlinearFontScaleFactor, double );
81  vtkGetMacro( NonlinearFontScaleFactor, double );
83 
87  virtual void ReleaseGraphicsResources(vtkWindow *);
88 
90 
91  void SetText(int i, const char *text);
92  const char* GetText(int i);
93  void ClearAllTexts();
94  void CopyAllTextsFrom(vtkCornerAnnotation *ca);
96 
98 
99  void SetImageActor(vtkImageActor*);
100  vtkGetObjectMacro(ImageActor,vtkImageActor);
102 
104 
106  void SetWindowLevel(vtkImageMapToWindowLevelColors*);
107  vtkGetObjectMacro(WindowLevel,vtkImageMapToWindowLevelColors);
109 
111 
112  vtkSetMacro(LevelShift, double);
113  vtkGetMacro(LevelShift, double);
115 
117 
118  vtkSetMacro(LevelScale, double);
119  vtkGetMacro(LevelScale, double);
121 
123 
124  virtual void SetTextProperty(vtkTextProperty *p);
125  vtkGetObjectMacro(TextProperty,vtkTextProperty);
127 
129 
131  vtkBooleanMacro(ShowSliceAndImage, int);
132  vtkSetMacro(ShowSliceAndImage, int);
133  vtkGetMacro(ShowSliceAndImage, int);
135 
136 protected:
139 
141 
143 
145  double LevelShift;
146  double LevelScale;
149 
150  char *CornerText[4];
151 
152  int FontSize;
153  vtkActor2D *TextActor[4];
155  int LastSize[2];
156  vtkTextMapper *TextMapper[4];
157 
160 
163 
165 
167 
168  virtual void TextReplace(
171 
173 
174  virtual void SetTextActorsPosition(int vsize[2]);
175  virtual void SetTextActorsJustification();
177 
178 private:
179  vtkCornerAnnotation(const vtkCornerAnnotation&); // Not implemented.
180  void operator=(const vtkCornerAnnotation&); // Not implemented.
181 };
182 
183 
184 #endif
185 
186 
187 
text annotation in four corners
vtkTextProperty * TextProperty
virtual void ReleaseGraphicsResources(vtkWindow *)
abstract specification for Viewports
Definition: vtkViewport.h:45
map the input image through a lookup table and window / level it
a actor that draws 2D data
Definition: vtkActor2D.h:43
record modification and/or execution time
Definition: vtkTimeStamp.h:33
vtkImageMapToWindowLevelColors * WindowLevel
2D text annotation
Definition: vtkTextMapper.h:43
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
virtual int HasTranslucentPolygonalGeometry()
draw an image (data & properties) in a rendered 3D scene
Definition: vtkImageActor.h:49
virtual int RenderOpaqueGeometry(vtkViewport *viewport)
vtkImageActor * ImageActor
a simple class to control print indentation
Definition: vtkIndent.h:37
void PrintSelf(ostream &os, vtkIndent indent)
static vtkActor2D * New()
represent text properties.
virtual int RenderOverlay(vtkViewport *viewport)
#define VTK_HYBRID_EXPORT
vtkImageActor * LastImageActor
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)