summaryrefslogtreecommitdiff
path: root/src/BRepMesh/BRepMesh_Delaun.cdl
blob: e22c547a61672cca0cd1504383cada17a3ad2c66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
-- File:        BRepMesh_Delaun.cdl
-- Created:     Tue May 11 17:19:19 1993
-- Author:      Didier PIFFAULT
--              <dpf@nonox>
---Copyright:	 Matra Datavision 1993, 1994 
 

class Delaun from BRepMesh

  ---Purpose: Compute the  Delaunay's triangulation    with  the
  --          algorithm of Watson.


  uses    Integer from Standard,
          SequenceOfInteger from TColStd,
          Array1OfInteger from TColStd,
          Box2d from Bnd,
          CircleTool from BRepMesh,
          MapOfInteger from BRepMesh,
          DataStructureOfDelaun from BRepMesh,
          MapOfIntegerInteger from BRepMesh,
          Vertex from BRepMesh,
          Edge from BRepMesh,
          Triangle from BRepMesh,
          ComparatorOfVertexOfDelaun from BRepMesh,
          ComparatorOfIndexedVertexOfDelaun from BRepMesh,
          Array1OfVertexOfDelaun from BRepMesh,
          HArray1OfVertexOfDelaun from BRepMesh,
          HeapSortVertexOfDelaun from BRepMesh,
          HeapSortIndexedVertexOfDelaun from BRepMesh


  is
  -- Interface :

          Create         (Vertices  : in out Array1OfVertexOfDelaun from BRepMesh;
                          ZPositive : in Boolean from Standard=Standard_True)
              ---Purpose: Creates the  triangulation with an  empty Mesh
              --          data structure.
              returns Delaun from BRepMesh;


          Create         (OldMesh   : mutable DataStructureOfDelaun from BRepMesh;
                          Vertices  : in out Array1OfVertexOfDelaun from BRepMesh;
                          ZPositive : in Boolean from Standard=Standard_True)
              ---Purpose: Creates  the triangulation with   and existant
              --          Mesh data structure.
              returns Delaun from BRepMesh;


          Create         (OldMesh       : mutable DataStructureOfDelaun from BRepMesh;
                          VertexIndices : in out Array1OfInteger from TColStd;
                          ZPositive     : in Boolean from Standard=Standard_True)
                  ---Purpose: Creates  the triangulation with   and existant
                  --          Mesh data structure.
                  returns Delaun from BRepMesh;


          RemoveVertex   (me            : in out;
                          theVertex     : in Vertex from BRepMesh);
                ---Purpose: Removes a vertex in the triangulation.


           AddVertices    (me            : in out;
                           Vertices      : in out Array1OfVertexOfDelaun from BRepMesh);
                ---Purpose: Adds some vertices in the triangulation.


           UseEdge        (me            : in out;
                           theEdge       : in Integer from Standard)
                  ---Purpose: Modify mesh to use the edge. Return True if done.
                  returns Boolean from Standard;


           Result         (me)
                  ---C++: return const &
                  ---Purpose: Gives the Mesh data structure.
                  returns DataStructureOfDelaun from BRepMesh;


           Frontier       (me     : in out)
                  ---Purpose: Gives the list of frontier edges
                  ---C++: return const &
                  returns MapOfInteger from BRepMesh;


           InternalEdges  (me     : in out)
                  ---Purpose: Gives the list of internal edges
                  ---C++: return const &
                  returns MapOfInteger from BRepMesh;


           FreeEdges      (me     : in out)
                  ---Purpose: Gives the list of free edges used only one time
                  ---C++: return const &
                  returns MapOfInteger from BRepMesh;


           GetVertex      (me;
                           vIndex : in Integer from Standard)
                 ---C++: return const &
                 ---C++: inline
                 returns Vertex from BRepMesh;


           GetEdge        (me;
                           eIndex : in Integer from Standard)
           ---C++: return const &
           ---C++: inline
           returns Edge from BRepMesh;


           GetTriangle    (me;
                           tIndex : in Integer from Standard)
           ---C++: return const &
           ---C++: inline
           returns Triangle from BRepMesh;


           -- Implementation :

           Init           (me            : in out;
                           Vertices      : in out Array1OfVertexOfDelaun from BRepMesh);
           ---Purpose: Initializes the triangulation with an Array of
           --          Vertex.

           Compute        (me            : in out;
                            VertexIndices : in out Array1OfInteger from TColStd);
           ---Purpose: Computes the triangulation and add the vertices
           --          edges and triangles to the Mesh data structure.


           SuperMesh      (me            : in out;
                           theBox        : Box2d from Bnd);
           ---Purpose: Build the super mesh .


           FrontierAdjust (me            : in out)
           ---Purpose: Adjust the mesh on the frontier.
           is private;


           MeshLeftPolygonOf  (me        : in out;
                               EdgeIndex : Integer from Standard;
                               EdgeSens  : Boolean from Standard)
              ---Purpose: Find left polygon of the edge and call MeshPolygon.
              is private;


            MeshPolygon    (me            : in out;
                            Polygon       : in out SequenceOfInteger from TColStd)
                  ---Purpose: Mesh closed polygon.
              is private;


            CreateTriangles(me            : in out; 
                            vertexIndex   : Integer from Standard; 
                --vertex        : in Vertex from BRepMesh; 
                                freeEdges: out MapOfIntegerInteger from BRepMesh)
                ---Purpose: Creates the triangles beetween the node 
                --          <Vertex> and the polyline <freeEdges>.
              is private;


           DeleteTriangle (me         : in out; 
                            TrianIndex : Integer from Standard; 
                            freeEdges  : out MapOfIntegerInteger from BRepMesh)
               ---Purpose: Deletes the triangle of index <TrianIndex> and
               --          add the free edges to the map.
               --          When an edge is suppressed more than one time 
               --          it is destroyed.
               is private;
               
               
           Perform (me: in out;
                    theBndBox       : out Box2d from Bnd;
                    theVertexIndices: out Array1OfInteger from TColStd)
              is private;


           Contains       (me;
                           TrianIndex    : Integer from Standard;
                           theVertex     : in Vertex from BRepMesh;
                           edgeOn        : out Integer from Standard)
            ---Purpose: Test  if   triangle   of  index   <TrianIndex>
            --          contains geometricaly <theVertex>. If <EdgeOn>
            --          is != 0  then theVertex is  on Edge  of  index
            --          <edgeOn>.
            returns Boolean from Standard;


            CreateTrianglesOnNewVertices(me            : in out;
                                       theVertexIndices: out Array1OfInteger from TColStd)
                --vertex        : in Vertex from BRepMesh; 
                ---Purpose: Creates the triangles on new nodes
              is private;


            fields  MeshData               : DataStructureOfDelaun from BRepMesh;
                    PositiveOrientation    : Boolean from Standard;
                    tCircles               : CircleTool from BRepMesh;
                    supVert1               : Integer from Standard;
                    supVert2               : Integer from Standard;
                    supVert3               : Integer from Standard;
                    supTrian               : Triangle from BRepMesh;
                    mapEdges               : MapOfInteger from BRepMesh;


end Delaun;