Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

Rendering/vtkProp3D.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkProp3D.h,v $
00005   Language:  C++
00006 
00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
00008   All rights reserved.
00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00010 
00011      This software is distributed WITHOUT ANY WARRANTY; without even 
00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00013      PURPOSE.  See the above copyright notice for more information.
00014 
00015 =========================================================================*/
00049 #ifndef __vtkProp3D_h
00050 #define __vtkProp3D_h
00051 
00052 #include "vtkProp.h"
00053 
00054 class vtkRenderer;
00055 class vtkTransform;
00056 class vtkLinearTransform;
00057 
00058 class VTK_RENDERING_EXPORT vtkProp3D : public vtkProp
00059 {
00060 public:
00061   vtkTypeRevisionMacro(vtkProp3D,vtkProp);
00062   void PrintSelf(ostream& os, vtkIndent indent);
00063 
00065   void ShallowCopy(vtkProp *prop);
00066 
00068 
00069   virtual void SetPosition(float _arg1, float _arg2, float _arg3) 
00070     { 
00071       vtkDebugMacro(<< this->GetClassName() << " (" << this << 
00072       "): setting Position to (" << _arg1 << "," << _arg2 << "," << 
00073       _arg3 << ")"); 
00074       if ((this->Position[0] != _arg1)||
00075           (this->Position[1] != _arg2)||
00076           (this->Position[2] != _arg3)) 
00077         { 
00078         this->Position[0] = _arg1; 
00079         this->Position[1] = _arg2; 
00080         this->Position[2] = _arg3; 
00081         this->Modified(); 
00082         this->IsIdentity = 0;
00083         } 
00084     }; 
00085   virtual void SetPosition (float _arg[3]) 
00086     { 
00087       this->SetPosition (_arg[0], _arg[1], _arg[2]);
00088     } 
00089   vtkGetVectorMacro(Position,float,3);
00090   void AddPosition(float deltaPosition[3]);
00091   void AddPosition(float deltaX,float deltaY,float deltaZ);
00093 
00095 
00097   virtual void SetOrigin(float _arg1, float _arg2, float _arg3) 
00098     { 
00099       vtkDebugMacro(<< this->GetClassName() << " (" << this << 
00100       "): setting Origin to (" << _arg1 << "," << _arg2 << "," << 
00101       _arg3 << ")"); 
00102       if ((this->Origin[0] != _arg1)||
00103           (this->Origin[1] != _arg2)||
00104           (this->Origin[2] != _arg3)) 
00105         { 
00106         this->Origin[0] = _arg1; 
00107         this->Origin[1] = _arg2; 
00108         this->Origin[2] = _arg3; 
00109         this->Modified(); 
00110         this->IsIdentity = 0;
00111         } 
00112     }; 
00113   virtual void SetOrigin(float _arg[3]) 
00114     { 
00115       this->SetOrigin (_arg[0], _arg[1], _arg[2]);
00116     } 
00117   vtkGetVectorMacro(Origin,float,3);
00119 
00121 
00124   virtual void SetScale(float _arg1, float _arg2, float _arg3) 
00125     { 
00126       vtkDebugMacro(<< this->GetClassName() << " (" << this << 
00127       "): setting Scale to (" << _arg1 << "," << _arg2 << "," << 
00128       _arg3 << ")"); 
00129       if ((this->Scale[0] != _arg1)||
00130           (this->Scale[1] != _arg2)||
00131           (this->Scale[2] != _arg3)) 
00132         { 
00133         this->Scale[0] = _arg1; 
00134         this->Scale[1] = _arg2; 
00135         this->Scale[2] = _arg3; 
00136         this->Modified(); 
00137         this->IsIdentity = 0;
00138         } 
00139     }; 
00140   virtual void SetScale (float _arg[3]) 
00141     { 
00142       this->SetScale (_arg[0], _arg[1], _arg[2]);
00143     } 
00144   vtkGetVectorMacro(Scale,float,3);
00146 
00148   void SetScale(float s) {this->SetScale(s,s,s);};
00149 
00151 
00160   void SetUserTransform(vtkLinearTransform *transform);
00161   vtkGetObjectMacro(UserTransform,vtkLinearTransform);
00163 
00165 
00166   void SetUserMatrix(vtkMatrix4x4 *matrix);
00167   vtkMatrix4x4 *GetUserMatrix();
00169 
00171 
00174   virtual void GetMatrix(vtkMatrix4x4 *m);
00175   virtual void GetMatrix(double m[16]);
00177 
00182   void GetBounds(float bounds[6]);
00183   virtual float *GetBounds() = 0;
00185   
00187   float *GetCenter();
00188 
00190   float *GetXRange();
00191 
00193   float *GetYRange();
00194 
00196   float *GetZRange();
00197 
00199   float GetLength();
00200 
00206   void RotateX(float);
00207 
00213   void RotateY(float);
00214 
00220   void RotateZ(float);
00221 
00225   void RotateWXYZ(float,float,float,float);
00226 
00230   void SetOrientation(float,float,float);
00231 
00235   void SetOrientation(float a[3]);
00236 
00238 
00242   float *GetOrientation();
00243   void GetOrientation(float o[3]);
00245 
00247   float *GetOrientationWXYZ();
00248 
00252   void AddOrientation(float,float,float);
00253 
00257   void AddOrientation(float a[3]);
00258 
00267   void PokeMatrix(vtkMatrix4x4 *matrix);
00268 
00271   void InitPathTraversal();
00272 
00274   unsigned long int GetMTime();
00275 
00277   unsigned long int GetUserTransformMatrixMTime();
00278  
00280   virtual void ComputeMatrix();
00281 
00283 
00284   vtkMatrix4x4 *GetMatrix() 
00285     { 
00286       this->ComputeMatrix();
00287       return this->Matrix; 
00288     }
00290 
00292 
00293   vtkGetMacro(IsIdentity,int);
00295   
00296 protected:
00297   vtkProp3D();
00298   ~vtkProp3D();
00299 
00300   vtkLinearTransform *UserTransform;
00301   vtkMatrix4x4  *UserMatrix;
00302   vtkMatrix4x4  *Matrix;
00303   vtkTimeStamp  MatrixMTime;
00304   float         Origin[3];
00305   float         Position[3];
00306   float         Orientation[3];
00307   float         Scale[3];
00308   float         Center[3];
00309   vtkTransform  *Transform;
00310   float         Bounds[6];
00311   vtkProp3D     *CachedProp3D; //support the PokeMatrix() method
00312   int           IsIdentity;
00313 private:
00314   vtkProp3D(const vtkProp3D&);  // Not implemented.
00315   void operator=(const vtkProp3D&);  // Not implemented.
00316 };
00317 
00318 #endif
00319