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 
60 class vtkActor;
61 class vtkCaptionActor2D;
62 class vtkConeSource;
63 class vtkCylinderSource;
64 class vtkLineSource;
65 class vtkPolyData;
66 class vtkPropCollection;
67 class vtkProperty;
68 class vtkRenderer;
69 class vtkSphereSource;
70 
71 class VTKRENDERINGANNOTATION_EXPORT vtkAxesActor : public vtkProp3D
72 {
73 public:
74  static vtkAxesActor *New();
75  vtkTypeMacro(vtkAxesActor,vtkProp3D);
76  void PrintSelf(ostream& os, vtkIndent indent);
77 
83  virtual void GetActors(vtkPropCollection *);
84 
86 
89  virtual int RenderOpaqueGeometry(vtkViewport *viewport);
90  virtual int RenderTranslucentPolygonalGeometry(vtkViewport *viewport);
91  virtual int RenderOverlay(vtkViewport *viewport);
93 
97  virtual int HasTranslucentPolygonalGeometry();
98 
102  void ShallowCopy(vtkProp *prop);
103 
110 
112 
116  void GetBounds(double bounds[6]);
117  double *GetBounds();
119 
124 
131  virtual vtkMTimeType GetRedrawMTime();
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 
231  void SetUserDefinedTip( vtkPolyData * );
232  vtkGetObjectMacro( UserDefinedTip, vtkPolyData );
234 
236 
239  void SetUserDefinedShaft( vtkPolyData * );
240  vtkGetObjectMacro( UserDefinedShaft, vtkPolyData );
242 
244 
247  vtkProperty *GetXAxisTipProperty();
248  vtkProperty *GetYAxisTipProperty();
249  vtkProperty *GetZAxisTipProperty();
251 
253 
256  vtkProperty *GetXAxisShaftProperty();
257  vtkProperty *GetYAxisShaftProperty();
258  vtkProperty *GetZAxisShaftProperty();
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 
307 protected:
308  vtkAxesActor();
309  ~vtkAxesActor();
310 
315 
319 
323 
324  void UpdateProps();
325 
326  double TotalLength[3];
327  double NormalizedShaftLength[3];
328  double NormalizedTipLength[3];
329  double NormalizedLabelPosition[3];
330 
332  int TipType;
333 
336 
340 
344 
346 
347 
351 
352  double ConeRadius;
353  double SphereRadius;
355 
356 private:
357  vtkAxesActor(const vtkAxesActor&) VTK_DELETE_FUNCTION;
358  void operator=(const vtkAxesActor&) VTK_DELETE_FUNCTION;
359 };
360 
361 #endif
362 
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:50
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
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:51
void SetTotalLength(double v[3])
Set the total length of the axes in 3 dimensions.
Definition: vtkAxesActor.h:137
vtkPolyData * UserDefinedTip
Definition: vtkAxesActor.h:334
generate a cylinder centered at origin
abstract specification for Viewports
Definition: vtkViewport.h:47
represent surface properties of a geometric object
Definition: vtkProperty.h:64
virtual int RenderOpaqueGeometry(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:222
virtual int HasTranslucentPolygonalGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:294
virtual int RenderOverlay(vtkViewport *)
Definition: vtkProp.h:228
vtkCaptionActor2D * GetYAxisCaptionActor2D()
Definition: vtkAxesActor.h:267
vtkCaptionActor2D * GetZAxisCaptionActor2D()
Definition: vtkAxesActor.h:269
int CylinderResolution
Definition: vtkAxesActor.h:350
a 3D axes representation
Definition: vtkAxesActor.h:71
char * ZAxisLabelText
Definition: vtkAxesActor.h:339
abstract specification for renderers
Definition: vtkRenderer.h:63
vtkLineSource * LineSource
Definition: vtkAxesActor.h:312
generate polygonal cone
Definition: vtkConeSource.h:44
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:46
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
vtkSphereSource * SphereSource
Definition: vtkAxesActor.h:314
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248
a list of Props
virtual void ReleaseGraphicsResources(vtkWindow *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
Definition: vtkProp.h:303
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
virtual vtkMTimeType GetRedrawMTime()
Return the mtime of anything that would cause the rendered image to appear differently.
Definition: vtkProp.h:111
create a polygonal sphere centered at the origin
#define VTK_FLOAT_MAX
Definition: vtkType.h:161
char * XAxisLabelText
Definition: vtkAxesActor.h:337
void ShallowCopy(vtkProp *prop)
Shallow copy of this vtkProp3D.
vtkActor * ZAxisShaft
Definition: vtkAxesActor.h:318
a simple class to control print indentation
Definition: vtkIndent.h:39
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkCaptionActor2D * ZAxisLabel
Definition: vtkAxesActor.h:343
vtkConeSource * ConeSource
Definition: vtkAxesActor.h:313
vtkActor * XAxisTip
Definition: vtkAxesActor.h:320
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
vtkCaptionActor2D * YAxisLabel
Definition: vtkAxesActor.h:342
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
vtkActor * ZAxisTip
Definition: vtkAxesActor.h:322
double SphereRadius
Definition: vtkAxesActor.h:353
create a line defined by two end points
Definition: vtkLineSource.h:42
void SetShaftTypeToUserDefined()
Set the type of the shaft to a cylinder, line, or user defined geometry.
Definition: vtkAxesActor.h:208
vtkActor * YAxisTip
Definition: vtkAxesActor.h:321
void SetShaftTypeToLine()
Set the type of the shaft to a cylinder, line, or user defined geometry.
Definition: vtkAxesActor.h:206
double ConeRadius
Definition: vtkAxesActor.h:352
vtkCylinderSource * CylinderSource
Definition: vtkAxesActor.h:311
vtkMTimeType GetMTime()
Get the vtkProp3D's mtime.
vtkActor * YAxisShaft
Definition: vtkAxesActor.h:317
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Definition: vtkProp.h:224
void SetTipTypeToCone()
Set the type of the tip to a cone, sphere, or user defined geometry.
Definition: vtkAxesActor.h:218
virtual double * GetBounds()=0
Return a reference to the Prop3D's composite transform.
vtkActor * XAxisShaft
Definition: vtkAxesActor.h:316
vtkCaptionActor2D * XAxisLabel
Definition: vtkAxesActor.h:341
draw text label associated with a point
void SetNormalizedLabelPosition(double v[3])
Set the normalized (0-1) position of the label along the length of the shaft.
Definition: vtkAxesActor.h:169
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
char * YAxisLabelText
Definition: vtkAxesActor.h:338
void SetShaftTypeToCylinder()
Set the type of the shaft to a cylinder, line, or user defined geometry.
Definition: vtkAxesActor.h:204
int SphereResolution
Definition: vtkAxesActor.h:349
void SetNormalizedTipLength(double v[3])
Set the normalized (0-1) length of the tip.
Definition: vtkAxesActor.h:158
double CylinderRadius
Definition: vtkAxesActor.h:354
vtkPolyData * UserDefinedShaft
Definition: vtkAxesActor.h:335
virtual void GetActors(vtkPropCollection *)
For some exporters and other other operations we must be able to collect all the actors or volumes...
Definition: vtkProp.h:61
void SetTipTypeToUserDefined()
Set the type of the tip to a cone, sphere, or user defined geometry.
Definition: vtkAxesActor.h:222
void SetTipTypeToSphere()
Set the type of the tip to a cone, sphere, or user defined geometry.
Definition: vtkAxesActor.h:220
void SetNormalizedShaftLength(double v[3])
Set the normalized (0-1) length of the shaft.
Definition: vtkAxesActor.h:147