VTK  9.3.20240424
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
148#ifndef vtkAxesActor_h
149#define vtkAxesActor_h
150
151#include "vtkProp3D.h"
152#include "vtkRenderingAnnotationModule.h" // For export macro
153#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
154
155VTK_ABI_NAMESPACE_BEGIN
156class vtkActor;
158class vtkConeSource;
160class vtkLineSource;
161class vtkPolyData;
163class vtkProperty;
164class vtkRenderer;
165class vtkSphereSource;
166
167class VTKRENDERINGANNOTATION_EXPORT VTK_MARSHALAUTO vtkAxesActor : public vtkProp3D
168{
169public:
170 static vtkAxesActor* New();
171 vtkTypeMacro(vtkAxesActor, vtkProp3D);
172 void PrintSelf(ostream& os, vtkIndent indent) override;
173
180
182
185 int RenderOpaqueGeometry(vtkViewport* viewport) override;
187 int RenderOverlay(vtkViewport* viewport) override;
189
194
198 void ShallowCopy(vtkProp* prop) override;
199
206
208
212 void GetBounds(double bounds[6]);
213 double* GetBounds() VTK_SIZEHINT(6) override;
215
219 vtkMTimeType GetMTime() override;
220
227 vtkMTimeType GetRedrawMTime() override;
228
230
233 void SetTotalLength(double v[3]) { this->SetTotalLength(v[0], v[1], v[2]); }
234 void SetTotalLength(double x, double y, double z);
235 vtkGetVectorMacro(TotalLength, double, 3);
237
239
242 void SetNormalizedShaftLength(double v[3]) { this->SetNormalizedShaftLength(v[0], v[1], v[2]); }
243 void SetNormalizedShaftLength(double x, double y, double z);
244 vtkGetVectorMacro(NormalizedShaftLength, double, 3);
246
248
252 void SetNormalizedTipLength(double v[3]) { this->SetNormalizedTipLength(v[0], v[1], v[2]); }
253 void SetNormalizedTipLength(double x, double y, double z);
254 vtkGetVectorMacro(NormalizedTipLength, double, 3);
256
258
263 {
264 this->SetNormalizedLabelPosition(v[0], v[1], v[2]);
265 }
266 void SetNormalizedLabelPosition(double x, double y, double z);
267 vtkGetVectorMacro(NormalizedLabelPosition, double, 3);
269
271
274 vtkSetClampMacro(ConeResolution, int, 3, 128);
275 vtkGetMacro(ConeResolution, int);
276 vtkSetClampMacro(SphereResolution, int, 3, 128);
277 vtkGetMacro(SphereResolution, int);
278 vtkSetClampMacro(CylinderResolution, int, 3, 128);
279 vtkGetMacro(CylinderResolution, int);
281
283
286 vtkSetClampMacro(ConeRadius, double, 0, VTK_FLOAT_MAX);
287 vtkGetMacro(ConeRadius, double);
288 vtkSetClampMacro(SphereRadius, double, 0, VTK_FLOAT_MAX);
289 vtkGetMacro(SphereRadius, double);
290 vtkSetClampMacro(CylinderRadius, double, 0, VTK_FLOAT_MAX);
291 vtkGetMacro(CylinderRadius, double);
293
295
298 void SetShaftType(int type);
300 void SetShaftTypeToLine() { this->SetShaftType(vtkAxesActor::LINE_SHAFT); }
302 vtkGetMacro(ShaftType, int);
304
306
309 void SetTipType(int type);
310 void SetTipTypeToCone() { this->SetTipType(vtkAxesActor::CONE_TIP); }
311 void SetTipTypeToSphere() { this->SetTipType(vtkAxesActor::SPHERE_TIP); }
313 vtkGetMacro(TipType, int);
315
317
321 vtkGetObjectMacro(UserDefinedTip, vtkPolyData);
323
325
329 vtkGetObjectMacro(UserDefinedShaft, vtkPolyData);
331
333
340
342
349
354 vtkCaptionActor2D* GetXAxisCaptionActor2D() { return this->XAxisLabel; }
355 vtkCaptionActor2D* GetYAxisCaptionActor2D() { return this->YAxisLabel; }
356 vtkCaptionActor2D* GetZAxisCaptionActor2D() { return this->ZAxisLabel; }
357
359
362 vtkSetStringMacro(XAxisLabelText);
363 vtkGetStringMacro(XAxisLabelText);
364 vtkSetStringMacro(YAxisLabelText);
365 vtkGetStringMacro(YAxisLabelText);
366 vtkSetStringMacro(ZAxisLabelText);
367 vtkGetStringMacro(ZAxisLabelText);
369
371
374 vtkSetMacro(AxisLabels, vtkTypeBool);
375 vtkGetMacro(AxisLabels, vtkTypeBool);
376 vtkBooleanMacro(AxisLabels, vtkTypeBool);
378
379 enum
380 {
383 USER_DEFINED_SHAFT
384 };
385
386 enum
387 {
390 USER_DEFINED_TIP
391 };
392
393protected:
395 ~vtkAxesActor() override;
396
401
405
409
411
412 double TotalLength[3];
413 double NormalizedShaftLength[3];
414 double NormalizedTipLength[3];
415 double NormalizedLabelPosition[3];
416
419
422
426
430
432
436
440
441private:
442 vtkAxesActor(const vtkAxesActor&) = delete;
443 void operator=(const vtkAxesActor&) = delete;
444};
445
446VTK_ABI_NAMESPACE_END
447#endif
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:151
a 3D axes representation
vtkActor * XAxisTip
vtkCaptionActor2D * GetXAxisCaptionActor2D()
Retrieve handles to the X, Y and Z axis (so that you can set their text properties for example)
void SetTipTypeToSphere()
Set the type of the tip to a cone, sphere, or user defined geometry.
vtkLineSource * LineSource
char * XAxisLabelText
void SetShaftTypeToLine()
Set the type of the shaft to a cylinder, line, or user defined geometry.
double ConeRadius
vtkCaptionActor2D * GetZAxisCaptionActor2D()
void SetNormalizedShaftLength(double v[3])
Set the normalized (0-1) length of the shaft.
char * ZAxisLabelText
vtkPolyData * UserDefinedShaft
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
vtkCylinderSource * CylinderSource
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
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.
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
vtkCaptionActor2D * GetYAxisCaptionActor2D()
vtkActor * YAxisTip
void SetTipTypeToUserDefined()
Set the type of the tip to a cone, sphere, or user defined geometry.
void ShallowCopy(vtkProp *prop) override
Shallow copy of an axes actor.
int RenderOverlay(vtkViewport *viewport) override
Support the standard render methods.
vtkPolyData * UserDefinedTip
vtkProperty * GetXAxisShaftProperty()
Get the shaft properties.
~vtkAxesActor() override
vtkProperty * GetYAxisShaftProperty()
Get the shaft properties.
vtkCaptionActor2D * ZAxisLabel
double CylinderRadius
vtkCaptionActor2D * XAxisLabel
vtkConeSource * ConeSource
vtkActor * YAxisShaft
void SetShaftTypeToCylinder()
Set the type of the shaft to a cylinder, line, or user defined geometry.
vtkActor * ZAxisTip
void SetTipTypeToCone()
Set the type of the tip to a cone, sphere, or user defined geometry.
vtkCaptionActor2D * YAxisLabel
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.
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.
vtkActor * XAxisShaft
vtkTypeBool AxisLabels
void UpdateProps()
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.
void GetActors(vtkPropCollection *) override
For some exporters and other other operations we must be able to collect all the actors or volumes.
double SphereRadius
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
generate a polygonal cylinder centered at the origin
a simple class to control print indentation
Definition vtkIndent.h:108
create a line defined by two end points
concrete dataset represents vertices, lines, polygons, and triangle strips
represents an 3D object for placement in a rendered scene
Definition vtkProp3D.h:89
an ordered list of Props
abstract superclass for all actors, volumes and annotations
Definition vtkProp.h:66
represent surface properties of a geometric object
abstract specification for renderers
create a polygonal sphere centered at the origin
abstract specification for Viewports
Definition vtkViewport.h:65
window superclass for vtkRenderWindow
Definition vtkWindow.h:48
int vtkTypeBool
Definition vtkABI.h:64
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:270
#define VTK_FLOAT_MAX
Definition vtkType.h:152
#define VTK_SIZEHINT(...)
#define VTK_MARSHALAUTO