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 =========================================================================*/
55 #ifndef vtkCaptionActor2D_h
56 #define vtkCaptionActor2D_h
57 
58 #include "vtkRenderingAnnotationModule.h" // For export macro
59 #include "vtkActor2D.h"
60 
61 class vtkActor;
62 class vtkAlgorithmOutput;
63 class vtkAppendPolyData;
64 class vtkCaptionActor2DConnection;
65 class vtkGlyph2D;
66 class vtkGlyph3D;
67 class vtkPolyData;
69 class vtkPolyDataMapper;
70 class vtkTextActor;
71 class vtkTextMapper;
72 class vtkTextProperty;
73 
74 class VTKRENDERINGANNOTATION_EXPORT vtkCaptionActor2D : public vtkActor2D
75 {
76 public:
78  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
79 
80  static vtkCaptionActor2D *New();
81 
83 
87  virtual void SetCaption(const char* caption);
88  virtual char* GetCaption();
90 
92 
97  vtkWorldCoordinateMacro(AttachmentPoint);
99 
101 
104  vtkSetMacro(Border,int);
105  vtkGetMacro(Border,int);
106  vtkBooleanMacro(Border,int);
108 
110 
114  vtkSetMacro(Leader,int);
115  vtkGetMacro(Leader,int);
116  vtkBooleanMacro(Leader,int);
118 
120 
123  vtkSetMacro(ThreeDimensionalLeader,int);
124  vtkGetMacro(ThreeDimensionalLeader,int);
125  vtkBooleanMacro(ThreeDimensionalLeader,int);
127 
129 
137  virtual void SetLeaderGlyphData(vtkPolyData*);
138  virtual void SetLeaderGlyphConnection(vtkAlgorithmOutput*);
139  virtual vtkPolyData* GetLeaderGlyph();
141 
143 
150  vtkSetClampMacro(LeaderGlyphSize,double,0.0,0.1);
151  vtkGetMacro(LeaderGlyphSize,double);
153 
155 
160  vtkSetClampMacro(MaximumLeaderGlyphSize,int,1,1000);
161  vtkGetMacro(MaximumLeaderGlyphSize,int);
163 
165 
169  vtkSetClampMacro(Padding, int, 0, 50);
170  vtkGetMacro(Padding, int);
172 
174 
178  vtkGetObjectMacro(TextActor,vtkTextActor);
180 
182 
185  virtual void SetCaptionTextProperty(vtkTextProperty *p);
186  vtkGetObjectMacro(CaptionTextProperty,vtkTextProperty);
188 
193  void ShallowCopy(vtkProp *prop) VTK_OVERRIDE;
194 
196 
200  vtkSetMacro(AttachEdgeOnly,int);
201  vtkGetMacro(AttachEdgeOnly,int);
202  vtkBooleanMacro(AttachEdgeOnly,int);
204 
212  void ReleaseGraphicsResources(vtkWindow *) VTK_OVERRIDE;
213 
215 
220  int RenderOpaqueGeometry(vtkViewport* viewport) VTK_OVERRIDE;
221  int RenderTranslucentPolygonalGeometry(vtkViewport* ) VTK_OVERRIDE {return 0;}
222  int RenderOverlay(vtkViewport* viewport) VTK_OVERRIDE;
224 
228  int HasTranslucentPolygonalGeometry() VTK_OVERRIDE;
229 
230 protected:
232  ~vtkCaptionActor2D() VTK_OVERRIDE;
233 
235 
236  int Border;
237  int Leader;
241 
242  int Padding;
244 
245 
246 private:
247  vtkTextActor *TextActor;
248  vtkTextProperty *CaptionTextProperty;
249 
250  vtkPolyData *BorderPolyData;
251  vtkPolyDataMapper2D *BorderMapper;
252  vtkActor2D *BorderActor;
253 
254  vtkPolyData *HeadPolyData; // single attachment point for glyphing
255  vtkGlyph3D *HeadGlyph; // for 3D leader
256  vtkPolyData *LeaderPolyData; // line represents the leader
257  vtkAppendPolyData *AppendLeader; // append head and leader
258 
259  // for 2D leader
260  vtkCoordinate *MapperCoordinate2D;
261  vtkPolyDataMapper2D *LeaderMapper2D;
262  vtkActor2D *LeaderActor2D;
263 
264  // for 3D leader
265  vtkPolyDataMapper *LeaderMapper3D;
266  vtkActor *LeaderActor3D;
267 
268  vtkCaptionActor2DConnection* LeaderGlyphConnectionHolder;
269 
270 private:
271  vtkCaptionActor2D(const vtkCaptionActor2D&) VTK_DELETE_FUNCTION;
272  void operator=(const vtkCaptionActor2D&) VTK_DELETE_FUNCTION;
273 };
274 
275 
276 #endif
277 
278 
279 
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:44
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:45
copy oriented and scaled glyph geometry to every input point (2D specialization)
Definition: vtkGlyph2D.h:36
int RenderOverlay(vtkViewport *viewport) override
Support the standard render methods.
abstract specification for Viewports
Definition: vtkViewport.h:44
a actor that draws 2D data
Definition: vtkActor2D.h:39
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
void ShallowCopy(vtkProp *prop) override
Shallow copy of this vtkActor2D.
2D text annotation
Definition: vtkTextMapper.h:47
Proxy object to connect input/output ports.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
An actor that displays text.
Definition: vtkTextActor.h:50
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:33
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:105
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:72
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
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
int RenderOpaqueGeometry(vtkViewport *viewport) override
Support the standard render methods.
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.