VTK  9.2.6
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) 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], vtkIdType& ptId);
133 
135 
138  vtkGetMacro(NumberOfEdges, vtkIdType);
140 
144  void InitTraversal();
145 
151  vtkIdType GetNextEdge(vtkIdType& p1, vtkIdType& p2);
152 
158  int GetNextEdge(vtkIdType& p1, vtkIdType& p2, void*& ptr);
159 
164  void Reset();
165 
166 protected:
167  vtkEdgeTable();
168  ~vtkEdgeTable() override;
169 
171  vtkIdType TableMaxId; // maximum point id inserted
172  vtkIdType TableSize; // allocated size of table
173  int Position[2];
174  int Extend;
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 
182  vtkIdList** Resize(vtkIdType size);
183 
184 private:
185  vtkEdgeTable(const vtkEdgeTable&) = delete;
186  void operator=(const vtkEdgeTable&) = delete;
187 };
188 
189 #endif
vtkVoidArray ** PointerAttributes
Definition: vtkEdgeTable.h:180
dynamic, self-adjusting array of void* pointers
Definition: vtkVoidArray.h:30
abstract base class for most VTK objects
Definition: vtkObject.h:62
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int vtkIdType
Definition: vtkType.h:332
vtkIdType TableMaxId
Definition: vtkEdgeTable.h:171
keep track of edges (edge is pair of integer id's)
Definition: vtkEdgeTable.h:40
vtkIdType NumberOfEdges
Definition: vtkEdgeTable.h:175
a simple class to control print indentation
Definition: vtkIndent.h:39
list of point or cell ids
Definition: vtkIdList.h:33
vtkPoints * Points
Definition: vtkEdgeTable.h:176
vtkIdList ** Table
Definition: vtkEdgeTable.h:170
vtkIdList ** Attributes
Definition: vtkEdgeTable.h:179
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
vtkIdType TableSize
Definition: vtkEdgeTable.h:172
represent and manipulate 3D points
Definition: vtkPoints.h:39