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

vtkProp3D.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkProp3D.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 =========================================================================*/
00044 #ifndef __vtkProp3D_h
00045 #define __vtkProp3D_h
00046 
00047 #include "vtkProp.h"
00048 
00049 class vtkRenderer;
00050 class vtkTransform;
00051 class vtkLinearTransform;
00052 
00053 class VTK_RENDERING_EXPORT vtkProp3D : public vtkProp
00054 {
00055 public:
00056   vtkTypeRevisionMacro(vtkProp3D,vtkProp);
00057   void PrintSelf(ostream& os, vtkIndent indent);
00058 
00060   void ShallowCopy(vtkProp *prop);
00061 
00063 
00064   virtual void SetPosition(double _arg1, double _arg2, double _arg3) 
00065     { 
00066       vtkDebugMacro(<< this->GetClassName() << " (" << this << 
00067       "): setting Position to (" << _arg1 << "," << _arg2 << "," << 
00068       _arg3 << ")"); 
00069       if ((this->Position[0] != _arg1)||
00070           (this->Position[1] != _arg2)||
00071           (this->Position[2] != _arg3)) 
00072         { 
00073         this->Position[0] = _arg1; 
00074         this->Position[1] = _arg2; 
00075         this->Position[2] = _arg3; 
00076         this->Modified(); 
00077         this->IsIdentity = 0;
00078         } 
00079     }; 
00080   virtual void SetPosition (double _arg[3]) 
00081     { 
00082       this->SetPosition (_arg[0], _arg[1], _arg[2]);
00083     } 
00084   vtkGetVectorMacro(Position,double,3);
00085   void AddPosition(double deltaPosition[3]);
00086   void AddPosition(double deltaX,double deltaY,double deltaZ);
00088 
00090 
00092   virtual void SetOrigin(double _arg1, double _arg2, double _arg3) 
00093     { 
00094       vtkDebugMacro(<< this->GetClassName() << " (" << this << 
00095       "): setting Origin to (" << _arg1 << "," << _arg2 << "," << 
00096       _arg3 << ")"); 
00097       if ((this->Origin[0] != _arg1)||
00098           (this->Origin[1] != _arg2)||
00099           (this->Origin[2] != _arg3)) 
00100         { 
00101         this->Origin[0] = _arg1; 
00102         this->Origin[1] = _arg2; 
00103         this->Origin[2] = _arg3; 
00104         this->Modified(); 
00105         this->IsIdentity = 0;
00106         } 
00107     }; 
00108   virtual void SetOrigin(double _arg[3]) 
00109     { 
00110       this->SetOrigin (_arg[0], _arg[1], _arg[2]);
00111     } 
00112   vtkGetVectorMacro(Origin,double,3);
00114 
00116 
00119   virtual void SetScale(double _arg1, double _arg2, double _arg3) 
00120     { 
00121       vtkDebugMacro(<< this->GetClassName() << " (" << this << 
00122       "): setting Scale to (" << _arg1 << "," << _arg2 << "," << 
00123       _arg3 << ")"); 
00124       if ((this->Scale[0] != _arg1)||
00125           (this->Scale[1] != _arg2)||
00126           (this->Scale[2] != _arg3)) 
00127         { 
00128         this->Scale[0] = _arg1; 
00129         this->Scale[1] = _arg2; 
00130         this->Scale[2] = _arg3; 
00131         this->Modified(); 
00132         this->IsIdentity = 0;
00133         } 
00134     }; 
00135   virtual void SetScale (double _arg[3]) 
00136     { 
00137       this->SetScale (_arg[0], _arg[1], _arg[2]);
00138     } 
00139   vtkGetVectorMacro(Scale,double,3);
00141 
00143   void SetScale(double s) {this->SetScale(s,s,s);};
00144 
00146 
00155   void SetUserTransform(vtkLinearTransform *transform);
00156   vtkGetObjectMacro(UserTransform,vtkLinearTransform);
00158 
00160 
00161   void SetUserMatrix(vtkMatrix4x4 *matrix);
00162   vtkMatrix4x4 *GetUserMatrix();
00164 
00166 
00169   virtual void GetMatrix(vtkMatrix4x4 *m);
00170   virtual void GetMatrix(double m[16]);
00172 
00177   void GetBounds(double bounds[6]);
00178   virtual double *GetBounds() = 0;
00180   
00182   double *GetCenter();
00183 
00185   double *GetXRange();
00186 
00188   double *GetYRange();
00189 
00191   double *GetZRange();
00192 
00194   double GetLength();
00195 
00201   void RotateX(double);
00202 
00208   void RotateY(double);
00209 
00215   void RotateZ(double);
00216 
00220   void RotateWXYZ(double,double,double,double);
00221 
00225   void SetOrientation(double,double,double);
00226 
00230   void SetOrientation(double a[3]);
00231 
00233 
00237   double *GetOrientation();
00238   void GetOrientation(double o[3]);
00240 
00242   double *GetOrientationWXYZ();
00243 
00247   void AddOrientation(double,double,double);
00248 
00252   void AddOrientation(double a[3]);
00253 
00262   void PokeMatrix(vtkMatrix4x4 *matrix);
00263 
00266   void InitPathTraversal();
00267 
00269   unsigned long int GetMTime();
00270 
00272   unsigned long int GetUserTransformMatrixMTime();
00273  
00275   virtual void ComputeMatrix();
00276 
00278 
00279   vtkMatrix4x4 *GetMatrix() 
00280     { 
00281       this->ComputeMatrix();
00282       return this->Matrix; 
00283     }
00285 
00287 
00288   vtkGetMacro(IsIdentity,int);
00290   
00291 protected:
00292   vtkProp3D();
00293   ~vtkProp3D();
00294 
00295   vtkLinearTransform *UserTransform;
00296   vtkMatrix4x4  *UserMatrix;
00297   vtkMatrix4x4  *Matrix;
00298   vtkTimeStamp  MatrixMTime;
00299   double         Origin[3];
00300   double         Position[3];
00301   double         Orientation[3];
00302   double         Scale[3];
00303   double         Center[3];
00304   vtkTransform  *Transform;
00305   double         Bounds[6];
00306   vtkProp3D     *CachedProp3D; //support the PokeMatrix() method
00307   int           IsIdentity;
00308 private:
00309   vtkProp3D(const vtkProp3D&);  // Not implemented.
00310   void operator=(const vtkProp3D&);  // Not implemented.
00311 };
00312 
00313 #endif
00314