VTK
vtkAxesActor.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkAxesActor.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 =========================================================================*/
53 #ifndef vtkAxesActor_h
54 #define vtkAxesActor_h
55 
56 #include "vtkRenderingAnnotationModule.h" // For export macro
57 #include "vtkProp3D.h"
58 
59 class vtkActor;
60 class vtkCaptionActor2D;
61 class vtkConeSource;
62 class vtkCylinderSource;
63 class vtkLineSource;
64 class vtkPolyData;
65 class vtkPropCollection;
66 class vtkProperty;
67 class vtkRenderer;
68 class vtkSphereSource;
69 
71 {
72 public:
73  static vtkAxesActor *New();
75  void PrintSelf(ostream& os, vtkIndent indent);
76 
80  virtual void GetActors(vtkPropCollection *);
81 
83 
84  virtual int RenderOpaqueGeometry(vtkViewport *viewport);
86  virtual int RenderOverlay(vtkViewport *viewport);
88 
91 
93  void ShallowCopy(vtkProp *prop);
94 
99 
101 
104  void GetBounds(double bounds[6]);
105  double *GetBounds();
107 
109  unsigned long int GetMTime();
110 
115  virtual unsigned long GetRedrawMTime();
116 
118 
119  void SetTotalLength( double v[3] )
120  { this->SetTotalLength( v[0], v[1], v[2] ); }
121  void SetTotalLength( double x, double y, double z );
122  vtkGetVectorMacro( TotalLength, double, 3 );
124 
126 
127  void SetNormalizedShaftLength( double v[3] )
128  { this->SetNormalizedShaftLength( v[0], v[1], v[2] ); }
129  void SetNormalizedShaftLength( double x, double y, double z );
130  vtkGetVectorMacro( NormalizedShaftLength, double, 3 );
132 
134 
136  void SetNormalizedTipLength( double v[3] )
137  { this->SetNormalizedTipLength( v[0], v[1], v[2] ); }
138  void SetNormalizedTipLength( double x, double y, double z );
139  vtkGetVectorMacro( NormalizedTipLength, double, 3 );
141 
143 
145  void SetNormalizedLabelPosition( double v[3] )
146  { this->SetNormalizedLabelPosition( v[0], v[1], v[2] ); }
147  void SetNormalizedLabelPosition( double x, double y, double z );
148  vtkGetVectorMacro( NormalizedLabelPosition, double, 3 );
150 
152 
153  vtkSetClampMacro(ConeResolution, int, 3, 128);
154  vtkGetMacro(ConeResolution, int);
155  vtkSetClampMacro(SphereResolution, int, 3, 128);
156  vtkGetMacro(SphereResolution, int);
157  vtkSetClampMacro(CylinderResolution, int, 3, 128);
158  vtkGetMacro(CylinderResolution, int);
160 
162 
163  vtkSetClampMacro(ConeRadius, double, 0, VTK_FLOAT_MAX);
164  vtkGetMacro(ConeRadius, double);
165  vtkSetClampMacro(SphereRadius, double, 0, VTK_FLOAT_MAX);
166  vtkGetMacro(SphereRadius, double);
167  vtkSetClampMacro(CylinderRadius, double, 0, VTK_FLOAT_MAX);
168  vtkGetMacro(CylinderRadius, double);
170 
172 
174  void SetShaftType( int type );
176  { this->SetShaftType( vtkAxesActor::CYLINDER_SHAFT ); }
178  { this->SetShaftType( vtkAxesActor::LINE_SHAFT ); }
180  { this->SetShaftType( vtkAxesActor::USER_DEFINED_SHAFT ); }
181  vtkGetMacro(ShaftType, int);
183 
185 
186  void SetTipType( int type );
188  { this->SetTipType( vtkAxesActor::CONE_TIP ); }
190  { this->SetTipType( vtkAxesActor::SPHERE_TIP ); }
192  { this->SetTipType( vtkAxesActor::USER_DEFINED_TIP ); }
193  vtkGetMacro(TipType, int);
195 
197 
199  vtkGetObjectMacro( UserDefinedTip, vtkPolyData );
201 
203 
205  vtkGetObjectMacro( UserDefinedShaft, vtkPolyData );
207 
209 
214 
216 
221 
223 
226  {return this->XAxisLabel;}
228  {return this->YAxisLabel;}
230  {return this->ZAxisLabel;}
232 
234 
235  vtkSetStringMacro( XAxisLabelText );
236  vtkGetStringMacro( XAxisLabelText );
237  vtkSetStringMacro( YAxisLabelText );
238  vtkGetStringMacro( YAxisLabelText );
239  vtkSetStringMacro( ZAxisLabelText );
240  vtkGetStringMacro( ZAxisLabelText );
242 
244 
245  vtkSetMacro(AxisLabels, int);
246  vtkGetMacro(AxisLabels, int);
247  vtkBooleanMacro(AxisLabels, int);
249 
250 //BTX
251  enum
252  {
255  USER_DEFINED_SHAFT
256  };
257 
258  enum
259  {
262  USER_DEFINED_TIP
263  };
264 //ETX
265 
266 protected:
269 
274 
278 
282 
283  void UpdateProps();
284 
285  double TotalLength[3];
286  double NormalizedShaftLength[3];
287  double NormalizedTipLength[3];
288  double NormalizedLabelPosition[3];
289 
291  int TipType;
292 
295 
299 
303 
305 
306 
310 
311  double ConeRadius;
312  double SphereRadius;
314 
315 private:
316  vtkAxesActor(const vtkAxesActor&); // Not implemented.
317  void operator=(const vtkAxesActor&); // Not implemented.
318 };
319 
320 #endif
321 
vtkgl::z
GLdouble GLdouble z
Definition: vtkgl.h:11754
vtkAxesActor::RenderOpaqueGeometry
virtual int RenderOpaqueGeometry(vtkViewport *viewport)
vtkAxesActor::UserDefinedShaft
vtkPolyData * UserDefinedShaft
Definition: vtkAxesActor.h:294
vtkRenderingAnnotationModule.h
vtkGetObjectMacro
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:232
vtkAxesActor::SetUserDefinedTip
void SetUserDefinedTip(vtkPolyData *)
vtkAxesActor::GetZAxisShaftProperty
vtkProperty * GetZAxisShaftProperty()
vtkAxesActor::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkAxesActor::ConeResolution
int ConeResolution
Definition: vtkAxesActor.h:307
vtkAxesActor::SetTotalLength
void SetTotalLength(double x, double y, double z)
vtkAxesActor::AxisLabels
int AxisLabels
Definition: vtkAxesActor.h:304
vtkAxesActor::RenderOverlay
virtual int RenderOverlay(vtkViewport *viewport)
vtkProp3D
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:43
vtkAxesActor::ConeRadius
double ConeRadius
Definition: vtkAxesActor.h:311
vtkAxesActor::YAxisLabel
vtkCaptionActor2D * YAxisLabel
Definition: vtkAxesActor.h:301
vtkAxesActor::LineSource
vtkLineSource * LineSource
Definition: vtkAxesActor.h:271
vtkAxesActor::SPHERE_TIP
@ SPHERE_TIP
Definition: vtkAxesActor.h:261
vtkAxesActor::HasTranslucentPolygonalGeometry
virtual int HasTranslucentPolygonalGeometry()
vtkAxesActor::UpdateProps
void UpdateProps()
vtkAxesActor::SetTotalLength
void SetTotalLength(double v[3])
Definition: vtkAxesActor.h:119
vtkAxesActor::SetNormalizedLabelPosition
void SetNormalizedLabelPosition(double x, double y, double z)
vtkAxesActor::USER_DEFINED_TIP
@ USER_DEFINED_TIP
Definition: vtkAxesActor.h:262
vtkConeSource
generate polygonal cone
Definition: vtkConeSource.h:44
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkAxesActor::CylinderSource
vtkCylinderSource * CylinderSource
Definition: vtkAxesActor.h:270
vtkgl::v
const GLdouble * v
Definition: vtkgl.h:11595
vtkgl::x
GLint GLint GLint GLint GLint x
Definition: vtkgl.h:11318
vtkAxesActor::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *)
vtkAxesActor::XAxisLabel
vtkCaptionActor2D * XAxisLabel
Definition: vtkAxesActor.h:300
vtkAxesActor::SetNormalizedLabelPosition
void SetNormalizedLabelPosition(double v[3])
Definition: vtkAxesActor.h:145
vtkAxesActor::SetUserDefinedShaft
void SetUserDefinedShaft(vtkPolyData *)
vtkAxesActor::GetXAxisShaftProperty
vtkProperty * GetXAxisShaftProperty()
vtkGetVectorMacro
#define vtkGetVectorMacro(name, type, count)
Definition: vtkSetGet.h:424
vtkAxesActor::GetYAxisTipProperty
vtkProperty * GetYAxisTipProperty()
vtkAxesActor::YAxisShaft
vtkActor * YAxisShaft
Definition: vtkAxesActor.h:276
vtkAxesActor::XAxisLabelText
char * XAxisLabelText
Definition: vtkAxesActor.h:296
vtkAxesActor::GetRedrawMTime
virtual unsigned long GetRedrawMTime()
vtkAxesActor::SetShaftTypeToCylinder
void SetShaftTypeToCylinder()
Definition: vtkAxesActor.h:175
vtkAxesActor::SetShaftType
void SetShaftType(int type)
vtkAxesActor::~vtkAxesActor
~vtkAxesActor()
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
vtkAxesActor::YAxisLabelText
char * YAxisLabelText
Definition: vtkAxesActor.h:297
vtkAxesActor::SphereResolution
int SphereResolution
Definition: vtkAxesActor.h:308
vtkAxesActor::ZAxisLabel
vtkCaptionActor2D * ZAxisLabel
Definition: vtkAxesActor.h:302
vtkAxesActor
a 3D axes representation
Definition: vtkAxesActor.h:71
vtkAxesActor::GetBounds
double * GetBounds()
vtkSetClampMacro
#define vtkSetClampMacro(name, type, min, max)
Definition: vtkSetGet.h:143
vtkAxesActor::SetTipTypeToUserDefined
void SetTipTypeToUserDefined()
Definition: vtkAxesActor.h:191
vtkAxesActor::SetTipType
void SetTipType(int type)
vtkAxesActor::SetNormalizedShaftLength
void SetNormalizedShaftLength(double x, double y, double z)
vtkAxesActor::CylinderRadius
double CylinderRadius
Definition: vtkAxesActor.h:313
vtkSphereSource
create a polygonal sphere centered at the origin
Definition: vtkSphereSource.h:46
vtkAxesActor::GetXAxisCaptionActor2D
vtkCaptionActor2D * GetXAxisCaptionActor2D()
Definition: vtkAxesActor.h:225
vtkAxesActor::ShallowCopy
void ShallowCopy(vtkProp *prop)
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:51
vtkAxesActor::CONE_TIP
@ CONE_TIP
Definition: vtkAxesActor.h:260
vtkAxesActor::GetZAxisTipProperty
vtkProperty * GetZAxisTipProperty()
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkSetStringMacro
#define vtkSetStringMacro(name)
Definition: vtkSetGet.h:104
vtkAxesActor::RenderTranslucentPolygonalGeometry
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *viewport)
vtkAxesActor::GetYAxisShaftProperty
vtkProperty * GetYAxisShaftProperty()
vtkAxesActor::SetShaftTypeToLine
void SetShaftTypeToLine()
Definition: vtkAxesActor.h:177
vtkAxesActor::New
static vtkAxesActor * New()
VTK_FLOAT_MAX
#define VTK_FLOAT_MAX
Definition: vtkType.h:140
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkCylinderSource
generate a cylinder centered at origin
Definition: vtkCylinderSource.h:42
vtkAxesActor::GetMTime
unsigned long int GetMTime()
vtkGetStringMacro
vtkGetStringMacro(ExtensionsString)
vtkLineSource
create a line defined by two end points
Definition: vtkLineSource.h:42
vtkAxesActor::XAxisTip
vtkActor * XAxisTip
Definition: vtkAxesActor.h:279
vtkAxesActor::CYLINDER_SHAFT
@ CYLINDER_SHAFT
Definition: vtkAxesActor.h:253
vtkAxesActor::UserDefinedTip
vtkPolyData * UserDefinedTip
Definition: vtkAxesActor.h:293
vtkAxesActor::GetZAxisCaptionActor2D
vtkCaptionActor2D * GetZAxisCaptionActor2D()
Definition: vtkAxesActor.h:229
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:47
vtkAxesActor::CylinderResolution
int CylinderResolution
Definition: vtkAxesActor.h:309
vtkAxesActor::SetTipTypeToCone
void SetTipTypeToCone()
Definition: vtkAxesActor.h:187
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:50
vtkCaptionActor2D
draw text label associated with a point
Definition: vtkCaptionActor2D.h:77
vtkAxesActor::ZAxisTip
vtkActor * ZAxisTip
Definition: vtkAxesActor.h:281
vtkgl::y
GLint GLint GLint GLint GLint GLint y
Definition: vtkgl.h:11318
vtkAxesActor::SphereSource
vtkSphereSource * SphereSource
Definition: vtkAxesActor.h:273
vtkAxesActor::SetNormalizedTipLength
void SetNormalizedTipLength(double v[3])
Definition: vtkAxesActor.h:136
vtkAxesActor::XAxisShaft
vtkActor * XAxisShaft
Definition: vtkAxesActor.h:275
vtkAxesActor::SetShaftTypeToUserDefined
void SetShaftTypeToUserDefined()
Definition: vtkAxesActor.h:179
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:64
vtkAxesActor::GetYAxisCaptionActor2D
vtkCaptionActor2D * GetYAxisCaptionActor2D()
Definition: vtkAxesActor.h:227
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
vtkAxesActor::TipType
int TipType
Definition: vtkAxesActor.h:291
vtkAxesActor::SphereRadius
double SphereRadius
Definition: vtkAxesActor.h:312
vtkAxesActor::SetTipTypeToSphere
void SetTipTypeToSphere()
Definition: vtkAxesActor.h:189
vtkAxesActor::ZAxisLabelText
char * ZAxisLabelText
Definition: vtkAxesActor.h:298
vtkAxesActor::YAxisTip
vtkActor * YAxisTip
Definition: vtkAxesActor.h:280
vtkProperty
represent surface properties of a geometric object
Definition: vtkProperty.h:64
vtkAxesActor::USER_DEFINED_SHAFT
@ USER_DEFINED_SHAFT
Definition: vtkAxesActor.h:255
vtkAxesActor::GetActors
virtual void GetActors(vtkPropCollection *)
vtkPropCollection
a list of Props
Definition: vtkPropCollection.h:38
vtkAxesActor::SetNormalizedShaftLength
void SetNormalizedShaftLength(double v[3])
Definition: vtkAxesActor.h:127
vtkAxesActor::ZAxisShaft
vtkActor * ZAxisShaft
Definition: vtkAxesActor.h:277
vtkgl::type
GLuint GLuint GLsizei GLenum type
Definition: vtkgl.h:11315
vtkAxesActor::SetNormalizedTipLength
void SetNormalizedTipLength(double x, double y, double z)
vtkAxesActor::ShaftType
int ShaftType
Definition: vtkAxesActor.h:290
vtkAxesActor::LINE_SHAFT
@ LINE_SHAFT
Definition: vtkAxesActor.h:254
vtkAxesActor::GetXAxisTipProperty
vtkProperty * GetXAxisTipProperty()
vtkAxesActor::vtkAxesActor
vtkAxesActor()
vtkAxesActor::ConeSource
vtkConeSource * ConeSource
Definition: vtkAxesActor.h:272
vtkAxesActor::GetBounds
void GetBounds(double bounds[6])
VTKRENDERINGANNOTATION_EXPORT
#define VTKRENDERINGANNOTATION_EXPORT
Definition: vtkRenderingAnnotationModule.h:15
vtkProp3D.h