VTK  9.2.6
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 =========================================================================*/
160 #ifndef vtkAxesActor_h
161 #define vtkAxesActor_h
162 
163 #include "vtkProp3D.h"
164 #include "vtkRenderingAnnotationModule.h" // For export macro
165 
166 class vtkActor;
167 class vtkCaptionActor2D;
168 class vtkConeSource;
169 class vtkCylinderSource;
170 class vtkLineSource;
171 class vtkPolyData;
172 class vtkPropCollection;
173 class vtkProperty;
174 class vtkRenderer;
175 class vtkSphereSource;
176 
177 class VTKRENDERINGANNOTATION_EXPORT vtkAxesActor : public vtkProp3D
178 {
179 public:
180  static vtkAxesActor* New();
181  vtkTypeMacro(vtkAxesActor, vtkProp3D);
182  void PrintSelf(ostream& os, vtkIndent indent) override;
183 
189  void GetActors(vtkPropCollection*) override;
190 
192 
195  int RenderOpaqueGeometry(vtkViewport* viewport) override;
197  int RenderOverlay(vtkViewport* viewport) override;
199 
204 
208  void ShallowCopy(vtkProp* prop) override;
209 
216 
218 
222  void GetBounds(double bounds[6]);
223  double* GetBounds() VTK_SIZEHINT(6) override;
225 
229  vtkMTimeType GetMTime() override;
230 
237  vtkMTimeType GetRedrawMTime() override;
238 
240 
243  void SetTotalLength(double v[3]) { this->SetTotalLength(v[0], v[1], v[2]); }
244  void SetTotalLength(double x, double y, double z);
245  vtkGetVectorMacro(TotalLength, double, 3);
247 
249 
252  void SetNormalizedShaftLength(double v[3]) { this->SetNormalizedShaftLength(v[0], v[1], v[2]); }
253  void SetNormalizedShaftLength(double x, double y, double z);
254  vtkGetVectorMacro(NormalizedShaftLength, double, 3);
256 
258 
262  void SetNormalizedTipLength(double v[3]) { this->SetNormalizedTipLength(v[0], v[1], v[2]); }
263  void SetNormalizedTipLength(double x, double y, double z);
264  vtkGetVectorMacro(NormalizedTipLength, double, 3);
266 
268 
272  void SetNormalizedLabelPosition(double v[3])
273  {
274  this->SetNormalizedLabelPosition(v[0], v[1], v[2]);
275  }
276  void SetNormalizedLabelPosition(double x, double y, double z);
277  vtkGetVectorMacro(NormalizedLabelPosition, double, 3);
279 
281 
284  vtkSetClampMacro(ConeResolution, int, 3, 128);
285  vtkGetMacro(ConeResolution, int);
286  vtkSetClampMacro(SphereResolution, int, 3, 128);
287  vtkGetMacro(SphereResolution, int);
288  vtkSetClampMacro(CylinderResolution, int, 3, 128);
289  vtkGetMacro(CylinderResolution, int);
291 
293 
296  vtkSetClampMacro(ConeRadius, double, 0, VTK_FLOAT_MAX);
297  vtkGetMacro(ConeRadius, double);
298  vtkSetClampMacro(SphereRadius, double, 0, VTK_FLOAT_MAX);
299  vtkGetMacro(SphereRadius, double);
300  vtkSetClampMacro(CylinderRadius, double, 0, VTK_FLOAT_MAX);
301  vtkGetMacro(CylinderRadius, double);
303 
305 
308  void SetShaftType(int type);
309  void SetShaftTypeToCylinder() { this->SetShaftType(vtkAxesActor::CYLINDER_SHAFT); }
310  void SetShaftTypeToLine() { this->SetShaftType(vtkAxesActor::LINE_SHAFT); }
312  vtkGetMacro(ShaftType, int);
314 
316 
319  void SetTipType(int type);
320  void SetTipTypeToCone() { this->SetTipType(vtkAxesActor::CONE_TIP); }
321  void SetTipTypeToSphere() { this->SetTipType(vtkAxesActor::SPHERE_TIP); }
323  vtkGetMacro(TipType, int);
325 
327 
331  vtkGetObjectMacro(UserDefinedTip, vtkPolyData);
333 
335 
339  vtkGetObjectMacro(UserDefinedShaft, vtkPolyData);
341 
343 
350 
352 
359 
364  vtkCaptionActor2D* GetXAxisCaptionActor2D() { return this->XAxisLabel; }
365  vtkCaptionActor2D* GetYAxisCaptionActor2D() { return this->YAxisLabel; }
366  vtkCaptionActor2D* GetZAxisCaptionActor2D() { return this->ZAxisLabel; }
367 
369 
372  vtkSetStringMacro(XAxisLabelText);
373  vtkGetStringMacro(XAxisLabelText);
374  vtkSetStringMacro(YAxisLabelText);
375  vtkGetStringMacro(YAxisLabelText);
376  vtkSetStringMacro(ZAxisLabelText);
377  vtkGetStringMacro(ZAxisLabelText);
379 
381 
384  vtkSetMacro(AxisLabels, vtkTypeBool);
385  vtkGetMacro(AxisLabels, vtkTypeBool);
386  vtkBooleanMacro(AxisLabels, vtkTypeBool);
388 
389  enum
390  {
393  USER_DEFINED_SHAFT
394  };
395 
396  enum
397  {
400  USER_DEFINED_TIP
401  };
402 
403 protected:
405  ~vtkAxesActor() override;
406 
411 
415 
419 
420  void UpdateProps();
421 
422  double TotalLength[3];
423  double NormalizedShaftLength[3];
424  double NormalizedTipLength[3];
425  double NormalizedLabelPosition[3];
426 
428  int TipType;
429 
432 
436 
440 
442 
446 
447  double ConeRadius;
448  double SphereRadius;
450 
451 private:
452  vtkAxesActor(const vtkAxesActor&) = delete;
453  void operator=(const vtkAxesActor&) = delete;
454 };
455 
456 #endif
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:161
a 3D axes representation
Definition: vtkAxesActor.h:178
int SphereResolution
Definition: vtkAxesActor.h:444
vtkActor * XAxisTip
Definition: vtkAxesActor.h:416
void SetTipTypeToSphere()
Set the type of the tip to a cone, sphere, or user defined geometry.
Definition: vtkAxesActor.h:321
vtkLineSource * LineSource
Definition: vtkAxesActor.h:408
vtkProperty * GetXAxisShaftProperty()
Get the shaft properties.
char * XAxisLabelText
Definition: vtkAxesActor.h:433
void SetShaftTypeToLine()
Set the type of the shaft to a cylinder, line, or user defined geometry.
Definition: vtkAxesActor.h:310
double ConeRadius
Definition: vtkAxesActor.h:447
void SetNormalizedShaftLength(double v[3])
Set the normalized (0-1) length of the shaft.
Definition: vtkAxesActor.h:252
char * ZAxisLabelText
Definition: vtkAxesActor.h:435
vtkPolyData * UserDefinedShaft
Definition: vtkAxesActor.h:431
void SetNormalizedTipLength(double x, double y, double z)
Set the normalized (0-1) length of the tip.
int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override
Support the standard render methods.
vtkSphereSource * SphereSource
Definition: vtkAxesActor.h:410
vtkCylinderSource * CylinderSource
Definition: vtkAxesActor.h:407
void SetNormalizedShaftLength(double x, double y, double z)
Set the normalized (0-1) length of the shaft.
vtkProperty * GetYAxisShaftProperty()
Get the shaft properties.
void SetShaftType(int type)
Set the type of the shaft to a cylinder, line, or user defined geometry.
static vtkAxesActor * New()
vtkProperty * GetZAxisShaftProperty()
Get the shaft properties.
char * YAxisLabelText
Definition: vtkAxesActor.h:434
vtkCaptionActor2D * GetZAxisCaptionActor2D()
Definition: vtkAxesActor.h:366
void SetTotalLength(double v[3])
Set the total length of the axes in 3 dimensions.
Definition: vtkAxesActor.h:243
void SetUserDefinedShaft(vtkPolyData *)
Set the user defined shaft polydata.
vtkTypeBool HasTranslucentPolygonalGeometry() override
Does this prop have some translucent polygonal geometry?
vtkActor * ZAxisShaft
Definition: vtkAxesActor.h:414
vtkActor * YAxisTip
Definition: vtkAxesActor.h:417
void SetTipTypeToUserDefined()
Set the type of the tip to a cone, sphere, or user defined geometry.
Definition: vtkAxesActor.h:322
void ShallowCopy(vtkProp *prop) override
Shallow copy of an axes actor.
int RenderOverlay(vtkViewport *viewport) override
Support the standard render methods.
vtkPolyData * UserDefinedTip
Definition: vtkAxesActor.h:430
~vtkAxesActor() override
vtkCaptionActor2D * GetXAxisCaptionActor2D()
Retrieve handles to the X, Y and Z axis (so that you can set their text properties for example)
Definition: vtkAxesActor.h:364
vtkCaptionActor2D * GetYAxisCaptionActor2D()
Definition: vtkAxesActor.h:365
vtkProperty * GetXAxisTipProperty()
Get the tip properties.
vtkCaptionActor2D * ZAxisLabel
Definition: vtkAxesActor.h:439
double CylinderRadius
Definition: vtkAxesActor.h:449
vtkCaptionActor2D * XAxisLabel
Definition: vtkAxesActor.h:437
vtkConeSource * ConeSource
Definition: vtkAxesActor.h:409
vtkActor * YAxisShaft
Definition: vtkAxesActor.h:413
void SetShaftTypeToCylinder()
Set the type of the shaft to a cylinder, line, or user defined geometry.
Definition: vtkAxesActor.h:309
vtkActor * ZAxisTip
Definition: vtkAxesActor.h:418
void SetTipTypeToCone()
Set the type of the tip to a cone, sphere, or user defined geometry.
Definition: vtkAxesActor.h:320
vtkCaptionActor2D * YAxisLabel
Definition: vtkAxesActor.h:438
vtkProperty * GetYAxisTipProperty()
Get the tip properties.
void GetBounds(double bounds[6])
Get the bounds for this Actor as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
void SetShaftTypeToUserDefined()
Set the type of the shaft to a cylinder, line, or user defined geometry.
Definition: vtkAxesActor.h:311
int RenderOpaqueGeometry(vtkViewport *viewport) override
Support the standard render methods.
void SetUserDefinedTip(vtkPolyData *)
Set the user defined tip polydata.
void SetNormalizedLabelPosition(double x, double y, double z)
Set the normalized (0-1) position of the label along the length of the shaft.
void SetNormalizedLabelPosition(double v[3])
Set the normalized (0-1) position of the label along the length of the shaft.
Definition: vtkAxesActor.h:272
vtkActor * XAxisShaft
Definition: vtkAxesActor.h:412
vtkTypeBool AxisLabels
Definition: vtkAxesActor.h:441
void UpdateProps()
int CylinderResolution
Definition: vtkAxesActor.h:445
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this actor.
void SetTotalLength(double x, double y, double z)
Set the total length of the axes in 3 dimensions.
void SetNormalizedTipLength(double v[3])
Set the normalized (0-1) length of the tip.
Definition: vtkAxesActor.h:262
double * GetBounds() override
Get the bounds for this Actor as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
void GetActors(vtkPropCollection *) override
For some exporters and other other operations we must be able to collect all the actors or volumes.
vtkProperty * GetZAxisTipProperty()
Get the tip properties.
double SphereRadius
Definition: vtkAxesActor.h:448
void SetTipType(int type)
Set the type of the tip to a cone, sphere, or user defined geometry.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
draw text label associated with a point
generate polygonal cone
generate a polygonal cylinder centered at the origin
a simple class to control print indentation
Definition: vtkIndent.h:119
create a line defined by two end points
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:200
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:99
an ordered list of Props
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:76
represent surface properties of a geometric object
Definition: vtkProperty.h:177
abstract specification for renderers
Definition: vtkRenderer.h:182
create a polygonal sphere centered at the origin
abstract specification for Viewports
Definition: vtkViewport.h:56
window superclass for vtkRenderWindow
Definition: vtkWindow.h:39
@ type
Definition: vtkX3D.h:522
int vtkTypeBool
Definition: vtkABI.h:69
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287
#define VTK_FLOAT_MAX
Definition: vtkType.h:163
#define VTK_SIZEHINT(...)