VTK  9.5.2
vtkAxesActor.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
39#ifndef vtkAxesActor_h
40#define vtkAxesActor_h
41
42#include "vtkProp3D.h"
43#include "vtkRenderingAnnotationModule.h" // For export macro
44#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
45
46VTK_ABI_NAMESPACE_BEGIN
47class vtkActor;
49class vtkConeSource;
51class vtkLineSource;
52class vtkPolyData;
54class vtkProperty;
55class vtkRenderer;
56class vtkSphereSource;
57
58class VTKRENDERINGANNOTATION_EXPORT VTK_MARSHALAUTO vtkAxesActor : public vtkProp3D
59{
60public:
61 static vtkAxesActor* New();
62 vtkTypeMacro(vtkAxesActor, vtkProp3D);
63 void PrintSelf(ostream& os, vtkIndent indent) override;
64
71
73
76 int RenderOpaqueGeometry(vtkViewport* viewport) override;
78 int RenderOverlay(vtkViewport* viewport) override;
80
85
89 void ShallowCopy(vtkProp* prop) override;
90
97
99
103 void GetBounds(double bounds[6]);
104 double* GetBounds() VTK_SIZEHINT(6) override;
106
110 vtkMTimeType GetMTime() override;
111
118 vtkMTimeType GetRedrawMTime() override;
119
121
124 void SetTotalLength(double v[3]) { this->SetTotalLength(v[0], v[1], v[2]); }
125 void SetTotalLength(double x, double y, double z);
126 vtkGetVectorMacro(TotalLength, double, 3);
128
130
133 void SetNormalizedShaftLength(double v[3]) { this->SetNormalizedShaftLength(v[0], v[1], v[2]); }
134 void SetNormalizedShaftLength(double x, double y, double z);
135 vtkGetVectorMacro(NormalizedShaftLength, double, 3);
137
139
143 void SetNormalizedTipLength(double v[3]) { this->SetNormalizedTipLength(v[0], v[1], v[2]); }
144 void SetNormalizedTipLength(double x, double y, double z);
145 vtkGetVectorMacro(NormalizedTipLength, double, 3);
147
149
154 {
155 this->SetNormalizedLabelPosition(v[0], v[1], v[2]);
156 }
157 void SetNormalizedLabelPosition(double x, double y, double z);
158 vtkGetVectorMacro(NormalizedLabelPosition, double, 3);
160
162
165 vtkSetClampMacro(ConeResolution, int, 3, 128);
166 vtkGetMacro(ConeResolution, int);
167 vtkSetClampMacro(SphereResolution, int, 3, 128);
168 vtkGetMacro(SphereResolution, int);
169 vtkSetClampMacro(CylinderResolution, int, 3, 128);
170 vtkGetMacro(CylinderResolution, int);
172
174
177 vtkSetClampMacro(ConeRadius, double, 0, VTK_FLOAT_MAX);
178 vtkGetMacro(ConeRadius, double);
179 vtkSetClampMacro(SphereRadius, double, 0, VTK_FLOAT_MAX);
180 vtkGetMacro(SphereRadius, double);
181 vtkSetClampMacro(CylinderRadius, double, 0, VTK_FLOAT_MAX);
182 vtkGetMacro(CylinderRadius, double);
184
186
191 void SetShaftTypeToLine() { this->SetShaftType(vtkAxesActor::LINE_SHAFT); }
193 vtkGetMacro(ShaftType, int);
195
197
200 void SetTipType(int type);
201 void SetTipTypeToCone() { this->SetTipType(vtkAxesActor::CONE_TIP); }
202 void SetTipTypeToSphere() { this->SetTipType(vtkAxesActor::SPHERE_TIP); }
204 vtkGetMacro(TipType, int);
206
208
212 vtkGetObjectMacro(UserDefinedTip, vtkPolyData);
214
216
220 vtkGetObjectMacro(UserDefinedShaft, vtkPolyData);
222
224
231
233
240
245 vtkCaptionActor2D* GetXAxisCaptionActor2D() { return this->XAxisLabel; }
246 vtkCaptionActor2D* GetYAxisCaptionActor2D() { return this->YAxisLabel; }
247 vtkCaptionActor2D* GetZAxisCaptionActor2D() { return this->ZAxisLabel; }
248
250
253 vtkSetStringMacro(XAxisLabelText);
254 vtkGetStringMacro(XAxisLabelText);
255 vtkSetStringMacro(YAxisLabelText);
256 vtkGetStringMacro(YAxisLabelText);
257 vtkSetStringMacro(ZAxisLabelText);
258 vtkGetStringMacro(ZAxisLabelText);
260
262
265 vtkSetMacro(AxisLabels, vtkTypeBool);
266 vtkGetMacro(AxisLabels, vtkTypeBool);
267 vtkBooleanMacro(AxisLabels, vtkTypeBool);
269
270 enum
271 {
274 USER_DEFINED_SHAFT
275 };
276
277 enum
278 {
281 USER_DEFINED_TIP
282 };
283
284protected:
286 ~vtkAxesActor() override;
287
292
296
300
302
303 double TotalLength[3];
304 double NormalizedShaftLength[3];
305 double NormalizedTipLength[3];
306 double NormalizedLabelPosition[3];
307
310
313
317
321
323
327
331
332private:
333 vtkAxesActor(const vtkAxesActor&) = delete;
334 void operator=(const vtkAxesActor&) = delete;
335};
336
337VTK_ABI_NAMESPACE_END
338#endif
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:42
a 3D axes representation
Definition: vtkAxesActor.h:59
int SphereResolution
Definition: vtkAxesActor.h:325
vtkActor * XAxisTip
Definition: vtkAxesActor.h:297
vtkCaptionActor2D * GetXAxisCaptionActor2D()
Retrieve handles to the X, Y and Z axis (so that you can set their text properties for example)
Definition: vtkAxesActor.h:245
void SetTipTypeToSphere()
Set the type of the tip to a cone, sphere, or user defined geometry.
Definition: vtkAxesActor.h:202
vtkLineSource * LineSource
Definition: vtkAxesActor.h:289
char * XAxisLabelText
Definition: vtkAxesActor.h:314
void SetShaftTypeToLine()
Set the type of the shaft to a cylinder, line, or user defined geometry.
Definition: vtkAxesActor.h:191
double ConeRadius
Definition: vtkAxesActor.h:328
vtkCaptionActor2D * GetZAxisCaptionActor2D()
Definition: vtkAxesActor.h:247
void SetNormalizedShaftLength(double v[3])
Set the normalized (0-1) length of the shaft.
Definition: vtkAxesActor.h:133
char * ZAxisLabelText
Definition: vtkAxesActor.h:316
vtkPolyData * UserDefinedShaft
Definition: vtkAxesActor.h:312
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:291
vtkCylinderSource * CylinderSource
Definition: vtkAxesActor.h:288
static vtkAxesActor * New()
void SetNormalizedShaftLength(double x, double y, double z)
Set the normalized (0-1) length of the shaft.
void SetShaftType(int type)
Set the type of the shaft to a cylinder, line, or user defined geometry.
char * YAxisLabelText
Definition: vtkAxesActor.h:315
vtkProperty * GetZAxisShaftProperty()
Get the shaft properties.
double * GetBounds() override
Get the bounds for this Actor as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
void SetTotalLength(double v[3])
Set the total length of the axes in 3 dimensions.
Definition: vtkAxesActor.h:124
vtkProperty * GetXAxisTipProperty()
Get the tip properties.
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:295
vtkCaptionActor2D * GetYAxisCaptionActor2D()
Definition: vtkAxesActor.h:246
vtkActor * YAxisTip
Definition: vtkAxesActor.h:298
void SetTipTypeToUserDefined()
Set the type of the tip to a cone, sphere, or user defined geometry.
Definition: vtkAxesActor.h:203
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:311
vtkProperty * GetXAxisShaftProperty()
Get the shaft properties.
~vtkAxesActor() override
vtkProperty * GetYAxisShaftProperty()
Get the shaft properties.
vtkCaptionActor2D * ZAxisLabel
Definition: vtkAxesActor.h:320
double CylinderRadius
Definition: vtkAxesActor.h:330
vtkCaptionActor2D * XAxisLabel
Definition: vtkAxesActor.h:318
vtkConeSource * ConeSource
Definition: vtkAxesActor.h:290
vtkActor * YAxisShaft
Definition: vtkAxesActor.h:294
void SetShaftTypeToCylinder()
Set the type of the shaft to a cylinder, line, or user defined geometry.
Definition: vtkAxesActor.h:190
vtkActor * ZAxisTip
Definition: vtkAxesActor.h:299
void SetTipTypeToCone()
Set the type of the tip to a cone, sphere, or user defined geometry.
Definition: vtkAxesActor.h:201
vtkCaptionActor2D * YAxisLabel
Definition: vtkAxesActor.h:319
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:192
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:153
vtkActor * XAxisShaft
Definition: vtkAxesActor.h:293
vtkTypeBool AxisLabels
Definition: vtkAxesActor.h:322
void UpdateProps()
int CylinderResolution
Definition: vtkAxesActor.h:326
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.
vtkProperty * GetYAxisTipProperty()
Get the tip properties.
void SetNormalizedTipLength(double v[3])
Set the normalized (0-1) length of the tip.
Definition: vtkAxesActor.h:143
void GetActors(vtkPropCollection *) override
For some exporters and other other operations we must be able to collect all the actors or volumes.
double SphereRadius
Definition: vtkAxesActor.h:329
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.
vtkProperty * GetZAxisTipProperty()
Get the tip properties.
draw text label associated with a point
generate polygonal cone
Definition: vtkConeSource.h:34
generate a polygonal cylinder centered at the origin
a simple class to control print indentation
Definition: vtkIndent.h:29
create a line defined by two end points
Definition: vtkLineSource.h:53
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:72
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:40
an ordered list of Props
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:47
represent surface properties of a geometric object
Definition: vtkProperty.h:61
abstract specification for renderers
Definition: vtkRenderer.h:63
create a polygonal sphere centered at the origin
abstract specification for Viewports
Definition: vtkViewport.h:47
window superclass for vtkRenderWindow
Definition: vtkWindow.h:29
@ type
Definition: vtkX3D.h:516
int vtkTypeBool
Definition: vtkABI.h:64
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287
#define VTK_FLOAT_MAX
Definition: vtkType.h:169
#define VTK_SIZEHINT(...)
#define VTK_MARSHALAUTO