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

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 =========================================================================*/
00049 #ifndef __vtkCell_h
00050 #define __vtkCell_h
00051 
00052 #define VTK_CELL_SIZE 512
00053 #define VTK_TOL 1.e-05 // Tolerance for geometric calculation
00054 
00055 #include "vtkObject.h"
00056 
00057 #include "vtkIdList.h" // Needed for inline methods
00058 #include "vtkCellType.h" // Needed to define cell types
00059 
00060 class vtkCellArray;
00061 class vtkCellData;
00062 class vtkDataArray;
00063 class vtkPointData;
00064 class vtkPointLocator;
00065 class vtkPoints;
00066 
00067 class VTK_FILTERING_EXPORT vtkCell : public vtkObject
00068 {
00069 public:
00070   vtkTypeRevisionMacro(vtkCell,vtkObject);
00071   void PrintSelf(ostream& os, vtkIndent indent);
00072 
00075   void Initialize(int npts, vtkIdType *pts, vtkPoints *p);
00076 
00080   virtual void ShallowCopy(vtkCell *c);
00081 
00084   virtual void DeepCopy(vtkCell *c);
00085 
00087   virtual int GetCellType() = 0;
00088 
00090   virtual int GetCellDimension() = 0;
00091 
00095   virtual int IsLinear() {return 1;}
00096 
00098 
00101   virtual int RequiresInitialization() {return 0;}
00102   virtual void Initialize() {}
00104 
00108   virtual int IsExplicitCell() {return 0;}
00109 
00111   vtkPoints *GetPoints() {return this->Points;}
00112 
00114   int GetNumberOfPoints() {return this->PointIds->GetNumberOfIds();}
00115 
00117   virtual int GetNumberOfEdges() = 0;
00118 
00120   virtual int GetNumberOfFaces() = 0;
00121 
00123   vtkIdList *GetPointIds() {return this->PointIds;}
00124 
00126   vtkIdType GetPointId(int ptId) {return this->PointIds->GetId(ptId);}
00127 
00129   virtual vtkCell *GetEdge(int edgeId) = 0;
00130 
00132   virtual vtkCell *GetFace(int faceId) = 0;
00133 
00139   virtual int CellBoundary(int subId, double pcoords[3], vtkIdList *pts) = 0;
00140 
00142 
00156   virtual int EvaluatePosition(double x[3], double* closestPoint, 
00157                                int& subId, double pcoords[3], 
00158                                double& dist2, double *weights) = 0;
00160 
00162 
00165   virtual void EvaluateLocation(int& subId, double pcoords[3], 
00166                                 double x[3], double *weights) = 0;
00168 
00170 
00181   virtual void Contour(double value, vtkDataArray *cellScalars, 
00182                        vtkPointLocator *locator, vtkCellArray *verts, 
00183                        vtkCellArray *lines, vtkCellArray *polys, 
00184                        vtkPointData *inPd, vtkPointData *outPd,
00185                        vtkCellData *inCd, vtkIdType cellId,
00186                        vtkCellData *outCd) = 0;
00188 
00190 
00201   virtual void Clip(double value, vtkDataArray *cellScalars, 
00202                     vtkPointLocator *locator, vtkCellArray *connectivity,
00203                     vtkPointData *inPd, vtkPointData *outPd,
00204                     vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd, 
00205                     int insideOut) = 0;
00207 
00209 
00212   virtual int IntersectWithLine(double p1[3], double p2[3], 
00213                                 double tol, double& t, double x[3], 
00214                                 double pcoords[3], int& subId) = 0;
00216 
00224   virtual int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts) = 0;
00225 
00227 
00239   virtual void Derivatives(int subId, double pcoords[3], double *values, 
00240                            int dim, double *derivs) = 0;
00242 
00243 
00246   void GetBounds(double bounds[6]);
00247 
00248 
00251   double *GetBounds();
00252 
00253 
00255   double GetLength2();
00256 
00257 
00263   virtual int GetParametricCenter(double pcoords[3]);
00264 
00265 
00271   virtual double GetParametricDistance(double pcoords[3]);
00272 
00273 
00279   virtual int IsPrimaryCell() {return 1;}
00280 
00281 
00289   virtual double *GetParametricCoords();
00290 
00291   // left public for quick computational access
00292   vtkPoints *Points;
00293   vtkIdList *PointIds;
00294 
00295 protected:
00296   vtkCell();
00297   ~vtkCell();
00298 
00299   double Bounds[6];
00300 
00301 private:
00302   vtkCell(const vtkCell&);  // Not implemented.
00303   void operator=(const vtkCell&);  // Not implemented.
00304 };
00305 
00306 #endif
00307 
00308