VTK  9.3.0
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 
70 
80  void InsertEdge(vtkIdType p1, vtkIdType p2, vtkIdType attributeId);
81 
91  void InsertEdge(vtkIdType p1, vtkIdType p2, void* ptr);
92 
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 
134 
141 
147  int GetNextEdge(vtkIdType& p1, vtkIdType& p2, void*& ptr);
148 
153  void Reset();
154 
155 protected:
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 
172 
173 private:
174  vtkEdgeTable(const vtkEdgeTable&) = delete;
175  void operator=(const vtkEdgeTable&) = delete;
176 };
177 
178 VTK_ABI_NAMESPACE_END
179 #endif
keep track of edges (edge is pair of integer id's)
Definition: vtkEdgeTable.h:30
int GetNextEdge(vtkIdType &p1, vtkIdType &p2, void *&ptr)
Similar to above, but fills a void* pointer if InitEdgeInsertion() has been called with storeAttribut...
vtkVoidArray ** PointerAttributes
Definition: vtkEdgeTable.h:169
vtkPoints * Points
Definition: vtkEdgeTable.h:165
vtkIdType NumberOfEdges
Definition: vtkEdgeTable.h:164
int InitPointInsertion(vtkPoints *newPts, vtkIdType estSize)
Initialize the point insertion process.
void InsertEdge(vtkIdType p1, vtkIdType p2, void *ptr)
Insert the edge (p1,p2) into the table with the attribute id specified (make sure the attributeId >= ...
vtkIdType TableSize
Definition: vtkEdgeTable.h:161
int InitEdgeInsertion(vtkIdType numPoints, int storeAttributes=0)
Initialize the edge insertion process.
void Initialize()
Free memory and return to the initially instantiated state.
vtkIdList ** Attributes
Definition: vtkEdgeTable.h:168
void Reset()
Reset the object and prepare for reinsertion of edges.
~vtkEdgeTable() override
vtkIdList ** Table
Definition: vtkEdgeTable.h:159
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkIdType GetNextEdge(vtkIdType &p1, vtkIdType &p2)
Traverse list of edges in table.
vtkIdType InsertEdge(vtkIdType p1, vtkIdType p2)
Insert the edge (p1,p2) into the table.
vtkIdList ** Resize(vtkIdType size)
vtkIdType TableMaxId
Definition: vtkEdgeTable.h:160
int InsertUniquePoint(vtkIdType p1, vtkIdType p2, double x[3], vtkIdType &ptId)
Insert a unique point on the specified edge.
void InitTraversal()
Initialize traversal of edges in table.
static vtkEdgeTable * New()
Instantiate object assuming that 1000 edges are to be inserted.
vtkIdType IsEdge(vtkIdType p1, vtkIdType p2)
Return an integer id for the edge, or an attribute id of the edge (p1,p2) if the edge has been previo...
void IsEdge(vtkIdType p1, vtkIdType p2, void *&ptr)
Similar to above, but returns a void* pointer is InitEdgeInsertion() has been called with storeAttrib...
void InsertEdge(vtkIdType p1, vtkIdType p2, vtkIdType attributeId)
Insert the edge (p1,p2) into the table with the attribute id specified (make sure the attributeId >= ...
list of point or cell ids
Definition: vtkIdList.h:23
a simple class to control print indentation
Definition: vtkIndent.h:29
abstract base class for most VTK objects
Definition: vtkObject.h:52
represent and manipulate 3D points
Definition: vtkPoints.h:29
dynamic, self-adjusting array of void* pointers
Definition: vtkVoidArray.h:20
@ size
Definition: vtkX3D.h:253
int vtkIdType
Definition: vtkType.h:315