VTK
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=========================================================================*/
54#ifndef vtkAxesActor_h
55#define vtkAxesActor_h
56
57#include "vtkRenderingAnnotationModule.h" // For export macro
58#include "vtkProp3D.h"
59
60class vtkActor;
62class vtkConeSource;
64class vtkLineSource;
65class vtkPolyData;
67class vtkProperty;
68class vtkRenderer;
69class vtkSphereSource;
70
71class VTKRENDERINGANNOTATION_EXPORT vtkAxesActor : public vtkProp3D
72{
73public:
74 static vtkAxesActor *New();
75 vtkTypeMacro(vtkAxesActor,vtkProp3D);
76 void PrintSelf(ostream& os, vtkIndent indent);
77
84
86
89 virtual int RenderOpaqueGeometry(vtkViewport *viewport);
91 virtual int RenderOverlay(vtkViewport *viewport);
93
98
102 void ShallowCopy(vtkProp *prop);
103
110
112
116 void GetBounds(double bounds[6]);
117 double *GetBounds();
119
124
132
134
137 void SetTotalLength( double v[3] )
138 { this->SetTotalLength( v[0], v[1], v[2] ); }
139 void SetTotalLength( double x, double y, double z );
140 vtkGetVectorMacro( TotalLength, double, 3 );
142
144
147 void SetNormalizedShaftLength( double v[3] )
148 { this->SetNormalizedShaftLength( v[0], v[1], v[2] ); }
149 void SetNormalizedShaftLength( double x, double y, double z );
150 vtkGetVectorMacro( NormalizedShaftLength, double, 3 );
152
154
158 void SetNormalizedTipLength( double v[3] )
159 { this->SetNormalizedTipLength( v[0], v[1], v[2] ); }
160 void SetNormalizedTipLength( double x, double y, double z );
161 vtkGetVectorMacro( NormalizedTipLength, double, 3 );
163
165
169 void SetNormalizedLabelPosition( double v[3] )
170 { this->SetNormalizedLabelPosition( v[0], v[1], v[2] ); }
171 void SetNormalizedLabelPosition( double x, double y, double z );
172 vtkGetVectorMacro( NormalizedLabelPosition, double, 3 );
174
176
179 vtkSetClampMacro(ConeResolution, int, 3, 128);
180 vtkGetMacro(ConeResolution, int);
181 vtkSetClampMacro(SphereResolution, int, 3, 128);
182 vtkGetMacro(SphereResolution, int);
183 vtkSetClampMacro(CylinderResolution, int, 3, 128);
184 vtkGetMacro(CylinderResolution, int);
186
188
191 vtkSetClampMacro(ConeRadius, double, 0, VTK_FLOAT_MAX);
192 vtkGetMacro(ConeRadius, double);
193 vtkSetClampMacro(SphereRadius, double, 0, VTK_FLOAT_MAX);
194 vtkGetMacro(SphereRadius, double);
195 vtkSetClampMacro(CylinderRadius, double, 0, VTK_FLOAT_MAX);
196 vtkGetMacro(CylinderRadius, double);
198
200
203 void SetShaftType( int type );
205 { this->SetShaftType( vtkAxesActor::CYLINDER_SHAFT ); }
207 { this->SetShaftType( vtkAxesActor::LINE_SHAFT ); }
209 { this->SetShaftType( vtkAxesActor::USER_DEFINED_SHAFT ); }
210 vtkGetMacro(ShaftType, int);
212
214
217 void SetTipType( int type );
219 { this->SetTipType( vtkAxesActor::CONE_TIP ); }
221 { this->SetTipType( vtkAxesActor::SPHERE_TIP ); }
223 { this->SetTipType( vtkAxesActor::USER_DEFINED_TIP ); }
224 vtkGetMacro(TipType, int);
226
228
232 vtkGetObjectMacro( UserDefinedTip, vtkPolyData );
234
236
240 vtkGetObjectMacro( UserDefinedShaft, vtkPolyData );
242
244
251
253
260
266 {return this->XAxisLabel;}
268 {return this->YAxisLabel;}
270 {return this->ZAxisLabel;}
271
273
276 vtkSetStringMacro( XAxisLabelText );
277 vtkGetStringMacro( XAxisLabelText );
278 vtkSetStringMacro( YAxisLabelText );
279 vtkGetStringMacro( YAxisLabelText );
280 vtkSetStringMacro( ZAxisLabelText );
281 vtkGetStringMacro( ZAxisLabelText );
283
285
288 vtkSetMacro(AxisLabels, int);
289 vtkGetMacro(AxisLabels, int);
290 vtkBooleanMacro(AxisLabels, int);
292
293 enum
294 {
297 USER_DEFINED_SHAFT
298 };
299
300 enum
301 {
304 USER_DEFINED_TIP
305 };
306
307protected:
310
315
319
323
325
326 double TotalLength[3];
327 double NormalizedShaftLength[3];
328 double NormalizedTipLength[3];
329 double NormalizedLabelPosition[3];
330
333
336
340
344
346
347
351
355
356private:
357 vtkAxesActor(const vtkAxesActor&) VTK_DELETE_FUNCTION;
358 void operator=(const vtkAxesActor&) VTK_DELETE_FUNCTION;
359};
360
361#endif
362
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:52
a 3D axes representation
Definition: vtkAxesActor.h:72
int SphereResolution
Definition: vtkAxesActor.h:349
vtkActor * XAxisTip
Definition: vtkAxesActor.h:320
vtkCaptionActor2D * GetXAxisCaptionActor2D()
Retrieve handles to the X, Y and Z axis (so that you can set their text properties for example)
Definition: vtkAxesActor.h:265
vtkMTimeType GetMTime()
Get the actors mtime plus consider its properties and texture if set.
void SetTipTypeToSphere()
Definition: vtkAxesActor.h:220
vtkLineSource * LineSource
Definition: vtkAxesActor.h:312
char * XAxisLabelText
Definition: vtkAxesActor.h:337
void SetShaftTypeToLine()
Definition: vtkAxesActor.h:206
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *viewport)
double ConeRadius
Definition: vtkAxesActor.h:352
vtkCaptionActor2D * GetZAxisCaptionActor2D()
Definition: vtkAxesActor.h:269
void SetNormalizedShaftLength(double v[3])
Set the normalized (0-1) length of the shaft.
Definition: vtkAxesActor.h:147
char * ZAxisLabelText
Definition: vtkAxesActor.h:339
vtkPolyData * UserDefinedShaft
Definition: vtkAxesActor.h:335
void SetNormalizedTipLength(double x, double y, double z)
vtkSphereSource * SphereSource
Definition: vtkAxesActor.h:314
vtkCylinderSource * CylinderSource
Definition: vtkAxesActor.h:311
static vtkAxesActor * New()
void SetNormalizedShaftLength(double x, double y, double z)
void SetShaftType(int type)
Set the type of the shaft to a cylinder, line, or user defined geometry.
char * YAxisLabelText
Definition: vtkAxesActor.h:338
vtkProperty * GetZAxisShaftProperty()
void SetTotalLength(double v[3])
Set the total length of the axes in 3 dimensions.
Definition: vtkAxesActor.h:137
virtual vtkMTimeType GetRedrawMTime()
Return the mtime of anything that would cause the rendered image to appear differently.
vtkProperty * GetXAxisTipProperty()
Get the tip properties.
virtual int RenderOverlay(vtkViewport *viewport)
void SetUserDefinedShaft(vtkPolyData *)
Set the user defined shaft polydata.
vtkActor * ZAxisShaft
Definition: vtkAxesActor.h:318
vtkCaptionActor2D * GetYAxisCaptionActor2D()
Definition: vtkAxesActor.h:267
vtkActor * YAxisTip
Definition: vtkAxesActor.h:321
void SetTipTypeToUserDefined()
Definition: vtkAxesActor.h:222
vtkPolyData * UserDefinedTip
Definition: vtkAxesActor.h:334
vtkProperty * GetXAxisShaftProperty()
Get the shaft properties.
virtual int HasTranslucentPolygonalGeometry()
Does this prop have some translucent polygonal geometry?
virtual void GetActors(vtkPropCollection *)
For some exporters and other other operations we must be able to collect all the actors or volumes.
vtkProperty * GetYAxisShaftProperty()
vtkCaptionActor2D * ZAxisLabel
Definition: vtkAxesActor.h:343
double CylinderRadius
Definition: vtkAxesActor.h:354
vtkCaptionActor2D * XAxisLabel
Definition: vtkAxesActor.h:341
vtkConeSource * ConeSource
Definition: vtkAxesActor.h:313
vtkActor * YAxisShaft
Definition: vtkAxesActor.h:317
void ReleaseGraphicsResources(vtkWindow *)
Release any graphics resources that are being consumed by this actor.
void SetShaftTypeToCylinder()
Definition: vtkAxesActor.h:204
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkActor * ZAxisTip
Definition: vtkAxesActor.h:322
void SetTipTypeToCone()
Definition: vtkAxesActor.h:218
vtkCaptionActor2D * YAxisLabel
Definition: vtkAxesActor.h:342
void GetBounds(double bounds[6])
Get the bounds for this Actor as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
virtual int RenderOpaqueGeometry(vtkViewport *viewport)
Support the standard render methods.
void SetShaftTypeToUserDefined()
Definition: vtkAxesActor.h:208
void ShallowCopy(vtkProp *prop)
Shallow copy of an axes actor.
void SetUserDefinedTip(vtkPolyData *)
Set the user defined tip polydata.
void SetNormalizedLabelPosition(double x, double y, double z)
void SetNormalizedLabelPosition(double v[3])
Set the normalized (0-1) position of the label along the length of the shaft.
Definition: vtkAxesActor.h:169
vtkActor * XAxisShaft
Definition: vtkAxesActor.h:316
void UpdateProps()
int CylinderResolution
Definition: vtkAxesActor.h:350
double * GetBounds()
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
void SetTotalLength(double x, double y, double z)
vtkProperty * GetYAxisTipProperty()
void SetNormalizedTipLength(double v[3])
Set the normalized (0-1) length of the tip.
Definition: vtkAxesActor.h:158
double SphereRadius
Definition: vtkAxesActor.h:353
void SetTipType(int type)
Set the type of the tip to a cone, sphere, or user defined geometry.
vtkProperty * GetZAxisTipProperty()
draw text label associated with a point
generate polygonal cone
Definition: vtkConeSource.h:45
generate a cylinder centered at origin
a simple class to control print indentation
Definition: vtkIndent.h:40
create a line defined by two end points
Definition: vtkLineSource.h:43
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:86
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:47
a list of Props
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:48
represent surface properties of a geometric object
Definition: vtkProperty.h:65
abstract specification for renderers
Definition: vtkRenderer.h:64
create a polygonal sphere centered at the origin
abstract specification for Viewports
Definition: vtkViewport.h:48
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
@ type
Definition: vtkX3D.h:516
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248
#define VTK_FLOAT_MAX
Definition: vtkType.h:161