VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkBridgeCell.h 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 =========================================================================*/ 00027 #ifndef vtkBridgeCell_h 00028 #define vtkBridgeCell_h 00029 00030 #include "vtkBridgeExport.h" //for module export macro 00031 #include "vtkGenericAdaptorCell.h" 00032 00033 class vtkCell; 00034 class vtkBridgeDataSet; 00035 class vtkBridgeCellIterator; 00036 00037 class VTKTESTINGGENERICBRIDGE_EXPORT vtkBridgeCell : public vtkGenericAdaptorCell 00038 { 00039 public: 00040 static vtkBridgeCell *New(); 00041 vtkTypeMacro(vtkBridgeCell,vtkGenericAdaptorCell); 00042 void PrintSelf(ostream& os, vtkIndent indent); 00043 00046 virtual vtkIdType GetId(); 00047 00049 virtual int IsInDataSet(); 00050 00054 virtual int GetType(); 00055 00058 virtual int GetDimension(); 00059 00061 virtual int GetGeometryOrder(); 00062 00065 int IsGeometryLinear(); 00066 00069 virtual int GetAttributeOrder(vtkGenericAttribute *a); 00070 00074 int IsAttributeLinear(vtkGenericAttribute *a); 00075 00077 virtual int IsPrimary(); 00078 00081 virtual int GetNumberOfPoints(); 00082 00091 virtual int GetNumberOfBoundaries(int dim=-1); 00092 00101 virtual int GetNumberOfDOFNodes(); 00102 00104 virtual void GetPointIterator(vtkGenericPointIterator *it); 00105 00107 virtual vtkGenericCellIterator *NewCellIterator(); 00108 00110 00114 virtual void GetBoundaryIterator(vtkGenericCellIterator *boundaries, 00115 int dim=-1); 00117 00119 00124 virtual int CountNeighbors(vtkGenericAdaptorCell *boundary); 00125 void CountEdgeNeighbors( int* sharing ); 00127 00129 00135 virtual void GetNeighbors(vtkGenericAdaptorCell *boundary, 00136 vtkGenericCellIterator *neighbors); 00138 00140 00144 virtual int FindClosestBoundary(int subId, 00145 double pcoords[3], 00146 vtkGenericCellIterator* &boundary); 00148 00150 00158 virtual int EvaluatePosition(double x[3], 00159 double *closestPoint, 00160 int &subId, 00161 double pcoords[3], 00162 double &dist2); 00164 00166 00170 virtual void EvaluateLocation(int subId, 00171 double pcoords[3], 00172 double x[3]); 00174 00176 00182 virtual void InterpolateTuple(vtkGenericAttribute *a, double pcoords[3], 00183 double *val); 00185 00187 00193 virtual void InterpolateTuple(vtkGenericAttributeCollection *c, double pcoords[3], 00194 double *val); 00195 #if 0 00196 00197 00198 00218 virtual void Contour(vtkContourValues *values, 00219 vtkImplicitFunction *f, 00220 vtkGenericAttributeCollection *attributes, 00221 vtkPointLocator *locator, 00222 vtkCellArray *verts, 00223 vtkCellArray *lines, 00224 vtkCellArray *polys, 00225 vtkPointData *outPd, 00226 vtkCellData *outCd); 00227 #endif 00228 #if 0 00229 00230 00231 00257 virtual void Clip(double value, 00258 vtkImplicitFunction *f, 00259 vtkGenericAttributeCollection *attributes, 00260 vtkGenericCellTessellator *tess, 00261 int insideOut, 00262 vtkPointLocator *locator, 00263 vtkCellArray *connectivity, 00264 vtkPointData *outPd, 00265 vtkCellData *outCd); 00266 #endif 00267 00268 00269 00275 virtual int IntersectWithLine(double p1[3], 00276 double p2[3], 00277 double tol, 00278 double &t, 00279 double x[3], 00280 double pcoords[3], 00281 int &subId); 00283 00285 00294 virtual void Derivatives(int subId, 00295 double pcoords[3], 00296 vtkGenericAttribute *attribute, 00297 double *derivs); 00299 00302 virtual void GetBounds(double bounds[6]); 00303 00307 virtual double *GetBounds(); 00308 00311 virtual double GetLength2(); 00312 00317 virtual int GetParametricCenter(double pcoords[3]); 00318 00324 virtual double GetParametricDistance(double pcoords[3]); 00325 00327 00335 virtual double *GetParametricCoords(); 00336 #if 0 00337 00338 00339 00348 virtual void Tessellate(vtkGenericAttributeCollection *attributes, 00349 vtkPoints *points, vtkCellArray* cellArray, 00350 vtkPointData *pd, vtkCellData* cd); 00351 #endif 00352 // For the internals of the tesselation algorithm (the hash table in particular) 00353 virtual int IsFaceOnBoundary(vtkIdType faceId); 00354 virtual int IsOnBoundary(); 00356 00358 00360 virtual void GetPointIds(vtkIdType *id); 00361 #if 0 00362 virtual void TriangulateFace(vtkGenericAttributeCollection *attributes, 00363 vtkGenericCellTessellator *tess, 00364 int index, 00365 vtkPoints *pts, vtkCellArray *cellArray, 00366 vtkPointData *pd, 00367 vtkCellData *cd ); 00368 #endif 00369 00370 00375 int *GetFaceArray(int faceId); 00376 00381 int GetNumberOfVerticesOnFace(int faceId); 00382 00387 int *GetEdgeArray(int edgeId); 00388 00390 00393 void Init(vtkBridgeDataSet *ds, 00394 vtkIdType cellid); 00396 00398 00400 void InitWithCell(vtkCell *c, 00401 vtkIdType id); 00403 00406 void DeepCopy(vtkBridgeCell *other); 00407 00408 protected: 00409 vtkBridgeCell(); 00410 virtual ~vtkBridgeCell(); 00411 00414 void AllocateWeights(); 00415 00417 void InterpolationFunctions(double pcoords[3], double *weights); 00418 00419 friend class vtkBridgeDataSet; 00420 friend class vtkBridgeAttribute; 00421 friend class vtkBridgeCellIterator; 00422 friend class vtkBridgeCellIteratorOnDataSet; 00423 friend class vtkBridgeCellIteratorOne; 00424 friend class vtkBridgeCellIteratorOnCellBoundaries; 00425 friend class vtkBridgePointIteratorOnCell; 00426 00427 vtkCell *Cell; 00428 vtkBridgeDataSet *DataSet; 00429 vtkIdType Id; // what does it mean for boundary cells? 00430 int BoolIsInDataSet; 00431 vtkBridgeCellIterator *InternalIterator; // used in Contour 00432 00433 double *Weights; // interpolation functions 00434 int WeightsCapacity; 00435 00436 private: 00437 vtkBridgeCell(const vtkBridgeCell&); // Not implemented. 00438 void operator=(const vtkBridgeCell&); // Not implemented. 00439 }; 00440 00441 #endif