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=========================================================================*/
57#ifndef vtkAxesActor_h
58#define vtkAxesActor_h
59
60#include "vtkProp3D.h"
61#include "vtkRenderingAnnotationModule.h" // For export macro
62
63class vtkActor;
65class vtkConeSource;
67class vtkLineSource;
68class vtkPolyData;
70class vtkProperty;
71class vtkRenderer;
72class vtkSphereSource;
73
74class VTKRENDERINGANNOTATION_EXPORT vtkAxesActor : public vtkProp3D
75{
76public:
77 static vtkAxesActor* New();
78 vtkTypeMacro(vtkAxesActor, vtkProp3D);
79 void PrintSelf(ostream& os, vtkIndent indent) override;
80
87
89
92 int RenderOpaqueGeometry(vtkViewport* viewport) override;
94 int RenderOverlay(vtkViewport* viewport) override;
96
101
105 void ShallowCopy(vtkProp* prop) override;
106
113
115
119 void GetBounds(double bounds[6]);
120 double* GetBounds() VTK_SIZEHINT(6) override;
122
126 vtkMTimeType GetMTime() override;
127
134 vtkMTimeType GetRedrawMTime() override;
135
137
140 void SetTotalLength(double v[3]) { this->SetTotalLength(v[0], v[1], v[2]); }
141 void SetTotalLength(double x, double y, double z);
142 vtkGetVectorMacro(TotalLength, double, 3);
144
146
149 void SetNormalizedShaftLength(double v[3]) { this->SetNormalizedShaftLength(v[0], v[1], v[2]); }
150 void SetNormalizedShaftLength(double x, double y, double z);
151 vtkGetVectorMacro(NormalizedShaftLength, double, 3);
153
155
159 void SetNormalizedTipLength(double v[3]) { this->SetNormalizedTipLength(v[0], v[1], v[2]); }
160 void SetNormalizedTipLength(double x, double y, double z);
161 vtkGetVectorMacro(NormalizedTipLength, double, 3);
163
165
170 {
171 this->SetNormalizedLabelPosition(v[0], v[1], v[2]);
172 }
173 void SetNormalizedLabelPosition(double x, double y, double z);
174 vtkGetVectorMacro(NormalizedLabelPosition, double, 3);
176
178
181 vtkSetClampMacro(ConeResolution, int, 3, 128);
182 vtkGetMacro(ConeResolution, int);
183 vtkSetClampMacro(SphereResolution, int, 3, 128);
184 vtkGetMacro(SphereResolution, int);
185 vtkSetClampMacro(CylinderResolution, int, 3, 128);
186 vtkGetMacro(CylinderResolution, int);
188
190
193 vtkSetClampMacro(ConeRadius, double, 0, VTK_FLOAT_MAX);
194 vtkGetMacro(ConeRadius, double);
195 vtkSetClampMacro(SphereRadius, double, 0, VTK_FLOAT_MAX);
196 vtkGetMacro(SphereRadius, double);
197 vtkSetClampMacro(CylinderRadius, double, 0, VTK_FLOAT_MAX);
198 vtkGetMacro(CylinderRadius, double);
200
202
205 void SetShaftType(int type);
207 void SetShaftTypeToLine() { this->SetShaftType(vtkAxesActor::LINE_SHAFT); }
209 vtkGetMacro(ShaftType, int);
211
213
216 void SetTipType(int type);
217 void SetTipTypeToCone() { this->SetTipType(vtkAxesActor::CONE_TIP); }
218 void SetTipTypeToSphere() { this->SetTipType(vtkAxesActor::SPHERE_TIP); }
220 vtkGetMacro(TipType, int);
222
224
228 vtkGetObjectMacro(UserDefinedTip, vtkPolyData);
230
232
236 vtkGetObjectMacro(UserDefinedShaft, vtkPolyData);
238
240
247
249
256
261 vtkCaptionActor2D* GetXAxisCaptionActor2D() { return this->XAxisLabel; }
262 vtkCaptionActor2D* GetYAxisCaptionActor2D() { return this->YAxisLabel; }
263 vtkCaptionActor2D* GetZAxisCaptionActor2D() { return this->ZAxisLabel; }
264
266
269 vtkSetStringMacro(XAxisLabelText);
270 vtkGetStringMacro(XAxisLabelText);
271 vtkSetStringMacro(YAxisLabelText);
272 vtkGetStringMacro(YAxisLabelText);
273 vtkSetStringMacro(ZAxisLabelText);
274 vtkGetStringMacro(ZAxisLabelText);
276
278
281 vtkSetMacro(AxisLabels, vtkTypeBool);
282 vtkGetMacro(AxisLabels, vtkTypeBool);
283 vtkBooleanMacro(AxisLabels, vtkTypeBool);
285
286 enum
287 {
290 USER_DEFINED_SHAFT
291 };
292
293 enum
294 {
297 USER_DEFINED_TIP
298 };
299
300protected:
302 ~vtkAxesActor() override;
303
308
312
316
318
319 double TotalLength[3];
320 double NormalizedShaftLength[3];
321 double NormalizedTipLength[3];
322 double NormalizedLabelPosition[3];
323
326
329
333
337
339
343
347
348private:
349 vtkAxesActor(const vtkAxesActor&) = delete;
350 void operator=(const vtkAxesActor&) = delete;
351};
352
353#endif
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:55
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 cylinder centered at origin
a simple class to control print indentation
Definition vtkIndent.h:43
create a line defined by two end points
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:95
represents an 3D object for placement in a rendered scene
Definition vtkProp3D.h:53
an ordered list of Props
abstract superclass for all actors, volumes and annotations
Definition vtkProp.h:57
represent surface properties of a geometric object
Definition vtkProperty.h:71
abstract specification for renderers
Definition vtkRenderer.h:73
create a polygonal sphere centered at the origin
abstract specification for Viewports
Definition vtkViewport.h:56
window superclass for vtkRenderWindow
Definition vtkWindow.h:45
int vtkTypeBool
Definition vtkABI.h:69
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:287
#define VTK_FLOAT_MAX
Definition vtkType.h:163
#define VTK_SIZEHINT(...)