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 =========================================================================*/
45 #ifndef vtkLeaderActor2D_h
46 #define vtkLeaderActor2D_h
47 
48 #include "vtkRenderingAnnotationModule.h" // For export macro
49 #include "vtkActor2D.h"
50 
51 class vtkPoints;
52 class vtkCellArray;
53 class vtkPolyData;
55 class vtkTextMapper;
56 class vtkTextProperty;
57 
59 {
60 public:
62  void PrintSelf(ostream& os, vtkIndent indent);
63 
65  static vtkLeaderActor2D *New();
66 
68 
78  vtkSetMacro(Radius,double);
79  vtkGetMacro(Radius,double);
81 
83 
88 
90 
92  vtkGetObjectMacro(LabelTextProperty,vtkTextProperty);
94 
96 
98  vtkSetClampMacro(LabelFactor, double, 0.1, 2.0);
99  vtkGetMacro(LabelFactor, double);
101 
102 //BTX
103  // Enums defined to support methods for control of arrow placement and
104  // and appearance of arrow heads.
105  enum {VTK_ARROW_NONE=0,VTK_ARROW_POINT1,VTK_ARROW_POINT2,VTK_ARROW_BOTH};
106  enum {VTK_ARROW_FILLED=0,VTK_ARROW_OPEN,VTK_ARROW_HOLLOW};
107 //ETX
108 
110 
112  vtkSetClampMacro(ArrowPlacement,int,VTK_ARROW_NONE,VTK_ARROW_BOTH);
113  vtkGetMacro(ArrowPlacement,int);
114  void SetArrowPlacementToNone() {this->SetArrowPlacement(VTK_ARROW_NONE);}
115  void SetArrowPlacementToPoint1() {this->SetArrowPlacement(VTK_ARROW_POINT1);}
116  void SetArrowPlacementToPoint2() {this->SetArrowPlacement(VTK_ARROW_POINT2);}
117  void SetArrowPlacementToBoth() {this->SetArrowPlacement(VTK_ARROW_BOTH);}
119 
121 
124  vtkSetClampMacro(ArrowStyle,int,VTK_ARROW_FILLED,VTK_ARROW_HOLLOW);
125  vtkGetMacro(ArrowStyle,int);
126  void SetArrowStyleToFilled() {this->SetArrowStyle(VTK_ARROW_FILLED);}
127  void SetArrowStyleToOpen() {this->SetArrowStyle(VTK_ARROW_OPEN);}
128  void SetArrowStyleToHollow() {this->SetArrowStyle(VTK_ARROW_HOLLOW);}
130 
132 
134  vtkSetClampMacro(ArrowLength,double,0.0,1.0);
135  vtkGetMacro(ArrowLength,double);
136  vtkSetClampMacro(ArrowWidth,double,0.0,1.0);
137  vtkGetMacro(ArrowWidth,double);
139 
141 
145  vtkSetClampMacro(MinimumArrowSize,double,1.0,VTK_FLOAT_MAX);
146  vtkGetMacro(MinimumArrowSize,double);
147  vtkSetClampMacro(MaximumArrowSize,double,1.0,VTK_FLOAT_MAX);
148  vtkGetMacro(MaximumArrowSize,double);
150 
152 
156  vtkSetMacro(AutoLabel,int);
157  vtkGetMacro(AutoLabel,int);
158  vtkBooleanMacro(AutoLabel,int);
160 
162 
163  vtkSetStringMacro(LabelFormat);
164  vtkGetStringMacro(LabelFormat);
166 
168 
170  vtkGetMacro(Length,double);
171  vtkGetMacro(Angle,double);
173 
175 
176  int RenderOverlay(vtkViewport* viewport);
180 
183 
185  void ShallowCopy(vtkProp *prop);
186 
187 protected:
190 
191  // Internal helper methods
192  virtual void BuildLeader(vtkViewport *viewport);
193  int SetFontSize(vtkViewport *viewport, vtkTextMapper *textMapper,
194  int *targetSize, double factor, int *stringSize);
195  int ClipLeader(double xL[3], int stringSize[2], double p1[3], double ray[3],
196  double c1[3], double c2[3]);
197  void BuildCurvedLeader(double p1[3], double p2[3], double ray[3], double rayLength,
198  double theta, vtkViewport *viewport, int viewportChanged);
199  int InStringBox(double center[3], int stringSize[2], double x[3]);
200 
201 
202  // Characteristics of the leader
203  double Radius;
204  double Length;
205  double Angle;
206 
208  char *LabelFormat;
209  char *Label;
210  double LabelFactor;
214 
217  double ArrowLength;
218  double ArrowWidth;
221 
228 
229  // Internal ivars for tracking whether to rebuild
230  int LastPosition[2];
231  int LastPosition2[2];
232  int LastSize[2];
234 
235 private:
236  vtkLeaderActor2D(const vtkLeaderActor2D&); // Not implemented.
237  void operator=(const vtkLeaderActor2D&); // Not implemented.
238 };
239 
240 
241 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:39
vtkLeaderActor2D::vtkLeaderActor2D
vtkLeaderActor2D()
vtkLeaderActor2D::ClipLeader
int ClipLeader(double xL[3], int stringSize[2], double p1[3], double ray[3], double c1[3], double c2[3])
vtkLeaderActor2D::Leader
vtkPolyData * Leader
Definition: vtkLeaderActor2D.h:225
vtkRenderingAnnotationModule.h
vtkGetObjectMacro
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:232
vtkLeaderActor2D::SetArrowStyleToOpen
void SetArrowStyleToOpen()
Definition: vtkLeaderActor2D.h:127
vtkLeaderActor2D::ArrowWidth
double ArrowWidth
Definition: vtkLeaderActor2D.h:218
vtkPolyDataMapper2D
draw vtkPolyData onto the image plane
Definition: vtkPolyDataMapper2D.h:51
vtkLeaderActor2D::BuildCurvedLeader
void BuildCurvedLeader(double p1[3], double p2[3], double ray[3], double rayLength, double theta, vtkViewport *viewport, int viewportChanged)
vtkLeaderActor2D::LeaderLines
vtkCellArray * LeaderLines
Definition: vtkLeaderActor2D.h:223
vtkLeaderActor2D::SetArrowPlacementToPoint2
void SetArrowPlacementToPoint2()
Definition: vtkLeaderActor2D.h:116
vtkLeaderActor2D::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *)
vtkLeaderActor2D::MaximumArrowSize
double MaximumArrowSize
Definition: vtkLeaderActor2D.h:220
vtkLeaderActor2D::LabelActor
vtkActor2D * LabelActor
Definition: vtkLeaderActor2D.h:212
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:35
vtkLeaderActor2D::SetFontSize
int SetFontSize(vtkViewport *viewport, vtkTextMapper *textMapper, int *targetSize, double factor, int *stringSize)
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkLeaderActor2D::LeaderMapper
vtkPolyDataMapper2D * LeaderMapper
Definition: vtkLeaderActor2D.h:226
vtkLeaderActor2D::RenderTranslucentPolygonalGeometry
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Definition: vtkLeaderActor2D.h:178
vtkLeaderActor2D::ArrowPlacement
int ArrowPlacement
Definition: vtkLeaderActor2D.h:215
vtkgl::x
GLint GLint GLint GLint GLint x
Definition: vtkgl.h:11318
vtkLeaderActor2D::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkLeaderActor2D::LabelMapper
vtkTextMapper * LabelMapper
Definition: vtkLeaderActor2D.h:211
vtkX3D::center
@ center
Definition: vtkX3D.h:230
vtkLeaderActor2D::ArrowStyle
int ArrowStyle
Definition: vtkLeaderActor2D.h:216
vtkLeaderActor2D::~vtkLeaderActor2D
~vtkLeaderActor2D()
vtkLeaderActor2D::HasTranslucentPolygonalGeometry
virtual int HasTranslucentPolygonalGeometry()
vtkLeaderActor2D::LeaderArrows
vtkCellArray * LeaderArrows
Definition: vtkLeaderActor2D.h:224
vtkLeaderActor2D::Label
char * Label
Definition: vtkLeaderActor2D.h:209
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
vtkLeaderActor2D::ArrowLength
double ArrowLength
Definition: vtkLeaderActor2D.h:217
vtkLeaderActor2D::InStringBox
int InStringBox(double center[3], int stringSize[2], double x[3])
vtkSetClampMacro
#define vtkSetClampMacro(name, type, min, max)
Definition: vtkSetGet.h:143
vtkTextMapper
2D text annotation
Definition: vtkTextMapper.h:53
vtkLeaderActor2D::Length
double Length
Definition: vtkLeaderActor2D.h:204
vtkLeaderActor2D::LabelTextProperty
vtkTextProperty * LabelTextProperty
Definition: vtkLeaderActor2D.h:213
vtkLeaderActor2D::New
static vtkLeaderActor2D * New()
vtkLeaderActor2D::ShallowCopy
void ShallowCopy(vtkProp *prop)
vtkLeaderActor2D::SetArrowPlacementToBoth
void SetArrowPlacementToBoth()
Definition: vtkLeaderActor2D.h:117
vtkLeaderActor2D::Radius
double Radius
Definition: vtkLeaderActor2D.h:203
vtkLeaderActor2D::LeaderActor
vtkActor2D * LeaderActor
Definition: vtkLeaderActor2D.h:227
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:50
vtkSetStringMacro
#define vtkSetStringMacro(name)
Definition: vtkSetGet.h:104
vtkLeaderActor2D::BuildTime
vtkTimeStamp BuildTime
Definition: vtkLeaderActor2D.h:233
vtkLeaderActor2D::VTK_ARROW_POINT2
@ VTK_ARROW_POINT2
Definition: vtkLeaderActor2D.h:105
vtkLeaderActor2D::MinimumArrowSize
double MinimumArrowSize
Definition: vtkLeaderActor2D.h:219
VTK_FLOAT_MAX
#define VTK_FLOAT_MAX
Definition: vtkType.h:140
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkGetStringMacro
vtkGetStringMacro(ExtensionsString)
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:47
vtkLeaderActor2D::SetArrowStyleToHollow
void SetArrowStyleToHollow()
Definition: vtkLeaderActor2D.h:128
vtkLeaderActor2D::SetLabelTextProperty
virtual void SetLabelTextProperty(vtkTextProperty *p)
vtkLeaderActor2D::LabelFactor
double LabelFactor
Definition: vtkLeaderActor2D.h:210
vtkLeaderActor2D::SetArrowPlacementToPoint1
void SetArrowPlacementToPoint1()
Definition: vtkLeaderActor2D.h:115
vtkTextProperty
represent text properties.
Definition: vtkTextProperty.h:39
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkLeaderActor2D::RenderOverlay
int RenderOverlay(vtkViewport *viewport)
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:50
vtkLeaderActor2D::BuildLeader
virtual void BuildLeader(vtkViewport *viewport)
vtkActor2D
a actor that draws 2D data
Definition: vtkActor2D.h:45
vtkLeaderActor2D::AutoLabel
int AutoLabel
Definition: vtkLeaderActor2D.h:207
vtkActor2D.h
vtkLeaderActor2D::SetArrowStyleToFilled
void SetArrowStyleToFilled()
Definition: vtkLeaderActor2D.h:126
vtkLeaderActor2D::LeaderPoints
vtkPoints * LeaderPoints
Definition: vtkLeaderActor2D.h:222
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
vtkLeaderActor2D::SetArrowPlacementToNone
void SetArrowPlacementToNone()
Definition: vtkLeaderActor2D.h:114
vtkgl::p
GLfloat GLfloat p
Definition: vtkgl.h:15717
vtkLeaderActor2D::Angle
double Angle
Definition: vtkLeaderActor2D.h:205
vtkLeaderActor2D::LabelFormat
char * LabelFormat
Definition: vtkLeaderActor2D.h:208
vtkLeaderActor2D::VTK_ARROW_OPEN
@ VTK_ARROW_OPEN
Definition: vtkLeaderActor2D.h:106
vtkLeaderActor2D
create a leader with optional label and arrows
Definition: vtkLeaderActor2D.h:59
vtkLeaderActor2D::RenderOpaqueGeometry
int RenderOpaqueGeometry(vtkViewport *viewport)
VTKRENDERINGANNOTATION_EXPORT
#define VTKRENDERINGANNOTATION_EXPORT
Definition: vtkRenderingAnnotationModule.h:15