VTK
vtkCaptionActor2D.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkCaptionActor2D.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 =========================================================================*/
58 #ifndef vtkCaptionActor2D_h
59 #define vtkCaptionActor2D_h
60 
61 #include "vtkRenderingAnnotationModule.h" // For export macro
62 #include "vtkActor2D.h"
63 
64 class vtkActor;
65 class vtkAlgorithmOutput;
66 class vtkAppendPolyData;
67 class vtkCaptionActor2DConnection;
68 class vtkGlyph2D;
69 class vtkGlyph3D;
70 class vtkPolyData;
72 class vtkPolyDataMapper;
73 class vtkTextActor;
74 class vtkTextMapper;
75 class vtkTextProperty;
76 
77 class VTKRENDERINGANNOTATION_EXPORT vtkCaptionActor2D : public vtkActor2D
78 {
79 public:
81  void PrintSelf(ostream& os, vtkIndent indent) override;
82 
83  static vtkCaptionActor2D *New();
84 
86 
90  virtual void SetCaption(const char* caption);
91  virtual char* GetCaption();
93 
95 
100  vtkWorldCoordinateMacro(AttachmentPoint);
102 
104 
107  vtkSetMacro(Border,vtkTypeBool);
108  vtkGetMacro(Border,vtkTypeBool);
109  vtkBooleanMacro(Border,vtkTypeBool);
111 
113 
117  vtkSetMacro(Leader,vtkTypeBool);
118  vtkGetMacro(Leader,vtkTypeBool);
119  vtkBooleanMacro(Leader,vtkTypeBool);
121 
123 
126  vtkSetMacro(ThreeDimensionalLeader,vtkTypeBool);
127  vtkGetMacro(ThreeDimensionalLeader,vtkTypeBool);
128  vtkBooleanMacro(ThreeDimensionalLeader,vtkTypeBool);
130 
132 
140  virtual void SetLeaderGlyphData(vtkPolyData*);
141  virtual void SetLeaderGlyphConnection(vtkAlgorithmOutput*);
142  virtual vtkPolyData* GetLeaderGlyph();
144 
146 
153  vtkSetClampMacro(LeaderGlyphSize,double,0.0,0.1);
154  vtkGetMacro(LeaderGlyphSize,double);
156 
158 
163  vtkSetClampMacro(MaximumLeaderGlyphSize,int,1,1000);
164  vtkGetMacro(MaximumLeaderGlyphSize,int);
166 
168 
172  vtkSetClampMacro(Padding, int, 0, 50);
173  vtkGetMacro(Padding, int);
175 
177 
181  vtkGetObjectMacro(TextActor,vtkTextActor);
183 
185 
188  virtual void SetCaptionTextProperty(vtkTextProperty *p);
189  vtkGetObjectMacro(CaptionTextProperty,vtkTextProperty);
191 
196  void ShallowCopy(vtkProp *prop) override;
197 
199 
203  vtkSetMacro(AttachEdgeOnly,vtkTypeBool);
204  vtkGetMacro(AttachEdgeOnly,vtkTypeBool);
205  vtkBooleanMacro(AttachEdgeOnly,vtkTypeBool);
207 
215  void ReleaseGraphicsResources(vtkWindow *) override;
216 
218 
223  int RenderOpaqueGeometry(vtkViewport* viewport) override;
225  int RenderOverlay(vtkViewport* viewport) override;
227 
232 
233 protected:
235  ~vtkCaptionActor2D() override;
236 
238 
244 
245  int Padding;
247 
248 
249 private:
250  vtkTextActor *TextActor;
251  vtkTextProperty *CaptionTextProperty;
252 
253  vtkPolyData *BorderPolyData;
254  vtkPolyDataMapper2D *BorderMapper;
255  vtkActor2D *BorderActor;
256 
257  vtkPolyData *HeadPolyData; // single attachment point for glyphing
258  vtkGlyph3D *HeadGlyph; // for 3D leader
259  vtkPolyData *LeaderPolyData; // line represents the leader
260  vtkAppendPolyData *AppendLeader; // append head and leader
261 
262  // for 2D leader
263  vtkCoordinate *MapperCoordinate2D;
264  vtkPolyDataMapper2D *LeaderMapper2D;
265  vtkActor2D *LeaderActor2D;
266 
267  // for 3D leader
268  vtkPolyDataMapper *LeaderMapper3D;
269  vtkActor *LeaderActor3D;
270 
271  vtkCaptionActor2DConnection* LeaderGlyphConnectionHolder;
272 
273 private:
274  vtkCaptionActor2D(const vtkCaptionActor2D&) = delete;
275  void operator=(const vtkCaptionActor2D&) = delete;
276 };
277 
278 
279 #endif
280 
281 
282 
vtkTypeBool AttachEdgeOnly
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:52
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:51
copy oriented and scaled glyph geometry to every input point (2D specialization)
Definition: vtkGlyph2D.h:39
int RenderOverlay(vtkViewport *viewport) override
Support the standard render methods.
abstract specification for Viewports
Definition: vtkViewport.h:47
a actor that draws 2D data
Definition: vtkActor2D.h:45
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
void ShallowCopy(vtkProp *prop) override
Shallow copy of this vtkActor2D.
2D text annotation
Definition: vtkTextMapper.h:53
Proxy object to connect input/output ports.
int vtkTypeBool
Definition: vtkABI.h:69
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
An actor that displays text.
Definition: vtkTextActor.h:56
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this actor.
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...
copy oriented and scaled glyph geometry to every input point
Definition: vtkGlyph3D.h:111
appends one or more polygonal datasets together
vtkTypeBool ThreeDimensionalLeader
represent text properties.
vtkCoordinate * AttachmentPointCoordinate
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems ...
Definition: vtkCoordinate.h:81
int RenderTranslucentPolygonalGeometry(vtkViewport *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
map vtkPolyData to graphics primitives
vtkTypeBool HasTranslucentPolygonalGeometry() override
Does this prop have some translucent polygonal geometry?
int RenderOpaqueGeometry(vtkViewport *viewport) override
Support the standard render methods.
draw text label associated with a point
draw vtkPolyData onto the image plane
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.