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 "vtkProp3D.h"
57 
58 class vtkActor;
59 class vtkCaptionActor2D;
60 class vtkConeSource;
61 class vtkCylinderSource;
62 class vtkLineSource;
63 class vtkPolyData;
64 class vtkPropCollection;
65 class vtkProperty;
66 class vtkRenderer;
67 class vtkSphereSource;
68 
70 {
71 public:
72  static vtkAxesActor *New();
73  vtkTypeMacro(vtkAxesActor,vtkProp3D);
74  void PrintSelf(ostream& os, vtkIndent indent);
75 
79  virtual void GetActors(vtkPropCollection *);
80 
82 
83  virtual int RenderOpaqueGeometry(vtkViewport *viewport);
84  virtual int RenderTranslucentPolygonalGeometry(vtkViewport *viewport);
85  virtual int RenderOverlay(vtkViewport *viewport);
87 
89  virtual int HasTranslucentPolygonalGeometry();
90 
92  void ShallowCopy(vtkProp *prop);
93 
98 
100 
103  void GetBounds(double bounds[6]);
104  double *GetBounds();
106 
108  unsigned long int GetMTime();
109 
114  virtual unsigned long GetRedrawMTime();
115 
117 
118  void SetTotalLength( double v[3] )
119  { this->SetTotalLength( v[0], v[1], v[2] ); }
120  void SetTotalLength( double x, double y, double z );
121  vtkGetVectorMacro( TotalLength, double, 3 );
123 
125 
126  void SetNormalizedShaftLength( double v[3] )
127  { this->SetNormalizedShaftLength( v[0], v[1], v[2] ); }
128  void SetNormalizedShaftLength( double x, double y, double z );
129  vtkGetVectorMacro( NormalizedShaftLength, double, 3 );
131 
133 
135  void SetNormalizedTipLength( double v[3] )
136  { this->SetNormalizedTipLength( v[0], v[1], v[2] ); }
137  void SetNormalizedTipLength( double x, double y, double z );
138  vtkGetVectorMacro( NormalizedTipLength, double, 3 );
140 
142 
144  void SetNormalizedLabelPosition( double v[3] )
145  { this->SetNormalizedLabelPosition( v[0], v[1], v[2] ); }
146  void SetNormalizedLabelPosition( double x, double y, double z );
147  vtkGetVectorMacro( NormalizedLabelPosition, double, 3 );
149 
151 
152  vtkSetClampMacro(ConeResolution, int, 3, 128);
153  vtkGetMacro(ConeResolution, int);
154  vtkSetClampMacro(SphereResolution, int, 3, 128);
155  vtkGetMacro(SphereResolution, int);
156  vtkSetClampMacro(CylinderResolution, int, 3, 128);
157  vtkGetMacro(CylinderResolution, int);
159 
161 
162  vtkSetClampMacro(ConeRadius, double, 0, VTK_LARGE_FLOAT);
163  vtkGetMacro(ConeRadius, double);
164  vtkSetClampMacro(SphereRadius, double, 0, VTK_LARGE_FLOAT);
165  vtkGetMacro(SphereRadius, double);
166  vtkSetClampMacro(CylinderRadius, double, 0, VTK_LARGE_FLOAT);
167  vtkGetMacro(CylinderRadius, double);
169 
171 
173  void SetShaftType( int type );
175  { this->SetShaftType( vtkAxesActor::CYLINDER_SHAFT ); }
177  { this->SetShaftType( vtkAxesActor::LINE_SHAFT ); }
179  { this->SetShaftType( vtkAxesActor::USER_DEFINED_SHAFT ); }
180  vtkGetMacro(ShaftType, int);
182 
184 
185  void SetTipType( int type );
187  { this->SetTipType( vtkAxesActor::CONE_TIP ); }
189  { this->SetTipType( vtkAxesActor::SPHERE_TIP ); }
191  { this->SetTipType( vtkAxesActor::USER_DEFINED_TIP ); }
192  vtkGetMacro(TipType, int);
194 
196 
197  void SetUserDefinedTip( vtkPolyData * );
198  vtkGetObjectMacro( UserDefinedTip, vtkPolyData );
200 
202 
203  void SetUserDefinedShaft( vtkPolyData * );
204  vtkGetObjectMacro( UserDefinedShaft, vtkPolyData );
206 
208 
209  vtkProperty *GetXAxisTipProperty();
210  vtkProperty *GetYAxisTipProperty();
211  vtkProperty *GetZAxisTipProperty();
213 
215 
216  vtkProperty *GetXAxisShaftProperty();
217  vtkProperty *GetYAxisShaftProperty();
218  vtkProperty *GetZAxisShaftProperty();
220 
222 
225  {return this->XAxisLabel;}
227  {return this->YAxisLabel;}
229  {return this->ZAxisLabel;}
231 
233 
234  vtkSetStringMacro( XAxisLabelText );
235  vtkGetStringMacro( XAxisLabelText );
236  vtkSetStringMacro( YAxisLabelText );
237  vtkGetStringMacro( YAxisLabelText );
238  vtkSetStringMacro( ZAxisLabelText );
239  vtkGetStringMacro( ZAxisLabelText );
241 
243 
244  vtkSetMacro(AxisLabels, int);
245  vtkGetMacro(AxisLabels, int);
246  vtkBooleanMacro(AxisLabels, int);
248 
249 //BTX
250  enum
251  {
254  USER_DEFINED_SHAFT
255  };
256 
257  enum
258  {
261  USER_DEFINED_TIP
262  };
263 //ETX
264 
265 protected:
266  vtkAxesActor();
267  ~vtkAxesActor();
268 
273 
277 
281 
282  void UpdateProps();
283 
284  double TotalLength[3];
285  double NormalizedShaftLength[3];
286  double NormalizedTipLength[3];
287  double NormalizedLabelPosition[3];
288 
290  int TipType;
291 
294 
298 
302 
304 
305 
309 
310  double ConeRadius;
311  double SphereRadius;
313 
314 private:
315  vtkAxesActor(const vtkAxesActor&); // Not implemented.
316  void operator=(const vtkAxesActor&); // Not implemented.
317 };
318 
319 #endif
320 
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:49
vtkCaptionActor2D * GetXAxisCaptionActor2D()
Definition: vtkAxesActor.h:224
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:49
void SetTotalLength(double v[3])
Definition: vtkAxesActor.h:118
vtkPolyData * UserDefinedTip
Definition: vtkAxesActor.h:292
generate a cylinder centered at origin
abstract specification for Viewports
Definition: vtkViewport.h:45
represent surface properties of a geometric object
Definition: vtkProperty.h:61
virtual int RenderOpaqueGeometry(vtkViewport *)
Definition: vtkProp.h:171
virtual int HasTranslucentPolygonalGeometry()
Definition: vtkProp.h:230
virtual int RenderOverlay(vtkViewport *)
Definition: vtkProp.h:174
vtkCaptionActor2D * GetYAxisCaptionActor2D()
Definition: vtkAxesActor.h:226
vtkCaptionActor2D * GetZAxisCaptionActor2D()
Definition: vtkAxesActor.h:228
int CylinderResolution
Definition: vtkAxesActor.h:308
a 3D axes representation
Definition: vtkAxesActor.h:69
char * ZAxisLabelText
Definition: vtkAxesActor.h:297
abstract specification for renderers
Definition: vtkRenderer.h:69
vtkLineSource * LineSource
Definition: vtkAxesActor.h:270
generate polygonal cone
Definition: vtkConeSource.h:42
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:41
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:81
vtkSphereSource * SphereSource
Definition: vtkAxesActor.h:272
a list of Props
virtual void ReleaseGraphicsResources(vtkWindow *)
Definition: vtkProp.h:236
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
create a polygonal sphere centered at the origin
char * XAxisLabelText
Definition: vtkAxesActor.h:295
void ShallowCopy(vtkProp *prop)
vtkActor * ZAxisShaft
Definition: vtkAxesActor.h:276
a simple class to control print indentation
Definition: vtkIndent.h:37
void PrintSelf(ostream &os, vtkIndent indent)
vtkCaptionActor2D * ZAxisLabel
Definition: vtkAxesActor.h:301
vtkConeSource * ConeSource
Definition: vtkAxesActor.h:271
vtkActor * XAxisTip
Definition: vtkAxesActor.h:278
virtual unsigned long GetRedrawMTime()
Definition: vtkProp.h:99
vtkCaptionActor2D * YAxisLabel
Definition: vtkAxesActor.h:300
vtkActor * ZAxisTip
Definition: vtkAxesActor.h:280
double SphereRadius
Definition: vtkAxesActor.h:311
create a line defined by two end points
Definition: vtkLineSource.h:34
void SetShaftTypeToUserDefined()
Definition: vtkAxesActor.h:178
vtkActor * YAxisTip
Definition: vtkAxesActor.h:279
void SetShaftTypeToLine()
Definition: vtkAxesActor.h:176
double ConeRadius
Definition: vtkAxesActor.h:310
#define VTK_LARGE_FLOAT
Definition: vtkType.h:149
vtkCylinderSource * CylinderSource
Definition: vtkAxesActor.h:269
vtkActor * YAxisShaft
Definition: vtkAxesActor.h:275
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Definition: vtkProp.h:172
void SetTipTypeToCone()
Definition: vtkAxesActor.h:186
virtual double * GetBounds()=0
vtkActor * XAxisShaft
Definition: vtkAxesActor.h:274
vtkCaptionActor2D * XAxisLabel
Definition: vtkAxesActor.h:299
draw text label associated with a point
void SetNormalizedLabelPosition(double v[3])
Definition: vtkAxesActor.h:144
static vtkObject * New()
#define VTK_HYBRID_EXPORT
char * YAxisLabelText
Definition: vtkAxesActor.h:296
void SetShaftTypeToCylinder()
Definition: vtkAxesActor.h:174
int SphereResolution
Definition: vtkAxesActor.h:307
void SetNormalizedTipLength(double v[3])
Definition: vtkAxesActor.h:135
double CylinderRadius
Definition: vtkAxesActor.h:312
vtkPolyData * UserDefinedShaft
Definition: vtkAxesActor.h:293
unsigned long int GetMTime()
virtual void GetActors(vtkPropCollection *)
Definition: vtkProp.h:59
void SetTipTypeToUserDefined()
Definition: vtkAxesActor.h:190
void SetTipTypeToSphere()
Definition: vtkAxesActor.h:188
void SetNormalizedShaftLength(double v[3])
Definition: vtkAxesActor.h:126