VTK  9.1.0
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 =========================================================================*/
157 #ifndef vtkAxesActor_h
158 #define vtkAxesActor_h
159 
160 #include "vtkProp3D.h"
161 #include "vtkRenderingAnnotationModule.h" // For export macro
162 
163 class vtkActor;
164 class vtkCaptionActor2D;
165 class vtkConeSource;
166 class vtkCylinderSource;
167 class vtkLineSource;
168 class vtkPolyData;
169 class vtkPropCollection;
170 class vtkProperty;
171 class vtkRenderer;
172 class vtkSphereSource;
173 
174 class VTKRENDERINGANNOTATION_EXPORT vtkAxesActor : public vtkProp3D
175 {
176 public:
177  static vtkAxesActor* New();
178  vtkTypeMacro(vtkAxesActor, vtkProp3D);
179  void PrintSelf(ostream& os, vtkIndent indent) override;
180 
186  void GetActors(vtkPropCollection*) override;
187 
189 
192  int RenderOpaqueGeometry(vtkViewport* viewport) override;
194  int RenderOverlay(vtkViewport* viewport) override;
196 
201 
205  void ShallowCopy(vtkProp* prop) override;
206 
213 
215 
219  void GetBounds(double bounds[6]);
220  double* GetBounds() VTK_SIZEHINT(6) override;
222 
226  vtkMTimeType GetMTime() override;
227 
234  vtkMTimeType GetRedrawMTime() override;
235 
237 
240  void SetTotalLength(double v[3]) { this->SetTotalLength(v[0], v[1], v[2]); }
241  void SetTotalLength(double x, double y, double z);
242  vtkGetVectorMacro(TotalLength, double, 3);
244 
246 
249  void SetNormalizedShaftLength(double v[3]) { this->SetNormalizedShaftLength(v[0], v[1], v[2]); }
250  void SetNormalizedShaftLength(double x, double y, double z);
251  vtkGetVectorMacro(NormalizedShaftLength, double, 3);
253 
255 
259  void SetNormalizedTipLength(double v[3]) { this->SetNormalizedTipLength(v[0], v[1], v[2]); }
260  void SetNormalizedTipLength(double x, double y, double z);
261  vtkGetVectorMacro(NormalizedTipLength, double, 3);
263 
265 
269  void SetNormalizedLabelPosition(double v[3])
270  {
271  this->SetNormalizedLabelPosition(v[0], v[1], v[2]);
272  }
273  void SetNormalizedLabelPosition(double x, double y, double z);
274  vtkGetVectorMacro(NormalizedLabelPosition, double, 3);
276 
278 
281  vtkSetClampMacro(ConeResolution, int, 3, 128);
282  vtkGetMacro(ConeResolution, int);
283  vtkSetClampMacro(SphereResolution, int, 3, 128);
284  vtkGetMacro(SphereResolution, int);
285  vtkSetClampMacro(CylinderResolution, int, 3, 128);
286  vtkGetMacro(CylinderResolution, int);
288 
290 
293  vtkSetClampMacro(ConeRadius, double, 0, VTK_FLOAT_MAX);
294  vtkGetMacro(ConeRadius, double);
295  vtkSetClampMacro(SphereRadius, double, 0, VTK_FLOAT_MAX);
296  vtkGetMacro(SphereRadius, double);
297  vtkSetClampMacro(CylinderRadius, double, 0, VTK_FLOAT_MAX);
298  vtkGetMacro(CylinderRadius, double);
300 
302 
305  void SetShaftType(int type);
306  void SetShaftTypeToCylinder() { this->SetShaftType(vtkAxesActor::CYLINDER_SHAFT); }
307  void SetShaftTypeToLine() { this->SetShaftType(vtkAxesActor::LINE_SHAFT); }
309  vtkGetMacro(ShaftType, int);
311 
313 
316  void SetTipType(int type);
317  void SetTipTypeToCone() { this->SetTipType(vtkAxesActor::CONE_TIP); }
318  void SetTipTypeToSphere() { this->SetTipType(vtkAxesActor::SPHERE_TIP); }
320  vtkGetMacro(TipType, int);
322 
324 
328  vtkGetObjectMacro(UserDefinedTip, vtkPolyData);
330 
332 
336  vtkGetObjectMacro(UserDefinedShaft, vtkPolyData);
338 
340 
347 
349 
356 
361  vtkCaptionActor2D* GetXAxisCaptionActor2D() { return this->XAxisLabel; }
362  vtkCaptionActor2D* GetYAxisCaptionActor2D() { return this->YAxisLabel; }
363  vtkCaptionActor2D* GetZAxisCaptionActor2D() { return this->ZAxisLabel; }
364 
366 
369  vtkSetStringMacro(XAxisLabelText);
370  vtkGetStringMacro(XAxisLabelText);
371  vtkSetStringMacro(YAxisLabelText);
372  vtkGetStringMacro(YAxisLabelText);
373  vtkSetStringMacro(ZAxisLabelText);
374  vtkGetStringMacro(ZAxisLabelText);
376 
378 
381  vtkSetMacro(AxisLabels, vtkTypeBool);
382  vtkGetMacro(AxisLabels, vtkTypeBool);
383  vtkBooleanMacro(AxisLabels, vtkTypeBool);
385 
386  enum
387  {
390  USER_DEFINED_SHAFT
391  };
392 
393  enum
394  {
397  USER_DEFINED_TIP
398  };
399 
400 protected:
402  ~vtkAxesActor() override;
403 
408 
412 
416 
417  void UpdateProps();
418 
419  double TotalLength[3];
420  double NormalizedShaftLength[3];
421  double NormalizedTipLength[3];
422  double NormalizedLabelPosition[3];
423 
425  int TipType;
426 
429 
433 
437 
439 
443 
444  double ConeRadius;
445  double SphereRadius;
447 
448 private:
449  vtkAxesActor(const vtkAxesActor&) = delete;
450  void operator=(const vtkAxesActor&) = delete;
451 };
452 
453 #endif
vtkAxesActor::UserDefinedShaft
vtkPolyData * UserDefinedShaft
Definition: vtkAxesActor.h:428
vtkAxesActor::SetUserDefinedTip
void SetUserDefinedTip(vtkPolyData *)
Set the user defined tip polydata.
vtkAxesActor::GetZAxisShaftProperty
vtkProperty * GetZAxisShaftProperty()
Get the shaft properties.
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:440
vtkAxesActor::~vtkAxesActor
~vtkAxesActor() override
vtkAxesActor::CONE_TIP
@ CONE_TIP
Definition: vtkAxesActor.h:395
vtkAxesActor::SetTotalLength
void SetTotalLength(double x, double y, double z)
Set the total length of the axes in 3 dimensions.
vtkX3D::type
@ type
Definition: vtkX3D.h:522
vtkProp3D
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:93
vtkAxesActor::ConeRadius
double ConeRadius
Definition: vtkAxesActor.h:444
vtkAxesActor::YAxisLabel
vtkCaptionActor2D * YAxisLabel
Definition: vtkAxesActor.h:435
vtkAxesActor::LineSource
vtkLineSource * LineSource
Definition: vtkAxesActor.h:405
vtkAxesActor::UpdateProps
void UpdateProps()
vtkAxesActor::SetTotalLength
void SetTotalLength(double v[3])
Set the total length of the axes in 3 dimensions.
Definition: vtkAxesActor.h:240
vtkAxesActor::SetNormalizedLabelPosition
void SetNormalizedLabelPosition(double x, double y, double z)
Set the normalized (0-1) position of the label along the length of the shaft.
vtkConeSource
generate polygonal cone
Definition: vtkConeSource.h:148
vtkAxesActor::CylinderSource
vtkCylinderSource * CylinderSource
Definition: vtkAxesActor.h:404
vtkAxesActor::AxisLabels
vtkTypeBool AxisLabels
Definition: vtkAxesActor.h:438
vtkAxesActor::USER_DEFINED_SHAFT
@ USER_DEFINED_SHAFT
Definition: vtkAxesActor.h:390
vtkAxesActor::XAxisLabel
vtkCaptionActor2D * XAxisLabel
Definition: vtkAxesActor.h:434
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:269
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:397
vtkAxesActor::GetYAxisTipProperty
vtkProperty * GetYAxisTipProperty()
Get the tip properties.
vtkAxesActor::YAxisShaft
vtkActor * YAxisShaft
Definition: vtkAxesActor.h:410
vtkAxesActor::XAxisLabelText
char * XAxisLabelText
Definition: vtkAxesActor.h:430
vtkAxesActor::SetShaftTypeToCylinder
void SetShaftTypeToCylinder()
Set the type of the shaft to a cylinder, line, or user defined geometry.
Definition: vtkAxesActor.h:306
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:39
vtkAxesActor::YAxisLabelText
char * YAxisLabelText
Definition: vtkAxesActor.h:431
vtkAxesActor::SphereResolution
int SphereResolution
Definition: vtkAxesActor.h:441
vtkAxesActor::ZAxisLabel
vtkCaptionActor2D * ZAxisLabel
Definition: vtkAxesActor.h:436
vtkAxesActor
a 3D axes representation
Definition: vtkAxesActor.h:175
vtkAxesActor::SetTipTypeToUserDefined
void SetTipTypeToUserDefined()
Set the type of the tip to a cone, sphere, or user defined geometry.
Definition: vtkAxesActor.h:319
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)
Set the normalized (0-1) length of the shaft.
VTK_SIZEHINT
#define VTK_SIZEHINT(...)
Definition: vtkWrappingHints.h:48
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:446
vtkAxesActor::RenderTranslucentPolygonalGeometry
int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override
Support the standard render methods.
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:149
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:361
vtkAxesActor::CYLINDER_SHAFT
@ CYLINDER_SHAFT
Definition: vtkAxesActor.h:388
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:155
vtkAxesActor::GetZAxisTipProperty
vtkProperty * GetZAxisTipProperty()
Get the tip properties.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkAxesActor::GetYAxisShaftProperty
vtkProperty * GetYAxisShaftProperty()
Get the shaft properties.
vtkAxesActor::SetShaftTypeToLine
void SetShaftTypeToLine()
Set the type of the shaft to a cylinder, line, or user defined geometry.
Definition: vtkAxesActor.h:307
vtkAxesActor::New
static vtkAxesActor * New()
vtkAxesActor::SPHERE_TIP
@ SPHERE_TIP
Definition: vtkAxesActor.h:396
VTK_FLOAT_MAX
#define VTK_FLOAT_MAX
Definition: vtkType.h:163
vtkCylinderSource
generate a cylinder centered at origin
Definition: vtkCylinderSource.h:146
vtkLineSource
create a line defined by two end points
Definition: vtkLineSource.h:170
vtkAxesActor::XAxisTip
vtkActor * XAxisTip
Definition: vtkAxesActor.h:413
vtkAxesActor::UserDefinedTip
vtkPolyData * UserDefinedTip
Definition: vtkAxesActor.h:427
vtkAxesActor::GetZAxisCaptionActor2D
vtkCaptionActor2D * GetZAxisCaptionActor2D()
Definition: vtkAxesActor.h:363
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:47
vtkAxesActor::GetBounds
double * GetBounds() override
Get the bounds for this Actor as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
vtkAxesActor::CylinderResolution
int CylinderResolution
Definition: vtkAxesActor.h:442
vtkAxesActor::SetTipTypeToCone
void SetTipTypeToCone()
Set the type of the tip to a cone, sphere, or user defined geometry.
Definition: vtkAxesActor.h:317
vtkAxesActor::RenderOpaqueGeometry
int RenderOpaqueGeometry(vtkViewport *viewport) override
Support the standard render methods.
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:76
vtkCaptionActor2D
draw text label associated with a point
Definition: vtkCaptionActor2D.h:144
vtkAxesActor::ZAxisTip
vtkActor * ZAxisTip
Definition: vtkAxesActor.h:415
vtkAxesActor::ShallowCopy
void ShallowCopy(vtkProp *prop) override
Shallow copy of an axes actor.
vtkAxesActor::RenderOverlay
int RenderOverlay(vtkViewport *viewport) override
Support the standard render methods.
vtkAxesActor::SphereSource
vtkSphereSource * SphereSource
Definition: vtkAxesActor.h:407
vtkAxesActor::SetNormalizedTipLength
void SetNormalizedTipLength(double v[3])
Set the normalized (0-1) length of the tip.
Definition: vtkAxesActor.h:259
vtkAxesActor::XAxisShaft
vtkActor * XAxisShaft
Definition: vtkAxesActor.h:409
vtkAxesActor::SetShaftTypeToUserDefined
void SetShaftTypeToUserDefined()
Set the type of the shaft to a cylinder, line, or user defined geometry.
Definition: vtkAxesActor.h:308
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:182
vtkAxesActor::GetYAxisCaptionActor2D
vtkCaptionActor2D * GetYAxisCaptionActor2D()
Definition: vtkAxesActor.h:362
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:195
vtkAxesActor::TipType
int TipType
Definition: vtkAxesActor.h:425
vtkAxesActor::SphereRadius
double SphereRadius
Definition: vtkAxesActor.h:445
vtkAxesActor::SetTipTypeToSphere
void SetTipTypeToSphere()
Set the type of the tip to a cone, sphere, or user defined geometry.
Definition: vtkAxesActor.h:318
vtkAxesActor::ZAxisLabelText
char * ZAxisLabelText
Definition: vtkAxesActor.h:432
vtkAxesActor::YAxisTip
vtkActor * YAxisTip
Definition: vtkAxesActor.h:414
vtkProperty
represent surface properties of a geometric object
Definition: vtkProperty.h:171
vtkAxesActor::LINE_SHAFT
@ LINE_SHAFT
Definition: vtkAxesActor.h:389
vtkPropCollection
an ordered list of Props
Definition: vtkPropCollection.h:85
vtkAxesActor::SetNormalizedShaftLength
void SetNormalizedShaftLength(double v[3])
Set the normalized (0-1) length of the shaft.
Definition: vtkAxesActor.h:249
vtkAxesActor::ZAxisShaft
vtkActor * ZAxisShaft
Definition: vtkAxesActor.h:411
vtkAxesActor::SetNormalizedTipLength
void SetNormalizedTipLength(double x, double y, double z)
Set the normalized (0-1) length of the tip.
vtkAxesActor::ShaftType
int ShaftType
Definition: vtkAxesActor.h:424
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:406
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:287
vtkProp3D.h