VTK  9.4.20251007
vtkCaptionActor2D.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
45
46#ifndef vtkCaptionActor2D_h
47#define vtkCaptionActor2D_h
48
49#include "vtkActor2D.h"
50#include "vtkRenderingAnnotationModule.h" // For export macro
51#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
52
53VTK_ABI_NAMESPACE_BEGIN
54class vtkActor;
57class vtkCaptionActor2DConnection;
58class vtkGlyph2D;
59class vtkGlyph3D;
60class vtkPolyData;
63class vtkTextActor;
64class vtkTextMapper;
65class vtkTextProperty;
66
67class VTKRENDERINGANNOTATION_EXPORT VTK_MARSHALAUTO vtkCaptionActor2D : public vtkActor2D
68{
69public:
71 void PrintSelf(ostream& os, vtkIndent indent) override;
72
74
76
80 virtual void SetCaption(const char* caption);
81 virtual char* GetCaption();
83
85
90 vtkWorldCoordinateMacro(AttachmentPoint);
92
94
97 vtkSetMacro(Border, vtkTypeBool);
98 vtkGetMacro(Border, vtkTypeBool);
99 vtkBooleanMacro(Border, vtkTypeBool);
101
103
107 vtkSetMacro(Leader, vtkTypeBool);
108 vtkGetMacro(Leader, vtkTypeBool);
109 vtkBooleanMacro(Leader, vtkTypeBool);
111
113
120
122
134
136
143 vtkSetClampMacro(LeaderGlyphSize, double, 0.0, 0.1);
144 vtkGetMacro(LeaderGlyphSize, double);
146
148
153 vtkSetClampMacro(MaximumLeaderGlyphSize, int, 1, 1000);
154 vtkGetMacro(MaximumLeaderGlyphSize, int);
156
158
162 vtkSetClampMacro(Padding, int, 0, 50);
163 vtkGetMacro(Padding, int);
165
167
171 vtkGetObjectMacro(TextActor, vtkTextActor);
173
175
179 vtkGetObjectMacro(CaptionTextProperty, vtkTextProperty);
181
186 void ShallowCopy(vtkProp* prop) override;
187
189
195 vtkBooleanMacro(AttachEdgeOnly, vtkTypeBool);
197
206
208
213 int RenderOpaqueGeometry(vtkViewport* viewport) override;
215 int RenderOverlay(vtkViewport* viewport) override;
217
222
223protected:
226
228
234
237
238private:
239 vtkTextActor* TextActor;
240 vtkTextProperty* CaptionTextProperty;
241
242 vtkPolyData* BorderPolyData;
243 vtkPolyDataMapper2D* BorderMapper;
244 vtkActor2D* BorderActor;
245
246 vtkPolyData* HeadPolyData; // single attachment point for glyphing
247 vtkGlyph3D* HeadGlyph; // for 3D leader
248 vtkPolyData* LeaderPolyData; // line represents the leader
249 vtkAppendPolyData* AppendLeader; // append head and leader
250
251 // for 2D leader
252 vtkCoordinate* MapperCoordinate2D;
253 vtkPolyDataMapper2D* LeaderMapper2D;
254 vtkActor2D* LeaderActor2D;
255
256 // for 3D leader
257 vtkPolyDataMapper* LeaderMapper3D;
258 vtkActor* LeaderActor3D;
259
260 vtkCaptionActor2DConnection* LeaderGlyphConnectionHolder;
261
262 vtkCaptionActor2D(const vtkCaptionActor2D&) = delete;
263 void operator=(const vtkCaptionActor2D&) = delete;
264};
265
266VTK_ABI_NAMESPACE_END
267#endif
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:42
Proxy object to connect input/output ports.
appends one or more polygonal datasets together
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:32
copy oriented and scaled glyph geometry to every input point
Definition vtkGlyph3D.h:102
a simple class to control print indentation
Definition vtkIndent.h:29
draw vtkPolyData onto the image plane
map vtkPolyData to graphics primitives
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:72
An actor that displays text.
2D text annotation
represent text properties.
abstract specification for Viewports
Definition vtkViewport.h:46
window superclass for vtkRenderWindow
Definition vtkWindow.h:29
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_MARSHALAUTO