VTK  9.0.1
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 =========================================================================*/
55 #ifndef vtkCaptionActor2D_h
56 #define vtkCaptionActor2D_h
57 
58 #include "vtkActor2D.h"
59 #include "vtkRenderingAnnotationModule.h" // For export macro
60 
61 class vtkActor;
62 class vtkAlgorithmOutput;
63 class vtkAppendPolyData;
64 class vtkCaptionActor2DConnection;
65 class vtkGlyph2D;
66 class vtkGlyph3D;
67 class vtkPolyData;
69 class vtkPolyDataMapper;
70 class vtkTextActor;
71 class vtkTextMapper;
72 class vtkTextProperty;
73 
74 class VTKRENDERINGANNOTATION_EXPORT vtkCaptionActor2D : public vtkActor2D
75 {
76 public:
77  vtkTypeMacro(vtkCaptionActor2D, vtkActor2D);
78  void PrintSelf(ostream& os, vtkIndent indent) override;
79 
80  static vtkCaptionActor2D* New();
81 
83 
87  virtual void SetCaption(const char* caption);
88  virtual char* GetCaption();
90 
92 
97  vtkWorldCoordinateMacro(AttachmentPoint);
99 
101 
104  vtkSetMacro(Border, vtkTypeBool);
105  vtkGetMacro(Border, vtkTypeBool);
106  vtkBooleanMacro(Border, vtkTypeBool);
108 
110 
114  vtkSetMacro(Leader, vtkTypeBool);
115  vtkGetMacro(Leader, vtkTypeBool);
116  vtkBooleanMacro(Leader, vtkTypeBool);
118 
120 
123  vtkSetMacro(ThreeDimensionalLeader, vtkTypeBool);
124  vtkGetMacro(ThreeDimensionalLeader, vtkTypeBool);
125  vtkBooleanMacro(ThreeDimensionalLeader, vtkTypeBool);
127 
129 
137  virtual void SetLeaderGlyphData(vtkPolyData*);
138  virtual void SetLeaderGlyphConnection(vtkAlgorithmOutput*);
139  virtual vtkPolyData* GetLeaderGlyph();
141 
143 
150  vtkSetClampMacro(LeaderGlyphSize, double, 0.0, 0.1);
151  vtkGetMacro(LeaderGlyphSize, double);
153 
155 
160  vtkSetClampMacro(MaximumLeaderGlyphSize, int, 1, 1000);
161  vtkGetMacro(MaximumLeaderGlyphSize, int);
163 
165 
169  vtkSetClampMacro(Padding, int, 0, 50);
170  vtkGetMacro(Padding, int);
172 
174 
178  vtkGetObjectMacro(TextActor, vtkTextActor);
180 
182 
185  virtual void SetCaptionTextProperty(vtkTextProperty* p);
186  vtkGetObjectMacro(CaptionTextProperty, vtkTextProperty);
188 
193  void ShallowCopy(vtkProp* prop) override;
194 
196 
200  vtkSetMacro(AttachEdgeOnly, vtkTypeBool);
201  vtkGetMacro(AttachEdgeOnly, vtkTypeBool);
202  vtkBooleanMacro(AttachEdgeOnly, vtkTypeBool);
204 
212  void ReleaseGraphicsResources(vtkWindow*) override;
213 
215 
220  int RenderOpaqueGeometry(vtkViewport* viewport) override;
221  int RenderTranslucentPolygonalGeometry(vtkViewport*) override { return 0; }
222  int RenderOverlay(vtkViewport* viewport) override;
224 
229 
230 protected:
232  ~vtkCaptionActor2D() override;
233 
235 
241 
242  int Padding;
244 
245 private:
246  vtkTextActor* TextActor;
247  vtkTextProperty* CaptionTextProperty;
248 
249  vtkPolyData* BorderPolyData;
250  vtkPolyDataMapper2D* BorderMapper;
251  vtkActor2D* BorderActor;
252 
253  vtkPolyData* HeadPolyData; // single attachment point for glyphing
254  vtkGlyph3D* HeadGlyph; // for 3D leader
255  vtkPolyData* LeaderPolyData; // line represents the leader
256  vtkAppendPolyData* AppendLeader; // append head and leader
257 
258  // for 2D leader
259  vtkCoordinate* MapperCoordinate2D;
260  vtkPolyDataMapper2D* LeaderMapper2D;
261  vtkActor2D* LeaderActor2D;
262 
263  // for 3D leader
264  vtkPolyDataMapper* LeaderMapper3D;
265  vtkActor* LeaderActor3D;
266 
267  vtkCaptionActor2DConnection* LeaderGlyphConnectionHolder;
268 
269 private:
270  vtkCaptionActor2D(const vtkCaptionActor2D&) = delete;
271  void operator=(const vtkCaptionActor2D&) = delete;
272 };
273 
274 #endif
vtkTypeBool AttachEdgeOnly
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:53
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:45
copy oriented and scaled glyph geometry to every input point (2D specialization)
Definition: vtkGlyph2D.h:36
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:39
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
void ShallowCopy(vtkProp *prop) override
Shallow copy of this vtkActor2D.
2D text annotation
Definition: vtkTextMapper.h:47
Proxy object to connect input/output ports.
int vtkTypeBool
Definition: vtkABI.h:69
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
An actor that displays text.
Definition: vtkTextActor.h:50
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:33
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:105
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:76
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.