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 =========================================================================*/
54 #ifndef vtkAxesActor_h
55 #define vtkAxesActor_h
56 
57 #include "vtkRenderingAnnotationModule.h" // For export macro
58 #include "vtkProp3D.h"
59 
60 class vtkActor;
61 class vtkCaptionActor2D;
62 class vtkConeSource;
63 class vtkCylinderSource;
64 class vtkLineSource;
65 class vtkPolyData;
66 class vtkPropCollection;
67 class vtkProperty;
68 class vtkRenderer;
69 class vtkSphereSource;
70 
71 class VTKRENDERINGANNOTATION_EXPORT vtkAxesActor : public vtkProp3D
72 {
73 public:
74  static vtkAxesActor *New();
75  vtkTypeMacro(vtkAxesActor,vtkProp3D);
76  void PrintSelf(ostream& os, vtkIndent indent);
77 
83  virtual void GetActors(vtkPropCollection *);
84 
86 
89  virtual int RenderOpaqueGeometry(vtkViewport *viewport);
90  virtual int RenderTranslucentPolygonalGeometry(vtkViewport *viewport);
91  virtual int RenderOverlay(vtkViewport *viewport);
93 
97  virtual int HasTranslucentPolygonalGeometry();
98 
102  void ShallowCopy(vtkProp *prop);
103 
110 
112 
116  void GetBounds(double bounds[6]);
117  double *GetBounds();
119 
124 
131  virtual vtkMTimeType GetRedrawMTime();
132 
134 
137  void SetTotalLength( double v[3] )
138  { this->SetTotalLength( v[0], v[1], v[2] ); }
139  void SetTotalLength( double x, double y, double z );
140  vtkGetVectorMacro( TotalLength, double, 3 );
142 
144 
147  void SetNormalizedShaftLength( double v[3] )
148  { this->SetNormalizedShaftLength( v[0], v[1], v[2] ); }
149  void SetNormalizedShaftLength( double x, double y, double z );
150  vtkGetVectorMacro( NormalizedShaftLength, double, 3 );
152 
154 
158  void SetNormalizedTipLength( double v[3] )
159  { this->SetNormalizedTipLength( v[0], v[1], v[2] ); }
160  void SetNormalizedTipLength( double x, double y, double z );
161  vtkGetVectorMacro( NormalizedTipLength, double, 3 );
163 
165 
169  void SetNormalizedLabelPosition( double v[3] )
170  { this->SetNormalizedLabelPosition( v[0], v[1], v[2] ); }
171  void SetNormalizedLabelPosition( double x, double y, double z );
172  vtkGetVectorMacro( NormalizedLabelPosition, double, 3 );
174 
176 
179  vtkSetClampMacro(ConeResolution, int, 3, 128);
180  vtkGetMacro(ConeResolution, int);
181  vtkSetClampMacro(SphereResolution, int, 3, 128);
182  vtkGetMacro(SphereResolution, int);
183  vtkSetClampMacro(CylinderResolution, int, 3, 128);
184  vtkGetMacro(CylinderResolution, int);
186 
188 
191  vtkSetClampMacro(ConeRadius, double, 0, VTK_FLOAT_MAX);
192  vtkGetMacro(ConeRadius, double);
193  vtkSetClampMacro(SphereRadius, double, 0, VTK_FLOAT_MAX);
194  vtkGetMacro(SphereRadius, double);
195  vtkSetClampMacro(CylinderRadius, double, 0, VTK_FLOAT_MAX);
196  vtkGetMacro(CylinderRadius, double);
198 
200 
203  void SetShaftType( int type );
205  { this->SetShaftType( vtkAxesActor::CYLINDER_SHAFT ); }
207  { this->SetShaftType( vtkAxesActor::LINE_SHAFT ); }
209  { this->SetShaftType( vtkAxesActor::USER_DEFINED_SHAFT ); }
210  vtkGetMacro(ShaftType, int);
212 
214 
217  void SetTipType( int type );
219  { this->SetTipType( vtkAxesActor::CONE_TIP ); }
221  { this->SetTipType( vtkAxesActor::SPHERE_TIP ); }
223  { this->SetTipType( vtkAxesActor::USER_DEFINED_TIP ); }
224  vtkGetMacro(TipType, int);
226 
228 
231  void SetUserDefinedTip( vtkPolyData * );
232  vtkGetObjectMacro( UserDefinedTip, vtkPolyData );
234 
236 
239  void SetUserDefinedShaft( vtkPolyData * );
240  vtkGetObjectMacro( UserDefinedShaft, vtkPolyData );
242 
244 
247  vtkProperty *GetXAxisTipProperty();
248  vtkProperty *GetYAxisTipProperty();
249  vtkProperty *GetZAxisTipProperty();
251 
253 
256  vtkProperty *GetXAxisShaftProperty();
257  vtkProperty *GetYAxisShaftProperty();
258  vtkProperty *GetZAxisShaftProperty();
260 
266  {return this->XAxisLabel;}
268  {return this->YAxisLabel;}
270  {return this->ZAxisLabel;}
271 
273 
276  vtkSetStringMacro( XAxisLabelText );
277  vtkGetStringMacro( XAxisLabelText );
278  vtkSetStringMacro( YAxisLabelText );
279  vtkGetStringMacro( YAxisLabelText );
280  vtkSetStringMacro( ZAxisLabelText );
281  vtkGetStringMacro( ZAxisLabelText );
283 
285 
288  vtkSetMacro(AxisLabels, int);
289  vtkGetMacro(AxisLabels, int);
290  vtkBooleanMacro(AxisLabels, int);
292 
293  enum
294  {
297  USER_DEFINED_SHAFT
298  };
299 
300  enum
301  {
304  USER_DEFINED_TIP
305  };
306 
307 protected:
308  vtkAxesActor();
309  ~vtkAxesActor();
310 
315 
319 
323 
324  void UpdateProps();
325 
326  double TotalLength[3];
327  double NormalizedShaftLength[3];
328  double NormalizedTipLength[3];
329  double NormalizedLabelPosition[3];
330 
332  int TipType;
333 
336 
340 
344 
346 
347 
351 
352  double ConeRadius;
353  double SphereRadius;
355 
356 private:
357  vtkAxesActor(const vtkAxesActor&) VTK_DELETE_FUNCTION;
358  void operator=(const vtkAxesActor&) VTK_DELETE_FUNCTION;
359 };
360 
361 #endif
362 
vtkAxesActor::CONE_TIP
Definition: vtkAxesActor.h:302
vtkAxesActor::UserDefinedShaft
vtkPolyData * UserDefinedShaft
Definition: vtkAxesActor.h:335
vtkAxesActor::ConeResolution
int ConeResolution
Definition: vtkAxesActor.h:348
vtkAxesActor::AxisLabels
int AxisLabels
Definition: vtkAxesActor.h:345
vtkX3D::type
Definition: vtkX3D.h:516
vtkProp3D
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:46
vtkProp3D::GetMTime
vtkMTimeType GetMTime()
Get the vtkProp3D's mtime.
vtkProp::RenderOverlay
virtual int RenderOverlay(vtkViewport *)
Definition: vtkProp.h:225
vtkAxesActor::ConeRadius
double ConeRadius
Definition: vtkAxesActor.h:352
vtkAxesActor::YAxisLabel
vtkCaptionActor2D * YAxisLabel
Definition: vtkAxesActor.h:342
vtkAxesActor::LineSource
vtkLineSource * LineSource
Definition: vtkAxesActor.h:312
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkAxesActor::SetTotalLength
void SetTotalLength(double v[3])
Set the total length of the axes in 3 dimensions.
Definition: vtkAxesActor.h:137
vtkProp::RenderOpaqueGeometry
virtual int RenderOpaqueGeometry(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:219
vtkAxesActor::USER_DEFINED_SHAFT
Definition: vtkAxesActor.h:297
vtkConeSource
generate polygonal cone
Definition: vtkConeSource.h:44
vtkAxesActor::CYLINDER_SHAFT
Definition: vtkAxesActor.h:295
vtkAxesActor::CylinderSource
vtkCylinderSource * CylinderSource
Definition: vtkAxesActor.h:311
vtkAxesActor::XAxisLabel
vtkCaptionActor2D * XAxisLabel
Definition: vtkAxesActor.h:341
vtkAxesActor::SetNormalizedLabelPosition
void SetNormalizedLabelPosition(double v[3])
Set the normalized (0-1) position of the label along the length of the shaft.
Definition: vtkAxesActor.h:169
vtkAxesActor::SPHERE_TIP
Definition: vtkAxesActor.h:303
vtkAxesActor::USER_DEFINED_TIP
Definition: vtkAxesActor.h:304
vtkAxesActor::YAxisShaft
vtkActor * YAxisShaft
Definition: vtkAxesActor.h:317
vtkAxesActor::XAxisLabelText
char * XAxisLabelText
Definition: vtkAxesActor.h:337
vtkAxesActor::SetShaftTypeToCylinder
void SetShaftTypeToCylinder()
Definition: vtkAxesActor.h:204
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
vtkMTimeType
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248
vtkProp3D::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkAxesActor::YAxisLabelText
char * YAxisLabelText
Definition: vtkAxesActor.h:338
vtkAxesActor::SphereResolution
int SphereResolution
Definition: vtkAxesActor.h:349
vtkAxesActor::ZAxisLabel
vtkCaptionActor2D * ZAxisLabel
Definition: vtkAxesActor.h:343
vtkAxesActor
a 3D axes representation
Definition: vtkAxesActor.h:71
vtkProp::GetActors
virtual void GetActors(vtkPropCollection *)
For some exporters and other other operations we must be able to collect all the actors or volumes.
Definition: vtkProp.h:58
vtkAxesActor::SetTipTypeToUserDefined
void SetTipTypeToUserDefined()
Definition: vtkAxesActor.h:222
vtkAxesActor::CylinderRadius
double CylinderRadius
Definition: vtkAxesActor.h:354
vtkSphereSource
create a polygonal sphere centered at the origin
Definition: vtkSphereSource.h:46
vtkAxesActor::GetXAxisCaptionActor2D
vtkCaptionActor2D * GetXAxisCaptionActor2D()
Retrieve handles to the X, Y and Z axis (so that you can set their text properties for example)
Definition: vtkAxesActor.h:265
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:51
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkAxesActor::SetShaftTypeToLine
void SetShaftTypeToLine()
Definition: vtkAxesActor.h:206
VTK_FLOAT_MAX
#define VTK_FLOAT_MAX
Definition: vtkType.h:161
vtkCylinderSource
generate a cylinder centered at origin
Definition: vtkCylinderSource.h:42
vtkGetStringMacro
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
vtkLineSource
create a line defined by two end points
Definition: vtkLineSource.h:42
vtkAxesActor::XAxisTip
vtkActor * XAxisTip
Definition: vtkAxesActor.h:320
vtkAxesActor::UserDefinedTip
vtkPolyData * UserDefinedTip
Definition: vtkAxesActor.h:334
vtkAxesActor::GetZAxisCaptionActor2D
vtkCaptionActor2D * GetZAxisCaptionActor2D()
Definition: vtkAxesActor.h:269
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:47
vtkAxesActor::CylinderResolution
int CylinderResolution
Definition: vtkAxesActor.h:350
vtkAxesActor::SetTipTypeToCone
void SetTipTypeToCone()
Definition: vtkAxesActor.h:218
vtkProp::RenderTranslucentPolygonalGeometry
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Definition: vtkProp.h:221
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:47
vtkCaptionActor2D
draw text label associated with a point
Definition: vtkCaptionActor2D.h:77
vtkProp3D::ShallowCopy
void ShallowCopy(vtkProp *prop)
Shallow copy of this vtkProp3D.
vtkAxesActor::ZAxisTip
vtkActor * ZAxisTip
Definition: vtkAxesActor.h:322
vtkAxesActor::SphereSource
vtkSphereSource * SphereSource
Definition: vtkAxesActor.h:314
vtkAxesActor::LINE_SHAFT
Definition: vtkAxesActor.h:296
vtkAxesActor::SetNormalizedTipLength
void SetNormalizedTipLength(double v[3])
Set the normalized (0-1) length of the tip.
Definition: vtkAxesActor.h:158
vtkAxesActor::XAxisShaft
vtkActor * XAxisShaft
Definition: vtkAxesActor.h:316
vtkAxesActor::SetShaftTypeToUserDefined
void SetShaftTypeToUserDefined()
Definition: vtkAxesActor.h:208
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:63
vtkAxesActor::GetYAxisCaptionActor2D
vtkCaptionActor2D * GetYAxisCaptionActor2D()
Definition: vtkAxesActor.h:267
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
vtkAxesActor::TipType
int TipType
Definition: vtkAxesActor.h:332
vtkAxesActor::SphereRadius
double SphereRadius
Definition: vtkAxesActor.h:353
vtkAxesActor::SetTipTypeToSphere
void SetTipTypeToSphere()
Definition: vtkAxesActor.h:220
vtkAxesActor::ZAxisLabelText
char * ZAxisLabelText
Definition: vtkAxesActor.h:339
vtkAxesActor::YAxisTip
vtkActor * YAxisTip
Definition: vtkAxesActor.h:321
vtkProperty
represent surface properties of a geometric object
Definition: vtkProperty.h:64
vtkPropCollection
a list of Props
Definition: vtkPropCollection.h:38
vtkAxesActor::SetNormalizedShaftLength
void SetNormalizedShaftLength(double v[3])
Set the normalized (0-1) length of the shaft.
Definition: vtkAxesActor.h:147
vtkAxesActor::ZAxisShaft
vtkActor * ZAxisShaft
Definition: vtkAxesActor.h:318
vtkProp::GetRedrawMTime
virtual vtkMTimeType GetRedrawMTime()
Return the mtime of anything that would cause the rendered image to appear differently.
Definition: vtkProp.h:108
vtkProp::ReleaseGraphicsResources
virtual void ReleaseGraphicsResources(vtkWindow *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
Definition: vtkProp.h:300
vtkProp::HasTranslucentPolygonalGeometry
virtual int HasTranslucentPolygonalGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:291
vtkAxesActor::ShaftType
int ShaftType
Definition: vtkAxesActor.h:331
vtkAxesActor::ConeSource
vtkConeSource * ConeSource
Definition: vtkAxesActor.h:313
vtkProp3D.h
vtkProp3D::GetBounds
virtual double * GetBounds()=0
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).