VTK  9.3.0
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
46 #ifndef vtkCaptionActor2D_h
47 #define vtkCaptionActor2D_h
48 
49 #include "vtkActor2D.h"
50 #include "vtkRenderingAnnotationModule.h" // For export macro
51 
52 VTK_ABI_NAMESPACE_BEGIN
53 class vtkActor;
54 class vtkAlgorithmOutput;
55 class vtkAppendPolyData;
56 class vtkCaptionActor2DConnection;
57 class vtkGlyph2D;
58 class vtkGlyph3D;
59 class vtkPolyData;
61 class vtkPolyDataMapper;
62 class vtkTextActor;
63 class vtkTextMapper;
64 class vtkTextProperty;
65 
66 class VTKRENDERINGANNOTATION_EXPORT vtkCaptionActor2D : public vtkActor2D
67 {
68 public:
69  vtkTypeMacro(vtkCaptionActor2D, vtkActor2D);
70  void PrintSelf(ostream& os, vtkIndent indent) override;
71 
73 
75 
79  virtual void SetCaption(const char* caption);
80  virtual char* GetCaption();
82 
84 
89  vtkWorldCoordinateMacro(AttachmentPoint);
91 
93 
96  vtkSetMacro(Border, vtkTypeBool);
97  vtkGetMacro(Border, vtkTypeBool);
98  vtkBooleanMacro(Border, vtkTypeBool);
100 
102 
106  vtkSetMacro(Leader, vtkTypeBool);
107  vtkGetMacro(Leader, vtkTypeBool);
108  vtkBooleanMacro(Leader, vtkTypeBool);
110 
112 
115  vtkSetMacro(ThreeDimensionalLeader, vtkTypeBool);
116  vtkGetMacro(ThreeDimensionalLeader, vtkTypeBool);
117  vtkBooleanMacro(ThreeDimensionalLeader, vtkTypeBool);
119 
121 
133 
135 
142  vtkSetClampMacro(LeaderGlyphSize, double, 0.0, 0.1);
143  vtkGetMacro(LeaderGlyphSize, double);
145 
147 
152  vtkSetClampMacro(MaximumLeaderGlyphSize, int, 1, 1000);
153  vtkGetMacro(MaximumLeaderGlyphSize, int);
155 
157 
161  vtkSetClampMacro(Padding, int, 0, 50);
162  vtkGetMacro(Padding, int);
164 
166 
170  vtkGetObjectMacro(TextActor, vtkTextActor);
172 
174 
178  vtkGetObjectMacro(CaptionTextProperty, vtkTextProperty);
180 
185  void ShallowCopy(vtkProp* prop) override;
186 
188 
192  vtkSetMacro(AttachEdgeOnly, vtkTypeBool);
193  vtkGetMacro(AttachEdgeOnly, vtkTypeBool);
194  vtkBooleanMacro(AttachEdgeOnly, vtkTypeBool);
196 
205 
207 
212  int RenderOpaqueGeometry(vtkViewport* viewport) override;
213  int RenderTranslucentPolygonalGeometry(vtkViewport*) override { return 0; }
214  int RenderOverlay(vtkViewport* viewport) override;
216 
221 
222 protected:
224  ~vtkCaptionActor2D() override;
225 
227 
233 
234  int Padding;
236 
237 private:
238  vtkTextActor* TextActor;
239  vtkTextProperty* CaptionTextProperty;
240 
241  vtkPolyData* BorderPolyData;
242  vtkPolyDataMapper2D* BorderMapper;
243  vtkActor2D* BorderActor;
244 
245  vtkPolyData* HeadPolyData; // single attachment point for glyphing
246  vtkGlyph3D* HeadGlyph; // for 3D leader
247  vtkPolyData* LeaderPolyData; // line represents the leader
248  vtkAppendPolyData* AppendLeader; // append head and leader
249 
250  // for 2D leader
251  vtkCoordinate* MapperCoordinate2D;
252  vtkPolyDataMapper2D* LeaderMapper2D;
253  vtkActor2D* LeaderActor2D;
254 
255  // for 3D leader
256  vtkPolyDataMapper* LeaderMapper3D;
257  vtkActor* LeaderActor3D;
258 
259  vtkCaptionActor2DConnection* LeaderGlyphConnectionHolder;
260 
261  vtkCaptionActor2D(const vtkCaptionActor2D&) = delete;
262  void operator=(const vtkCaptionActor2D&) = delete;
263 };
264 
265 VTK_ABI_NAMESPACE_END
266 #endif
a actor that draws 2D data
Definition: vtkActor2D.h:35
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:41
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()
Define the text to be placed in the caption.
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".
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".
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
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
Definition: vtkCoordinate.h:69
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:80
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:46
An actor that displays text.
Definition: vtkTextActor.h:46
2D text annotation
Definition: vtkTextMapper.h:40
represent text properties.
abstract specification for Viewports
Definition: vtkViewport.h:45
window superclass for vtkRenderWindow
Definition: vtkWindow.h:28
int vtkTypeBool
Definition: vtkABI.h:64