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 =========================================================================*/
35 #ifndef __vtkCornerAnnotation_h
36 #define __vtkCornerAnnotation_h
37 
38 #include "vtkActor2D.h"
39 
40 class vtkTextMapper;
42 class vtkImageActor;
43 class vtkTextProperty;
44 
46 {
47 public:
49  void PrintSelf(ostream& os, vtkIndent indent);
50 
53  static vtkCornerAnnotation *New();
54 
56 
57  int RenderOpaqueGeometry(vtkViewport* viewport);
58  virtual int RenderTranslucentPolygonalGeometry(vtkViewport* ) {return 0;};
59  int RenderOverlay(vtkViewport* viewport);
61 
63  virtual int HasTranslucentPolygonalGeometry();
64 
66 
68  vtkSetMacro(MaximumLineHeight,double);
69  vtkGetMacro(MaximumLineHeight,double);
71 
73 
75  vtkSetMacro(MinimumFontSize,int);
76  vtkGetMacro(MinimumFontSize,int);
77  vtkSetMacro(MaximumFontSize,int);
78  vtkGetMacro(MaximumFontSize,int);
80 
82 
88  vtkSetMacro( LinearFontScaleFactor, double );
89  vtkGetMacro( LinearFontScaleFactor, double );
90  vtkSetMacro( NonlinearFontScaleFactor, double );
91  vtkGetMacro( NonlinearFontScaleFactor, double );
93 
97  virtual void ReleaseGraphicsResources(vtkWindow *);
98 
100 
101  void SetText(int i, const char *text);
102  const char* GetText(int i);
103  void ClearAllTexts();
104  void CopyAllTextsFrom(vtkCornerAnnotation *ca);
106 
108 
109  void SetImageActor(vtkImageActor*);
110  vtkGetObjectMacro(ImageActor,vtkImageActor);
112 
114 
116  void SetWindowLevel(vtkImageMapToWindowLevelColors*);
117  vtkGetObjectMacro(WindowLevel,vtkImageMapToWindowLevelColors);
119 
121 
122  vtkSetMacro(LevelShift, double);
123  vtkGetMacro(LevelShift, double);
125 
127 
128  vtkSetMacro(LevelScale, double);
129  vtkGetMacro(LevelScale, double);
131 
133 
134  virtual void SetTextProperty(vtkTextProperty *p);
135  vtkGetObjectMacro(TextProperty,vtkTextProperty);
137 
139 
141  vtkBooleanMacro(ShowSliceAndImage, int);
142  vtkSetMacro(ShowSliceAndImage, int);
143  vtkGetMacro(ShowSliceAndImage, int);
145 
146 protected:
149 
151 
153 
155  double LevelShift;
156  double LevelScale;
159 
160  char *CornerText[4];
161 
162  int FontSize;
163  vtkActor2D *TextActor[4];
165  int LastSize[2];
166  vtkTextMapper *TextMapper[4];
167 
170 
173 
175 
177 
178  virtual void TextReplace(
181 
183 
184  virtual void SetTextActorsPosition(int vsize[2]);
185  virtual void SetTextActorsJustification();
187 
188 private:
189  vtkCornerAnnotation(const vtkCornerAnnotation&); // Not implemented.
190  void operator=(const vtkCornerAnnotation&); // Not implemented.
191 };
192 
193 
194 #endif
195 
196 
197