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