VTK
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=========================================================================*/
46#ifndef vtkLeaderActor2D_h
47#define vtkLeaderActor2D_h
48
49#include "vtkRenderingAnnotationModule.h" // For export macro
50#include "vtkActor2D.h"
51
52class vtkPoints;
53class vtkCellArray;
54class vtkPolyData;
56class vtkTextMapper;
57class vtkTextProperty;
58
59class VTKRENDERINGANNOTATION_EXPORT vtkLeaderActor2D : public vtkActor2D
60{
61public:
63 void PrintSelf(ostream& os, vtkIndent indent);
64
69
71
83 vtkSetMacro(Radius,double);
84 vtkGetMacro(Radius,double);
86
88
92 vtkSetStringMacro(Label);
95
97
101 vtkGetObjectMacro(LabelTextProperty,vtkTextProperty);
103
105
109 vtkSetClampMacro(LabelFactor, double, 0.1, 2.0);
110 vtkGetMacro(LabelFactor, double);
112
113 // Enums defined to support methods for control of arrow placement and
114 // and appearance of arrow heads.
115 enum {VTK_ARROW_NONE=0,VTK_ARROW_POINT1,VTK_ARROW_POINT2,VTK_ARROW_BOTH};
116 enum {VTK_ARROW_FILLED=0,VTK_ARROW_OPEN,VTK_ARROW_HOLLOW};
117
119
123 vtkSetClampMacro(ArrowPlacement,int,VTK_ARROW_NONE,VTK_ARROW_BOTH);
124 vtkGetMacro(ArrowPlacement,int);
125 void SetArrowPlacementToNone() {this->SetArrowPlacement(VTK_ARROW_NONE);}
126 void SetArrowPlacementToPoint1() {this->SetArrowPlacement(VTK_ARROW_POINT1);}
127 void SetArrowPlacementToPoint2() {this->SetArrowPlacement(VTK_ARROW_POINT2);}
128 void SetArrowPlacementToBoth() {this->SetArrowPlacement(VTK_ARROW_BOTH);}
130
132
137 vtkSetClampMacro(ArrowStyle,int,VTK_ARROW_FILLED,VTK_ARROW_HOLLOW);
138 vtkGetMacro(ArrowStyle,int);
139 void SetArrowStyleToFilled() {this->SetArrowStyle(VTK_ARROW_FILLED);}
140 void SetArrowStyleToOpen() {this->SetArrowStyle(VTK_ARROW_OPEN);}
141 void SetArrowStyleToHollow() {this->SetArrowStyle(VTK_ARROW_HOLLOW);}
143
145
149 vtkSetClampMacro(ArrowLength,double,0.0,1.0);
150 vtkGetMacro(ArrowLength,double);
151 vtkSetClampMacro(ArrowWidth,double,0.0,1.0);
152 vtkGetMacro(ArrowWidth,double);
154
156
162 vtkSetClampMacro(MinimumArrowSize,double,1.0,VTK_FLOAT_MAX);
163 vtkGetMacro(MinimumArrowSize,double);
164 vtkSetClampMacro(MaximumArrowSize,double,1.0,VTK_FLOAT_MAX);
165 vtkGetMacro(MaximumArrowSize,double);
167
169
175 vtkSetMacro(AutoLabel,int);
176 vtkGetMacro(AutoLabel,int);
177 vtkBooleanMacro(AutoLabel,int);
179
181
184 vtkSetStringMacro(LabelFormat);
185 vtkGetStringMacro(LabelFormat);
187
189
193 vtkGetMacro(Length,double);
194 vtkGetMacro(Angle,double);
196
198
205
210
212 void ShallowCopy(vtkProp *prop);
213
214protected:
217
218 // Internal helper methods
219 virtual void BuildLeader(vtkViewport *viewport);
220 int SetFontSize(vtkViewport *viewport, vtkTextMapper *textMapper,
221 int *targetSize, double factor, int *stringSize);
222 int ClipLeader(double xL[3], int stringSize[2], double p1[3], double ray[3],
223 double c1[3], double c2[3]);
224 void BuildCurvedLeader(double p1[3], double p2[3], double ray[3], double rayLength,
225 double theta, vtkViewport *viewport, int viewportChanged);
226 int InStringBox(double center[3], int stringSize[2], double x[3]);
227
228
229 // Characteristics of the leader
230 double Radius;
231 double Length;
232 double Angle;
233
236 char *Label;
241
248
255
256 // Internal ivars for tracking whether to rebuild
257 int LastPosition[2];
258 int LastPosition2[2];
259 int LastSize[2];
261
262private:
263 vtkLeaderActor2D(const vtkLeaderActor2D&) VTK_DELETE_FUNCTION;
264 void operator=(const vtkLeaderActor2D&) VTK_DELETE_FUNCTION;
265};
266
267
268#endif
a actor that draws 2D data
Definition: vtkActor2D.h:46
object to represent cell connectivity
Definition: vtkCellArray.h:51
a simple class to control print indentation
Definition: vtkIndent.h:40
create a leader with optional label and arrows
vtkCellArray * LeaderArrows
void BuildCurvedLeader(double p1[3], double p2[3], double ray[3], double rayLength, double theta, vtkViewport *viewport, int viewportChanged)
vtkActor2D * LabelActor
void SetArrowPlacementToNone()
int InStringBox(double center[3], int stringSize[2], double x[3])
void SetArrowPlacementToBoth()
virtual void SetLabelTextProperty(vtkTextProperty *p)
Set/Get the text property of the label.
void ShallowCopy(vtkProp *prop)
Shallow copy of this vtkActor2D.
vtkCellArray * LeaderLines
vtkPoints * LeaderPoints
vtkTimeStamp BuildTime
void ReleaseGraphicsResources(vtkWindow *)
Release any graphics resources that are being consumed by this actor.
vtkPolyDataMapper2D * LeaderMapper
virtual void BuildLeader(vtkViewport *viewport)
vtkPolyData * Leader
void SetArrowPlacementToPoint2()
int SetFontSize(vtkViewport *viewport, vtkTextMapper *textMapper, int *targetSize, double factor, int *stringSize)
int RenderOpaqueGeometry(vtkViewport *viewport)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
vtkTextProperty * LabelTextProperty
virtual int HasTranslucentPolygonalGeometry()
Does this prop have some translucent polygonal geometry?
int ClipLeader(double xL[3], int stringSize[2], double p1[3], double ray[3], double c1[3], double c2[3])
vtkTextMapper * LabelMapper
void SetArrowPlacementToPoint1()
int RenderOverlay(vtkViewport *viewport)
Methods required by vtkProp and vtkActor2D superclasses.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
static vtkLeaderActor2D * New()
Instantiate object.
vtkActor2D * LeaderActor
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
represent and manipulate 3D points
Definition: vtkPoints.h:40
draw vtkPolyData onto the image plane
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:86
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:48
2D text annotation
Definition: vtkTextMapper.h:54
represent text properties.
record modification and/or execution time
Definition: vtkTimeStamp.h:36
abstract specification for Viewports
Definition: vtkViewport.h:48
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
@ center
Definition: vtkX3D.h:230
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
#define VTK_FLOAT_MAX
Definition: vtkType.h:161