VTK  9.0.1
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 "vtkActor2D.h"
59 #include "vtkRenderingAnnotationModule.h" // For export macro
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:
77  vtkTypeMacro(vtkCaptionActor2D, vtkActor2D);
78  void PrintSelf(ostream& os, vtkIndent indent) override;
79 
81 
83 
87  virtual void SetCaption(const char* caption);
88  virtual char* GetCaption();
90 
92 
97  vtkWorldCoordinateMacro(AttachmentPoint);
99 
101 
104  vtkSetMacro(Border, vtkTypeBool);
105  vtkGetMacro(Border, vtkTypeBool);
106  vtkBooleanMacro(Border, vtkTypeBool);
108 
110 
114  vtkSetMacro(Leader, vtkTypeBool);
115  vtkGetMacro(Leader, vtkTypeBool);
116  vtkBooleanMacro(Leader, vtkTypeBool);
118 
120 
123  vtkSetMacro(ThreeDimensionalLeader, vtkTypeBool);
124  vtkGetMacro(ThreeDimensionalLeader, vtkTypeBool);
125  vtkBooleanMacro(ThreeDimensionalLeader, vtkTypeBool);
127 
129 
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 
186  vtkGetObjectMacro(CaptionTextProperty, vtkTextProperty);
188 
193  void ShallowCopy(vtkProp* prop) override;
194 
196 
200  vtkSetMacro(AttachEdgeOnly, vtkTypeBool);
201  vtkGetMacro(AttachEdgeOnly, vtkTypeBool);
202  vtkBooleanMacro(AttachEdgeOnly, vtkTypeBool);
204 
213 
215 
220  int RenderOpaqueGeometry(vtkViewport* viewport) override;
221  int RenderTranslucentPolygonalGeometry(vtkViewport*) override { return 0; }
222  int RenderOverlay(vtkViewport* viewport) override;
224 
229 
230 protected:
232  ~vtkCaptionActor2D() override;
233 
235 
241 
242  int Padding;
244 
245 private:
246  vtkTextActor* TextActor;
247  vtkTextProperty* CaptionTextProperty;
248 
249  vtkPolyData* BorderPolyData;
250  vtkPolyDataMapper2D* BorderMapper;
251  vtkActor2D* BorderActor;
252 
253  vtkPolyData* HeadPolyData; // single attachment point for glyphing
254  vtkGlyph3D* HeadGlyph; // for 3D leader
255  vtkPolyData* LeaderPolyData; // line represents the leader
256  vtkAppendPolyData* AppendLeader; // append head and leader
257 
258  // for 2D leader
259  vtkCoordinate* MapperCoordinate2D;
260  vtkPolyDataMapper2D* LeaderMapper2D;
261  vtkActor2D* LeaderActor2D;
262 
263  // for 3D leader
264  vtkPolyDataMapper* LeaderMapper3D;
265  vtkActor* LeaderActor3D;
266 
267  vtkCaptionActor2DConnection* LeaderGlyphConnectionHolder;
268 
269 private:
270  vtkCaptionActor2D(const vtkCaptionActor2D&) = delete;
271  void operator=(const vtkCaptionActor2D&) = delete;
272 };
273 
274 #endif
a actor that draws 2D data
Definition: vtkActor2D.h:40
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:46
Proxy object to connect input/output ports.
appends one or more polygonal datasets together
draw text label associated with a point
virtual void SetCaptionTextProperty(vtkTextProperty *p)
Set/Get the text property.
int RenderOpaqueGeometry(vtkViewport *viewport) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
virtual char * GetCaption()
vtkTypeBool ThreeDimensionalLeader
void ShallowCopy(vtkProp *prop) override
Shallow copy of this scaled text actor.
vtkTypeBool HasTranslucentPolygonalGeometry() override
Does this prop have some translucent polygonal geometry?
virtual void SetLeaderGlyphConnection(vtkAlgorithmOutput *)
int RenderTranslucentPolygonalGeometry(vtkViewport *) override
virtual void SetLeaderGlyphData(vtkPolyData *)
Specify a glyph to be used as the leader "head".
static vtkCaptionActor2D * New()
vtkTypeBool AttachEdgeOnly
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
~vtkCaptionActor2D() override
int RenderOverlay(vtkViewport *viewport) override
vtkCoordinate * AttachmentPointCoordinate
virtual vtkPolyData * GetLeaderGlyph()
void ReleaseGraphicsResources(vtkWindow *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
virtual void SetCaption(const char *caption)
Define the text to be placed in the caption.
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:77
copy oriented and scaled glyph geometry to every input point (2D specialization)
Definition: vtkGlyph2D.h:37
copy oriented and scaled glyph geometry to every input point
Definition: vtkGlyph3D.h:106
a simple class to control print indentation
Definition: vtkIndent.h:34
draw vtkPolyData onto the image plane
map vtkPolyData to graphics primitives
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:48
An actor that displays text.
Definition: vtkTextActor.h:51
2D text annotation
Definition: vtkTextMapper.h:48
represent text properties.
abstract specification for Viewports
Definition: vtkViewport.h:45
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
int vtkTypeBool
Definition: vtkABI.h:69