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

dox/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 =========================================================================*/ 00036 #ifndef __vtkProp3D_h 00037 #define __vtkProp3D_h 00038 00039 #include "vtkProp.h" 00040 00041 class vtkRenderer; 00042 class vtkTransform; 00043 class vtkLinearTransform; 00044 00045 class VTK_RENDERING_EXPORT vtkProp3D : public vtkProp 00046 { 00047 public: 00048 vtkTypeRevisionMacro(vtkProp3D,vtkProp); 00049 void PrintSelf(ostream& os, vtkIndent indent); 00050 00052 void ShallowCopy(vtkProp *prop); 00053 00055 00056 virtual void SetPosition(float _arg1, float _arg2, float _arg3) 00057 { 00058 vtkDebugMacro(<< this->GetClassName() << " (" << this << 00059 "): setting Position to (" << _arg1 << "," << _arg2 << "," << 00060 _arg3 << ")"); 00061 if ((this->Position[0] != _arg1)|| 00062 (this->Position[1] != _arg2)|| 00063 (this->Position[2] != _arg3)) 00064 { 00065 this->Position[0] = _arg1; 00066 this->Position[1] = _arg2; 00067 this->Position[2] = _arg3; 00068 this->Modified(); 00069 this->IsIdentity = 0; 00070 } 00071 }; 00072 virtual void SetPosition (float _arg[3]) 00073 { 00074 this->SetPosition (_arg[0], _arg[1], _arg[2]); 00075 } 00076 vtkGetVectorMacro(Position,float,3); 00077 void AddPosition(float deltaPosition[3]); 00078 void AddPosition(float deltaX,float deltaY,float deltaZ); 00080 00082 00084 virtual void SetOrigin(float _arg1, float _arg2, float _arg3) 00085 { 00086 vtkDebugMacro(<< this->GetClassName() << " (" << this << 00087 "): setting Origin to (" << _arg1 << "," << _arg2 << "," << 00088 _arg3 << ")"); 00089 if ((this->Origin[0] != _arg1)|| 00090 (this->Origin[1] != _arg2)|| 00091 (this->Origin[2] != _arg3)) 00092 { 00093 this->Origin[0] = _arg1; 00094 this->Origin[1] = _arg2; 00095 this->Origin[2] = _arg3; 00096 this->Modified(); 00097 this->IsIdentity = 0; 00098 } 00099 }; 00100 virtual void SetOrigin(float _arg[3]) 00101 { 00102 this->SetOrigin (_arg[0], _arg[1], _arg[2]); 00103 } 00104 vtkGetVectorMacro(Origin,float,3); 00106 00108 00111 virtual void SetScale(float _arg1, float _arg2, float _arg3) 00112 { 00113 vtkDebugMacro(<< this->GetClassName() << " (" << this << 00114 "): setting Scale to (" << _arg1 << "," << _arg2 << "," << 00115 _arg3 << ")"); 00116 if ((this->Scale[0] != _arg1)|| 00117 (this->Scale[1] != _arg2)|| 00118 (this->Scale[2] != _arg3)) 00119 { 00120 this->Scale[0] = _arg1; 00121 this->Scale[1] = _arg2; 00122 this->Scale[2] = _arg3; 00123 this->Modified(); 00124 this->IsIdentity = 0; 00125 } 00126 }; 00127 virtual void SetScale (float _arg[3]) 00128 { 00129 this->SetScale (_arg[0], _arg[1], _arg[2]); 00130 } 00131 vtkGetVectorMacro(Scale,float,3); 00133 00135 void SetScale(float s) {this->SetScale(s,s,s);}; 00136 00138 00147 void SetUserTransform(vtkLinearTransform *transform); 00148 vtkGetObjectMacro(UserTransform,vtkLinearTransform); 00150 00152 00153 void SetUserMatrix(vtkMatrix4x4 *matrix); 00154 vtkMatrix4x4 *GetUserMatrix(); 00156 00158 00161 virtual void GetMatrix(vtkMatrix4x4 *m); 00162 virtual void GetMatrix(double m[16]); 00164 00169 void GetBounds(float bounds[6]); 00170 virtual float *GetBounds() = 0; 00172 00174 float *GetCenter(); 00175 00177 float *GetXRange(); 00178 00180 float *GetYRange(); 00181 00183 float *GetZRange(); 00184 00186 float GetLength(); 00187 00193 void RotateX(float); 00194 00200 void RotateY(float); 00201 00207 void RotateZ(float); 00208 00212 void RotateWXYZ(float,float,float,float); 00213 00217 void SetOrientation(float,float,float); 00218 00222 void SetOrientation(float a[3]); 00223 00225 00229 float *GetOrientation(); 00230 void GetOrientation(float o[3]); 00232 00234 float *GetOrientationWXYZ(); 00235 00239 void AddOrientation(float,float,float); 00240 00244 void AddOrientation(float a[3]); 00245 00254 void PokeMatrix(vtkMatrix4x4 *matrix); 00255 00258 void InitPathTraversal(); 00259 00261 unsigned long int GetMTime(); 00262 00264 unsigned long int GetUserTransformMatrixMTime(); 00265 00267 virtual void ComputeMatrix(); 00268 00270 00271 vtkMatrix4x4 *GetMatrix() 00272 { 00273 this->ComputeMatrix(); 00274 return this->Matrix; 00275 } 00277 00279 00280 vtkGetMacro(IsIdentity,int); 00282 00283 protected: 00284 vtkProp3D(); 00285 ~vtkProp3D(); 00286 00287 vtkLinearTransform *UserTransform; 00288 vtkMatrix4x4 *UserMatrix; 00289 vtkMatrix4x4 *Matrix; 00290 vtkTimeStamp MatrixMTime; 00291 float Origin[3]; 00292 float Position[3]; 00293 float Orientation[3]; 00294 float Scale[3]; 00295 float Center[3]; 00296 vtkTransform *Transform; 00297 float Bounds[6]; 00298 vtkProp3D *CachedProp3D; //support the PokeMatrix() method 00299 int IsIdentity; 00300 private: 00301 vtkProp3D(const vtkProp3D&); // Not implemented. 00302 void operator=(const vtkProp3D&); // Not implemented. 00303 }; 00304 00305 #endif 00306