VTK  9.2.6
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=========================================================================*/
67#ifndef vtkCaptionActor2D_h
68#define vtkCaptionActor2D_h
69
70#include "vtkActor2D.h"
71#include "vtkRenderingAnnotationModule.h" // For export macro
72
73class vtkActor;
76class vtkCaptionActor2DConnection;
77class vtkGlyph2D;
78class vtkGlyph3D;
79class vtkPolyData;
82class vtkTextActor;
83class vtkTextMapper;
84class vtkTextProperty;
85
86class VTKRENDERINGANNOTATION_EXPORT vtkCaptionActor2D : public vtkActor2D
87{
88public:
90 void PrintSelf(ostream& os, vtkIndent indent) override;
91
93
95
99 virtual void SetCaption(const char* caption);
100 virtual char* GetCaption();
102
104
109 vtkWorldCoordinateMacro(AttachmentPoint);
111
113
116 vtkSetMacro(Border, vtkTypeBool);
117 vtkGetMacro(Border, vtkTypeBool);
118 vtkBooleanMacro(Border, vtkTypeBool);
120
122
126 vtkSetMacro(Leader, vtkTypeBool);
127 vtkGetMacro(Leader, vtkTypeBool);
128 vtkBooleanMacro(Leader, vtkTypeBool);
130
132
135 vtkSetMacro(ThreeDimensionalLeader, vtkTypeBool);
136 vtkGetMacro(ThreeDimensionalLeader, vtkTypeBool);
137 vtkBooleanMacro(ThreeDimensionalLeader, vtkTypeBool);
139
141
153
155
162 vtkSetClampMacro(LeaderGlyphSize, double, 0.0, 0.1);
163 vtkGetMacro(LeaderGlyphSize, double);
165
167
172 vtkSetClampMacro(MaximumLeaderGlyphSize, int, 1, 1000);
173 vtkGetMacro(MaximumLeaderGlyphSize, int);
175
177
181 vtkSetClampMacro(Padding, int, 0, 50);
182 vtkGetMacro(Padding, int);
184
186
190 vtkGetObjectMacro(TextActor, vtkTextActor);
192
194
198 vtkGetObjectMacro(CaptionTextProperty, vtkTextProperty);
200
205 void ShallowCopy(vtkProp* prop) override;
206
208
212 vtkSetMacro(AttachEdgeOnly, vtkTypeBool);
213 vtkGetMacro(AttachEdgeOnly, vtkTypeBool);
214 vtkBooleanMacro(AttachEdgeOnly, vtkTypeBool);
216
225
227
232 int RenderOpaqueGeometry(vtkViewport* viewport) override;
234 int RenderOverlay(vtkViewport* viewport) override;
236
241
242protected:
245
247
253
256
257private:
258 vtkTextActor* TextActor;
259 vtkTextProperty* CaptionTextProperty;
260
261 vtkPolyData* BorderPolyData;
262 vtkPolyDataMapper2D* BorderMapper;
263 vtkActor2D* BorderActor;
264
265 vtkPolyData* HeadPolyData; // single attachment point for glyphing
266 vtkGlyph3D* HeadGlyph; // for 3D leader
267 vtkPolyData* LeaderPolyData; // line represents the leader
268 vtkAppendPolyData* AppendLeader; // append head and leader
269
270 // for 2D leader
271 vtkCoordinate* MapperCoordinate2D;
272 vtkPolyDataMapper2D* LeaderMapper2D;
273 vtkActor2D* LeaderActor2D;
274
275 // for 3D leader
276 vtkPolyDataMapper* LeaderMapper3D;
277 vtkActor* LeaderActor3D;
278
279 vtkCaptionActor2DConnection* LeaderGlyphConnectionHolder;
280
281private:
282 vtkCaptionActor2D(const vtkCaptionActor2D&) = delete;
283 void operator=(const vtkCaptionActor2D&) = delete;
284};
285
286#endif
a actor that draws 2D data
Definition vtkActor2D.h:55
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:61
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...
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 *)
Specify a glyph to be used as the leader "head".
static vtkCaptionActor2D * New()
int RenderTranslucentPolygonalGeometry(vtkViewport *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
virtual void SetLeaderGlyphData(vtkPolyData *)
Specify a glyph to be used as the leader "head".
virtual char * GetCaption()
Define the text to be placed in the caption.
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
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
vtkCoordinate * AttachmentPointCoordinate
virtual vtkPolyData * GetLeaderGlyph()
Specify a glyph to be used as the leader "head".
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
copy oriented and scaled glyph geometry to every input point (2D specialization)
Definition vtkGlyph2D.h:52
copy oriented and scaled glyph geometry to every input point
Definition vtkGlyph3D.h:122
a simple class to control print indentation
Definition vtkIndent.h:49
draw vtkPolyData onto the image plane
map vtkPolyData to graphics primitives
concrete dataset represents vertices, lines, polygons, and triangle strips
abstract superclass for all actors, volumes and annotations
Definition vtkProp.h:66
An actor that displays text.
2D text annotation
represent text properties.
abstract specification for Viewports
Definition vtkViewport.h:65
window superclass for vtkRenderWindow
Definition vtkWindow.h:48
int vtkTypeBool
Definition vtkABI.h:69