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 =========================================================================*/
51 #ifndef vtkAxesActor_h
52 #define vtkAxesActor_h
53 
54 #include "vtkRenderingAnnotationModule.h" // For export macro
55 #include "vtkProp3D.h"
56 
57 class vtkActor;
58 class vtkCaptionActor2D;
59 class vtkConeSource;
60 class vtkCylinderSource;
61 class vtkLineSource;
62 class vtkPolyData;
63 class vtkPropCollection;
64 class vtkProperty;
65 class vtkRenderer;
66 class vtkSphereSource;
67 
68 class VTKRENDERINGANNOTATION_EXPORT vtkAxesActor : public vtkProp3D
69 {
70 public:
71  static vtkAxesActor *New();
72  vtkTypeMacro(vtkAxesActor,vtkProp3D);
73  void PrintSelf(ostream& os, vtkIndent indent) override;
74 
80  void GetActors(vtkPropCollection *) override;
81 
83 
86  int RenderOpaqueGeometry(vtkViewport *viewport) override;
88  int RenderOverlay(vtkViewport *viewport) override;
90 
95 
99  void ShallowCopy(vtkProp *prop) override;
100 
107 
109 
113  void GetBounds(double bounds[6]);
114  double *GetBounds() VTK_SIZEHINT(6) override;
116 
120  vtkMTimeType GetMTime() override;
121 
128  vtkMTimeType GetRedrawMTime() override;
129 
131 
134  void SetTotalLength( double v[3] )
135  { this->SetTotalLength( v[0], v[1], v[2] ); }
136  void SetTotalLength( double x, double y, double z );
137  vtkGetVectorMacro( TotalLength, double, 3 );
139 
141 
144  void SetNormalizedShaftLength( double v[3] )
145  { this->SetNormalizedShaftLength( v[0], v[1], v[2] ); }
146  void SetNormalizedShaftLength( double x, double y, double z );
147  vtkGetVectorMacro( NormalizedShaftLength, double, 3 );
149 
151 
155  void SetNormalizedTipLength( double v[3] )
156  { this->SetNormalizedTipLength( v[0], v[1], v[2] ); }
157  void SetNormalizedTipLength( double x, double y, double z );
158  vtkGetVectorMacro( NormalizedTipLength, double, 3 );
160 
162 
166  void SetNormalizedLabelPosition( double v[3] )
167  { this->SetNormalizedLabelPosition( v[0], v[1], v[2] ); }
168  void SetNormalizedLabelPosition( double x, double y, double z );
169  vtkGetVectorMacro( NormalizedLabelPosition, double, 3 );
171 
173 
176  vtkSetClampMacro(ConeResolution, int, 3, 128);
177  vtkGetMacro(ConeResolution, int);
178  vtkSetClampMacro(SphereResolution, int, 3, 128);
179  vtkGetMacro(SphereResolution, int);
180  vtkSetClampMacro(CylinderResolution, int, 3, 128);
181  vtkGetMacro(CylinderResolution, int);
183 
185 
188  vtkSetClampMacro(ConeRadius, double, 0, VTK_FLOAT_MAX);
189  vtkGetMacro(ConeRadius, double);
190  vtkSetClampMacro(SphereRadius, double, 0, VTK_FLOAT_MAX);
191  vtkGetMacro(SphereRadius, double);
192  vtkSetClampMacro(CylinderRadius, double, 0, VTK_FLOAT_MAX);
193  vtkGetMacro(CylinderRadius, double);
195 
197 
200  void SetShaftType( int type );
202  { this->SetShaftType( vtkAxesActor::CYLINDER_SHAFT ); }
204  { this->SetShaftType( vtkAxesActor::LINE_SHAFT ); }
206  { this->SetShaftType( vtkAxesActor::USER_DEFINED_SHAFT ); }
207  vtkGetMacro(ShaftType, int);
209 
211 
214  void SetTipType( int type );
216  { this->SetTipType( vtkAxesActor::CONE_TIP ); }
218  { this->SetTipType( vtkAxesActor::SPHERE_TIP ); }
220  { this->SetTipType( vtkAxesActor::USER_DEFINED_TIP ); }
221  vtkGetMacro(TipType, int);
223 
225 
229  vtkGetObjectMacro( UserDefinedTip, vtkPolyData );
231 
233 
237  vtkGetObjectMacro( UserDefinedShaft, vtkPolyData );
239 
241 
248 
250 
257 
263  {return this->XAxisLabel;}
265  {return this->YAxisLabel;}
267  {return this->ZAxisLabel;}
268 
270 
273  vtkSetStringMacro( XAxisLabelText );
274  vtkGetStringMacro( XAxisLabelText );
275  vtkSetStringMacro( YAxisLabelText );
276  vtkGetStringMacro( YAxisLabelText );
277  vtkSetStringMacro( ZAxisLabelText );
278  vtkGetStringMacro( ZAxisLabelText );
280 
282 
285  vtkSetMacro(AxisLabels, vtkTypeBool);
286  vtkGetMacro(AxisLabels, vtkTypeBool);
287  vtkBooleanMacro(AxisLabels, vtkTypeBool);
289 
290  enum
291  {
294  USER_DEFINED_SHAFT
295  };
296 
297  enum
298  {
301  USER_DEFINED_TIP
302  };
303 
304 protected:
306  ~vtkAxesActor() override;
307 
312 
316 
320 
321  void UpdateProps();
322 
323  double TotalLength[3];
324  double NormalizedShaftLength[3];
325  double NormalizedTipLength[3];
326  double NormalizedLabelPosition[3];
327 
329  int TipType;
330 
333 
337 
341 
343 
344 
348 
349  double ConeRadius;
350  double SphereRadius;
352 
353 private:
354  vtkAxesActor(const vtkAxesActor&) = delete;
355  void operator=(const vtkAxesActor&) = delete;
356 };
357 
358 #endif
359 
vtkAxesActor::UserDefinedShaft
vtkPolyData * UserDefinedShaft
Definition: vtkAxesActor.h:332
vtkAxesActor::SetUserDefinedTip
void SetUserDefinedTip(vtkPolyData *)
Set the user defined tip polydata.
vtkAxesActor::GetZAxisShaftProperty
vtkProperty * GetZAxisShaftProperty()
vtkAxesActor::GetActors
void GetActors(vtkPropCollection *) override
For some exporters and other other operations we must be able to collect all the actors or volumes.
vtkAxesActor::ConeResolution
int ConeResolution
Definition: vtkAxesActor.h:345
vtkAxesActor::~vtkAxesActor
~vtkAxesActor() override
vtkAxesActor::SetTotalLength
void SetTotalLength(double x, double y, double z)
vtkX3D::type
@ type
Definition: vtkX3D.h:516
vtkProp3D
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:47
vtkAxesActor::CONE_TIP
@ CONE_TIP
Definition: vtkAxesActor.h:299
vtkAxesActor::ConeRadius
double ConeRadius
Definition: vtkAxesActor.h:349
vtkAxesActor::YAxisLabel
vtkCaptionActor2D * YAxisLabel
Definition: vtkAxesActor.h:339
vtkAxesActor::LineSource
vtkLineSource * LineSource
Definition: vtkAxesActor.h:309
vtkAxesActor::UpdateProps
void UpdateProps()
vtkAxesActor::SetNormalizedLabelPosition
void SetNormalizedLabelPosition(double x, double y, double z)
vtkConeSource
generate polygonal cone
Definition: vtkConeSource.h:45
vtkAxesActor::CylinderSource
vtkCylinderSource * CylinderSource
Definition: vtkAxesActor.h:308
vtkAxesActor::AxisLabels
vtkTypeBool AxisLabels
Definition: vtkAxesActor.h:342
vtkAxesActor::USER_DEFINED_SHAFT
@ USER_DEFINED_SHAFT
Definition: vtkAxesActor.h:294
vtkAxesActor::XAxisLabel
vtkCaptionActor2D * XAxisLabel
Definition: vtkAxesActor.h:338
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:166
vtkAxesActor::SetUserDefinedShaft
void SetUserDefinedShaft(vtkPolyData *)
Set the user defined shaft polydata.
vtkAxesActor::GetXAxisShaftProperty
vtkProperty * GetXAxisShaftProperty()
Get the shaft properties.
vtkAxesActor::GetYAxisTipProperty
vtkProperty * GetYAxisTipProperty()
vtkAxesActor::YAxisShaft
vtkActor * YAxisShaft
Definition: vtkAxesActor.h:314
vtkAxesActor::XAxisLabelText
char * XAxisLabelText
Definition: vtkAxesActor.h:334
vtkAxesActor::SetShaftTypeToCylinder
void SetShaftTypeToCylinder()
Definition: vtkAxesActor.h:201
vtkAxesActor::SetShaftType
void SetShaftType(int type)
Set the type of the shaft to a cylinder, line, or user defined geometry.
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:38
vtkAxesActor::YAxisLabelText
char * YAxisLabelText
Definition: vtkAxesActor.h:335
vtkAxesActor::SphereResolution
int SphereResolution
Definition: vtkAxesActor.h:346
vtkAxesActor::ZAxisLabel
vtkCaptionActor2D * ZAxisLabel
Definition: vtkAxesActor.h:340
vtkAxesActor
a 3D axes representation
Definition: vtkAxesActor.h:69
vtkAxesActor::SetTipTypeToUserDefined
void SetTipTypeToUserDefined()
Definition: vtkAxesActor.h:219
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)
VTK_SIZEHINT
#define VTK_SIZEHINT(...)
Definition: vtkWrappingHints.h:42
vtkAxesActor::USER_DEFINED_TIP
@ USER_DEFINED_TIP
Definition: vtkAxesActor.h:301
vtkAxesActor::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkAxesActor::CylinderRadius
double CylinderRadius
Definition: vtkAxesActor.h:351
vtkAxesActor::LINE_SHAFT
@ LINE_SHAFT
Definition: vtkAxesActor.h:293
vtkAxesActor::RenderTranslucentPolygonalGeometry
int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override
vtkAxesActor::HasTranslucentPolygonalGeometry
vtkTypeBool HasTranslucentPolygonalGeometry() override
Does this prop have some translucent polygonal geometry?
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:262
vtkAxesActor::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this 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::GetYAxisShaftProperty
vtkProperty * GetYAxisShaftProperty()
vtkAxesActor::SetShaftTypeToLine
void SetShaftTypeToLine()
Definition: vtkAxesActor.h:203
vtkAxesActor::New
static vtkAxesActor * New()
VTK_FLOAT_MAX
#define VTK_FLOAT_MAX
Definition: vtkType.h:167
vtkAxesActor::CYLINDER_SHAFT
@ CYLINDER_SHAFT
Definition: vtkAxesActor.h:292
vtkCylinderSource
generate a cylinder centered at origin
Definition: vtkCylinderSource.h:43
vtkLineSource
create a line defined by two end points
Definition: vtkLineSource.h:43
vtkAxesActor::XAxisTip
vtkActor * XAxisTip
Definition: vtkAxesActor.h:317
vtkAxesActor::UserDefinedTip
vtkPolyData * UserDefinedTip
Definition: vtkAxesActor.h:331
vtkAxesActor::GetZAxisCaptionActor2D
vtkCaptionActor2D * GetZAxisCaptionActor2D()
Definition: vtkAxesActor.h:266
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:48
vtkAxesActor::GetBounds
double * GetBounds() override
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
vtkAxesActor::CylinderResolution
int CylinderResolution
Definition: vtkAxesActor.h:347
vtkAxesActor::SetTipTypeToCone
void SetTipTypeToCone()
Definition: vtkAxesActor.h:215
vtkAxesActor::RenderOpaqueGeometry
int RenderOpaqueGeometry(vtkViewport *viewport) override
Support the standard render methods.
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:53
vtkCaptionActor2D
draw text label associated with a point
Definition: vtkCaptionActor2D.h:78
vtkAxesActor::ZAxisTip
vtkActor * ZAxisTip
Definition: vtkAxesActor.h:319
vtkAxesActor::ShallowCopy
void ShallowCopy(vtkProp *prop) override
Shallow copy of an axes actor.
vtkAxesActor::SPHERE_TIP
@ SPHERE_TIP
Definition: vtkAxesActor.h:300
vtkAxesActor::RenderOverlay
int RenderOverlay(vtkViewport *viewport) override
vtkAxesActor::SphereSource
vtkSphereSource * SphereSource
Definition: vtkAxesActor.h:311
vtkAxesActor::SetNormalizedTipLength
void SetNormalizedTipLength(double v[3])
Set the normalized (0-1) length of the tip.
Definition: vtkAxesActor.h:155
vtkAxesActor::XAxisShaft
vtkActor * XAxisShaft
Definition: vtkAxesActor.h:313
vtkAxesActor::SetShaftTypeToUserDefined
void SetShaftTypeToUserDefined()
Definition: vtkAxesActor.h:205
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:64
vtkAxesActor::GetYAxisCaptionActor2D
vtkCaptionActor2D * GetYAxisCaptionActor2D()
Definition: vtkAxesActor.h:264
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:86
vtkAxesActor::TipType
int TipType
Definition: vtkAxesActor.h:329
vtkAxesActor::SphereRadius
double SphereRadius
Definition: vtkAxesActor.h:350
vtkAxesActor::SetTipTypeToSphere
void SetTipTypeToSphere()
Definition: vtkAxesActor.h:217
vtkAxesActor::ZAxisLabelText
char * ZAxisLabelText
Definition: vtkAxesActor.h:336
vtkAxesActor::YAxisTip
vtkActor * YAxisTip
Definition: vtkAxesActor.h:318
vtkProperty
represent surface properties of a geometric object
Definition: vtkProperty.h:67
vtkPropCollection
an ordered list of Props
Definition: vtkPropCollection.h:42
vtkAxesActor::SetNormalizedShaftLength
void SetNormalizedShaftLength(double v[3])
Set the normalized (0-1) length of the shaft.
Definition: vtkAxesActor.h:144
vtkAxesActor::ZAxisShaft
vtkActor * ZAxisShaft
Definition: vtkAxesActor.h:315
vtkAxesActor::SetNormalizedTipLength
void SetNormalizedTipLength(double x, double y, double z)
vtkAxesActor::ShaftType
int ShaftType
Definition: vtkAxesActor.h:328
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkAxesActor::GetXAxisTipProperty
vtkProperty * GetXAxisTipProperty()
Get the tip properties.
vtkAxesActor::vtkAxesActor
vtkAxesActor()
vtkAxesActor::ConeSource
vtkConeSource * ConeSource
Definition: vtkAxesActor.h:310
vtkAxesActor::GetBounds
void GetBounds(double bounds[6])
Get the bounds for this Actor as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:302
vtkProp3D.h