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 "vtkObject.h"
33 
34 class vtkIdList;
35 class vtkPoints;
36 class vtkVoidArray;
37 
39 {
40 public:
42  static vtkEdgeTable *New();
43 
44  vtkTypeMacro(vtkEdgeTable,vtkObject);
45  void PrintSelf(ostream& os, vtkIndent indent);
46 
48  void Initialize();
49 
62  int InitEdgeInsertion(vtkIdType numPoints, int storeAttributes=0);
63 
71  vtkIdType InsertEdge(vtkIdType p1, vtkIdType p2);
72 
79  void InsertEdge(vtkIdType p1, vtkIdType p2, vtkIdType attributeId);
80 
87  void InsertEdge(vtkIdType p1, vtkIdType p2, void* ptr);
88 
94  vtkIdType IsEdge(vtkIdType p1, vtkIdType p2);
95 
99  void IsEdge(vtkIdType p1, vtkIdType p2, void* &ptr);
100 
104  int InitPointInsertion(vtkPoints *newPts, vtkIdType estSize);
105 
107 
110  int InsertUniquePoint(vtkIdType p1, vtkIdType p2, double x[3],
111  vtkIdType &ptId);
113 
115 
116  vtkGetMacro(NumberOfEdges, vtkIdType);
118 
120  void InitTraversal();
121 
126  vtkIdType GetNextEdge(vtkIdType &p1, vtkIdType &p2);
127 
131  int GetNextEdge(vtkIdType &p1, vtkIdType &p2, void* &ptr);
132 
135  void Reset();
136 
137 protected:
138  vtkEdgeTable();
139  ~vtkEdgeTable();
140 
142  vtkIdType TableMaxId; //maximum point id inserted
143  vtkIdType TableSize; //allocated size of table
144  int Position[2];
145  int Extend;
147  vtkPoints *Points; //support point insertion
148 
149  int StoreAttributes; //==0:no attributes stored;==1:vtkIdType;==2:void*
150  vtkIdList **Attributes; //used to store IdTypes attributes
151  vtkVoidArray **PointerAttributes; //used to store void* pointers
152 
153  vtkIdList **Resize(vtkIdType size);
154 
155 private:
156  vtkEdgeTable(const vtkEdgeTable&); // Not implemented.
157  void operator=(const vtkEdgeTable&); // Not implemented.
158 };
159 
160 #endif
161 
vtkVoidArray ** PointerAttributes
Definition: vtkEdgeTable.h:151
dynamic, self-adjusting array of void* pointers
Definition: vtkVoidArray.h:28
abstract base class for most VTK objects
Definition: vtkObject.h:60
int vtkIdType
Definition: vtkType.h:255
vtkIdType TableMaxId
Definition: vtkEdgeTable.h:142
keep track of edges (edge is pair of integer id's)
Definition: vtkEdgeTable.h:38
vtkIdType NumberOfEdges
Definition: vtkEdgeTable.h:146
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:37
list of point or cell ids
Definition: vtkIdList.h:34
vtkPoints * Points
Definition: vtkEdgeTable.h:147
vtkIdList ** Table
Definition: vtkEdgeTable.h:141
#define VTK_COMMON_EXPORT
vtkIdList ** Attributes
Definition: vtkEdgeTable.h:150
static vtkObject * New()
vtkIdType TableSize
Definition: vtkEdgeTable.h:143
represent and manipulate 3D points
Definition: vtkPoints.h:38