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 
45 class vtkTextMapper;
47 class vtkImageActor;
48 class vtkTextProperty;
49 
50 class VTKRENDERINGANNOTATION_EXPORT vtkCornerAnnotation : public vtkActor2D
51 {
52 public:
54  void PrintSelf(ostream& os, vtkIndent indent) override;
55 
60  static vtkCornerAnnotation *New();
61 
63 
66  int RenderOpaqueGeometry(vtkViewport* viewport) override;
67  int RenderTranslucentPolygonalGeometry(vtkViewport* ) override {return 0;};
68  int RenderOverlay(vtkViewport* viewport) override;
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 
118  void ReleaseGraphicsResources(vtkWindow *) override;
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);
146  void ClearAllTexts();
147  void CopyAllTextsFrom(vtkCornerAnnotation *ca);
149 
151 
154  void SetImageActor(vtkImageActor*);
155  vtkGetObjectMacro(ImageActor,vtkImageActor);
157 
159 
163  void SetWindowLevel(vtkImageMapToWindowLevelColors*);
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 
187  virtual void SetTextProperty(vtkTextProperty *p);
188  vtkGetObjectMacro(TextProperty,vtkTextProperty);
190 
192 
195  vtkBooleanMacro(ShowSliceAndImage, vtkTypeBool);
196  vtkSetMacro(ShowSliceAndImage, vtkTypeBool);
197  vtkGetMacro(ShowSliceAndImage, vtkTypeBool);
199 
200 protected:
202  ~vtkCornerAnnotation() override;
203 
205 
207 
209  double LevelShift;
210  double LevelScale;
213 
214  char *CornerText[NumTextPositions];
215 
216  int FontSize;
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]);
241  virtual void SetTextActorsJustification();
243 
244 private:
245  vtkCornerAnnotation(const vtkCornerAnnotation&) = delete;
246  void operator=(const vtkCornerAnnotation&) = delete;
247 };
248 
249 
250 #endif
251 
252 
253 
text annotation in four corners
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.
vtkTextProperty * TextProperty
Uses the lower edge center.
abstract specification for Viewports
Definition: vtkViewport.h:47
Uses the upper left corner.
Map an image through a lookup table and/or a window/level.
a actor that draws 2D data
Definition: vtkActor2D.h:45
record modification and/or execution time
Definition: vtkTimeStamp.h:35
vtkImageMapToWindowLevelColors * WindowLevel
2D text annotation
Definition: vtkTextMapper.h:53
int vtkTypeBool
Definition: vtkABI.h:69
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
TextPosition
Position used to get or set the corner annotation text.
draw an image in a rendered 3D scene
Definition: vtkImageActor.h:49
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this actor.
vtkImageActor * ImageActor
a simple class to control print indentation
Definition: vtkIndent.h:39
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.
vtkTypeBool HasTranslucentPolygonalGeometry() override
Does this prop have some translucent polygonal geometry?
int RenderOpaqueGeometry(vtkViewport *viewport) override
Support the standard render methods.
Uses the right edge center.
Uses the lower right corner.
vtkImageActor * LastImageActor
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.