VTK  9.3.1
vtkEdgeTable.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
18 #ifndef vtkEdgeTable_h
19 #define vtkEdgeTable_h
20 
21 #include "vtkCommonDataModelModule.h" // For export macro
22 #include "vtkObject.h"
23 
24 VTK_ABI_NAMESPACE_BEGIN
25 class vtkIdList;
26 class vtkPoints;
27 class vtkVoidArray;
28 
29 class VTKCOMMONDATAMODEL_EXPORT vtkEdgeTable : public vtkObject
30 {
31 public:
35  static vtkEdgeTable* New();
36 
37  vtkTypeMacro(vtkEdgeTable, vtkObject);
38  void PrintSelf(ostream& os, vtkIndent indent) override;
39 
43  void Initialize();
44 
58  int InitEdgeInsertion(vtkIdType numPoints, int storeAttributes = 0);
59 
69  vtkIdType InsertEdge(vtkIdType p1, vtkIdType p2);
70 
80  void InsertEdge(vtkIdType p1, vtkIdType p2, vtkIdType attributeId);
81 
91  void InsertEdge(vtkIdType p1, vtkIdType p2, void* ptr);
92 
100  vtkIdType IsEdge(vtkIdType p1, vtkIdType p2);
101 
107  void IsEdge(vtkIdType p1, vtkIdType p2, void*& ptr);
108 
114  int InitPointInsertion(vtkPoints* newPts, vtkIdType estSize);
115 
121  int InsertUniquePoint(vtkIdType p1, vtkIdType p2, double x[3], vtkIdType& ptId);
122 
124 
127  vtkGetMacro(NumberOfEdges, vtkIdType);
129 
133  void InitTraversal();
134 
140  vtkIdType GetNextEdge(vtkIdType& p1, vtkIdType& p2);
141 
147  int GetNextEdge(vtkIdType& p1, vtkIdType& p2, void*& ptr);
148 
153  void Reset();
154 
155 protected:
156  vtkEdgeTable();
157  ~vtkEdgeTable() override;
158 
160  vtkIdType TableMaxId; // maximum point id inserted
161  vtkIdType TableSize; // allocated size of table
162  int Position[2];
163  int Extend;
165  vtkPoints* Points; // support point insertion
166 
167  int StoreAttributes; //==0:no attributes stored;==1:vtkIdType;==2:void*
168  vtkIdList** Attributes; // used to store IdTypes attributes
169  vtkVoidArray** PointerAttributes; // used to store void* pointers
170 
171  vtkIdList** Resize(vtkIdType size);
172 
173 private:
174  vtkEdgeTable(const vtkEdgeTable&) = delete;
175  void operator=(const vtkEdgeTable&) = delete;
176 };
177 
178 VTK_ABI_NAMESPACE_END
179 #endif
vtkVoidArray ** PointerAttributes
Definition: vtkEdgeTable.h:169
dynamic, self-adjusting array of void* pointers
Definition: vtkVoidArray.h:19
abstract base class for most VTK objects
Definition: vtkObject.h:51
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int vtkIdType
Definition: vtkType.h:315
vtkIdType TableMaxId
Definition: vtkEdgeTable.h:160
keep track of edges (edge is pair of integer id's)
Definition: vtkEdgeTable.h:29
vtkIdType NumberOfEdges
Definition: vtkEdgeTable.h:164
a simple class to control print indentation
Definition: vtkIndent.h:28
list of point or cell ids
Definition: vtkIdList.h:22
vtkPoints * Points
Definition: vtkEdgeTable.h:165
vtkIdList ** Table
Definition: vtkEdgeTable.h:159
vtkIdList ** Attributes
Definition: vtkEdgeTable.h:168
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
vtkIdType TableSize
Definition: vtkEdgeTable.h:161
represent and manipulate 3D points
Definition: vtkPoints.h:28