00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00058 #ifndef __vtkUnstructuredGrid_h
00059 #define __vtkUnstructuredGrid_h
00060
00061 #include "vtkPointSet.h"
00062 #include "vtkIdList.h"
00063 #include "vtkCellArray.h"
00064 #include "vtkCellLinks.h"
00065 #include "vtkIntArray.h"
00066 #include "vtkUnsignedCharArray.h"
00067 class vtkVertex;
00068 class vtkPolyVertex;
00069 class vtkLine;
00070 class vtkPolyLine;
00071 class vtkTriangle;
00072 class vtkTriangleStrip;
00073 class vtkPixel;
00074 class vtkQuad;
00075 class vtkPolygon;
00076 class vtkTetra;
00077 class vtkVoxel;
00078 class vtkHexahedron;
00079 class vtkWedge;
00080 class vtkPyramid;
00081
00082 class VTK_COMMON_EXPORT vtkUnstructuredGrid : public vtkPointSet {
00083 private:
00084 vtkUnstructuredGrid(const vtkUnstructuredGrid&);
00085 void operator=(const vtkUnstructuredGrid&);
00086 public:
00087 static vtkUnstructuredGrid *New();
00088
00089 vtkTypeMacro(vtkUnstructuredGrid,vtkPointSet);
00090 void PrintSelf(ostream& os, vtkIndent indent);
00091
00093
00094 int GetDataObjectType() {return VTK_UNSTRUCTURED_GRID;};
00095 virtual void Allocate(vtkIdType numCells=1000, int extSize=1000);
00096 int InsertNextCell(int type, int npts, vtkIdType *pts);
00097 int InsertNextCell(int type, vtkIdList *ptIds);
00098 void Reset();
00099 void SetCells(int *types, vtkCellArray *cells);
00100 void SetCells(vtkUnsignedCharArray *cellTypes, vtkIntArray *cellLocations,
00101 vtkCellArray *cells);
00102 vtkCellArray *GetCells() {return this->Connectivity;};
00103 vtkDataObject *MakeObject() {return vtkUnstructuredGrid::New();};
00104 virtual void CopyStructure(vtkDataSet *ds);
00105 vtkIdType GetNumberOfCells();
00106 virtual vtkCell *GetCell(vtkIdType cellId);
00107 virtual void GetCell(vtkIdType cellId, vtkGenericCell *cell);
00108 virtual void GetCellBounds(vtkIdType cellId, float bounds[6]);
00109 virtual void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds);
00110 void GetPointCells(vtkIdType ptId, vtkIdList *cellIds);
00112
00113 int GetCellType(vtkIdType cellId);
00114 void Squeeze();
00115 void Initialize();
00116 int GetMaxCellSize();
00117 void BuildLinks();
00118 vtkCellLinks *GetCellLinks() {return this->Links;};
00119 virtual void GetCellPoints(vtkIdType cellId, vtkIdType& npts,
00120 vtkIdType* &pts);
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);
00126
00128
00131 virtual void GetCellNeighbors(vtkIdType cellId, vtkIdList *ptIds,
00132 vtkIdList *cellIds);
00134
00136
00139 void SetUpdateExtent(int piece, int numPieces, int ghostLevel);
00140 void SetUpdateExtent(int piece, int numPieces)
00141 {this->SetUpdateExtent(piece, numPieces, 0);}
00142 void GetUpdateExtent(int &piece, int &numPieces, int &ghostLevel);
00144
00146
00147 vtkGetVector6Macro( UpdateExtent, int );
00149
00151
00155 void SetUpdateExtent( int x1, int x2, int y1, int y2, int z1, int z2 )
00156 { this->vtkPointSet::SetUpdateExtent( x1, x2, y1, y2, z1, z2 ); };
00157 void SetUpdateExtent( int ext[6] )
00158 { this->vtkPointSet::SetUpdateExtent( ext ); };
00160
00161
00163
00165 vtkGetMacro( Piece, int );
00166 vtkGetMacro( NumberOfPieces, int );
00168
00170
00171 vtkGetMacro( GhostLevel, int );
00173
00179 unsigned long GetActualMemorySize();
00180
00182
00183 virtual void ShallowCopy(vtkDataObject *src);
00184 virtual void DeepCopy(vtkDataObject *src);
00186
00190 void GetListOfUniqueCellTypes(vtkUnsignedCharArray *uniqueTypes);
00191
00195 void GetIdsOfCellsOfType(int type, vtkIntArray *array);
00196
00198 int IsHomogeneous();
00199
00200 protected:
00201 vtkUnstructuredGrid();
00202 ~vtkUnstructuredGrid();
00203
00204
00205 vtkVertex *Vertex;
00206 vtkPolyVertex *PolyVertex;
00207 vtkLine *Line;
00208 vtkPolyLine *PolyLine;
00209 vtkTriangle *Triangle;
00210 vtkTriangleStrip *TriangleStrip;
00211 vtkPixel *Pixel;
00212 vtkQuad *Quad;
00213 vtkPolygon *Polygon;
00214 vtkTetra *Tetra;
00215 vtkVoxel *Voxel;
00216 vtkHexahedron *Hexahedron;
00217 vtkWedge *Wedge;
00218 vtkPyramid *Pyramid;
00219
00220
00221
00222 vtkCellArray *Connectivity;
00223 vtkCellLinks *Links;
00224 vtkUnsignedCharArray *Types;
00225 vtkIntArray *Locations;
00226
00227 private:
00228
00229
00231
00232 void GetCellNeighbors(vtkIdType cellId, vtkIdList& ptIds, vtkIdList& cellIds)
00233 {this->GetCellNeighbors(cellId, &ptIds, &cellIds);}
00235 };
00236
00237 #endif
00238
00239
00240
00241
00242
00243
00244