VTK  9.2.20230320
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 =========================================================================*/
127 #ifndef vtkCaptionActor2D_h
128 #define vtkCaptionActor2D_h
129 
130 #include "vtkActor2D.h"
131 #include "vtkRenderingAnnotationModule.h" // For export macro
132 
133 VTK_ABI_NAMESPACE_BEGIN
134 class vtkActor;
135 class vtkAlgorithmOutput;
136 class vtkAppendPolyData;
137 class vtkCaptionActor2DConnection;
138 class vtkGlyph2D;
139 class vtkGlyph3D;
140 class vtkPolyData;
141 class vtkPolyDataMapper2D;
142 class vtkPolyDataMapper;
143 class vtkTextActor;
144 class vtkTextMapper;
145 class vtkTextProperty;
146 
147 class VTKRENDERINGANNOTATION_EXPORT vtkCaptionActor2D : public vtkActor2D
148 {
149 public:
151  void PrintSelf(ostream& os, vtkIndent indent) override;
152 
154 
156 
160  virtual void SetCaption(const char* caption);
161  virtual char* GetCaption();
163 
165 
170  vtkWorldCoordinateMacro(AttachmentPoint);
172 
174 
177  vtkSetMacro(Border, vtkTypeBool);
178  vtkGetMacro(Border, vtkTypeBool);
179  vtkBooleanMacro(Border, vtkTypeBool);
181 
183 
187  vtkSetMacro(Leader, vtkTypeBool);
188  vtkGetMacro(Leader, vtkTypeBool);
189  vtkBooleanMacro(Leader, vtkTypeBool);
191 
193 
196  vtkSetMacro(ThreeDimensionalLeader, vtkTypeBool);
197  vtkGetMacro(ThreeDimensionalLeader, vtkTypeBool);
198  vtkBooleanMacro(ThreeDimensionalLeader, vtkTypeBool);
200 
202 
214 
216 
223  vtkSetClampMacro(LeaderGlyphSize, double, 0.0, 0.1);
224  vtkGetMacro(LeaderGlyphSize, double);
226 
228 
233  vtkSetClampMacro(MaximumLeaderGlyphSize, int, 1, 1000);
234  vtkGetMacro(MaximumLeaderGlyphSize, int);
236 
238 
242  vtkSetClampMacro(Padding, int, 0, 50);
243  vtkGetMacro(Padding, int);
245 
247 
251  vtkGetObjectMacro(TextActor, vtkTextActor);
253 
255 
259  vtkGetObjectMacro(CaptionTextProperty, vtkTextProperty);
261 
266  void ShallowCopy(vtkProp* prop) override;
267 
269 
273  vtkSetMacro(AttachEdgeOnly, vtkTypeBool);
274  vtkGetMacro(AttachEdgeOnly, vtkTypeBool);
275  vtkBooleanMacro(AttachEdgeOnly, vtkTypeBool);
277 
286 
288 
293  int RenderOpaqueGeometry(vtkViewport* viewport) override;
294  int RenderTranslucentPolygonalGeometry(vtkViewport*) override { return 0; }
295  int RenderOverlay(vtkViewport* viewport) override;
297 
302 
303 protected:
305  ~vtkCaptionActor2D() override;
306 
308 
314 
315  int Padding;
317 
318 private:
319  vtkTextActor* TextActor;
320  vtkTextProperty* CaptionTextProperty;
321 
322  vtkPolyData* BorderPolyData;
323  vtkPolyDataMapper2D* BorderMapper;
324  vtkActor2D* BorderActor;
325 
326  vtkPolyData* HeadPolyData; // single attachment point for glyphing
327  vtkGlyph3D* HeadGlyph; // for 3D leader
328  vtkPolyData* LeaderPolyData; // line represents the leader
329  vtkAppendPolyData* AppendLeader; // append head and leader
330 
331  // for 2D leader
332  vtkCoordinate* MapperCoordinate2D;
333  vtkPolyDataMapper2D* LeaderMapper2D;
334  vtkActor2D* LeaderActor2D;
335 
336  // for 3D leader
337  vtkPolyDataMapper* LeaderMapper3D;
338  vtkActor* LeaderActor3D;
339 
340  vtkCaptionActor2DConnection* LeaderGlyphConnectionHolder;
341 
342 private:
343  vtkCaptionActor2D(const vtkCaptionActor2D&) = delete;
344  void operator=(const vtkCaptionActor2D&) = delete;
345 };
346 
347 VTK_ABI_NAMESPACE_END
348 #endif
a actor that draws 2D data
Definition: vtkActor2D.h:156
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:162
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
copy oriented and scaled glyph geometry to every input point (2D specialization)
Definition: vtkGlyph2D.h:73
copy oriented and scaled glyph geometry to every input point
Definition: vtkGlyph3D.h:223
a simple class to control print indentation
Definition: vtkIndent.h:120
draw vtkPolyData onto the image plane
map vtkPolyData to graphics primitives
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:201
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:77
An actor that displays text.
Definition: vtkTextActor.h:167
2D text annotation
represent text properties.
abstract specification for Viewports
Definition: vtkViewport.h:57
window superclass for vtkRenderWindow
Definition: vtkWindow.h:40
int vtkTypeBool
Definition: vtkABI.h:71