00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
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;
00319 int IsIdentity;
00320 private:
00321 vtkProp3D(const vtkProp3D&);
00322 void operator=(const vtkProp3D&);
00323 };
00324
00325 #endif
00326