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);
91  virtual int RenderOverlay(vtkViewport *viewport);
93 
98 
102  void ShallowCopy(vtkProp *prop);
103 
110 
112 
116  void GetBounds(double bounds[6]);
117  double *GetBounds();
119 
124 
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 
232  vtkGetObjectMacro( UserDefinedTip, vtkPolyData );
234 
236 
240  vtkGetObjectMacro( UserDefinedShaft, vtkPolyData );
242 
244 
251 
253 
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:
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
@ CONE_TIP
Definition: vtkAxesActor.h:302
vtkAxesActor::RenderOpaqueGeometry
virtual int RenderOpaqueGeometry(vtkViewport *viewport)
Support the standard render methods.
vtkAxesActor::UserDefinedShaft
vtkPolyData * UserDefinedShaft
Definition: vtkAxesActor.h:335
vtkAxesActor::SetUserDefinedTip
void SetUserDefinedTip(vtkPolyData *)
Set the user defined tip polydata.
vtkAxesActor::GetZAxisShaftProperty
vtkProperty * GetZAxisShaftProperty()
vtkAxesActor::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkAxesActor::ConeResolution
int ConeResolution
Definition: vtkAxesActor.h:348
vtkAxesActor::SetTotalLength
void SetTotalLength(double x, double y, double z)
vtkAxesActor::AxisLabels
int AxisLabels
Definition: vtkAxesActor.h:345
vtkAxesActor::RenderOverlay
virtual int RenderOverlay(vtkViewport *viewport)
vtkX3D::type
@ type
Definition: vtkX3D.h:516
vtkProp3D
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:47
vtkAxesActor::ConeRadius
double ConeRadius
Definition: vtkAxesActor.h:352
vtkAxesActor::YAxisLabel
vtkCaptionActor2D * YAxisLabel
Definition: vtkAxesActor.h:342
vtkAxesActor::LineSource
vtkLineSource * LineSource
Definition: vtkAxesActor.h:312
vtkAxesActor::HasTranslucentPolygonalGeometry
virtual int HasTranslucentPolygonalGeometry()
Does this prop have some translucent polygonal geometry?
vtkAxesActor::UpdateProps
void UpdateProps()
vtkAxesActor::SetTotalLength
void SetTotalLength(double v[3])
Set the total length of the axes in 3 dimensions.
Definition: vtkAxesActor.h:137
vtkAxesActor::SetNormalizedLabelPosition
void SetNormalizedLabelPosition(double x, double y, double z)
vtkAxesActor::USER_DEFINED_SHAFT
@ USER_DEFINED_SHAFT
Definition: vtkAxesActor.h:297
vtkConeSource
generate polygonal cone
Definition: vtkConeSource.h:45
vtkAxesActor::CYLINDER_SHAFT
@ CYLINDER_SHAFT
Definition: vtkAxesActor.h:295
vtkAxesActor::CylinderSource
vtkCylinderSource * CylinderSource
Definition: vtkAxesActor.h:311
vtkAxesActor::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *)
Release any graphics resources that are being consumed by this actor.
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
@ SPHERE_TIP
Definition: vtkAxesActor.h:303
vtkAxesActor::SetUserDefinedShaft
void SetUserDefinedShaft(vtkPolyData *)
Set the user defined shaft polydata.
vtkAxesActor::GetXAxisShaftProperty
vtkProperty * GetXAxisShaftProperty()
Get the shaft properties.
vtkAxesActor::USER_DEFINED_TIP
@ USER_DEFINED_TIP
Definition: vtkAxesActor.h:304
vtkAxesActor::GetYAxisTipProperty
vtkProperty * GetYAxisTipProperty()
vtkAxesActor::YAxisShaft
vtkActor * YAxisShaft
Definition: vtkAxesActor.h:317
vtkAxesActor::XAxisLabelText
char * XAxisLabelText
Definition: vtkAxesActor.h:337
vtkAxesActor::SetShaftTypeToCylinder
void SetShaftTypeToCylinder()
Definition: vtkAxesActor.h:204
vtkAxesActor::SetShaftType
void SetShaftType(int type)
Set the type of the shaft to a cylinder, line, or user defined geometry.
vtkAxesActor::~vtkAxesActor
~vtkAxesActor()
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
vtkMTimeType
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248
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:72
vtkAxesActor::GetBounds
double * GetBounds()
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
vtkAxesActor::SetTipTypeToUserDefined
void SetTipTypeToUserDefined()
Definition: vtkAxesActor.h:222
vtkAxesActor::SetTipType
void SetTipType(int type)
Set the type of the tip to a cone, sphere, or user defined geometry.
vtkAxesActor::SetNormalizedShaftLength
void SetNormalizedShaftLength(double x, double y, double z)
vtkAxesActor::CylinderRadius
double CylinderRadius
Definition: vtkAxesActor.h:354
vtkSphereSource
create a polygonal sphere centered at the origin
Definition: vtkSphereSource.h:47
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
vtkAxesActor::ShallowCopy
void ShallowCopy(vtkProp *prop)
Shallow copy of an axes actor.
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:52
vtkAxesActor::GetZAxisTipProperty
vtkProperty * GetZAxisTipProperty()
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkAxesActor::RenderTranslucentPolygonalGeometry
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *viewport)
vtkAxesActor::GetYAxisShaftProperty
vtkProperty * GetYAxisShaftProperty()
vtkAxesActor::SetShaftTypeToLine
void SetShaftTypeToLine()
Definition: vtkAxesActor.h:206
vtkAxesActor::New
static vtkAxesActor * New()
VTK_FLOAT_MAX
#define VTK_FLOAT_MAX
Definition: vtkType.h:161
vtkCylinderSource
generate a cylinder centered at origin
Definition: vtkCylinderSource.h:43
vtkAxesActor::GetMTime
vtkMTimeType GetMTime()
Get the actors mtime plus consider its properties and texture if set.
vtkGetStringMacro
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
vtkLineSource
create a line defined by two end points
Definition: vtkLineSource.h:43
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:48
vtkAxesActor::CylinderResolution
int CylinderResolution
Definition: vtkAxesActor.h:350
vtkAxesActor::SetTipTypeToCone
void SetTipTypeToCone()
Definition: vtkAxesActor.h:218
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:48
vtkCaptionActor2D
draw text label associated with a point
Definition: vtkCaptionActor2D.h:78
vtkAxesActor::ZAxisTip
vtkActor * ZAxisTip
Definition: vtkAxesActor.h:322
vtkAxesActor::SphereSource
vtkSphereSource * SphereSource
Definition: vtkAxesActor.h:314
vtkAxesActor::LINE_SHAFT
@ 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:64
vtkAxesActor::GetYAxisCaptionActor2D
vtkCaptionActor2D * GetYAxisCaptionActor2D()
Definition: vtkAxesActor.h:267
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:86
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::GetRedrawMTime
virtual vtkMTimeType GetRedrawMTime()
Return the mtime of anything that would cause the rendered image to appear differently.
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:65
vtkAxesActor::GetActors
virtual void GetActors(vtkPropCollection *)
For some exporters and other other operations we must be able to collect all the actors or volumes.
vtkPropCollection
a list of Props
Definition: vtkPropCollection.h:39
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
vtkAxesActor::SetNormalizedTipLength
void SetNormalizedTipLength(double x, double y, double z)
vtkAxesActor::ShaftType
int ShaftType
Definition: vtkAxesActor.h:331
vtkAxesActor::GetXAxisTipProperty
vtkProperty * GetXAxisTipProperty()
Get the tip properties.
vtkAxesActor::vtkAxesActor
vtkAxesActor()
vtkAxesActor::ConeSource
vtkConeSource * ConeSource
Definition: vtkAxesActor.h:313
vtkAxesActor::GetBounds
void GetBounds(double bounds[6])
Get the bounds for this Actor as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
vtkProp3D.h