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

vtkEdgeTable.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkEdgeTable.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 =========================================================================*/
00041 #ifndef __vtkEdgeTable_h
00042 #define __vtkEdgeTable_h
00043 
00044 #include "vtkObject.h"
00045 
00046 class vtkIdList;
00047 class vtkPoints;
00048 class vtkVoidArray;
00049 
00050 class VTK_COMMON_EXPORT vtkEdgeTable : public vtkObject
00051 {
00052 public:
00054   static vtkEdgeTable *New();
00055 
00056   vtkTypeRevisionMacro(vtkEdgeTable,vtkObject);
00057   void PrintSelf(ostream& os, vtkIndent indent);
00058 
00060   void Initialize();
00061 
00074   int InitEdgeInsertion(vtkIdType numPoints, int storeAttributes=0);
00075 
00083   vtkIdType InsertEdge(vtkIdType p1, vtkIdType p2);
00084 
00091   void InsertEdge(vtkIdType p1, vtkIdType p2, vtkIdType attributeId);
00092 
00099   void InsertEdge(vtkIdType p1, vtkIdType p2, void* ptr);
00100 
00106   vtkIdType IsEdge(vtkIdType p1, vtkIdType p2);
00107 
00111   void IsEdge(vtkIdType p1, vtkIdType p2, void* &ptr);
00112 
00116   int InitPointInsertion(vtkPoints *newPts, vtkIdType estSize);
00117 
00119 
00122   int InsertUniquePoint(vtkIdType p1, vtkIdType p2, double x[3],
00123                         vtkIdType &ptId);
00125 
00127 
00128   vtkGetMacro(NumberOfEdges, vtkIdType);
00130 
00132   void InitTraversal();
00133 
00138   vtkIdType GetNextEdge(vtkIdType &p1, vtkIdType &p2);
00139 
00143   int GetNextEdge(vtkIdType &p1, vtkIdType &p2, void* &ptr);
00144 
00147   void Reset();
00148 
00149 protected:
00150   vtkEdgeTable();
00151   ~vtkEdgeTable();
00152 
00153   vtkIdList **Table;
00154   vtkIdType TableMaxId; //maximum point id inserted
00155   vtkIdType TableSize;  //allocated size of table
00156   int Position[2];
00157   int Extend;
00158   vtkIdType NumberOfEdges;
00159   vtkPoints *Points; //support point insertion
00160 
00161   int StoreAttributes; //==0:no attributes stored;==1:vtkIdType;==2:void*
00162   vtkIdList **Attributes; //used to store IdTypes attributes
00163   vtkVoidArray **PointerAttributes; //used to store void* pointers
00164 
00165   vtkIdList **Resize(vtkIdType size);
00166 
00167 private:
00168   vtkEdgeTable(const vtkEdgeTable&);  // Not implemented.
00169   void operator=(const vtkEdgeTable&);  // Not implemented.
00170 };
00171 
00172 #endif
00173