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 =========================================================================*/
29 #ifndef vtkEdgeTable_h
30 #define vtkEdgeTable_h
31 
32 #include "vtkCommonDataModelModule.h" // For export macro
33 #include "vtkObject.h"
34 
35 class vtkIdList;
36 class vtkPoints;
37 class vtkVoidArray;
38 
40 {
41 public:
43  static vtkEdgeTable *New();
44 
45  vtkTypeMacro(vtkEdgeTable,vtkObject);
46  void PrintSelf(ostream& os, vtkIndent indent);
47 
49  void Initialize();
50 
63  int InitEdgeInsertion(vtkIdType numPoints, int storeAttributes=0);
64 
72  vtkIdType InsertEdge(vtkIdType p1, vtkIdType p2);
73 
80  void InsertEdge(vtkIdType p1, vtkIdType p2, vtkIdType attributeId);
81 
88  void InsertEdge(vtkIdType p1, vtkIdType p2, void* ptr);
89 
95  vtkIdType IsEdge(vtkIdType p1, vtkIdType p2);
96 
100  void IsEdge(vtkIdType p1, vtkIdType p2, void* &ptr);
101 
105  int InitPointInsertion(vtkPoints *newPts, vtkIdType estSize);
106 
108 
111  int InsertUniquePoint(vtkIdType p1, vtkIdType p2, double x[3],
112  vtkIdType &ptId);
114 
116 
117  vtkGetMacro(NumberOfEdges, vtkIdType);
119 
121  void InitTraversal();
122 
127  vtkIdType GetNextEdge(vtkIdType &p1, vtkIdType &p2);
128 
132  int GetNextEdge(vtkIdType &p1, vtkIdType &p2, void* &ptr);
133 
136  void Reset();
137 
138 protected:
139  vtkEdgeTable();
140  ~vtkEdgeTable();
141 
143  vtkIdType TableMaxId; //maximum point id inserted
144  vtkIdType TableSize; //allocated size of table
145  int Position[2];
146  int Extend;
148  vtkPoints *Points; //support point insertion
149 
150  int StoreAttributes; //==0:no attributes stored;==1:vtkIdType;==2:void*
151  vtkIdList **Attributes; //used to store IdTypes attributes
152  vtkVoidArray **PointerAttributes; //used to store void* pointers
153 
154  vtkIdList **Resize(vtkIdType size);
155 
156 private:
157  vtkEdgeTable(const vtkEdgeTable&); // Not implemented.
158  void operator=(const vtkEdgeTable&); // Not implemented.
159 };
160 
161 #endif
162 
vtkVoidArray ** PointerAttributes
Definition: vtkEdgeTable.h:152
dynamic, self-adjusting array of void* pointers
Definition: vtkVoidArray.h:29
abstract base class for most VTK objects
Definition: vtkObject.h:61
int vtkIdType
Definition: vtkType.h:275
vtkIdType TableMaxId
Definition: vtkEdgeTable.h:143
keep track of edges (edge is pair of integer id's)
Definition: vtkEdgeTable.h:39
vtkIdType NumberOfEdges
Definition: vtkEdgeTable.h:147
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:38
list of point or cell ids
Definition: vtkIdList.h:35
vtkPoints * Points
Definition: vtkEdgeTable.h:148
vtkIdList ** Table
Definition: vtkEdgeTable.h:142
vtkIdList ** Attributes
Definition: vtkEdgeTable.h:151
static vtkObject * New()
vtkIdType TableSize
Definition: vtkEdgeTable.h:144
#define VTKCOMMONDATAMODEL_EXPORT
represent and manipulate 3D points
Definition: vtkPoints.h:38