VTK  9.7.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 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
52 
53 VTK_ABI_NAMESPACE_BEGIN
54 class vtkActor;
55 class vtkAlgorithmOutput;
56 class vtkAppendPolyData;
57 class vtkCaptionActor2DConnection;
58 class vtkGlyph2D;
59 class vtkGlyph3D;
60 class vtkPolyData;
62 class vtkPolyDataMapper;
63 class vtkTextActor;
64 class vtkTextMapper;
65 class vtkTextProperty;
66 
67 class VTKRENDERINGANNOTATION_EXPORT VTK_MARSHALAUTO vtkCaptionActor2D : public vtkActor2D
68 {
69 public:
70  vtkTypeMacro(vtkCaptionActor2D, vtkActor2D);
71  void PrintSelf(ostream& os, vtkIndent indent) override;
72 
73  static vtkCaptionActor2D* New();
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 
116  vtkSetMacro(ThreeDimensionalLeader, vtkTypeBool);
117  vtkGetMacro(ThreeDimensionalLeader, vtkTypeBool);
118  vtkBooleanMacro(ThreeDimensionalLeader, vtkTypeBool);
120 
122 
130  virtual void SetLeaderGlyphData(vtkPolyData*);
131  virtual void SetLeaderGlyphConnection(vtkAlgorithmOutput*);
132  virtual vtkPolyData* GetLeaderGlyph();
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 
178  virtual void SetCaptionTextProperty(vtkTextProperty* p);
179  vtkGetObjectMacro(CaptionTextProperty, vtkTextProperty);
181 
186  void ShallowCopy(vtkProp* prop) override;
187 
189 
193  vtkSetMacro(AttachEdgeOnly, vtkTypeBool);
194  vtkGetMacro(AttachEdgeOnly, vtkTypeBool);
195  vtkBooleanMacro(AttachEdgeOnly, vtkTypeBool);
197 
205  void ReleaseGraphicsResources(vtkWindow*) override;
206 
208 
213  int RenderOpaqueGeometry(vtkViewport* viewport) override;
214  int RenderTranslucentPolygonalGeometry(vtkViewport*) override { return 0; }
215  int RenderOverlay(vtkViewport* viewport) override;
217 
222 
223 protected:
225  ~vtkCaptionActor2D() override;
226 
228 
234 
235  int Padding;
237 
238 private:
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 
266 VTK_ABI_NAMESPACE_END
267 #endif
vtkTypeBool AttachEdgeOnly
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:49
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:41
copy oriented and scaled glyph geometry to every input point (2D specialization)
Definition: vtkGlyph2D.h:32
int RenderOverlay(vtkViewport *viewport) override
Support the standard render methods.
abstract specification for Viewports
Definition: vtkViewport.h:46
a actor that draws 2D data
Definition: vtkActor2D.h:35
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:71
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:41
An actor that displays text.
Definition: vtkTextActor.h:48
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:102
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:69
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.
#define VTK_MARSHALAUTO
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.