VTK  9.3.20240425
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
24VTK_ABI_NAMESPACE_BEGIN
25class vtkIdList;
26class vtkPoints;
27class vtkVoidArray;
28
29class VTKCOMMONDATAMODEL_EXPORT vtkEdgeTable : public vtkObject
30{
31public:
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
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
155protected:
157 ~vtkEdgeTable() override;
158
160 vtkIdType TableMaxId; // maximum point id inserted
161 vtkIdType TableSize; // allocated size of table
162 int Position[2];
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
173private:
174 vtkEdgeTable(const vtkEdgeTable&) = delete;
175 void operator=(const vtkEdgeTable&) = delete;
176};
177
178VTK_ABI_NAMESPACE_END
179#endif
keep track of edges (edge is pair of integer id's)
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
vtkPoints * Points
vtkIdType NumberOfEdges
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
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
void Reset()
Reset the object and prepare for reinsertion of edges.
~vtkEdgeTable() override
vtkIdList ** Table
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.
vtkIdType TableMaxId
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.
vtkIdList ** Resize(vtkIdType size)
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 >= ...
static vtkEdgeTable * New()
Instantiate object assuming that 1000 edges are to be inserted.
list of point or cell ids
Definition vtkIdList.h:133
a simple class to control print indentation
Definition vtkIndent.h:108
abstract base class for most VTK objects
Definition vtkObject.h:162
represent and manipulate 3D points
Definition vtkPoints.h:139
dynamic, self-adjusting array of void* pointers
int vtkIdType
Definition vtkType.h:315