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 );
174  void SetShaftTypeToCylinder()
175  { this->SetShaftType( vtkAxesActor::CYLINDER_SHAFT ); }
176  void SetShaftTypeToLine()
177  { this->SetShaftType( vtkAxesActor::LINE_SHAFT ); }
178  void SetShaftTypeToUserDefined()
179  { this->SetShaftType( vtkAxesActor::USER_DEFINED_SHAFT ); }
180  vtkGetMacro(ShaftType, int);
182 
184 
185  void SetTipType( int type );
186  void SetTipTypeToCone()
187  { this->SetTipType( vtkAxesActor::CONE_TIP ); }
188  void SetTipTypeToSphere()
189  { this->SetTipType( vtkAxesActor::SPHERE_TIP ); }
190  void SetTipTypeToUserDefined()
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 
224  vtkCaptionActor2D *GetXAxisCaptionActor2D()
225  {return this->XAxisLabel;}
226  vtkCaptionActor2D *GetYAxisCaptionActor2D()
227  {return this->YAxisLabel;}
228  vtkCaptionActor2D *GetZAxisCaptionActor2D()
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