VTK  9.0.1
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 "vtkActor2D.h"
40 #include "vtkRenderingAnnotationModule.h" // For export macro
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) override;
52 
57  static vtkCornerAnnotation* New();
58 
60 
63  int RenderOpaqueGeometry(vtkViewport* viewport) override;
64  int RenderTranslucentPolygonalGeometry(vtkViewport*) override { return 0; }
65  int RenderOverlay(vtkViewport* viewport) override;
67 
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*) 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, vtkTypeBool);
193  vtkSetMacro(ShowSliceAndImage, vtkTypeBool);
194  vtkGetMacro(ShowSliceAndImage, vtkTypeBool);
196 
197 protected:
199  ~vtkCornerAnnotation() override;
200 
202 
204 
206  double LevelShift;
207  double LevelScale;
210 
211  char* CornerText[NumTextPositions];
212 
213  int FontSize;
214  vtkActor2D* TextActor[NumTextPositions];
216  int LastSize[2];
217  vtkTextMapper* TextMapper[NumTextPositions];
218 
221 
224 
226 
230  virtual void TextReplace(vtkImageActor* ia, vtkImageMapToWindowLevelColors* wl);
231 
233 
236  virtual void SetTextActorsPosition(const int vsize[2]);
237  virtual void SetTextActorsJustification();
239 
240 private:
241  vtkCornerAnnotation(const vtkCornerAnnotation&) = delete;
242  void operator=(const vtkCornerAnnotation&) = delete;
243 };
244 
245 #endif
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:44
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:39
record modification and/or execution time
Definition: vtkTimeStamp.h:32
vtkImageMapToWindowLevelColors * WindowLevel
2D text annotation
Definition: vtkTextMapper.h:47
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:42
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:33
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.