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 "vtkActor2D.h"
61 
62 class vtkActor;
63 class vtkAppendPolyData;
64 class vtkGlyph2D;
65 class vtkGlyph3D;
66 class vtkPolyData;
68 class vtkPolyDataMapper;
69 class vtkTextActor;
70 class vtkTextMapper;
71 class vtkTextProperty;
72 
74 {
75 public:
77  void PrintSelf(ostream& os, vtkIndent indent);
78 
79  static vtkCaptionActor2D *New();
80 
82 
84  virtual void SetCaption(const char* caption);
85  virtual char* GetCaption();
87 
89 
92  vtkWorldCoordinateMacro(AttachmentPoint);
94 
96 
97  vtkSetMacro(Border,int);
98  vtkGetMacro(Border,int);
99  vtkBooleanMacro(Border,int);
101 
103 
105  vtkSetMacro(Leader,int);
106  vtkGetMacro(Leader,int);
107  vtkBooleanMacro(Leader,int);
109 
111 
113  vtkSetMacro(ThreeDimensionalLeader,int);
114  vtkGetMacro(ThreeDimensionalLeader,int);
115  vtkBooleanMacro(ThreeDimensionalLeader,int);
117 
119 
123  virtual void SetLeaderGlyph(vtkPolyData*);
124  vtkGetObjectMacro(LeaderGlyph,vtkPolyData);
126 
128 
133  vtkSetClampMacro(LeaderGlyphSize,double,0.0,0.1);
134  vtkGetMacro(LeaderGlyphSize,double);
136 
138 
141  vtkSetClampMacro(MaximumLeaderGlyphSize,int,1,1000);
142  vtkGetMacro(MaximumLeaderGlyphSize,int);
144 
146 
148  vtkSetClampMacro(Padding, int, 0, 50);
149  vtkGetMacro(Padding, int);
151 
153 
155  vtkGetObjectMacro(TextActor,vtkTextActor);
157 
159 
160  virtual void SetCaptionTextProperty(vtkTextProperty *p);
161  vtkGetObjectMacro(CaptionTextProperty,vtkTextProperty);
163 
166  void ShallowCopy(vtkProp *prop);
167 
169 
171  vtkSetMacro(AttachEdgeOnly,int);
172  vtkGetMacro(AttachEdgeOnly,int);
173  vtkBooleanMacro(AttachEdgeOnly,int);
175 
176 //BTX
181  virtual void ReleaseGraphicsResources(vtkWindow *);
182 
184 
187  int RenderOpaqueGeometry(vtkViewport* viewport);
189  int RenderOverlay(vtkViewport* viewport);
191 
193 
194  virtual int HasTranslucentPolygonalGeometry();
195 //ETX
197 
198 protected:
201 
203 
204  int Border;
205  int Leader;
209 
210  vtkPolyData *LeaderGlyph; //what to put on the end of the leader
211 
212  int Padding;
214 
215 
216 private:
217  vtkTextActor *TextActor;
218  vtkTextProperty *CaptionTextProperty;
219 
220  vtkPolyData *BorderPolyData;
221  vtkPolyDataMapper2D *BorderMapper;
222  vtkActor2D *BorderActor;
223 
224  vtkPolyData *HeadPolyData; // single attachment point for glyphing
225  vtkGlyph3D *HeadGlyph; // for 3D leader
226  vtkPolyData *LeaderPolyData; // line represents the leader
227  vtkAppendPolyData *AppendLeader; // append head and leader
228 
229  // for 2D leader
230  vtkCoordinate *MapperCoordinate2D;
231  vtkPolyDataMapper2D *LeaderMapper2D;
232  vtkActor2D *LeaderActor2D;
233 
234  // for 3D leader
235  vtkPolyDataMapper *LeaderMapper3D;
236  vtkActor *LeaderActor3D;
237 
238 private:
239  vtkCaptionActor2D(const vtkCaptionActor2D&); // Not implemented.
240  void operator=(const vtkCaptionActor2D&); // Not implemented.
241 };
242 
243 
244 #endif
245 
246 
247 
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:49
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:49
copy oriented and scaled glyph geometry to every input point (2D specialization)
Definition: vtkGlyph2D.h:37
virtual void ReleaseGraphicsResources(vtkWindow *)
abstract specification for Viewports
Definition: vtkViewport.h:45
a actor that draws 2D data
Definition: vtkActor2D.h:43
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:81
2D text annotation
Definition: vtkTextMapper.h:43
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
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:37
void PrintSelf(ostream &os, vtkIndent indent)
static vtkActor2D * New()
copy oriented and scaled glyph geometry to every input point
Definition: vtkGlyph3D.h:109
appends one or more polygonal datasets together
vtkPolyData * LeaderGlyph
represent text properties.
vtkCoordinate * AttachmentPointCoordinate
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems ...
Definition: vtkCoordinate.h:68
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
#define VTK_HYBRID_EXPORT
draw vtkPolyData onto the image plane