VTK
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) VTK_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 
125  int InitPointInsertion(vtkPoints *newPts, vtkIdType estSize);
126 
132  int InsertUniquePoint(vtkIdType p1, vtkIdType p2, double x[3],
133  vtkIdType &ptId);
134 
136 
139  vtkGetMacro(NumberOfEdges, vtkIdType);
141 
146 
153 
159  int GetNextEdge(vtkIdType &p1, vtkIdType &p2, void* &ptr);
160 
165  void Reset();
166 
167 protected:
169  ~vtkEdgeTable() VTK_OVERRIDE;
170 
171  vtkIdList **Table;
172  vtkIdType TableMaxId; //maximum point id inserted
173  vtkIdType TableSize; //allocated size of table
174  int Position[2];
175  int Extend;
176  vtkIdType NumberOfEdges;
177  vtkPoints *Points; //support point insertion
178 
179  int StoreAttributes; //==0:no attributes stored;==1:vtkIdType;==2:void*
180  vtkIdList **Attributes; //used to store IdTypes attributes
181  vtkVoidArray **PointerAttributes; //used to store void* pointers
182 
184 
185 private:
186  vtkEdgeTable(const vtkEdgeTable&) VTK_DELETE_FUNCTION;
187  void operator=(const vtkEdgeTable&) VTK_DELETE_FUNCTION;
188 };
189 
190 #endif
191 
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...
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 >= ...
int InitEdgeInsertion(vtkIdType numPoints, int storeAttributes=0)
Initialize the edge insertion process.
void Initialize()
Free memory and return to the initially instantiated state.
void Reset()
Reset the object and prepare for reinsertion of edges.
~vtkEdgeTable() override
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.
int InsertUniquePoint(vtkIdType p1, vtkIdType p2, double x[3], vtkIdType &ptId)
Insert a unique point on the specified edge.
void InitTraversal()
Intialize 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:37
a simple class to control print indentation
Definition: vtkIndent.h:40
abstract base class for most VTK objects
Definition: vtkObject.h:60
represent and manipulate 3D points
Definition: vtkPoints.h:40
dynamic, self-adjusting array of void* pointers
Definition: vtkVoidArray.h:31
@ size
Definition: vtkX3D.h:253
int vtkIdType
Definition: vtkType.h:287