Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

dox/Common/vtkCell.h

Go to the documentation of this file.
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkCell.h,v $ 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00039 #ifndef __vtkCell_h 00040 #define __vtkCell_h 00041 00042 #define VTK_CELL_SIZE 512 00043 #define VTK_TOL 1.e-05 // Tolerance for geometric calculation 00044 00045 #include "vtkObject.h" 00046 00047 #include "vtkIdList.h" // Needed for inline methods 00048 #include "vtkCellType.h" // Needed to define cell types 00049 00050 class vtkCellArray; 00051 class vtkCellData; 00052 class vtkDataArray; 00053 class vtkPointData; 00054 class vtkPointLocator; 00055 class vtkPoints; 00056 00057 class VTK_COMMON_EXPORT vtkCell : public vtkObject 00058 { 00059 public: 00060 vtkTypeRevisionMacro(vtkCell,vtkObject); 00061 void PrintSelf(ostream& os, vtkIndent indent); 00062 00065 void Initialize(int npts, vtkIdType *pts, vtkPoints *p); 00066 00070 virtual void ShallowCopy(vtkCell *c); 00071 00074 virtual void DeepCopy(vtkCell *c); 00075 00077 virtual int GetCellType() = 0; 00078 00080 virtual int GetCellDimension() = 0; 00081 00085 virtual int IsLinear() {return 1;} 00086 00088 00091 virtual int RequiresInitialization() {return 0;} 00092 virtual void Initialize() {} 00094 00098 virtual int IsExplicitCell() {return 0;} 00099 00101 vtkPoints *GetPoints() {return this->Points;} 00102 00104 int GetNumberOfPoints() {return this->PointIds->GetNumberOfIds();} 00105 00107 virtual int GetNumberOfEdges() = 0; 00108 00110 virtual int GetNumberOfFaces() = 0; 00111 00113 vtkIdList *GetPointIds() {return this->PointIds;} 00114 00116 vtkIdType GetPointId(int ptId) {return this->PointIds->GetId(ptId);} 00117 00119 virtual vtkCell *GetEdge(int edgeId) = 0; 00120 00122 virtual vtkCell *GetFace(int faceId) = 0; 00123 00129 virtual int CellBoundary(int subId, double pcoords[3], vtkIdList *pts) = 0; 00130 00132 00146 virtual int EvaluatePosition(double x[3], double* closestPoint, 00147 int& subId, double pcoords[3], 00148 double& dist2, double *weights) = 0; 00150 00152 00155 virtual void EvaluateLocation(int& subId, double pcoords[3], 00156 double x[3], double *weights) = 0; 00158 00160 00171 virtual void Contour(double value, vtkDataArray *cellScalars, 00172 vtkPointLocator *locator, vtkCellArray *verts, 00173 vtkCellArray *lines, vtkCellArray *polys, 00174 vtkPointData *inPd, vtkPointData *outPd, 00175 vtkCellData *inCd, vtkIdType cellId, 00176 vtkCellData *outCd) = 0; 00178 00180 00191 virtual void Clip(double value, vtkDataArray *cellScalars, 00192 vtkPointLocator *locator, vtkCellArray *connectivity, 00193 vtkPointData *inPd, vtkPointData *outPd, 00194 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd, 00195 int insideOut) = 0; 00197 00199 00202 virtual int IntersectWithLine(double p1[3], double p2[3], 00203 double tol, double& t, double x[3], 00204 double pcoords[3], int& subId) = 0; 00206 00214 virtual int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts) = 0; 00215 00217 00229 virtual void Derivatives(int subId, double pcoords[3], double *values, 00230 int dim, double *derivs) = 0; 00232 00233 00236 void GetBounds(double bounds[6]); 00237 00238 00241 double *GetBounds(); 00242 00243 00245 double GetLength2(); 00246 00247 00253 virtual int GetParametricCenter(double pcoords[3]); 00254 00255 00261 virtual double GetParametricDistance(double pcoords[3]); 00262 00263 00269 virtual int IsPrimaryCell() {return 1;} 00270 00271 00279 virtual double *GetParametricCoords(); 00280 00281 // left public for quick computational access 00282 vtkPoints *Points; 00283 vtkIdList *PointIds; 00284 00285 protected: 00286 vtkCell(); 00287 ~vtkCell(); 00288 00289 double Bounds[6]; 00290 00291 private: 00292 vtkCell(const vtkCell&); // Not implemented. 00293 void operator=(const vtkCell&); // Not implemented. 00294 }; 00295 00296 #endif 00297 00298