VTK  9.1.0
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
36class vtkIdList;
37class vtkPoints;
38class vtkVoidArray;
39
40class VTKCOMMONDATAMODEL_EXPORT vtkEdgeTable : public vtkObject
41{
42public:
46 static vtkEdgeTable* New();
47
48 vtkTypeMacro(vtkEdgeTable, vtkObject);
49 void PrintSelf(ostream& os, vtkIndent indent) override;
50
54 void Initialize();
55
69 int InitEdgeInsertion(vtkIdType numPoints, int storeAttributes = 0);
70
81
91 void InsertEdge(vtkIdType p1, vtkIdType p2, vtkIdType attributeId);
92
102 void InsertEdge(vtkIdType p1, vtkIdType p2, void* ptr);
103
112
118 void IsEdge(vtkIdType p1, vtkIdType p2, void*& ptr);
119
126
132 int InsertUniquePoint(vtkIdType p1, vtkIdType p2, double x[3], vtkIdType& ptId);
133
135
138 vtkGetMacro(NumberOfEdges, vtkIdType);
140
145
152
158 int GetNextEdge(vtkIdType& p1, vtkIdType& p2, void*& ptr);
159
164 void Reset();
165
166protected:
168 ~vtkEdgeTable() override;
169
171 vtkIdType TableMaxId; // maximum point id inserted
172 vtkIdType TableSize; // allocated size of table
173 int Position[2];
176 vtkPoints* Points; // support point insertion
177
178 int StoreAttributes; //==0:no attributes stored;==1:vtkIdType;==2:void*
179 vtkIdList** Attributes; // used to store IdTypes attributes
180 vtkVoidArray** PointerAttributes; // used to store void* pointers
181
183
184private:
185 vtkEdgeTable(const vtkEdgeTable&) = delete;
186 void operator=(const vtkEdgeTable&) = delete;
187};
188
189#endif
keep track of edges (edge is pair of integer id's)
Definition: vtkEdgeTable.h:41
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:180
vtkPoints * Points
Definition: vtkEdgeTable.h:176
vtkIdType NumberOfEdges
Definition: vtkEdgeTable.h:175
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:172
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:179
void Reset()
Reset the object and prepare for reinsertion of edges.
~vtkEdgeTable() override
vtkIdList ** Table
Definition: vtkEdgeTable.h:170
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
Definition: vtkEdgeTable.h:171
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:140
a simple class to control print indentation
Definition: vtkIndent.h:113
abstract base class for most VTK objects
Definition: vtkObject.h:82
represent and manipulate 3D points
Definition: vtkPoints.h:143
dynamic, self-adjusting array of void* pointers
Definition: vtkVoidArray.h:31
int vtkIdType
Definition: vtkType.h:332