00001
00002
00003 #ifndef __ssDepthSortPolyData_h
00004 #define __ssDepthSortPolyData_h
00005
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
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00066
00067
00068
00069
00070
00071 #include <vtkPolyDataToPolyDataFilter.h>
00072 #include <vtkCamera.h>
00073 #include <vtkProp3D.h>
00074 #include <vtkTransform.h>
00075
00076 class VTK_EXPORT ssDepthSortPolyData : public vtkPolyDataToPolyDataFilter
00077 {
00078 public:
00082 enum SortMethod
00083 {
00084 SS_DIRECTION_BACK_TO_FRONT = 0,
00085 SS_DIRECTION_FRONT_TO_BACK,
00086 SS_DIRECTION_SPECIFIED_VECTOR
00087 };
00088
00093 static ssDepthSortPolyData *New();
00094
00095 vtkTypeMacro(ssDepthSortPolyData, vtkPolyDataToPolyDataFilter);
00096 void PrintSelf(ostream& os, vtkIndent indent);
00097
00103 virtual void SetDirection(int arg)
00104 {
00105 this->Direction = arg;
00106 }
00107
00114 virtual int GetDirection() const
00115 {
00116 return this->Direction;
00117 }
00118
00122 void SetDirectionToFrontToBack()
00123 {
00124 this->SetDirection(SS_DIRECTION_FRONT_TO_BACK);
00125 };
00126
00130 void SetDirectionToBackToFront()
00131 {
00132 this->SetDirection(SS_DIRECTION_BACK_TO_FRONT);
00133 };
00134
00138 void SetDirectionToSpecifiedVector()
00139 {
00140 this->SetDirection(SS_DIRECTION_SPECIFIED_VECTOR);
00141 };
00142
00149 virtual void SetCamera(vtkCamera *arg)
00150 {
00151 this->Camera = arg;
00152 }
00153
00158 virtual vtkCamera *GetCamera() const
00159 {
00160 return this->Camera;
00161 }
00162
00170 void SetProp3D(vtkProp3D *arg);
00171 vtkProp3D *GetProp3D();
00172
00181 virtual void SetVector(double x, double y, double z)
00182 {
00183 this->Vector[0] = x;
00184 this->Vector[1] = y;
00185 this->Vector[2] = z;
00186 }
00187
00194 virtual void SetVector(double x[3])
00195 {
00196 this->Vector[0] = x[0];
00197 this->Vector[1] = x[1];
00198 this->Vector[2] = x[2];
00199 }
00200
00205 virtual const double *GetVector() const
00206 {
00207 return this->Vector;
00208 }
00209
00214 virtual void GetVector(double x[3])
00215 {
00216 x[0] = this->Vector[0];
00217 x[1] = this->Vector[1];
00218 x[2] = this->Vector[2];
00219 }
00220
00230 virtual void SetOrigin(double x, double y, double z)
00231 {
00232 this->Origin[0] = x;
00233 this->Origin[1] = y;
00234 this->Origin[2] = z;
00235 }
00236
00244 virtual void SetOrigin(double x[3])
00245 {
00246 this->Origin[0] = x[0];
00247 this->Origin[1] = x[1];
00248 this->Origin[2] = x[2];
00249 }
00250
00255 virtual const double *GetOrigin() const
00256 {
00257 return this->Origin;
00258 }
00259
00264 virtual void GetOrigin(double x[3])
00265 {
00266 x[0] = this->Origin[0];
00267 x[1] = this->Origin[1];
00268 x[2] = this->Origin[2];
00269 }
00270
00278 virtual void SetSortScalars(int arg)
00279 {
00280 this->SortScalars = arg;
00281 }
00282
00287 virtual int GetSortScalars()
00288 {
00289 return this->SortScalars;
00290 }
00291
00295 virtual void SortScalarsOn()
00296 {
00297 this->SetSortScalars(1);
00298 }
00299
00303 virtual void SortScalarsOff()
00304 {
00305 this->SetSortScalars(0);
00306 }
00307
00313 unsigned long GetMTime();
00314
00315 protected:
00316 ssDepthSortPolyData();
00317 ~ssDepthSortPolyData();
00318 ssDepthSortPolyData(const ssDepthSortPolyData&) {};
00319 void operator=(const ssDepthSortPolyData&) {};
00320
00324 void Execute();
00325
00331 void ComputeProjectionVector(double vector[3], double origin[3]);
00332
00333 int Direction;
00334 vtkCamera *Camera;
00335 vtkProp3D *Prop3D;
00336 vtkTransform *Transform;
00337 double Vector[3];
00338 double Origin[3];
00339 int SortScalars;
00340
00341 };
00342
00346 #endif