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) VTK_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,int);
108  vtkGetMacro(Border,int);
109  vtkBooleanMacro(Border,int);
111 
113 
117  vtkSetMacro(Leader,int);
118  vtkGetMacro(Leader,int);
119  vtkBooleanMacro(Leader,int);
121 
123 
126  vtkSetMacro(ThreeDimensionalLeader,int);
127  vtkGetMacro(ThreeDimensionalLeader,int);
128  vtkBooleanMacro(ThreeDimensionalLeader,int);
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) VTK_OVERRIDE;
197 
199 
203  vtkSetMacro(AttachEdgeOnly,int);
204  vtkGetMacro(AttachEdgeOnly,int);
205  vtkBooleanMacro(AttachEdgeOnly,int);
207 
215  void ReleaseGraphicsResources(vtkWindow *) VTK_OVERRIDE;
216 
218 
223  int RenderOpaqueGeometry(vtkViewport* viewport) VTK_OVERRIDE;
224  int RenderTranslucentPolygonalGeometry(vtkViewport* ) VTK_OVERRIDE {return 0;}
225  int RenderOverlay(vtkViewport* viewport) VTK_OVERRIDE;
227 
231  int HasTranslucentPolygonalGeometry() VTK_OVERRIDE;
232 
233 protected:
235  ~vtkCaptionActor2D() VTK_OVERRIDE;
236 
238 
239  int Border;
240  int Leader;
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&) VTK_DELETE_FUNCTION;
275  void operator=(const vtkCaptionActor2D&) VTK_DELETE_FUNCTION;
276 };
277 
278 
279 #endif
280 
281 
282 
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:50
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.
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
int HasTranslucentPolygonalGeometry() override
Does this prop have some translucent polygonal geometry?
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
represent text properties.
vtkCoordinate * AttachmentPointCoordinate
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems ...
Definition: vtkCoordinate.h:78
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
map vtkPolyData to graphics primitives
draw text label associated with a point
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
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.