VTK
vtkEdgeTable.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkEdgeTable.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
30 #ifndef vtkEdgeTable_h
31 #define vtkEdgeTable_h
32 
33 #include "vtkCommonDataModelModule.h" // For export macro
34 #include "vtkObject.h"
35 
36 class vtkIdList;
37 class vtkPoints;
38 class vtkVoidArray;
39 
40 class VTKCOMMONDATAMODEL_EXPORT vtkEdgeTable : public vtkObject
41 {
42 public:
46  static vtkEdgeTable *New();
47 
48  vtkTypeMacro(vtkEdgeTable,vtkObject);
49  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
50 
54  void Initialize();
55 
69  int InitEdgeInsertion(vtkIdType numPoints, int storeAttributes=0);
70 
80  vtkIdType InsertEdge(vtkIdType p1, vtkIdType p2);
81 
91  void InsertEdge(vtkIdType p1, vtkIdType p2, vtkIdType attributeId);
92 
102  void InsertEdge(vtkIdType p1, vtkIdType p2, void* ptr);
103 
111  vtkIdType IsEdge(vtkIdType p1, vtkIdType p2);
112 
118  void IsEdge(vtkIdType p1, vtkIdType p2, void* &ptr);
119 
125  int InitPointInsertion(vtkPoints *newPts, vtkIdType estSize);
126 
132  int InsertUniquePoint(vtkIdType p1, vtkIdType p2, double x[3],
133  vtkIdType &ptId);
134 
136 
139  vtkGetMacro(NumberOfEdges, vtkIdType);
141 
145  void InitTraversal();
146 
152  vtkIdType GetNextEdge(vtkIdType &p1, vtkIdType &p2);
153 
159  int GetNextEdge(vtkIdType &p1, vtkIdType &p2, void* &ptr);
160 
165  void Reset();
166 
167 protected:
168  vtkEdgeTable();
169  ~vtkEdgeTable() VTK_OVERRIDE;
170 
171  vtkIdList **Table;
172  vtkIdType TableMaxId; //maximum point id inserted
173  vtkIdType TableSize; //allocated size of table
174  int Position[2];
175  int Extend;
176  vtkIdType NumberOfEdges;
177  vtkPoints *Points; //support point insertion
178 
179  int StoreAttributes; //==0:no attributes stored;==1:vtkIdType;==2:void*
180  vtkIdList **Attributes; //used to store IdTypes attributes
181  vtkVoidArray **PointerAttributes; //used to store void* pointers
182 
183  vtkIdList **Resize(vtkIdType size);
184 
185 private:
186  vtkEdgeTable(const vtkEdgeTable&) VTK_DELETE_FUNCTION;
187  void operator=(const vtkEdgeTable&) VTK_DELETE_FUNCTION;
188 };
189 
190 #endif
191 
dynamic, self-adjusting array of void* pointers
Definition: vtkVoidArray.h:30
abstract base class for most VTK objects
Definition: vtkObject.h:59
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int vtkIdType
Definition: vtkType.h:287
keep track of edges (edge is pair of integer id's)
Definition: vtkEdgeTable.h:40
a simple class to control print indentation
Definition: vtkIndent.h:39
list of point or cell ids
Definition: vtkIdList.h:36
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
represent and manipulate 3D points
Definition: vtkPoints.h:39