vtkUnstructuredGridBunykRayCastFunction.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00071 #ifndef __vtkUnstructuredGridBunykRayCastFunction_h
00072 #define __vtkUnstructuredGridBunykRayCastFunction_h
00073
00074 #include "vtkUnstructuredGridVolumeRayCastFunction.h"
00075
00076 class vtkRenderer;
00077 class vtkVolume;
00078 class vtkUnstructuredGridVolumeRayCastMapper;
00079 class vtkMatrix4x4;
00080 class vtkPiecewiseFunction;
00081 class vtkColorTransferFunction;
00082 class vtkUnstructuredGrid;
00083 class vtkIdList;
00084 class vtkDoubleArray;
00085 class vtkDataArray;
00086
00087
00088
00089
00090 #define VTK_BUNYKRCF_MAX_ARRAYS 10000
00091 #define VTK_BUNYKRCF_ARRAY_SIZE 10000
00092
00093 class VTK_RENDERING_EXPORT vtkUnstructuredGridBunykRayCastFunction : public vtkUnstructuredGridVolumeRayCastFunction
00094 {
00095 public:
00096 static vtkUnstructuredGridBunykRayCastFunction *New();
00097 vtkTypeRevisionMacro(vtkUnstructuredGridBunykRayCastFunction,vtkUnstructuredGridVolumeRayCastFunction);
00098 virtual void PrintSelf(ostream& os, vtkIndent indent);
00099
00100
00102 virtual void Initialize( vtkRenderer *ren, vtkVolume *vol );
00103
00105 virtual void Finalize();
00106
00107 virtual vtkUnstructuredGridVolumeRayCastIterator *NewIterator();
00108
00109
00110
00111 class Triangle {
00112 public:
00113 vtkIdType PointIndex[3];
00114 vtkIdType ReferredByTetra[2];
00115 double P1X, P1Y;
00116 double P2X, P2Y;
00117 double Denominator;
00118 double A, B, C, D;
00119 Triangle *Next;
00120 };
00121
00122
00123
00124 class Intersection {
00125 public:
00126 Triangle *TriPtr;
00127 double Z;
00128 Intersection *Next;
00129 };
00130
00132
00134 int InTriangle( double x, double y,
00135 Triangle *triPtr );
00137
00138
00140 double *GetPoints() {return this->Points;}
00141
00143
00144 vtkGetObjectMacro( ViewToWorldMatrix, vtkMatrix4x4 );
00146
00148
00149 vtkGetVectorMacro( ImageOrigin, int, 2 );
00151
00153
00154 vtkGetVectorMacro( ImageViewportSize, int, 2 );
00156
00158 Triangle **GetTetraTriangles () {return this->TetraTriangles;}
00159
00161 Intersection *GetIntersectionList( int x, int y ) { return this->Image[y*this->ImageSize[0] + x]; }
00162
00163
00164
00165 protected:
00166 vtkUnstructuredGridBunykRayCastFunction();
00167 ~vtkUnstructuredGridBunykRayCastFunction();
00168
00169
00170
00171 vtkRenderer *Renderer;
00172 vtkVolume *Volume;
00173 vtkUnstructuredGridVolumeRayCastMapper *Mapper;
00174 vtkDataArray *Scalars;
00175 int NumberOfComponents;
00176
00177
00178
00179
00180 int Valid;
00181
00182
00183 int NumberOfPoints;
00184 double *Points;
00185
00186
00187
00188 vtkMatrix4x4 *ViewToWorldMatrix;
00189
00190
00191
00192 Intersection **Image;
00193
00194
00195
00196 int ImageSize[2];
00197
00198
00199
00200
00201
00202
00203 int ImageOrigin[2];
00204
00205
00206 int ImageViewportSize[2];
00207
00208
00209
00210 vtkUnstructuredGrid *SavedTriangleListInput;
00211 vtkTimeStamp SavedTriangleListMTime;
00212
00213
00214
00215
00216
00217
00218
00219
00220 Triangle **TetraTriangles;
00221 Triangle *TriangleList;
00222
00223
00224
00225
00226
00227 int IsTriangleFrontFacing( Triangle *triPtr, vtkIdType tetraIndex );
00228
00229
00230
00231
00232 void ClearImage();
00233
00234
00235
00236
00237 Intersection *IntersectionBuffer[VTK_BUNYKRCF_MAX_ARRAYS];
00238 int IntersectionBufferCount[VTK_BUNYKRCF_MAX_ARRAYS];
00239
00240
00241
00242
00243 void *NewIntersection();
00244
00245
00246
00247
00248
00249 int CheckValidity(vtkRenderer *ren,
00250 vtkVolume *vol);
00251
00252
00253
00254 void TransformPoints();
00255
00256
00257
00258 void UpdateTriangleList();
00259
00260
00261
00262 void ComputeViewDependentInfo();
00263
00264
00265
00266
00267 void ComputePixelIntersections();
00268
00269
00270
00271 private:
00272 vtkUnstructuredGridBunykRayCastFunction(const vtkUnstructuredGridBunykRayCastFunction&);
00273 void operator=(const vtkUnstructuredGridBunykRayCastFunction&);
00274 };
00275
00276 #endif
00277
00278
00279
00280
00281
00282
00283