VTK  9.3.1
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 
72  static vtkCaptionActor2D* New();
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 
129  virtual void SetLeaderGlyphData(vtkPolyData*);
130  virtual void SetLeaderGlyphConnection(vtkAlgorithmOutput*);
131  virtual vtkPolyData* GetLeaderGlyph();
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 
177  virtual void SetCaptionTextProperty(vtkTextProperty* p);
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 
204  void ReleaseGraphicsResources(vtkWindow*) override;
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
vtkTypeBool AttachEdgeOnly
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:45
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:40
copy oriented and scaled glyph geometry to every input point (2D specialization)
Definition: vtkGlyph2D.h:31
int RenderOverlay(vtkViewport *viewport) override
Support the standard render methods.
abstract specification for Viewports
Definition: vtkViewport.h:44
a actor that draws 2D data
Definition: vtkActor2D.h:34
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
void ShallowCopy(vtkProp *prop) override
Shallow copy of this vtkActor2D.
2D text annotation
Definition: vtkTextMapper.h:39
Proxy object to connect input/output ports.
int vtkTypeBool
Definition: vtkABI.h:64
window superclass for vtkRenderWindow
Definition: vtkWindow.h:27
An actor that displays text.
Definition: vtkTextActor.h:45
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this actor.
a simple class to control print indentation
Definition: vtkIndent.h:28
static vtkActor2D * New()
Creates an actor2D with the following defaults: position (0,0) (coordinate system is viewport); at la...
copy oriented and scaled glyph geometry to every input point
Definition: vtkGlyph3D.h:101
appends one or more polygonal datasets together
vtkTypeBool ThreeDimensionalLeader
represent text properties.
vtkCoordinate * AttachmentPointCoordinate
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems ...
Definition: vtkCoordinate.h:68
int RenderTranslucentPolygonalGeometry(vtkViewport *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
map vtkPolyData to graphics primitives
vtkTypeBool HasTranslucentPolygonalGeometry() override
Does this prop have some translucent polygonal geometry?
int RenderOpaqueGeometry(vtkViewport *viewport) override
Support the standard render methods.
draw text label associated with a point
draw vtkPolyData onto the image plane
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.