VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkEdgeTable.h 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 =========================================================================*/ 00029 #ifndef __vtkEdgeTable_h 00030 #define __vtkEdgeTable_h 00031 00032 #include "vtkCommonDataModelModule.h" // For export macro 00033 #include "vtkObject.h" 00034 00035 class vtkIdList; 00036 class vtkPoints; 00037 class vtkVoidArray; 00038 00039 class VTKCOMMONDATAMODEL_EXPORT vtkEdgeTable : public vtkObject 00040 { 00041 public: 00043 static vtkEdgeTable *New(); 00044 00045 vtkTypeMacro(vtkEdgeTable,vtkObject); 00046 void PrintSelf(ostream& os, vtkIndent indent); 00047 00049 void Initialize(); 00050 00063 int InitEdgeInsertion(vtkIdType numPoints, int storeAttributes=0); 00064 00072 vtkIdType InsertEdge(vtkIdType p1, vtkIdType p2); 00073 00080 void InsertEdge(vtkIdType p1, vtkIdType p2, vtkIdType attributeId); 00081 00088 void InsertEdge(vtkIdType p1, vtkIdType p2, void* ptr); 00089 00095 vtkIdType IsEdge(vtkIdType p1, vtkIdType p2); 00096 00100 void IsEdge(vtkIdType p1, vtkIdType p2, void* &ptr); 00101 00105 int InitPointInsertion(vtkPoints *newPts, vtkIdType estSize); 00106 00108 00111 int InsertUniquePoint(vtkIdType p1, vtkIdType p2, double x[3], 00112 vtkIdType &ptId); 00114 00116 00117 vtkGetMacro(NumberOfEdges, vtkIdType); 00119 00121 void InitTraversal(); 00122 00127 vtkIdType GetNextEdge(vtkIdType &p1, vtkIdType &p2); 00128 00132 int GetNextEdge(vtkIdType &p1, vtkIdType &p2, void* &ptr); 00133 00136 void Reset(); 00137 00138 protected: 00139 vtkEdgeTable(); 00140 ~vtkEdgeTable(); 00141 00142 vtkIdList **Table; 00143 vtkIdType TableMaxId; //maximum point id inserted 00144 vtkIdType TableSize; //allocated size of table 00145 int Position[2]; 00146 int Extend; 00147 vtkIdType NumberOfEdges; 00148 vtkPoints *Points; //support point insertion 00149 00150 int StoreAttributes; //==0:no attributes stored;==1:vtkIdType;==2:void* 00151 vtkIdList **Attributes; //used to store IdTypes attributes 00152 vtkVoidArray **PointerAttributes; //used to store void* pointers 00153 00154 vtkIdList **Resize(vtkIdType size); 00155 00156 private: 00157 vtkEdgeTable(const vtkEdgeTable&); // Not implemented. 00158 void operator=(const vtkEdgeTable&); // Not implemented. 00159 }; 00160 00161 #endif 00162