Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class 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 =========================================================================*/
00048 #ifndef __vtkProp3D_h
00049 #define __vtkProp3D_h
00050 
00051 #include "vtkProp.h"
00052 
00053 class vtkRenderer;
00054 class vtkTransform;
00055 class vtkLinearTransform;
00056 
00057 class VTK_RENDERING_EXPORT vtkProp3D : public vtkProp
00058 {
00059 public:
00060   vtkTypeRevisionMacro(vtkProp3D,vtkProp);
00061   void PrintSelf(ostream& os, vtkIndent indent);
00062 
00064   void ShallowCopy(vtkProp *prop);
00065 
00067 
00068   virtual void SetPosition(float _arg1, float _arg2, float _arg3) 
00069     { 
00070       vtkDebugMacro(<< this->GetClassName() << " (" << this << 
00071       "): setting Position to (" << _arg1 << "," << _arg2 << "," << 
00072       _arg3 << ")"); 
00073       if ((this->Position[0] != _arg1)||
00074           (this->Position[1] != _arg2)||
00075           (this->Position[2] != _arg3)) 
00076         { 
00077         this->Position[0] = _arg1; 
00078         this->Position[1] = _arg2; 
00079         this->Position[2] = _arg3; 
00080         this->Modified(); 
00081         this->IsIdentity = 0;
00082         } 
00083     }; 
00084   virtual void SetPosition (float _arg[3]) 
00085     { 
00086       this->SetPosition (_arg[0], _arg[1], _arg[2]);
00087     } 
00088   vtkGetVectorMacro(Position,float,3);
00089   void AddPosition(float deltaPosition[3]);
00090   void AddPosition(float deltaX,float deltaY,float deltaZ);
00092 
00094 
00096   virtual void SetOrigin(float _arg1, float _arg2, float _arg3) 
00097     { 
00098       vtkDebugMacro(<< this->GetClassName() << " (" << this << 
00099       "): setting Origin to (" << _arg1 << "," << _arg2 << "," << 
00100       _arg3 << ")"); 
00101       if ((this->Origin[0] != _arg1)||
00102           (this->Origin[1] != _arg2)||
00103           (this->Origin[2] != _arg3)) 
00104         { 
00105         this->Origin[0] = _arg1; 
00106         this->Origin[1] = _arg2; 
00107         this->Origin[2] = _arg3; 
00108         this->Modified(); 
00109         this->IsIdentity = 0;
00110         } 
00111     }; 
00112   virtual void SetOrigin(float _arg[3]) 
00113     { 
00114       this->SetOrigin (_arg[0], _arg[1], _arg[2]);
00115     } 
00116   vtkGetVectorMacro(Origin,float,3);
00118 
00120 
00123   virtual void SetScale(float _arg1, float _arg2, float _arg3) 
00124     { 
00125       vtkDebugMacro(<< this->GetClassName() << " (" << this << 
00126       "): setting Scale to (" << _arg1 << "," << _arg2 << "," << 
00127       _arg3 << ")"); 
00128       if ((this->Scale[0] != _arg1)||
00129           (this->Scale[1] != _arg2)||
00130           (this->Scale[2] != _arg3)) 
00131         { 
00132         this->Scale[0] = _arg1; 
00133         this->Scale[1] = _arg2; 
00134         this->Scale[2] = _arg3; 
00135         this->Modified(); 
00136         this->IsIdentity = 0;
00137         } 
00138     }; 
00139   virtual void SetScale (float _arg[3]) 
00140     { 
00141       this->SetScale (_arg[0], _arg[1], _arg[2]);
00142     } 
00143   vtkGetVectorMacro(Scale,float,3);
00145 
00147   void SetScale(float s) {this->SetScale(s,s,s);};
00148 
00150 
00159   void SetUserTransform(vtkLinearTransform *transform);
00160   vtkGetObjectMacro(UserTransform,vtkLinearTransform);
00162 
00164 
00165   void SetUserMatrix(vtkMatrix4x4 *matrix);
00166   vtkMatrix4x4 *GetUserMatrix();
00168 
00170 
00173   virtual void GetMatrix(vtkMatrix4x4 *m);
00174   virtual void GetMatrix(double m[16]);
00176 
00181   void GetBounds(float bounds[6]);
00182   virtual float *GetBounds() = 0;
00184   
00186   float *GetCenter();
00187 
00189   float *GetXRange();
00190 
00192   float *GetYRange();
00193 
00195   float *GetZRange();
00196 
00198   float GetLength();
00199 
00205   void RotateX(float);
00206 
00212   void RotateY(float);
00213 
00219   void RotateZ(float);
00220 
00224   void RotateWXYZ(float,float,float,float);
00225 
00229   void SetOrientation(float,float,float);
00230 
00234   void SetOrientation(float a[3]);
00235 
00237 
00241   float *GetOrientation();
00242   void GetOrientation(float o[3]);
00244 
00246   float *GetOrientationWXYZ();
00247 
00251   void AddOrientation(float,float,float);
00252 
00256   void AddOrientation(float a[3]);
00257 
00266   void PokeMatrix(vtkMatrix4x4 *matrix);
00267 
00270   void InitPathTraversal();
00271 
00273   unsigned long int GetMTime();
00274 
00276   unsigned long int GetUserTransformMatrixMTime();
00277  
00279   virtual void ComputeMatrix();
00280 
00282 
00283   vtkMatrix4x4 *GetMatrix() 
00284     { 
00285       this->ComputeMatrix();
00286       return this->Matrix; 
00287     }
00289 
00291 
00292   vtkGetMacro(IsIdentity,int);
00294   
00295 protected:
00296   vtkProp3D();
00297   ~vtkProp3D();
00298 
00299   vtkLinearTransform *UserTransform;
00300   vtkMatrix4x4  *UserMatrix;
00301   vtkMatrix4x4  *Matrix;
00302   vtkTimeStamp  MatrixMTime;
00303   float         Origin[3];
00304   float         Position[3];
00305   float         Orientation[3];
00306   float         Scale[3];
00307   float         Center[3];
00308   vtkTransform  *Transform;
00309   float         Bounds[6];
00310   vtkProp3D     *CachedProp3D; //support the PokeMatrix() method
00311   int           IsIdentity;
00312 private:
00313   vtkProp3D(const vtkProp3D&);  // Not implemented.
00314   void operator=(const vtkProp3D&);  // Not implemented.
00315 };
00316 
00317 #endif
00318