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 =========================================================================*/
57 #ifndef vtkCaptionActor2D_h
58 #define vtkCaptionActor2D_h
59 
60 #include "vtkRenderingAnnotationModule.h" // For export macro
61 #include "vtkActor2D.h"
62 
63 class vtkActor;
64 class vtkAlgorithmOutput;
65 class vtkAppendPolyData;
66 class vtkCaptionActor2DConnection;
67 class vtkGlyph2D;
68 class vtkGlyph3D;
69 class vtkPolyData;
71 class vtkPolyDataMapper;
72 class vtkTextActor;
73 class vtkTextMapper;
74 class vtkTextProperty;
75 
77 {
78 public:
80  void PrintSelf(ostream& os, vtkIndent indent);
81 
82  static vtkCaptionActor2D *New();
83 
85 
87  virtual void SetCaption(const char* caption);
88  virtual char* GetCaption();
90 
92 
95  vtkWorldCoordinateMacro(AttachmentPoint);
97 
99 
100  vtkSetMacro(Border,int);
101  vtkGetMacro(Border,int);
102  vtkBooleanMacro(Border,int);
104 
106 
108  vtkSetMacro(Leader,int);
109  vtkGetMacro(Leader,int);
110  vtkBooleanMacro(Leader,int);
112 
114 
116  vtkSetMacro(ThreeDimensionalLeader,int);
117  vtkGetMacro(ThreeDimensionalLeader,int);
118  vtkBooleanMacro(ThreeDimensionalLeader,int);
120 
122 
129  virtual void SetLeaderGlyphData(vtkPolyData*);
130  virtual void SetLeaderGlyphConnection(vtkAlgorithmOutput*);
131  virtual vtkPolyData* GetLeaderGlyph();
133 
135 
140  vtkSetClampMacro(LeaderGlyphSize,double,0.0,0.1);
141  vtkGetMacro(LeaderGlyphSize,double);
143 
145 
148  vtkSetClampMacro(MaximumLeaderGlyphSize,int,1,1000);
149  vtkGetMacro(MaximumLeaderGlyphSize,int);
151 
153 
155  vtkSetClampMacro(Padding, int, 0, 50);
156  vtkGetMacro(Padding, int);
158 
160 
162  vtkGetObjectMacro(TextActor,vtkTextActor);
164 
166 
167  virtual void SetCaptionTextProperty(vtkTextProperty *p);
168  vtkGetObjectMacro(CaptionTextProperty,vtkTextProperty);
170 
173  void ShallowCopy(vtkProp *prop);
174 
176 
178  vtkSetMacro(AttachEdgeOnly,int);
179  vtkGetMacro(AttachEdgeOnly,int);
180  vtkBooleanMacro(AttachEdgeOnly,int);
182 
183 //BTX
188  virtual void ReleaseGraphicsResources(vtkWindow *);
189 
191 
194  int RenderOpaqueGeometry(vtkViewport* viewport);
196  int RenderOverlay(vtkViewport* viewport);
198 
200 
201  virtual int HasTranslucentPolygonalGeometry();
202 //ETX
204 
205 protected:
208 
210 
211  int Border;
212  int Leader;
216 
217  int Padding;
219 
220 
221 private:
222  vtkTextActor *TextActor;
223  vtkTextProperty *CaptionTextProperty;
224 
225  vtkPolyData *BorderPolyData;
226  vtkPolyDataMapper2D *BorderMapper;
227  vtkActor2D *BorderActor;
228 
229  vtkPolyData *HeadPolyData; // single attachment point for glyphing
230  vtkGlyph3D *HeadGlyph; // for 3D leader
231  vtkPolyData *LeaderPolyData; // line represents the leader
232  vtkAppendPolyData *AppendLeader; // append head and leader
233 
234  // for 2D leader
235  vtkCoordinate *MapperCoordinate2D;
236  vtkPolyDataMapper2D *LeaderMapper2D;
237  vtkActor2D *LeaderActor2D;
238 
239  // for 3D leader
240  vtkPolyDataMapper *LeaderMapper3D;
241  vtkActor *LeaderActor3D;
242 
243  vtkCaptionActor2DConnection* LeaderGlyphConnectionHolder;
244 
245 private:
246  vtkCaptionActor2D(const vtkCaptionActor2D&); // Not implemented.
247  void operator=(const vtkCaptionActor2D&); // Not implemented.
248 };
249 
250 
251 #endif
252 
253 
254 
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:52
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:50
copy oriented and scaled glyph geometry to every input point (2D specialization)
Definition: vtkGlyph2D.h:38
virtual void ReleaseGraphicsResources(vtkWindow *)
abstract specification for Viewports
Definition: vtkViewport.h:46
a actor that draws 2D data
Definition: vtkActor2D.h:44
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:83
2D text annotation
Definition: vtkTextMapper.h:52
#define VTKRENDERINGANNOTATION_EXPORT
Proxy object to connect input/output ports.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:36
An actor that displays text. Scaled or unscaled.
Definition: vtkTextActor.h:54
virtual int HasTranslucentPolygonalGeometry()
virtual int RenderOpaqueGeometry(vtkViewport *viewport)
a simple class to control print indentation
Definition: vtkIndent.h:38
void PrintSelf(ostream &os, vtkIndent indent)
static vtkActor2D * New()
copy oriented and scaled glyph geometry to every input point
Definition: vtkGlyph3D.h:110
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:69
map vtkPolyData to graphics primitives
virtual void ShallowCopy(vtkProp *prop)
virtual int RenderOverlay(vtkViewport *viewport)
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
draw text label associated with a point
draw vtkPolyData onto the image plane