00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00027 #ifndef __vtkUnstructuredGrid_h
00028 #define __vtkUnstructuredGrid_h
00029
00030 #include "vtkPointSet.h"
00031
00032 class vtkCellArray;
00033 class vtkCellLinks;
00034 class vtkConvexPointSet;
00035 class vtkEmptyCell;
00036 class vtkHexahedron;
00037 class vtkIdList;
00038 class vtkIdTypeArray;
00039 class vtkLine;
00040 class vtkPixel;
00041 class vtkPolyLine;
00042 class vtkPolyVertex;
00043 class vtkPolygon;
00044 class vtkPyramid;
00045 class vtkPentagonalPrism;
00046 class vtkHexagonalPrism;
00047 class vtkQuad;
00048 class vtkQuadraticEdge;
00049 class vtkQuadraticHexahedron;
00050 class vtkQuadraticWedge;
00051 class vtkQuadraticPyramid;
00052 class vtkQuadraticQuad;
00053 class vtkQuadraticTetra;
00054 class vtkQuadraticTriangle;
00055 class vtkTetra;
00056 class vtkTriangle;
00057 class vtkTriangleStrip;
00058 class vtkUnsignedCharArray;
00059 class vtkVertex;
00060 class vtkVoxel;
00061 class vtkWedge;
00062 class vtkTriQuadraticHexahedron;
00063 class vtkQuadraticLinearWedge;
00064 class vtkQuadraticLinearQuad;
00065 class vtkBiQuadraticQuad;
00066 class vtkBiQuadraticQuadraticWedge;
00067 class vtkBiQuadraticQuadraticHexahedron;
00068 class vtkBiQuadraticTriangle;
00069 class vtkCubicLine;
00070
00071
00072 class VTK_FILTERING_EXPORT vtkUnstructuredGrid : public vtkPointSet
00073 {
00074 public:
00075 static vtkUnstructuredGrid *New();
00076
00077 vtkTypeRevisionMacro(vtkUnstructuredGrid,vtkPointSet);
00078 void PrintSelf(ostream& os, vtkIndent indent);
00079
00081
00082 int GetDataObjectType() {return VTK_UNSTRUCTURED_GRID;};
00083 virtual void Allocate(vtkIdType numCells=1000, int extSize=1000);
00085
00087
00089 vtkIdType InsertNextCell(int type, vtkIdType npts, vtkIdType *pts);
00090 vtkIdType InsertNextCell(int type, vtkIdList *ptIds);
00092
00093 void Reset();
00094 virtual void CopyStructure(vtkDataSet *ds);
00095 vtkIdType GetNumberOfCells();
00096 virtual vtkCell *GetCell(vtkIdType cellId);
00097 virtual void GetCell(vtkIdType cellId, vtkGenericCell *cell);
00098 virtual void GetCellBounds(vtkIdType cellId, double bounds[6]);
00099 virtual void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds);
00100 void GetPointCells(vtkIdType ptId, vtkIdList *cellIds);
00101
00102 int GetCellType(vtkIdType cellId);
00103 vtkUnsignedCharArray* GetCellTypesArray() { return this->Types; }
00104 vtkIdTypeArray* GetCellLocationsArray() { return this->Locations; }
00105 void Squeeze();
00106 void Initialize();
00107 int GetMaxCellSize();
00108 void BuildLinks();
00109 vtkCellLinks *GetCellLinks() {return this->Links;};
00110 virtual void GetCellPoints(vtkIdType cellId, vtkIdType& npts,
00111 vtkIdType* &pts);
00112
00114
00116 void SetCells(int type, vtkCellArray *cells);
00117 void SetCells(int *types, vtkCellArray *cells);
00118 void SetCells(vtkUnsignedCharArray *cellTypes, vtkIdTypeArray *cellLocations,
00119 vtkCellArray *cells);
00120 vtkCellArray *GetCells() {return this->Connectivity;};
00121 void ReplaceCell(vtkIdType cellId, int npts, vtkIdType *pts);
00122 int InsertNextLinkedCell(int type, int npts, vtkIdType *pts);
00123 void RemoveReferenceToCell(vtkIdType ptId, vtkIdType cellId);
00124 void AddReferenceToCell(vtkIdType ptId, vtkIdType cellId);
00125 void ResizeCellList(vtkIdType ptId, int size);
00127
00129
00132 virtual void GetCellNeighbors(vtkIdType cellId, vtkIdList *ptIds,
00133 vtkIdList *cellIds);
00135
00139 void GetUpdateExtent(int &piece, int &numPieces, int &ghostLevel);
00140
00142
00143 virtual int* GetUpdateExtent();
00144 virtual void GetUpdateExtent(int& x0, int& x1, int& y0, int& y1,
00145 int& z0, int& z1);
00146 virtual void GetUpdateExtent(int extent[6]);
00148
00150
00152 virtual int GetPiece();
00153 virtual int GetNumberOfPieces();
00155
00157 virtual int GetGhostLevel();
00158
00164 unsigned long GetActualMemorySize();
00165
00167
00168 virtual void ShallowCopy(vtkDataObject *src);
00169 virtual void DeepCopy(vtkDataObject *src);
00171
00175 void GetIdsOfCellsOfType(int type, vtkIdTypeArray *array);
00176
00178 int IsHomogeneous();
00179
00182 void RemoveGhostCells(int level);
00183
00184
00186
00187 static vtkUnstructuredGrid* GetData(vtkInformation* info);
00188 static vtkUnstructuredGrid* GetData(vtkInformationVector* v, int i=0);
00189
00191
00192 protected:
00193 vtkUnstructuredGrid();
00194 ~vtkUnstructuredGrid();
00195
00196
00197 vtkVertex *Vertex;
00198 vtkPolyVertex *PolyVertex;
00199 vtkLine *Line;
00200 vtkPolyLine *PolyLine;
00201 vtkTriangle *Triangle;
00202 vtkTriangleStrip *TriangleStrip;
00203 vtkPixel *Pixel;
00204 vtkQuad *Quad;
00205 vtkPolygon *Polygon;
00206 vtkTetra *Tetra;
00207 vtkVoxel *Voxel;
00208 vtkHexahedron *Hexahedron;
00209 vtkWedge *Wedge;
00210 vtkPyramid *Pyramid;
00211 vtkPentagonalPrism *PentagonalPrism;
00212 vtkHexagonalPrism *HexagonalPrism;
00213 vtkQuadraticEdge *QuadraticEdge;
00214 vtkQuadraticTriangle *QuadraticTriangle;
00215 vtkQuadraticQuad *QuadraticQuad;
00216 vtkQuadraticTetra *QuadraticTetra;
00217 vtkQuadraticHexahedron *QuadraticHexahedron;
00218 vtkQuadraticWedge *QuadraticWedge;
00219 vtkQuadraticPyramid *QuadraticPyramid;
00220 vtkQuadraticLinearQuad *QuadraticLinearQuad;
00221 vtkBiQuadraticQuad *BiQuadraticQuad;
00222 vtkTriQuadraticHexahedron *TriQuadraticHexahedron;
00223 vtkQuadraticLinearWedge *QuadraticLinearWedge;
00224 vtkBiQuadraticQuadraticWedge *BiQuadraticQuadraticWedge;
00225 vtkBiQuadraticQuadraticHexahedron *BiQuadraticQuadraticHexahedron;
00226 vtkBiQuadraticTriangle *BiQuadraticTriangle;
00227 vtkCubicLine *CubicLine;
00228 vtkConvexPointSet *ConvexPointSet;
00229 vtkEmptyCell *EmptyCell;
00230
00231
00232
00233 vtkCellArray *Connectivity;
00234 vtkCellLinks *Links;
00235 vtkUnsignedCharArray *Types;
00236 vtkIdTypeArray *Locations;
00237
00238 private:
00239 void Cleanup();
00240
00241
00242
00244 VTK_LEGACY(void GetCellNeighbors(vtkIdType cellId, vtkIdList& ptIds, vtkIdList& cellIds));
00245
00246 vtkUnstructuredGrid(const vtkUnstructuredGrid&);
00247 void operator=(const vtkUnstructuredGrid&);
00248 };
00249
00250 #endif
00251
00252
00253
00254
00255
00256
00257