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

vtkGenericAdaptorCell.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkGenericAdaptorCell.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 =========================================================================*/
00071 #ifndef __vtkGenericAdaptorCell_h
00072 #define __vtkGenericAdaptorCell_h
00073 
00074 
00075 #include "vtkObject.h"
00076 
00077 class vtkLine;
00078 class vtkTetra;
00079 class vtkPoints;
00080 class vtkVertex;
00081 class vtkTriangle;
00082 class vtkCellData;
00083 class vtkPointData;
00084 class vtkCellArray;
00085 class vtkDoubleArray;
00086 class vtkGenericCellIterator;
00087 class vtkPointLocator;
00088 class vtkContourValues;
00089 class vtkImplicitFunction;
00090 class vtkGenericCellTessellator;
00091 class vtkGenericAttributeCollection;
00092 class vtkGenericAttribute;
00093 
00094 
00095 class VTK_FILTERING_EXPORT vtkGenericAdaptorCell : public vtkObject
00096 {
00097 public:
00098   vtkTypeRevisionMacro(vtkGenericAdaptorCell,vtkObject);
00099   void PrintSelf(ostream& os, vtkIndent indent);
00100 
00103   virtual vtkIdType GetId() = 0;
00104 
00106   virtual int IsInDataSet()=0;
00107   
00112   virtual int GetType()=0;
00113 
00116   virtual int GetDimension() = 0;
00117 
00120   virtual int GetGeometryOrder()=0;
00121   
00124   int IsGeometryLinear();
00125   
00128   virtual int GetAttributeOrder(vtkGenericAttribute *a)=0;
00129   
00132   int IsAttributeLinear(vtkGenericAttribute *a);
00133   
00135   virtual int IsPrimary()=0;
00136 
00139   virtual int GetNumberOfPoints()=0;
00140 
00145   virtual int GetNumberOfBoundaries(int dim=-1)=0;
00146 
00152   virtual int GetNumberOfDOFNodes()=0;
00153   
00156   virtual vtkGenericCellIterator *NewCellIterator()=0;
00157  
00159 
00163   virtual void GetBoundaryIterator(vtkGenericCellIterator *boundaries,
00164                                    int dim=-1)=0;
00166   
00168 
00173   virtual int CountNeighbors(vtkGenericAdaptorCell *boundary)=0;
00174   virtual void CountEdgeNeighbors( int* sharing ) = 0;
00176 
00178 
00184   virtual void GetNeighbors(vtkGenericAdaptorCell *boundary,
00185                             vtkGenericCellIterator *neighbors)=0;
00187 
00189 
00193   virtual int FindClosestBoundary(int subId,
00194                                   double pcoords[3],
00195                                   vtkGenericCellIterator* &boundary)=0;
00197 
00199 
00207   virtual int EvaluatePosition(double x[3],
00208                                double *closestPoint, 
00209                                int &subId,
00210                                double pcoords[3], 
00211                                double &dist2)=0;
00213   
00215 
00220   virtual void EvaluateLocation(int subId,
00221                                 double pcoords[3],
00222                                 double x[3])=0;
00224   
00226 
00231   virtual void InterpolateTuple(vtkGenericAttribute *a, double pcoords[3],
00232                                 double *val) = 0;
00234 
00236 
00241   virtual void InterpolateTuple(vtkGenericAttributeCollection *c,
00242                                 double pcoords[3],
00243                                 double *val) = 0;
00245   
00247 
00267   virtual void Contour(vtkContourValues *values,
00268                        vtkImplicitFunction *f,
00269                        vtkGenericAttributeCollection *attributes,
00270                        vtkGenericCellTessellator *tess,
00271                        vtkPointLocator *locator,
00272                        vtkCellArray *verts,
00273                        vtkCellArray *lines,
00274                        vtkCellArray *polys,
00275                        vtkPointData *outPd,
00276                        vtkCellData *outCd);
00278 
00280 
00306   virtual void Clip(double value,
00307                     vtkImplicitFunction *f,
00308                     vtkGenericAttributeCollection *attributes,
00309                     vtkGenericCellTessellator *tess,
00310                     int insideOut,
00311                     vtkPointLocator *locator,
00312                     vtkCellArray *connectivity,
00313                     vtkPointData *outPd,
00314                     vtkCellData *outCd);
00316 
00318 
00324   virtual int IntersectWithLine(double p1[3],
00325                                 double p2[3], 
00326                                 double tol,
00327                                 double &t,
00328                                 double x[3], 
00329                                 double pcoords[3],
00330                                 int &subId)=0;
00332 
00334 
00343   virtual void Derivatives(int subId,
00344                            double pcoords[3],
00345                            vtkGenericAttribute *attribute,
00346                            double *derivs)=0;
00348 
00351   virtual void GetBounds(double bounds[6])=0;
00352 
00356   virtual double *GetBounds()=0;
00357 
00360   virtual double GetLength2()=0;
00361 
00366   virtual int GetParametricCenter(double pcoords[3])=0;
00367 
00374   virtual double GetParametricDistance(double pcoords[3])=0;
00375 
00384   virtual double *GetParametricCoords()=0;
00385   
00387 
00396   virtual void Tessellate(vtkGenericAttributeCollection *attributes, 
00397                           vtkGenericCellTessellator *tess,
00398                           vtkPoints *points, vtkCellArray* cellArray,  
00399                           vtkPointData *pd, vtkCellData* cd);
00401 
00402   // The following methods are for the internals of the tesselation algorithm
00403   // (the hash table in particular)
00404   
00407   virtual int IsFaceOnBoundary(vtkIdType faceId) = 0;
00408   
00411   virtual int IsOnBoundary() = 0;
00412 
00415   virtual void GetPointIds(vtkIdType *id) = 0;
00416 
00417   virtual void TriangulateFace(vtkGenericAttributeCollection *attributes,
00418                                vtkGenericCellTessellator *tess, int index, 
00419                                vtkPoints *pts, vtkCellArray *cellArray, 
00420                                vtkPointData *pd, vtkCellData *cd );
00421   
00428   virtual int *GetFaceArray(int faceId)=0;
00429   
00430 protected:
00431   vtkGenericAdaptorCell();
00432   virtual ~vtkGenericAdaptorCell();
00433 
00435   void Reset();
00436 
00437   //Internal tetra used for the contouring/clipping algoirthm
00438   vtkTetra       *Tetra;
00439   vtkTriangle    *Triangle;
00440   vtkLine        *Line;
00441   vtkVertex      *Vertex; //is it used ?
00442 
00443   // Internal locator when tessellating on a cell basis, this is different
00444   // from the main locator used in contour/clip filter, this locator is used for
00445   // points for
00446   // Be carefull the use of a vtkLocator in conjuction with the table fast
00447   // tessellator is very sensitive, we need to keep all the points we used
00448   vtkDoubleArray  *InternalPoints;
00449   vtkCellArray    *InternalCellArray;
00450   vtkDoubleArray  *InternalScalars;
00451   
00452   vtkDoubleArray  *PointDataScalars;
00453   
00454   //Attributes to mimic the vtk cell look and feel, internal use only
00455   vtkDoubleArray  *Scalars;
00456   vtkPointData    *PointData;
00457   vtkCellData     *CellData;
00458   
00459 private:
00460   vtkGenericAdaptorCell(const vtkGenericAdaptorCell&);  // Not implemented.
00461   void operator=(const vtkGenericAdaptorCell&);  // Not implemented.
00462 };
00463 
00464 #endif