Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

common/vtkUnstructuredGrid.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkUnstructuredGrid.h,v $
00005   Language:  C++
00006 
00007 
00008 Copyright (c) 1993-2001 Ken Martin, Will Schroeder, Bill Lorensen 
00009 All rights reserved.
00010 
00011 Redistribution and use in source and binary forms, with or without
00012 modification, are permitted provided that the following conditions are met:
00013 
00014  * Redistributions of source code must retain the above copyright notice,
00015    this list of conditions and the following disclaimer.
00016 
00017  * Redistributions in binary form must reproduce the above copyright notice,
00018    this list of conditions and the following disclaimer in the documentation
00019    and/or other materials provided with the distribution.
00020 
00021  * Neither name of Ken Martin, Will Schroeder, or Bill Lorensen nor the names
00022    of any contributors may be used to endorse or promote products derived
00023    from this software without specific prior written permission.
00024 
00025  * Modified source versions must be plainly marked as such, and must not be
00026    misrepresented as being the original software.
00027 
00028 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
00029 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00030 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00031 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
00032 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00033 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00034 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00035 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00036 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00037 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00038 
00039 =========================================================================*/
00055 #ifndef __vtkUnstructuredGrid_h
00056 #define __vtkUnstructuredGrid_h
00057 
00058 #include "vtkPointSet.h"
00059 #include "vtkIdList.h"
00060 #include "vtkCellArray.h"
00061 #include "vtkCellTypes.h"
00062 #include "vtkCellLinks.h"
00063 class vtkVertex;
00064 class vtkPolyVertex;
00065 class vtkLine;
00066 class vtkPolyLine;
00067 class vtkTriangle;
00068 class vtkTriangleStrip;
00069 class vtkPixel;
00070 class vtkQuad;
00071 class vtkPolygon;
00072 class vtkTetra;
00073 class vtkVoxel;
00074 class vtkHexahedron;
00075 class vtkWedge;
00076 class vtkPyramid;
00077 
00078 class VTK_EXPORT vtkUnstructuredGrid : public vtkPointSet {
00079 public:
00080   static vtkUnstructuredGrid *New();
00081 
00082   vtkTypeMacro(vtkUnstructuredGrid,vtkPointSet);
00083   void PrintSelf(ostream& os, vtkIndent indent);
00084 
00086   int GetDataObjectType() {return VTK_UNSTRUCTURED_GRID;};
00087   void Allocate(int numCells=1000, int extSize=1000);
00088   int InsertNextCell(int type, int npts, int *pts);
00089   int InsertNextCell(int type, vtkIdList *ptIds);
00090   void Reset();
00091   void SetCells(int *types, vtkCellArray *cells);
00092   vtkCellArray *GetCells() {return this->Connectivity;};
00093   vtkDataObject *MakeObject() {return vtkUnstructuredGrid::New();};
00094   void CopyStructure(vtkDataSet *ds);
00095   int GetNumberOfCells();
00096   vtkCell *GetCell(int cellId);
00097   void GetCell(int cellId, vtkGenericCell *cell);
00098   void GetCellBounds(int cellId, float bounds[6]);
00099   void GetCellPoints(int cellId, vtkIdList *ptIds);
00100   void GetPointCells(int ptId, vtkIdList *cellIds);
00101 
00102   int GetCellType(int cellId);
00103   void Squeeze();
00104   void Initialize();
00105   int GetMaxCellSize();
00106   void BuildLinks();
00107   vtkCellLinks *GetCellLinks() {return this->Links;};
00108   void GetCellPoints(int cellId, int& npts, int* &pts);
00109   void ReplaceCell(int cellId, int npts, int *pts);
00110   int InsertNextLinkedCell(int type, int npts, int *pts); 
00111   void RemoveReferenceToCell(int ptId, int cellId);
00112   void AddReferenceToCell(int ptId, int cellId);
00113   void ResizeCellList(int ptId, int size);
00114 
00118   virtual void GetCellNeighbors(int cellId, vtkIdList *ptIds, 
00119             vtkIdList *cellIds);
00120 
00124   void SetUpdateExtent(int piece, int numPieces, int ghostLevel);
00125   void SetUpdateExtent(int piece, int numPieces)
00126     {this->SetUpdateExtent(piece, numPieces, 0);}
00127   void GetUpdateExtent(int &piece, int &numPieces, int &ghostLevel);
00128 
00130   vtkGetVector6Macro( UpdateExtent, int );
00131 
00136   void SetUpdateExtent( int x1, int x2, int y1, int y2, int z1, int z2 )
00137     { this->vtkPointSet::SetUpdateExtent( x1, x2, y1, y2, z1, z2 ); };
00138   void SetUpdateExtent( int ext[6] )
00139     { this->vtkPointSet::SetUpdateExtent( ext ); };
00140 
00141 
00144   vtkGetMacro( Piece, int );
00145   vtkGetMacro( NumberOfPieces, int );
00146 
00148   vtkGetMacro( GhostLevel, int );
00149   
00155   unsigned long GetActualMemorySize();
00156     
00158   void ShallowCopy(vtkDataObject *src);  
00159   void DeepCopy(vtkDataObject *src);
00160 
00161 #ifndef VTK_REMOVE_LEGACY_CODE
00162 
00163   void GetCellPoints(int cellId, vtkIdList &ptIds)
00164     {VTK_LEGACY_METHOD(GetCellPoints,"3.2"); this->GetCellPoints(cellId, &ptIds);}
00165   void GetPointCells(int ptId, vtkIdList &cellIds)
00166     {VTK_LEGACY_METHOD(GetPointCells,"3.2"); this->GetPointCells(ptId, &cellIds);}
00167   int InsertNextCell(int type, vtkIdList &pts) 
00168     {VTK_LEGACY_METHOD(InsertNextCell,"3.2"); return this->InsertNextCell(type, &pts);}
00169 #endif
00170   
00171 protected:
00172   vtkUnstructuredGrid();
00173   ~vtkUnstructuredGrid();
00174   vtkUnstructuredGrid(const vtkUnstructuredGrid&) {};
00175   void operator=(const vtkUnstructuredGrid&) {};
00176 
00177   // used by GetCell method
00178   vtkVertex *Vertex;
00179   vtkPolyVertex *PolyVertex;
00180   vtkLine *Line;
00181   vtkPolyLine *PolyLine;
00182   vtkTriangle *Triangle;
00183   vtkTriangleStrip *TriangleStrip;
00184   vtkPixel *Pixel;
00185   vtkQuad *Quad;
00186   vtkPolygon *Polygon;
00187   vtkTetra *Tetra;
00188   vtkVoxel *Voxel;
00189   vtkHexahedron *Hexahedron;
00190   vtkWedge *Wedge;
00191   vtkPyramid *Pyramid;
00192   
00193   // points inherited
00194   // point data (i.e., scalars, vectors, normals, tcoords) inherited
00195   vtkCellTypes *Cells;
00196   vtkCellArray *Connectivity;
00197   vtkCellLinks *Links;
00198 
00199  private:
00200   // Hide these from the user and the compiler.
00201   
00203   void GetCellNeighbors(int cellId, vtkIdList& ptIds, vtkIdList& cellIds)
00204     {this->GetCellNeighbors(cellId, &ptIds, &cellIds);}
00205 };
00206 
00207 #endif
00208 
00209 
00210 
00211 
00212 
00213 
00214 

Generated on Wed Nov 21 12:26:54 2001 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001