Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | 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 =========================================================================*/
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_FILTERING_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 
00216   virtual int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts) = 0;
00217 
00219 
00231   virtual void Derivatives(int subId, double pcoords[3], double *values, 
00232                            int dim, double *derivs) = 0;
00234 
00235 
00238   void GetBounds(double bounds[6]);
00239 
00240 
00243   double *GetBounds();
00244 
00245 
00247   double GetLength2();
00248 
00249 
00255   virtual int GetParametricCenter(double pcoords[3]);
00256 
00257 
00263   virtual double GetParametricDistance(double pcoords[3]);
00264 
00265 
00271   virtual int IsPrimaryCell() {return 1;}
00272 
00273 
00281   virtual double *GetParametricCoords();
00282 
00283   // left public for quick computational access
00284   vtkPoints *Points;
00285   vtkIdList *PointIds;
00286 
00287 protected:
00288   vtkCell();
00289   ~vtkCell();
00290 
00291   double Bounds[6];
00292 
00293 private:
00294   vtkCell(const vtkCell&);  // Not implemented.
00295   void operator=(const vtkCell&);  // Not implemented.
00296 };
00297 
00298 #endif
00299 
00300 

Generated on Mon Jan 21 23:07:18 2008 for VTK by  doxygen 1.4.3-20050530