1 -- File: MeshAlgo_Delaunay.cdl
2 -- Created: Tue May 11 17:19:19 1993
3 -- Author: Didier PIFFAULT
5 ---Copyright: Matra Datavision 1993, 1994
8 generic class Delaunay from MeshAlgo (Vertex as any;
12 ---Purpose: Compute the Delaunay's triangulation with the
13 -- algorithm of Watson.
16 uses Integer from Standard,
17 SequenceOfInteger from TColStd,
18 Array1OfInteger from TColStd,
21 CircleTool from MeshAlgo,
22 MapOfInteger from MeshDS,
23 MapOfIntegerInteger from MeshDS
26 class DataStructure instantiates Mesh2d from MeshDS
27 (Vertex, Edge, Triangle);
29 class ComparatorOfVertex instantiates PntComparator(Vertex,XY from gp);
31 class ComparatorOfIndexedVertex instantiates IndexedPntComparator
32 (DataStructure from MeshAlgo, XY from gp);
34 class Array1OfVertex instantiates Array1 from TCollection(Vertex);
36 class HArray1OfVertex instantiates HArray1 from TCollection
37 (Vertex, Array1OfVertex);
39 class HeapSortVertex instantiates HeapSort from SortTools
40 (Vertex, Array1OfVertex, ComparatorOfVertex);
42 class HeapSortIndexedVertex instantiates HeapSort from SortTools
43 (Integer, Array1OfInteger from TColStd, ComparatorOfIndexedVertex);
50 Create (Vertices : in out Array1OfVertex from MeshAlgo;
51 ZPositive : in Boolean from Standard=Standard_True)
52 ---Purpose: Creates the triangulation with an empty Mesh
54 returns Delaunay from MeshAlgo;
57 Create (OldMesh : mutable DataStructure from MeshAlgo;
58 Vertices : in out Array1OfVertex from MeshAlgo;
59 ZPositive : in Boolean from Standard=Standard_True)
60 ---Purpose: Creates the triangulation with and existant
61 -- Mesh data structure.
62 returns Delaunay from MeshAlgo;
65 Create (OldMesh : mutable DataStructure from MeshAlgo;
66 VertexIndices : in out Array1OfInteger from TColStd;
67 ZPositive : in Boolean from Standard=Standard_True)
68 ---Purpose: Creates the triangulation with and existant
69 -- Mesh data structure.
70 returns Delaunay from MeshAlgo;
73 AddVertex (me : in out;
74 theVertex : in Vertex);
75 ---Purpose: Adds a new vertex in the triangulation.
78 RemoveVertex (me : in out;
79 theVertex : in Vertex);
80 ---Purpose: Removes a vertex in the triangulation.
83 AddVertices (me : in out;
84 Vertices : in out Array1OfVertex from MeshAlgo);
85 ---Purpose: Adds some vertices in the triangulation.
88 RevertDiagonal (me : in out;
89 theEdge : in Integer from Standard)
90 ---Purpose: Substitutes the Edge beetween to triangles by the
91 -- other diagonal of the quadrilatere if it is
92 -- possible (convex polygon). Return True if done.
93 returns Boolean from Standard;
97 theEdge : in Integer from Standard)
98 ---Purpose: Modify mesh to use the edge. Return True if done.
99 returns Boolean from Standard;
102 SmoothMesh (me : in out;
103 Epsilon : in Real from Standard);
104 ---Purpose: Smooths the mesh in 2d space. The method is to
105 -- move the free and OnSurface vertices at the
106 -- barycentre of their polygon.
110 ---C++: return const &
111 ---Purpose: Gives the Mesh data structure.
112 returns DataStructure from MeshAlgo;
115 Frontier (me : in out)
116 ---Purpose: Gives the list of frontier edges
117 ---C++: return const &
118 returns MapOfInteger from MeshDS;
121 InternalEdges (me : in out)
122 ---Purpose: Gives the list of internal edges
123 ---C++: return const &
124 returns MapOfInteger from MeshDS;
127 FreeEdges (me : in out)
128 ---Purpose: Gives the list of free edges used only one time
129 ---C++: return const &
130 returns MapOfInteger from MeshDS;
134 vIndex : in Integer from Standard)
135 ---C++: return const &
141 eIndex : in Integer from Standard)
142 ---C++: return const &
148 tIndex : in Integer from Standard)
149 ---C++: return const &
157 Vertices : in out Array1OfVertex from MeshAlgo);
158 ---Purpose: Initializes the triangulation with an Array of
161 Compute (me : in out;
162 VertexIndices : in out Array1OfInteger from TColStd);
163 ---Purpose: Computes the triangulation and add the vertices
164 -- edges and triangles to the Mesh data structure.
166 ReCompute (me : in out;
167 VertexIndices : in out Array1OfInteger from TColStd);
168 ---Purpose: Clear the existing triangles and recomputes
169 -- the triangulation .
171 SuperMesh (me : in out;
172 theBox : Box2d from Bnd);
173 ---Purpose: Build the super mesh .
176 FrontierAdjust (me : in out)
177 ---Purpose: Adjust the mesh on the frontier.
181 MeshLeftPolygonOf (me : in out;
182 EdgeIndex : Integer from Standard;
183 EdgeSens : Boolean from Standard)
184 ---Purpose: Find left polygon of the edge and call MeshPolygon.
188 MeshPolygon (me : in out;
189 Polygon : in out SequenceOfInteger from TColStd)
190 ---Purpose: Mesh closed polygon.
194 CreateTriangles(me : in out;
195 vertexIndex : Integer from Standard;
196 --vertex : in Vertex;
197 freeEdges: out MapOfIntegerInteger from MeshDS)
198 ---Purpose: Creates the triangles beetween the node
199 -- <Vertex> and the polyline <freeEdges>.
203 DeleteTriangle (me : in out;
204 TrianIndex : Integer from Standard;
205 freeEdges : out MapOfIntegerInteger from MeshDS)
206 ---Purpose: Deletes the triangle of index <TrianIndex> and
207 -- add the free edges to the map.
208 -- When an edge is suppressed more than one time
214 TrianIndex : Integer from Standard;
215 theVertex : in Vertex;
216 edgeOn : out Integer from Standard)
217 ---Purpose: Test if triangle of index <TrianIndex>
218 -- contains geometricaly <theVertex>. If <EdgeOn>
219 -- is != 0 then theVertex is on Edge of index
221 returns Boolean from Standard;
225 theVertex : in Vertex)
226 ---Purpose: Gives the index of triangle containing
227 -- geometricaly <theVertex>.
228 returns Integer from Standard;
231 fields MeshData : DataStructure from MeshAlgo;
232 PositiveOrientation : Boolean from Standard;
233 tCircles : CircleTool from MeshAlgo;
234 supVert1 : Integer from Standard;
235 supVert2 : Integer from Standard;
236 supVert3 : Integer from Standard;
238 mapEdges : MapOfInteger from MeshDS;