VTK  9.2.6
vtkLeaderActor2D.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkLeaderActor2D.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=========================================================================*/
42
43#ifndef vtkLeaderActor2D_h
44#define vtkLeaderActor2D_h
45
46#include "vtkActor2D.h"
47#include "vtkRenderingAnnotationModule.h" // For export macro
48
49class vtkPoints;
50class vtkCellArray;
51class vtkPolyData;
53class vtkTextMapper;
54class vtkTextProperty;
55
56class VTKRENDERINGANNOTATION_EXPORT vtkLeaderActor2D : public vtkActor2D
57{
58public:
60 void PrintSelf(ostream& os, vtkIndent indent) override;
61
66
68
80 vtkSetMacro(Radius, double);
81 vtkGetMacro(Radius, double);
83
85
89 vtkSetStringMacro(Label);
90 vtkGetStringMacro(Label);
92
94
100
102
106 vtkSetClampMacro(LabelFactor, double, 0.1, 2.0);
107 vtkGetMacro(LabelFactor, double);
109
110 // Enums defined to support methods for control of arrow placement and
111 // and appearance of arrow heads.
112 enum
113 {
118 };
119 enum
120 {
124 };
125
127
132 vtkGetMacro(ArrowPlacement, int);
138
140
146 vtkGetMacro(ArrowStyle, int);
151
153
157 vtkSetClampMacro(ArrowLength, double, 0.0, 1.0);
158 vtkGetMacro(ArrowLength, double);
159 vtkSetClampMacro(ArrowWidth, double, 0.0, 1.0);
160 vtkGetMacro(ArrowWidth, double);
162
164
170 vtkSetClampMacro(MinimumArrowSize, double, 1.0, VTK_FLOAT_MAX);
171 vtkGetMacro(MinimumArrowSize, double);
172 vtkSetClampMacro(MaximumArrowSize, double, 1.0, VTK_FLOAT_MAX);
173 vtkGetMacro(MaximumArrowSize, double);
175
177
183 vtkSetMacro(AutoLabel, vtkTypeBool);
184 vtkGetMacro(AutoLabel, vtkTypeBool);
185 vtkBooleanMacro(AutoLabel, vtkTypeBool);
187
189
192 vtkSetStringMacro(LabelFormat);
193 vtkGetStringMacro(LabelFormat);
195
197
201 vtkGetMacro(Length, double);
202 vtkGetMacro(Angle, double);
204
206
209 int RenderOverlay(vtkViewport* viewport) override;
210 int RenderOpaqueGeometry(vtkViewport* viewport) override;
213
218
220 void ShallowCopy(vtkProp* prop) override;
221
223
232
233protected:
236
237 // Internal helper methods
238 virtual void BuildLeader(vtkViewport* viewport);
239 int SetFontSize(vtkViewport* viewport, vtkTextMapper* textMapper, const int* targetSize,
240 double factor, int* stringSize);
242 double xL[3], int stringSize[2], double p1[3], double ray[3], double c1[3], double c2[3]);
243 void BuildCurvedLeader(double p1[3], double p2[3], double ray[3], double rayLength, double theta,
244 vtkViewport* viewport, int viewportChanged);
245 int InStringBox(double center[3], int stringSize[2], double x[3]);
246
247 // Characteristics of the leader
248 double Radius;
249 double Length;
250 double Angle;
251
254 char* Label;
259
261
268
275
276 // Internal ivars for tracking whether to rebuild
279 int LastSize[2];
281
282private:
283 vtkLeaderActor2D(const vtkLeaderActor2D&) = delete;
284 void operator=(const vtkLeaderActor2D&) = delete;
285};
286
287#endif
object to represent cell connectivity
a simple class to control print indentation
Definition vtkIndent.h:34
vtkCellArray * LeaderArrows
void SetArrowStyleToOpen()
Control the appearance of the arrow heads.
void BuildCurvedLeader(double p1[3], double p2[3], double ray[3], double rayLength, double theta, vtkViewport *viewport, int viewportChanged)
vtkActor2D * LabelActor
void SetArrowPlacementToNone()
Control whether arrow heads are drawn on the leader.
int InStringBox(double center[3], int stringSize[2], double x[3])
void SetArrowPlacementToBoth()
Control whether arrow heads are drawn on the leader.
void ShallowCopy(vtkProp *prop) override
Shallow copy of this vtkActor2D.
virtual void SetLabelTextProperty(vtkTextProperty *p)
Set/Get the text property of the label.
vtkCellArray * LeaderLines
vtkPoints * LeaderPoints
int SetFontSize(vtkViewport *viewport, vtkTextMapper *textMapper, const int *targetSize, double factor, int *stringSize)
vtkTimeStamp BuildTime
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetArrowStyleToHollow()
Control the appearance of the arrow heads.
vtkTypeBool HasTranslucentPolygonalGeometry() override
Does this prop have some translucent polygonal geometry?
void SetArrowStyleToFilled()
Control the appearance of the arrow heads.
vtkPolyDataMapper2D * LeaderMapper
virtual void BuildLeader(vtkViewport *viewport)
int RenderOpaqueGeometry(vtkViewport *viewport) override
Methods required by vtkProp and vtkActor2D superclasses.
~vtkLeaderActor2D() override
virtual void SetArrowStyle(int)
Control the appearance of the arrow heads.
int RenderTranslucentPolygonalGeometry(vtkViewport *) override
Methods required by vtkProp and vtkActor2D superclasses.
vtkPolyData * Leader
void SetArrowPlacementToPoint2()
Control whether arrow heads are drawn on the leader.
vtkTextProperty * LabelTextProperty
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this actor.
vtkTypeBool UseFontSizeFromProperty
int ClipLeader(double xL[3], int stringSize[2], double p1[3], double ray[3], double c1[3], double c2[3])
vtkTextMapper * LabelMapper
void SetArrowPlacementToPoint1()
Control whether arrow heads are drawn on the leader.
int RenderOverlay(vtkViewport *viewport) override
Methods required by vtkProp and vtkActor2D superclasses.
static vtkLeaderActor2D * New()
Instantiate object.
virtual void SetArrowPlacement(int)
Control whether arrow heads are drawn on the leader.
vtkActor2D * LeaderActor
represent and manipulate 3D points
Definition vtkPoints.h:34
draw vtkPolyData onto the image plane
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:85
2D text annotation
represent text properties.
record modification and/or execution time
abstract specification for Viewports
Definition vtkViewport.h:50
window superclass for vtkRenderWindow
Definition vtkWindow.h:39
int vtkTypeBool
Definition vtkABI.h:69
#define VTK_FLOAT_MAX
Definition vtkType.h:163