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
00067 #ifndef __vtkCell_h
00068 #define __vtkCell_h
00069
00070 #define VTK_CELL_SIZE 512
00071 #define VTK_TOL 1.e-05 // Tolerance for geometric calculation
00072
00073 #include "vtkObject.h"
00074 #include "vtkPoints.h"
00075 #include "vtkIdList.h"
00076
00077
00078 #include "vtkCellType.h"
00079
00080 class vtkCellArray;
00081 class vtkPointLocator;
00082 class vtkPointData;
00083 class vtkCellData;
00084
00085 class VTK_COMMON_EXPORT vtkCell : public vtkObject
00086 {
00087 public:
00088 vtkTypeMacro(vtkCell,vtkObject);
00089 void PrintSelf(ostream& os, vtkIndent indent);
00090
00093 void Initialize(int npts, vtkIdType *pts, vtkPoints *p);
00094
00097 virtual vtkCell *MakeObject() = 0;
00098
00102 virtual void ShallowCopy(vtkCell *c);
00103
00106 virtual void DeepCopy(vtkCell *c);
00107
00109 virtual int GetCellType() = 0;
00110
00112 virtual int GetCellDimension() = 0;
00113
00115 virtual int GetInterpolationOrder() {return 1;};
00116
00118 vtkPoints *GetPoints() {return this->Points;};
00119
00121 int GetNumberOfPoints() {return this->PointIds->GetNumberOfIds();};
00122
00124 virtual int GetNumberOfEdges() = 0;
00125
00127 virtual int GetNumberOfFaces() = 0;
00128
00130 vtkIdList *GetPointIds() {return this->PointIds;};
00131
00133 vtkIdType GetPointId(int ptId) {return this->PointIds->GetId(ptId);};
00134
00136 virtual vtkCell *GetEdge(int edgeId) = 0;
00137
00139 virtual vtkCell *GetFace(int faceId) = 0;
00140
00146 virtual int CellBoundary(int subId, float pcoords[3], vtkIdList *pts) = 0;
00147
00149
00163 virtual int EvaluatePosition(float x[3], float* closestPoint,
00164 int& subId, float pcoords[3],
00165 float& dist2, float *weights) = 0;
00167
00169
00172 virtual void EvaluateLocation(int& subId, float pcoords[3],
00173 float x[3], float *weights) = 0;
00175
00177
00188 virtual void Contour(float value, vtkDataArray *cellScalars,
00189 vtkPointLocator *locator, vtkCellArray *verts,
00190 vtkCellArray *lines, vtkCellArray *polys,
00191 vtkPointData *inPd, vtkPointData *outPd,
00192 vtkCellData *inCd, vtkIdType cellId,
00193 vtkCellData *outCd) = 0;
00195
00197
00208 virtual void Clip(float value, vtkDataArray *cellScalars,
00209 vtkPointLocator *locator, vtkCellArray *connectivity,
00210 vtkPointData *inPd, vtkPointData *outPd,
00211 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd,
00212 int insideOut) = 0;
00214
00216
00219 virtual int IntersectWithLine(float p1[3], float p2[3], float tol, float& t,
00220 float x[3], float pcoords[3], int& subId) = 0;
00222
00230 virtual int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts) = 0;
00231
00233
00245 virtual void Derivatives(int subId, float pcoords[3], float *values,
00246 int dim, float *derivs) = 0;
00248
00249
00252 void GetBounds(float bounds[6]);
00253
00254
00257 float *GetBounds();
00258
00259
00261 float GetLength2();
00262
00263
00269 virtual int GetParametricCenter(float pcoords[3]);
00270
00271
00273
00280 static char HitBBox(float bounds[6], float origin[3], float dir[3],
00281 float coord[3], float& t);
00283
00284
00285
00286 vtkPoints *Points;
00287 vtkIdList *PointIds;
00288
00289 protected:
00290 vtkCell();
00291 ~vtkCell();
00292
00293 float Bounds[6];
00294 private:
00295 vtkCell(const vtkCell&);
00296 void operator=(const vtkCell&);
00297 };
00298
00299 #endif
00300
00301