Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

vtkAxesActor.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkAxesActor.h,v $
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 "vtkProp3D.h"
00057 
00058 class vtkActor;
00059 class vtkCaptionActor2D;
00060 class vtkConeSource;
00061 class vtkCylinderSource;
00062 class vtkLineSource;
00063 class vtkPolyData;
00064 class vtkPropCollection;
00065 class vtkProperty;
00066 class vtkRenderer;
00067 class vtkSphereSource;
00068 
00069 class VTK_HYBRID_EXPORT vtkAxesActor : public vtkProp3D
00070 {
00071 public:
00072   static vtkAxesActor *New();
00073   vtkTypeRevisionMacro(vtkAxesActor,vtkProp3D);
00074   void PrintSelf(ostream& os, vtkIndent indent);
00075 
00079   virtual void GetActors(vtkPropCollection *);
00080 
00082 
00083   virtual int RenderOpaqueGeometry(vtkViewport *viewport);
00084   virtual int RenderTranslucentGeometry(vtkViewport *viewport);
00085   virtual int RenderOverlay(vtkViewport *viewport);
00087 
00089   void ShallowCopy(vtkProp *prop);
00090 
00094   void ReleaseGraphicsResources(vtkWindow *);
00095 
00097 
00100   void GetBounds(double bounds[6]);
00101   double *GetBounds();
00103 
00105   unsigned long int GetMTime();
00106   
00111   virtual unsigned long GetRedrawMTime();
00112 
00114 
00115   void SetTotalLength( double v[3] ) 
00116     { this->SetTotalLength( v[0], v[1], v[2] ); }
00117   void SetTotalLength( double x, double y, double z );
00118   vtkGetVectorMacro( TotalLength, double, 3 );
00120 
00122 
00123   void SetNormalizedShaftLength( double v[3] )
00124     { this->SetNormalizedShaftLength( v[0], v[1], v[2] ); }
00125   void SetNormalizedShaftLength( double x, double y, double z );
00126   vtkGetVectorMacro( NormalizedShaftLength, double, 3 );
00128 
00130 
00132   void SetNormalizedTipLength( double v[3] )
00133     { this->SetNormalizedTipLength( v[0], v[1], v[2] ); }
00134   void SetNormalizedTipLength( double x, double y, double z );
00135   vtkGetVectorMacro( NormalizedTipLength, double, 3 );
00137 
00139 
00141   void SetNormalizedLabelPosition( double v[3] )
00142     { this->SetNormalizedLabelPosition( v[0], v[1], v[2] ); }
00143   void SetNormalizedLabelPosition( double x, double y, double z );
00144   vtkGetVectorMacro( NormalizedLabelPosition, double, 3 );   
00146 
00148 
00149   vtkSetClampMacro(ConeResolution, int, 3, 128);
00150   vtkGetMacro(ConeResolution, int);
00151   vtkSetClampMacro(SphereResolution, int, 3, 128);
00152   vtkGetMacro(SphereResolution, int);
00153   vtkSetClampMacro(CylinderResolution, int, 3, 128);
00154   vtkGetMacro(CylinderResolution, int);
00156   
00158 
00159   vtkSetClampMacro(ConeRadius, double, 0, VTK_LARGE_FLOAT);
00160   vtkGetMacro(ConeRadius, double);
00161   vtkSetClampMacro(SphereRadius, double, 0, VTK_LARGE_FLOAT);
00162   vtkGetMacro(SphereRadius, double);
00163   vtkSetClampMacro(CylinderRadius, double, 0, VTK_LARGE_FLOAT);
00164   vtkGetMacro(CylinderRadius, double);
00166 
00168 
00170   void SetShaftType( int type );
00171   void SetShaftTypeToCylinder()
00172     { this->SetShaftType( vtkAxesActor::CYLINDER_SHAFT ); }
00173   void SetShaftTypeToLine()
00174     { this->SetShaftType( vtkAxesActor::LINE_SHAFT ); }
00175   void SetShaftTypeToUserDefined()
00176     { this->SetShaftType( vtkAxesActor::USER_DEFINED_SHAFT ); }
00177   vtkGetMacro(ShaftType, int);
00179 
00181 
00182   void SetTipType( int type );
00183   void SetTipTypeToCone()
00184     { this->SetTipType( vtkAxesActor::CONE_TIP ); }
00185   void SetTipTypeToSphere()
00186     { this->SetTipType( vtkAxesActor::SPHERE_TIP ); }
00187   void SetTipTypeToUserDefined()
00188     { this->SetTipType( vtkAxesActor::USER_DEFINED_TIP ); }
00189   vtkGetMacro(TipType, int);
00191 
00193 
00194   void SetUserDefinedTip( vtkPolyData * );
00195   vtkGetObjectMacro( UserDefinedTip, vtkPolyData );
00197 
00199 
00200   void SetUserDefinedShaft( vtkPolyData * );
00201   vtkGetObjectMacro( UserDefinedShaft, vtkPolyData );
00203 
00205 
00206   vtkProperty *GetXAxisTipProperty();
00207   vtkProperty *GetYAxisTipProperty();
00208   vtkProperty *GetZAxisTipProperty();
00210 
00212 
00213   vtkProperty *GetXAxisShaftProperty();
00214   vtkProperty *GetYAxisShaftProperty();
00215   vtkProperty *GetZAxisShaftProperty();
00217 
00219 
00221   vtkCaptionActor2D *GetXAxisCaptionActor2D()
00222     {return this->XAxisLabel;}
00223   vtkCaptionActor2D *GetYAxisCaptionActor2D()
00224     {return this->YAxisLabel;}
00225   vtkCaptionActor2D *GetZAxisCaptionActor2D()
00226     {return this->ZAxisLabel;}
00228 
00230 
00231   vtkSetStringMacro( XAxisLabelText );
00232   vtkGetStringMacro( XAxisLabelText );
00233   vtkSetStringMacro( YAxisLabelText );
00234   vtkGetStringMacro( YAxisLabelText );
00235   vtkSetStringMacro( ZAxisLabelText );
00236   vtkGetStringMacro( ZAxisLabelText );
00238 
00240 
00241   vtkSetMacro(AxisLabels, int);
00242   vtkGetMacro(AxisLabels, int);
00243   vtkBooleanMacro(AxisLabels, int);
00245 
00246 //BTX
00247   enum
00248   {
00249     CYLINDER_SHAFT,
00250     LINE_SHAFT,
00251     USER_DEFINED_SHAFT
00252   };
00253 
00254   enum
00255   {
00256     CONE_TIP,
00257     SPHERE_TIP,
00258     USER_DEFINED_TIP
00259   };  
00260 //ETX
00261 
00262 protected:
00263   vtkAxesActor();
00264   ~vtkAxesActor();
00265 
00266   vtkCylinderSource *CylinderSource;
00267   vtkLineSource     *LineSource;
00268   vtkConeSource     *ConeSource;
00269   vtkSphereSource   *SphereSource;
00270 
00271   vtkActor          *XAxisShaft;
00272   vtkActor          *YAxisShaft;
00273   vtkActor          *ZAxisShaft;
00274 
00275   vtkActor          *XAxisTip;
00276   vtkActor          *YAxisTip;
00277   vtkActor          *ZAxisTip;
00278 
00279   void               UpdateProps();
00280 
00281   double             TotalLength[3];
00282   double             NormalizedShaftLength[3];
00283   double             NormalizedTipLength[3];
00284   double             NormalizedLabelPosition[3];
00285 
00286   int                ShaftType;
00287   int                TipType;
00288 
00289   vtkPolyData       *UserDefinedTip;
00290   vtkPolyData       *UserDefinedShaft;
00291 
00292   char              *XAxisLabelText;
00293   char              *YAxisLabelText;
00294   char              *ZAxisLabelText;
00295 
00296   vtkCaptionActor2D *XAxisLabel;
00297   vtkCaptionActor2D *YAxisLabel;
00298   vtkCaptionActor2D *ZAxisLabel;
00299 
00300   int                AxisLabels;
00301 
00302 
00303   int                ConeResolution;
00304   int                SphereResolution;
00305   int                CylinderResolution;
00306 
00307   double             ConeRadius;
00308   double             SphereRadius;
00309   double             CylinderRadius;
00310 
00311 private:
00312   vtkAxesActor(const vtkAxesActor&);  // Not implemented.
00313   void operator=(const vtkAxesActor&);  // Not implemented.
00314 };
00315 
00316 #endif
00317 

Generated on Mon Jan 21 23:07:27 2008 for VTK by  doxygen 1.4.3-20050530