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 
00008 Copyright (c) 1993-2001 Ken Martin, Will Schroeder, Bill Lorensen 
00009 All rights reserved.
00010 
00011 Redistribution and use in source and binary forms, with or without
00012 modification, are permitted provided that the following conditions are met:
00013 
00014  * Redistributions of source code must retain the above copyright notice,
00015    this list of conditions and the following disclaimer.
00016 
00017  * Redistributions in binary form must reproduce the above copyright notice,
00018    this list of conditions and the following disclaimer in the documentation
00019    and/or other materials provided with the distribution.
00020 
00021  * Neither name of Ken Martin, Will Schroeder, or Bill Lorensen nor the names
00022    of any contributors may be used to endorse or promote products derived
00023    from this software without specific prior written permission.
00024 
00025  * Modified source versions must be plainly marked as such, and must not be
00026    misrepresented as being the original software.
00027 
00028 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
00029 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00030 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00031 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
00032 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00033 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00034 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00035 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00036 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00037 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00038 
00039 =========================================================================*/
00060 #ifndef __vtkProp3D_h
00061 #define __vtkProp3D_h
00062 
00063 #include "vtkProp.h"
00064 #include "vtkTransform.h"
00065 
00066 class vtkRenderer;
00067 
00068 class VTK_RENDERING_EXPORT vtkProp3D : public vtkProp
00069 {
00070 public:
00071   vtkTypeMacro(vtkProp3D,vtkProp);
00072   void PrintSelf(ostream& os, vtkIndent indent);
00073 
00075   void ShallowCopy(vtkProp *prop);
00076 
00078 
00079   virtual void SetPosition(float _arg1, float _arg2, float _arg3) 
00080     { 
00081       vtkDebugMacro(<< this->GetClassName() << " (" << this << 
00082       "): setting Position to (" << _arg1 << "," << _arg2 << "," << 
00083       _arg3 << ")"); 
00084       if ((this->Position[0] != _arg1)||
00085           (this->Position[1] != _arg2)||
00086           (this->Position[2] != _arg3)) 
00087         { 
00088         this->Position[0] = _arg1; 
00089         this->Position[1] = _arg2; 
00090         this->Position[2] = _arg3; 
00091         this->Modified(); 
00092         this->IsIdentity = 0;
00093         } 
00094     }; 
00095   virtual void SetPosition (float _arg[3]) 
00096     { 
00097       this->SetPosition (_arg[0], _arg[1], _arg[2]);
00098     } 
00099   vtkGetVectorMacro(Position,float,3);
00100   void AddPosition(float deltaPosition[3]);
00101   void AddPosition(float deltaX,float deltaY,float deltaZ);
00103 
00105 
00107   virtual void SetOrigin(float _arg1, float _arg2, float _arg3) 
00108     { 
00109       vtkDebugMacro(<< this->GetClassName() << " (" << this << 
00110       "): setting Origin to (" << _arg1 << "," << _arg2 << "," << 
00111       _arg3 << ")"); 
00112       if ((this->Origin[0] != _arg1)||
00113           (this->Origin[1] != _arg2)||
00114           (this->Origin[2] != _arg3)) 
00115         { 
00116         this->Origin[0] = _arg1; 
00117         this->Origin[1] = _arg2; 
00118         this->Origin[2] = _arg3; 
00119         this->Modified(); 
00120         this->IsIdentity = 0;
00121         } 
00122     }; 
00123   virtual void SetOrigin(float _arg[3]) 
00124     { 
00125       this->SetOrigin (_arg[0], _arg[1], _arg[2]);
00126     } 
00127   vtkGetVectorMacro(Origin,float,3);
00129 
00131 
00134   virtual void SetScale(float _arg1, float _arg2, float _arg3) 
00135     { 
00136       vtkDebugMacro(<< this->GetClassName() << " (" << this << 
00137       "): setting Scale to (" << _arg1 << "," << _arg2 << "," << 
00138       _arg3 << ")"); 
00139       if ((this->Scale[0] != _arg1)||
00140           (this->Scale[1] != _arg2)||
00141           (this->Scale[2] != _arg3)) 
00142         { 
00143         this->Scale[0] = _arg1; 
00144         this->Scale[1] = _arg2; 
00145         this->Scale[2] = _arg3; 
00146         this->Modified(); 
00147         this->IsIdentity = 0;
00148         } 
00149     }; 
00150   virtual void SetScale (float _arg[3]) 
00151     { 
00152       this->SetScale (_arg[0], _arg[1], _arg[2]);
00153     } 
00154   vtkGetVectorMacro(Scale,float,3);
00156 
00158   void SetScale(float s) {this->SetScale(s,s,s);};
00159 
00161 
00170   void SetUserTransform(vtkLinearTransform *transform);
00171   vtkGetObjectMacro(UserTransform,vtkLinearTransform);
00173 
00175 
00176   void SetUserMatrix(vtkMatrix4x4 *matrix);
00177   vtkMatrix4x4 *GetUserMatrix() { 
00178     if (this->UserTransform) { this->UserTransform->Update(); };
00179     return this->UserMatrix; };
00181 
00183 
00186   virtual void GetMatrix(vtkMatrix4x4 *m);
00187   virtual void GetMatrix(double m[16]);
00189 
00194   void GetBounds(float bounds[6]);
00195   virtual float *GetBounds() = 0;
00197   
00199   float *GetCenter();
00200 
00202   float *GetXRange();
00203 
00205   float *GetYRange();
00206 
00208   float *GetZRange();
00209 
00211   float GetLength();
00212 
00218   void RotateX(float);
00219 
00225   void RotateY(float);
00226 
00232   void RotateZ(float);
00233 
00237   void RotateWXYZ(float,float,float,float);
00238 
00242   void SetOrientation(float,float,float);
00243 
00247   void SetOrientation(float a[3]);
00248 
00250 
00254   float *GetOrientation();
00255   void GetOrientation(float o[3]);
00257 
00259   float *GetOrientationWXYZ();
00260 
00264   void AddOrientation(float,float,float);
00265 
00269   void AddOrientation(float a[3]);
00270 
00279   void PokeMatrix(vtkMatrix4x4 *matrix);
00280 
00283   void InitPathTraversal();
00284 
00285   
00287   virtual void ComputeMatrix();
00288 
00290 
00291   vtkMatrix4x4 *GetMatrix() 
00292     { 
00293       this->ComputeMatrix();
00294       return this->Matrix; 
00295     }
00297 
00299 
00300   vtkGetMacro(IsIdentity,int);
00302   
00303 protected:
00304   vtkProp3D();
00305   ~vtkProp3D();
00306 
00307   vtkLinearTransform *UserTransform;
00308   vtkMatrix4x4  *UserMatrix;
00309   vtkMatrix4x4  *Matrix;
00310   vtkTimeStamp  MatrixMTime;
00311   float         Origin[3];
00312   float         Position[3];
00313   float         Orientation[3];
00314   float         Scale[3];
00315   float         Center[3];
00316   vtkTransform  *Transform;
00317   float         Bounds[6];
00318   vtkProp3D     *CachedProp3D; //support the PokeMatrix() method
00319   int           IsIdentity;
00320 private:
00321   vtkProp3D(const vtkProp3D&);  // Not implemented.
00322   void operator=(const vtkProp3D&);  // Not implemented.
00323 };
00324 
00325 #endif
00326 

Generated on Thu Mar 28 14:19:33 2002 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001