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;
87  int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override;
88  int RenderOverlay(vtkViewport *viewport) override;
90 
95 
99  void ShallowCopy(vtkProp *prop) override;
100 
106  void ReleaseGraphicsResources(vtkWindow *) override;
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 
228  void SetUserDefinedTip( vtkPolyData * );
229  vtkGetObjectMacro( UserDefinedTip, vtkPolyData );
231 
233 
236  void SetUserDefinedShaft( vtkPolyData * );
237  vtkGetObjectMacro( UserDefinedShaft, vtkPolyData );
239 
241 
244  vtkProperty *GetXAxisTipProperty();
245  vtkProperty *GetYAxisTipProperty();
246  vtkProperty *GetZAxisTipProperty();
248 
250 
253  vtkProperty *GetXAxisShaftProperty();
254  vtkProperty *GetYAxisShaftProperty();
255  vtkProperty *GetZAxisShaftProperty();
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:
305  vtkAxesActor();
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::ConeResolution
int ConeResolution
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
vtkAxesActor::CONE_TIP
Definition: vtkAxesActor.h:299
vtkProp::RenderOverlay
virtual int RenderOverlay(vtkViewport *)
Definition: vtkProp.h:230
vtkAxesActor::ConeRadius
double ConeRadius
Definition: vtkAxesActor.h:349
vtkAxesActor::YAxisLabel
vtkCaptionActor2D * YAxisLabel
Definition: vtkAxesActor.h:339
vtkAxesActor::LineSource
vtkLineSource * LineSource
Definition: vtkAxesActor.h:309
vtkProp3D::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
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:224
vtkConeSource
generate polygonal cone
Definition: vtkConeSource.h:44
vtkAxesActor::CylinderSource
vtkCylinderSource * CylinderSource
Definition: vtkAxesActor.h:308
vtkAxesActor::AxisLabels
vtkTypeBool AxisLabels
Definition: vtkAxesActor.h:342
vtkAxesActor::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::YAxisShaft
vtkActor * YAxisShaft
Definition: vtkAxesActor.h:314
vtkAxesActor::XAxisLabelText
char * XAxisLabelText
Definition: vtkAxesActor.h:334
vtkProp3D::GetBounds
double * GetBounds() override=0
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
vtkAxesActor::SetShaftTypeToCylinder
void SetShaftTypeToCylinder()
Definition: vtkAxesActor.h:201
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
vtkProp::HasTranslucentPolygonalGeometry
virtual vtkTypeBool HasTranslucentPolygonalGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:296
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:68
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:63
vtkAxesActor::SetTipTypeToUserDefined
void SetTipTypeToUserDefined()
Definition: vtkAxesActor.h:219
VTK_SIZEHINT
#define VTK_SIZEHINT(...)
Definition: vtkWrappingHints.h:42
vtkAxesActor::USER_DEFINED_TIP
Definition: vtkAxesActor.h:301
vtkAxesActor::CylinderRadius
double CylinderRadius
Definition: vtkAxesActor.h:351
vtkAxesActor::LINE_SHAFT
Definition: vtkAxesActor.h:293
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:262
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:203
VTK_FLOAT_MAX
#define VTK_FLOAT_MAX
Definition: vtkType.h:167
vtkAxesActor::CYLINDER_SHAFT
Definition: vtkAxesActor.h:292
vtkCylinderSource
generate a cylinder centered at origin
Definition: vtkCylinderSource.h:42
vtkLineSource
create a line defined by two end points
Definition: vtkLineSource.h:42
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:47
vtkAxesActor::CylinderResolution
int CylinderResolution
Definition: vtkAxesActor.h:347
vtkAxesActor::SetTipTypeToCone
void SetTipTypeToCone()
Definition: vtkAxesActor.h:215
vtkProp::RenderTranslucentPolygonalGeometry
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Definition: vtkProp.h:226
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:52
vtkCaptionActor2D
draw text label associated with a point
Definition: vtkCaptionActor2D.h:77
vtkAxesActor::ZAxisTip
vtkActor * ZAxisTip
Definition: vtkAxesActor.h:319
vtkAxesActor::SPHERE_TIP
Definition: vtkAxesActor.h:300
vtkProp3D::ShallowCopy
void ShallowCopy(vtkProp *prop) override
Shallow copy of this vtkProp3D.
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:63
vtkAxesActor::GetYAxisCaptionActor2D
vtkCaptionActor2D * GetYAxisCaptionActor2D()
Definition: vtkAxesActor.h:264
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
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:66
vtkPropCollection
an ordered list of Props
Definition: vtkPropCollection.h:41
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
vtkProp::ReleaseGraphicsResources
virtual void ReleaseGraphicsResources(vtkWindow *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
Definition: vtkProp.h:305
vtkAxesActor::ShaftType
int ShaftType
Definition: vtkAxesActor.h:328
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkAxesActor::ConeSource
vtkConeSource * ConeSource
Definition: vtkAxesActor.h:310
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:302
vtkProp3D.h