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

vtkUnstructuredGrid.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkUnstructuredGrid.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 =========================================================================*/
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 
00066 class VTK_FILTERING_EXPORT vtkUnstructuredGrid : public vtkPointSet 
00067 {
00068 public:
00069   static vtkUnstructuredGrid *New();
00070 
00071   vtkTypeRevisionMacro(vtkUnstructuredGrid,vtkPointSet);
00072   void PrintSelf(ostream& os, vtkIndent indent);
00073 
00075 
00076   int GetDataObjectType() {return VTK_UNSTRUCTURED_GRID;};
00077   virtual void Allocate(vtkIdType numCells=1000, int extSize=1000);
00079   
00081 
00083   vtkIdType InsertNextCell(int type, vtkIdType npts, vtkIdType *pts);
00084   vtkIdType InsertNextCell(int type, vtkIdList *ptIds);
00086   
00087   void Reset();
00088   virtual void CopyStructure(vtkDataSet *ds);
00089   vtkIdType GetNumberOfCells();
00090   virtual vtkCell *GetCell(vtkIdType cellId);
00091   virtual void GetCell(vtkIdType cellId, vtkGenericCell *cell);
00092   virtual void GetCellBounds(vtkIdType cellId, double bounds[6]);
00093   virtual void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds);
00094   void GetPointCells(vtkIdType ptId, vtkIdList *cellIds);
00095 
00096   int GetCellType(vtkIdType cellId);
00097   vtkUnsignedCharArray* GetCellTypesArray() { return this->Types; }
00098   vtkIdTypeArray* GetCellLocationsArray() { return this->Locations; }
00099   void Squeeze();
00100   void Initialize();
00101   int GetMaxCellSize();
00102   void BuildLinks();
00103   vtkCellLinks *GetCellLinks() {return this->Links;};
00104   virtual void GetCellPoints(vtkIdType cellId, vtkIdType& npts,
00105                              vtkIdType* &pts);
00106 
00108 
00110   void SetCells(int type, vtkCellArray *cells);
00111   void SetCells(int *types, vtkCellArray *cells);
00112   void SetCells(vtkUnsignedCharArray *cellTypes, vtkIdTypeArray *cellLocations, 
00113                 vtkCellArray *cells);
00114   vtkCellArray *GetCells() {return this->Connectivity;};
00115   void ReplaceCell(vtkIdType cellId, int npts, vtkIdType *pts);
00116   int InsertNextLinkedCell(int type, int npts, vtkIdType *pts);
00117   void RemoveReferenceToCell(vtkIdType ptId, vtkIdType cellId);
00118   void AddReferenceToCell(vtkIdType ptId, vtkIdType cellId);
00119   void ResizeCellList(vtkIdType ptId, int size);
00121 
00123 
00126   virtual void GetCellNeighbors(vtkIdType cellId, vtkIdList *ptIds, 
00127                                 vtkIdList *cellIds);
00129 
00133   void GetUpdateExtent(int &piece, int &numPieces, int &ghostLevel);
00134 
00136 
00137   virtual int* GetUpdateExtent();
00138   virtual void GetUpdateExtent(int& x0, int& x1, int& y0, int& y1,
00139                                int& z0, int& z1);
00140   virtual void GetUpdateExtent(int extent[6]);
00142 
00144 
00146   virtual int GetPiece();
00147   virtual int GetNumberOfPieces();
00149 
00151   virtual int GetGhostLevel();
00152   
00158   unsigned long GetActualMemorySize();
00159     
00161 
00162   virtual void ShallowCopy(vtkDataObject *src);  
00163   virtual void DeepCopy(vtkDataObject *src);
00165 
00169   void GetIdsOfCellsOfType(int type, vtkIdTypeArray *array);
00170 
00172   int IsHomogeneous();
00173 
00176   void RemoveGhostCells(int level);
00177 
00178   //BTX
00180 
00181   static vtkUnstructuredGrid* GetData(vtkInformation* info);
00182   static vtkUnstructuredGrid* GetData(vtkInformationVector* v, int i=0);
00183   //ETX
00185 
00186 protected:
00187   vtkUnstructuredGrid();
00188   ~vtkUnstructuredGrid();
00189 
00190   // used by GetCell method
00191   vtkVertex              *Vertex;
00192   vtkPolyVertex          *PolyVertex;
00193   vtkLine                *Line;
00194   vtkPolyLine            *PolyLine;
00195   vtkTriangle            *Triangle;
00196   vtkTriangleStrip       *TriangleStrip;
00197   vtkPixel               *Pixel;
00198   vtkQuad                *Quad;
00199   vtkPolygon             *Polygon;
00200   vtkTetra               *Tetra;
00201   vtkVoxel               *Voxel;
00202   vtkHexahedron          *Hexahedron;
00203   vtkWedge               *Wedge;
00204   vtkPyramid             *Pyramid;
00205   vtkPentagonalPrism     *PentagonalPrism;
00206   vtkHexagonalPrism      *HexagonalPrism;
00207   vtkQuadraticEdge       *QuadraticEdge;
00208   vtkQuadraticTriangle   *QuadraticTriangle;
00209   vtkQuadraticQuad       *QuadraticQuad;
00210   vtkQuadraticTetra      *QuadraticTetra;
00211   vtkQuadraticHexahedron *QuadraticHexahedron;
00212   vtkQuadraticWedge      *QuadraticWedge;
00213   vtkQuadraticPyramid    *QuadraticPyramid;
00214   vtkConvexPointSet      *ConvexPointSet;
00215   vtkEmptyCell           *EmptyCell;
00216   
00217   // points inherited
00218   // point data (i.e., scalars, vectors, normals, tcoords) inherited
00219   vtkCellArray *Connectivity;
00220   vtkCellLinks *Links;
00221   vtkUnsignedCharArray *Types;
00222   vtkIdTypeArray *Locations;
00223 
00224  private:
00225   // Hide these from the user and the compiler.
00226   
00228   VTK_LEGACY(void GetCellNeighbors(vtkIdType cellId, vtkIdList& ptIds, vtkIdList& cellIds));
00229 
00230   vtkUnstructuredGrid(const vtkUnstructuredGrid&);  // Not implemented.
00231   void operator=(const vtkUnstructuredGrid&);  // Not implemented.
00232 };
00233 
00234 #endif
00235 
00236 
00237 
00238 
00239 
00240 
00241 

Generated on Mon Jan 21 23:07:21 2008 for VTK by  doxygen 1.4.3-20050530