0023024: Update headers of OCCT files
[occt.git] / src / BRepMesh / BRepMesh_Delaun.cdl
1 -- Created on: 1993-05-11
2 -- Created by: Didier PIFFAULT
3 -- Copyright (c) 1993-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
5 --
6 -- The content of this file is subject to the Open CASCADE Technology Public
7 -- License Version 6.5 (the "License"). You may not use the content of this file
8 -- except in compliance with the License. Please obtain a copy of the License
9 -- at http://www.opencascade.org and read it completely before using this file.
10 --
11 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 --
14 -- The Original Code and all software distributed under the License is
15 -- distributed on an "AS IS" basis, without warranty of any kind, and the
16 -- Initial Developer hereby disclaims all such warranties, including without
17 -- limitation, any warranties of merchantability, fitness for a particular
18 -- purpose or non-infringement. Please see the License for the specific terms
19 -- and conditions governing the rights and limitations under the License.
20
21
22
23 class Delaun from BRepMesh
24
25   ---Purpose: Compute the  Delaunay's triangulation    with  the
26   --          algorithm of Watson.
27
28
29   uses    Integer from Standard,
30           SequenceOfInteger from TColStd,
31           Array1OfInteger from TColStd,
32           Box2d from Bnd,
33           CircleTool from BRepMesh,
34           MapOfInteger from BRepMesh,
35           DataStructureOfDelaun from BRepMesh,
36           MapOfIntegerInteger from BRepMesh,
37           Vertex from BRepMesh,
38           Edge from BRepMesh,
39           Triangle from BRepMesh,
40           ComparatorOfVertexOfDelaun from BRepMesh,
41           ComparatorOfIndexedVertexOfDelaun from BRepMesh,
42           Array1OfVertexOfDelaun from BRepMesh,
43           HArray1OfVertexOfDelaun from BRepMesh,
44           HeapSortVertexOfDelaun from BRepMesh,
45           HeapSortIndexedVertexOfDelaun from BRepMesh
46
47
48   is
49   -- Interface :
50
51           Create         (Vertices  : in out Array1OfVertexOfDelaun from BRepMesh;
52                           ZPositive : in Boolean from Standard=Standard_True)
53               ---Purpose: Creates the  triangulation with an  empty Mesh
54               --          data structure.
55               returns Delaun from BRepMesh;
56
57
58           Create         (OldMesh   : mutable DataStructureOfDelaun from BRepMesh;
59                           Vertices  : in out Array1OfVertexOfDelaun from BRepMesh;
60                           ZPositive : in Boolean from Standard=Standard_True)
61               ---Purpose: Creates  the triangulation with   and existant
62               --          Mesh data structure.
63               returns Delaun from BRepMesh;
64
65
66           Create         (OldMesh       : mutable DataStructureOfDelaun from BRepMesh;
67                           VertexIndices : in out Array1OfInteger from TColStd;
68                           ZPositive     : in Boolean from Standard=Standard_True)
69                   ---Purpose: Creates  the triangulation with   and existant
70                   --          Mesh data structure.
71                   returns Delaun from BRepMesh;
72
73
74           RemoveVertex   (me            : in out;
75                           theVertex     : in Vertex from BRepMesh);
76                 ---Purpose: Removes a vertex in the triangulation.
77
78
79            AddVertices    (me            : in out;
80                            Vertices      : in out Array1OfVertexOfDelaun from BRepMesh);
81                 ---Purpose: Adds some vertices in the triangulation.
82
83
84            UseEdge        (me            : in out;
85                            theEdge       : in Integer from Standard)
86                   ---Purpose: Modify mesh to use the edge. Return True if done.
87                   returns Boolean from Standard;
88
89
90            Result         (me)
91                   ---C++: return const &
92                   ---Purpose: Gives the Mesh data structure.
93                   returns DataStructureOfDelaun from BRepMesh;
94
95
96            Frontier       (me     : in out)
97                   ---Purpose: Gives the list of frontier edges
98                   ---C++: return const &
99                   returns MapOfInteger from BRepMesh;
100
101
102            InternalEdges  (me     : in out)
103                   ---Purpose: Gives the list of internal edges
104                   ---C++: return const &
105                   returns MapOfInteger from BRepMesh;
106
107
108            FreeEdges      (me     : in out)
109                   ---Purpose: Gives the list of free edges used only one time
110                   ---C++: return const &
111                   returns MapOfInteger from BRepMesh;
112
113
114            GetVertex      (me;
115                            vIndex : in Integer from Standard)
116                  ---C++: return const &
117                  ---C++: inline
118                  returns Vertex from BRepMesh;
119
120
121            GetEdge        (me;
122                            eIndex : in Integer from Standard)
123            ---C++: return const &
124            ---C++: inline
125            returns Edge from BRepMesh;
126
127
128            GetTriangle    (me;
129                            tIndex : in Integer from Standard)
130            ---C++: return const &
131            ---C++: inline
132            returns Triangle from BRepMesh;
133
134
135            -- Implementation :
136
137            Init           (me            : in out;
138                            Vertices      : in out Array1OfVertexOfDelaun from BRepMesh);
139            ---Purpose: Initializes the triangulation with an Array of
140            --          Vertex.
141
142            Compute        (me            : in out;
143                             VertexIndices : in out Array1OfInteger from TColStd);
144            ---Purpose: Computes the triangulation and add the vertices
145            --          edges and triangles to the Mesh data structure.
146
147
148            SuperMesh      (me            : in out;
149                            theBox        : Box2d from Bnd);
150            ---Purpose: Build the super mesh .
151
152
153            FrontierAdjust (me            : in out)
154            ---Purpose: Adjust the mesh on the frontier.
155            is private;
156
157
158            MeshLeftPolygonOf  (me        : in out;
159                                EdgeIndex : Integer from Standard;
160                                EdgeSens  : Boolean from Standard)
161               ---Purpose: Find left polygon of the edge and call MeshPolygon.
162               is private;
163
164
165             MeshPolygon    (me            : in out;
166                             Polygon       : in out SequenceOfInteger from TColStd)
167                   ---Purpose: Mesh closed polygon.
168               is private;
169
170
171             CreateTriangles(me            : in out; 
172                             vertexIndex   : Integer from Standard; 
173                 --vertex        : in Vertex from BRepMesh; 
174                                 freeEdges: out MapOfIntegerInteger from BRepMesh)
175                 ---Purpose: Creates the triangles beetween the node 
176                 --          <Vertex> and the polyline <freeEdges>.
177               is private;
178
179
180            DeleteTriangle (me         : in out; 
181                             TrianIndex : Integer from Standard; 
182                             freeEdges  : out MapOfIntegerInteger from BRepMesh)
183                ---Purpose: Deletes the triangle of index <TrianIndex> and
184                --          add the free edges to the map.
185                --          When an edge is suppressed more than one time 
186                --          it is destroyed.
187                is private;
188                
189                
190            Perform (me: in out;
191                     theBndBox       : out Box2d from Bnd;
192                     theVertexIndices: out Array1OfInteger from TColStd)
193               is private;
194
195
196            Contains       (me;
197                            TrianIndex    : Integer from Standard;
198                            theVertex     : in Vertex from BRepMesh;
199                            edgeOn        : out Integer from Standard)
200             ---Purpose: Test  if   triangle   of  index   <TrianIndex>
201             --          contains geometricaly <theVertex>. If <EdgeOn>
202             --          is != 0  then theVertex is  on Edge  of  index
203             --          <edgeOn>.
204             returns Boolean from Standard;
205
206
207             CreateTrianglesOnNewVertices(me            : in out;
208                                        theVertexIndices: out Array1OfInteger from TColStd)
209                 --vertex        : in Vertex from BRepMesh; 
210                 ---Purpose: Creates the triangles on new nodes
211               is private;
212
213
214             fields  MeshData               : DataStructureOfDelaun from BRepMesh;
215                     PositiveOrientation    : Boolean from Standard;
216                     tCircles               : CircleTool from BRepMesh;
217                     supVert1               : Integer from Standard;
218                     supVert2               : Integer from Standard;
219                     supVert3               : Integer from Standard;
220                     supTrian               : Triangle from BRepMesh;
221                     mapEdges               : MapOfInteger from BRepMesh;
222
223
224 end Delaun;