VTK
/Users/kitware/Dashboards/MyTests/VTK_BLD_Release_docs/Utilities/Doxygen/dox/Rendering/Annotation/vtkAxesActor.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkAxesActor.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00053 #ifndef vtkAxesActor_h
00054 #define vtkAxesActor_h
00055 
00056 #include "vtkRenderingAnnotationModule.h" // For export macro
00057 #include "vtkProp3D.h"
00058 
00059 class vtkActor;
00060 class vtkCaptionActor2D;
00061 class vtkConeSource;
00062 class vtkCylinderSource;
00063 class vtkLineSource;
00064 class vtkPolyData;
00065 class vtkPropCollection;
00066 class vtkProperty;
00067 class vtkRenderer;
00068 class vtkSphereSource;
00069 
00070 class VTKRENDERINGANNOTATION_EXPORT vtkAxesActor : public vtkProp3D
00071 {
00072 public:
00073   static vtkAxesActor *New();
00074   vtkTypeMacro(vtkAxesActor,vtkProp3D);
00075   void PrintSelf(ostream& os, vtkIndent indent);
00076 
00080   virtual void GetActors(vtkPropCollection *);
00081 
00083 
00084   virtual int RenderOpaqueGeometry(vtkViewport *viewport);
00085   virtual int RenderTranslucentPolygonalGeometry(vtkViewport *viewport);
00086   virtual int RenderOverlay(vtkViewport *viewport);
00088 
00090   virtual int HasTranslucentPolygonalGeometry();
00091 
00093   void ShallowCopy(vtkProp *prop);
00094 
00098   void ReleaseGraphicsResources(vtkWindow *);
00099 
00101 
00104   void GetBounds(double bounds[6]);
00105   double *GetBounds();
00107 
00109   unsigned long int GetMTime();
00110 
00115   virtual unsigned long GetRedrawMTime();
00116 
00118 
00119   void SetTotalLength( double v[3] )
00120     { this->SetTotalLength( v[0], v[1], v[2] ); }
00121   void SetTotalLength( double x, double y, double z );
00122   vtkGetVectorMacro( TotalLength, double, 3 );
00124 
00126 
00127   void SetNormalizedShaftLength( double v[3] )
00128     { this->SetNormalizedShaftLength( v[0], v[1], v[2] ); }
00129   void SetNormalizedShaftLength( double x, double y, double z );
00130   vtkGetVectorMacro( NormalizedShaftLength, double, 3 );
00132 
00134 
00136   void SetNormalizedTipLength( double v[3] )
00137     { this->SetNormalizedTipLength( v[0], v[1], v[2] ); }
00138   void SetNormalizedTipLength( double x, double y, double z );
00139   vtkGetVectorMacro( NormalizedTipLength, double, 3 );
00141 
00143 
00145   void SetNormalizedLabelPosition( double v[3] )
00146     { this->SetNormalizedLabelPosition( v[0], v[1], v[2] ); }
00147   void SetNormalizedLabelPosition( double x, double y, double z );
00148   vtkGetVectorMacro( NormalizedLabelPosition, double, 3 );
00150 
00152 
00153   vtkSetClampMacro(ConeResolution, int, 3, 128);
00154   vtkGetMacro(ConeResolution, int);
00155   vtkSetClampMacro(SphereResolution, int, 3, 128);
00156   vtkGetMacro(SphereResolution, int);
00157   vtkSetClampMacro(CylinderResolution, int, 3, 128);
00158   vtkGetMacro(CylinderResolution, int);
00160 
00162 
00163   vtkSetClampMacro(ConeRadius, double, 0, VTK_FLOAT_MAX);
00164   vtkGetMacro(ConeRadius, double);
00165   vtkSetClampMacro(SphereRadius, double, 0, VTK_FLOAT_MAX);
00166   vtkGetMacro(SphereRadius, double);
00167   vtkSetClampMacro(CylinderRadius, double, 0, VTK_FLOAT_MAX);
00168   vtkGetMacro(CylinderRadius, double);
00170 
00172 
00174   void SetShaftType( int type );
00175   void SetShaftTypeToCylinder()
00176     { this->SetShaftType( vtkAxesActor::CYLINDER_SHAFT ); }
00177   void SetShaftTypeToLine()
00178     { this->SetShaftType( vtkAxesActor::LINE_SHAFT ); }
00179   void SetShaftTypeToUserDefined()
00180     { this->SetShaftType( vtkAxesActor::USER_DEFINED_SHAFT ); }
00181   vtkGetMacro(ShaftType, int);
00183 
00185 
00186   void SetTipType( int type );
00187   void SetTipTypeToCone()
00188     { this->SetTipType( vtkAxesActor::CONE_TIP ); }
00189   void SetTipTypeToSphere()
00190     { this->SetTipType( vtkAxesActor::SPHERE_TIP ); }
00191   void SetTipTypeToUserDefined()
00192     { this->SetTipType( vtkAxesActor::USER_DEFINED_TIP ); }
00193   vtkGetMacro(TipType, int);
00195 
00197 
00198   void SetUserDefinedTip( vtkPolyData * );
00199   vtkGetObjectMacro( UserDefinedTip, vtkPolyData );
00201 
00203 
00204   void SetUserDefinedShaft( vtkPolyData * );
00205   vtkGetObjectMacro( UserDefinedShaft, vtkPolyData );
00207 
00209 
00210   vtkProperty *GetXAxisTipProperty();
00211   vtkProperty *GetYAxisTipProperty();
00212   vtkProperty *GetZAxisTipProperty();
00214 
00216 
00217   vtkProperty *GetXAxisShaftProperty();
00218   vtkProperty *GetYAxisShaftProperty();
00219   vtkProperty *GetZAxisShaftProperty();
00221 
00223 
00225   vtkCaptionActor2D *GetXAxisCaptionActor2D()
00226     {return this->XAxisLabel;}
00227   vtkCaptionActor2D *GetYAxisCaptionActor2D()
00228     {return this->YAxisLabel;}
00229   vtkCaptionActor2D *GetZAxisCaptionActor2D()
00230     {return this->ZAxisLabel;}
00232 
00234 
00235   vtkSetStringMacro( XAxisLabelText );
00236   vtkGetStringMacro( XAxisLabelText );
00237   vtkSetStringMacro( YAxisLabelText );
00238   vtkGetStringMacro( YAxisLabelText );
00239   vtkSetStringMacro( ZAxisLabelText );
00240   vtkGetStringMacro( ZAxisLabelText );
00242 
00244 
00245   vtkSetMacro(AxisLabels, int);
00246   vtkGetMacro(AxisLabels, int);
00247   vtkBooleanMacro(AxisLabels, int);
00249 
00250 //BTX
00251   enum
00252   {
00253     CYLINDER_SHAFT,
00254     LINE_SHAFT,
00255     USER_DEFINED_SHAFT
00256   };
00257 
00258   enum
00259   {
00260     CONE_TIP,
00261     SPHERE_TIP,
00262     USER_DEFINED_TIP
00263   };
00264 //ETX
00265 
00266 protected:
00267   vtkAxesActor();
00268   ~vtkAxesActor();
00269 
00270   vtkCylinderSource *CylinderSource;
00271   vtkLineSource     *LineSource;
00272   vtkConeSource     *ConeSource;
00273   vtkSphereSource   *SphereSource;
00274 
00275   vtkActor          *XAxisShaft;
00276   vtkActor          *YAxisShaft;
00277   vtkActor          *ZAxisShaft;
00278 
00279   vtkActor          *XAxisTip;
00280   vtkActor          *YAxisTip;
00281   vtkActor          *ZAxisTip;
00282 
00283   void               UpdateProps();
00284 
00285   double             TotalLength[3];
00286   double             NormalizedShaftLength[3];
00287   double             NormalizedTipLength[3];
00288   double             NormalizedLabelPosition[3];
00289 
00290   int                ShaftType;
00291   int                TipType;
00292 
00293   vtkPolyData       *UserDefinedTip;
00294   vtkPolyData       *UserDefinedShaft;
00295 
00296   char              *XAxisLabelText;
00297   char              *YAxisLabelText;
00298   char              *ZAxisLabelText;
00299 
00300   vtkCaptionActor2D *XAxisLabel;
00301   vtkCaptionActor2D *YAxisLabel;
00302   vtkCaptionActor2D *ZAxisLabel;
00303 
00304   int                AxisLabels;
00305 
00306 
00307   int                ConeResolution;
00308   int                SphereResolution;
00309   int                CylinderResolution;
00310 
00311   double             ConeRadius;
00312   double             SphereRadius;
00313   double             CylinderRadius;
00314 
00315 private:
00316   vtkAxesActor(const vtkAxesActor&);  // Not implemented.
00317   void operator=(const vtkAxesActor&);  // Not implemented.
00318 };
00319 
00320 #endif
00321