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 =========================================================================*/
53 #ifndef vtkAxesActor_h
54 #define vtkAxesActor_h
55 
56 #include "vtkRenderingAnnotationModule.h" // For export macro
57 #include "vtkProp3D.h"
58 
59 class vtkActor;
60 class vtkCaptionActor2D;
61 class vtkConeSource;
62 class vtkCylinderSource;
63 class vtkLineSource;
64 class vtkPolyData;
65 class vtkPropCollection;
66 class vtkProperty;
67 class vtkRenderer;
68 class vtkSphereSource;
69 
71 {
72 public:
73  static vtkAxesActor *New();
74  vtkTypeMacro(vtkAxesActor,vtkProp3D);
75  void PrintSelf(ostream& os, vtkIndent indent);
76 
80  virtual void GetActors(vtkPropCollection *);
81 
83 
84  virtual int RenderOpaqueGeometry(vtkViewport *viewport);
85  virtual int RenderTranslucentPolygonalGeometry(vtkViewport *viewport);
86  virtual int RenderOverlay(vtkViewport *viewport);
88 
90  virtual int HasTranslucentPolygonalGeometry();
91 
93  void ShallowCopy(vtkProp *prop);
94 
99 
101 
104  void GetBounds(double bounds[6]);
105  double *GetBounds();
107 
109  unsigned long int GetMTime();
110 
115  virtual unsigned long GetRedrawMTime();
116 
118 
119  void SetTotalLength( double v[3] )
120  { this->SetTotalLength( v[0], v[1], v[2] ); }
121  void SetTotalLength( double x, double y, double z );
122  vtkGetVectorMacro( TotalLength, double, 3 );
124 
126 
127  void SetNormalizedShaftLength( double v[3] )
128  { this->SetNormalizedShaftLength( v[0], v[1], v[2] ); }
129  void SetNormalizedShaftLength( double x, double y, double z );
130  vtkGetVectorMacro( NormalizedShaftLength, double, 3 );
132 
134 
136  void SetNormalizedTipLength( double v[3] )
137  { this->SetNormalizedTipLength( v[0], v[1], v[2] ); }
138  void SetNormalizedTipLength( double x, double y, double z );
139  vtkGetVectorMacro( NormalizedTipLength, double, 3 );
141 
143 
145  void SetNormalizedLabelPosition( double v[3] )
146  { this->SetNormalizedLabelPosition( v[0], v[1], v[2] ); }
147  void SetNormalizedLabelPosition( double x, double y, double z );
148  vtkGetVectorMacro( NormalizedLabelPosition, double, 3 );
150 
152 
153  vtkSetClampMacro(ConeResolution, int, 3, 128);
154  vtkGetMacro(ConeResolution, int);
155  vtkSetClampMacro(SphereResolution, int, 3, 128);
156  vtkGetMacro(SphereResolution, int);
157  vtkSetClampMacro(CylinderResolution, int, 3, 128);
158  vtkGetMacro(CylinderResolution, int);
160 
162 
163  vtkSetClampMacro(ConeRadius, double, 0, VTK_FLOAT_MAX);
164  vtkGetMacro(ConeRadius, double);
165  vtkSetClampMacro(SphereRadius, double, 0, VTK_FLOAT_MAX);
166  vtkGetMacro(SphereRadius, double);
167  vtkSetClampMacro(CylinderRadius, double, 0, VTK_FLOAT_MAX);
168  vtkGetMacro(CylinderRadius, double);
170 
172 
174  void SetShaftType( int type );
176  { this->SetShaftType( vtkAxesActor::CYLINDER_SHAFT ); }
178  { this->SetShaftType( vtkAxesActor::LINE_SHAFT ); }
180  { this->SetShaftType( vtkAxesActor::USER_DEFINED_SHAFT ); }
181  vtkGetMacro(ShaftType, int);
183 
185 
186  void SetTipType( int type );
188  { this->SetTipType( vtkAxesActor::CONE_TIP ); }
190  { this->SetTipType( vtkAxesActor::SPHERE_TIP ); }
192  { this->SetTipType( vtkAxesActor::USER_DEFINED_TIP ); }
193  vtkGetMacro(TipType, int);
195 
197 
198  void SetUserDefinedTip( vtkPolyData * );
199  vtkGetObjectMacro( UserDefinedTip, vtkPolyData );
201 
203 
204  void SetUserDefinedShaft( vtkPolyData * );
205  vtkGetObjectMacro( UserDefinedShaft, vtkPolyData );
207 
209 
210  vtkProperty *GetXAxisTipProperty();
211  vtkProperty *GetYAxisTipProperty();
212  vtkProperty *GetZAxisTipProperty();
214 
216 
217  vtkProperty *GetXAxisShaftProperty();
218  vtkProperty *GetYAxisShaftProperty();
219  vtkProperty *GetZAxisShaftProperty();
221 
223 
226  {return this->XAxisLabel;}
228  {return this->YAxisLabel;}
230  {return this->ZAxisLabel;}
232 
234 
235  vtkSetStringMacro( XAxisLabelText );
236  vtkGetStringMacro( XAxisLabelText );
237  vtkSetStringMacro( YAxisLabelText );
238  vtkGetStringMacro( YAxisLabelText );
239  vtkSetStringMacro( ZAxisLabelText );
240  vtkGetStringMacro( ZAxisLabelText );
242 
244 
245  vtkSetMacro(AxisLabels, int);
246  vtkGetMacro(AxisLabels, int);
247  vtkBooleanMacro(AxisLabels, int);
249 
250 //BTX
251  enum
252  {
255  USER_DEFINED_SHAFT
256  };
257 
258  enum
259  {
262  USER_DEFINED_TIP
263  };
264 //ETX
265 
266 protected:
267  vtkAxesActor();
268  ~vtkAxesActor();
269 
274 
278 
282 
283  void UpdateProps();
284 
285  double TotalLength[3];
286  double NormalizedShaftLength[3];
287  double NormalizedTipLength[3];
288  double NormalizedLabelPosition[3];
289 
291  int TipType;
292 
295 
299 
303 
305 
306 
310 
311  double ConeRadius;
312  double SphereRadius;
314 
315 private:
316  vtkAxesActor(const vtkAxesActor&); // Not implemented.
317  void operator=(const vtkAxesActor&); // Not implemented.
318 };
319 
320 #endif
321 
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:52
vtkCaptionActor2D * GetXAxisCaptionActor2D()
Definition: vtkAxesActor.h:225
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:50
void SetTotalLength(double v[3])
Definition: vtkAxesActor.h:119
vtkPolyData * UserDefinedTip
Definition: vtkAxesActor.h:293
generate a cylinder centered at origin
abstract specification for Viewports
Definition: vtkViewport.h:46
represent surface properties of a geometric object
Definition: vtkProperty.h:63
virtual int RenderOpaqueGeometry(vtkViewport *)
Definition: vtkProp.h:198
virtual int HasTranslucentPolygonalGeometry()
Definition: vtkProp.h:262
virtual int RenderOverlay(vtkViewport *)
Definition: vtkProp.h:204
vtkCaptionActor2D * GetYAxisCaptionActor2D()
Definition: vtkAxesActor.h:227
vtkCaptionActor2D * GetZAxisCaptionActor2D()
Definition: vtkAxesActor.h:229
int CylinderResolution
Definition: vtkAxesActor.h:309
a 3D axes representation
Definition: vtkAxesActor.h:70
char * ZAxisLabelText
Definition: vtkAxesActor.h:298
abstract specification for renderers
Definition: vtkRenderer.h:63
vtkLineSource * LineSource
Definition: vtkAxesActor.h:271
generate polygonal cone
Definition: vtkConeSource.h:43
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:42
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:83
vtkSphereSource * SphereSource
Definition: vtkAxesActor.h:273
#define VTKRENDERINGANNOTATION_EXPORT
a list of Props
virtual void ReleaseGraphicsResources(vtkWindow *)
Definition: vtkProp.h:270
window superclass for vtkRenderWindow
Definition: vtkWindow.h:36
create a polygonal sphere centered at the origin
#define VTK_FLOAT_MAX
Definition: vtkType.h:140
char * XAxisLabelText
Definition: vtkAxesActor.h:296
void ShallowCopy(vtkProp *prop)
vtkActor * ZAxisShaft
Definition: vtkAxesActor.h:277
a simple class to control print indentation
Definition: vtkIndent.h:38
void PrintSelf(ostream &os, vtkIndent indent)
vtkCaptionActor2D * ZAxisLabel
Definition: vtkAxesActor.h:302
vtkConeSource * ConeSource
Definition: vtkAxesActor.h:272
vtkActor * XAxisTip
Definition: vtkAxesActor.h:279
virtual unsigned long GetRedrawMTime()
Definition: vtkProp.h:103
vtkCaptionActor2D * YAxisLabel
Definition: vtkAxesActor.h:301
vtkActor * ZAxisTip
Definition: vtkAxesActor.h:281
double SphereRadius
Definition: vtkAxesActor.h:312
create a line defined by two end points
Definition: vtkLineSource.h:41
void SetShaftTypeToUserDefined()
Definition: vtkAxesActor.h:179
vtkActor * YAxisTip
Definition: vtkAxesActor.h:280
void SetShaftTypeToLine()
Definition: vtkAxesActor.h:177
double ConeRadius
Definition: vtkAxesActor.h:311
vtkCylinderSource * CylinderSource
Definition: vtkAxesActor.h:270
vtkActor * YAxisShaft
Definition: vtkAxesActor.h:276
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Definition: vtkProp.h:200
void SetTipTypeToCone()
Definition: vtkAxesActor.h:187
virtual double * GetBounds()=0
vtkActor * XAxisShaft
Definition: vtkAxesActor.h:275
vtkCaptionActor2D * XAxisLabel
Definition: vtkAxesActor.h:300
draw text label associated with a point
void SetNormalizedLabelPosition(double v[3])
Definition: vtkAxesActor.h:145
static vtkObject * New()
char * YAxisLabelText
Definition: vtkAxesActor.h:297
void SetShaftTypeToCylinder()
Definition: vtkAxesActor.h:175
int SphereResolution
Definition: vtkAxesActor.h:308
void SetNormalizedTipLength(double v[3])
Definition: vtkAxesActor.h:136
double CylinderRadius
Definition: vtkAxesActor.h:313
vtkPolyData * UserDefinedShaft
Definition: vtkAxesActor.h:294
unsigned long int GetMTime()
virtual void GetActors(vtkPropCollection *)
Definition: vtkProp.h:62
void SetTipTypeToUserDefined()
Definition: vtkAxesActor.h:191
void SetTipTypeToSphere()
Definition: vtkAxesActor.h:189
void SetNormalizedShaftLength(double v[3])
Definition: vtkAxesActor.h:127