0024428: Implementation of LGPL license
[occt.git] / src / BRepAlgo / BRepAlgo_DSAccess.cdl
1 -- Created on: 1997-08-13
2 -- Created by: Prestataire Mary FABIEN
3 -- Copyright (c) 1997-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
5 --
6 -- This file is part of Open CASCADE Technology software library.
7 --
8 -- This library is free software; you can redistribute it and / or modify it
9 -- under the terms of the GNU Lesser General Public version 2.1 as published
10 -- by the Free Software Foundation, with special exception defined in the file
11 -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 -- distribution for complete text of the license and disclaimer of any warranty.
13 --
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
16
17 class DSAccess from BRepAlgo
18
19     ---Purpose: 
20
21 uses
22
23     HDataStructure from TopOpeBRepDS,
24     Kind           from TopOpeBRepDS,
25     Shape          from TopoDS,
26     Wire           from TopoDS,
27     Face           from TopoDS,
28     Vertex         from TopoDS,
29     ListOfInteger  from TColStd,  
30     SetOfInteger   from TColStd,
31     MapOfInteger   from TColStd,
32     ListOfShape    from TopTools,
33     State          from TopAbs,
34     CheckStatus    from BRepAlgo,
35     EdgeConnector  from BRepAlgo,
36     LoopSet        from TopOpeBRepBuild,
37     HBuilder       from TopOpeBRepBuild,
38     DataMapOfShapeInterference  from BRepAlgo,
39     DataMapOfShapeShape from TopTools,
40     DataMapOfShapeListOfShape   from TopTools,
41     DSFiller from TopOpeBRep
42
43 is
44     
45     Create returns DSAccess from BRepAlgo;
46     
47     Init(me: in out);
48     ---Purpose: Clears the internal data structure, including the
49     --Shapes of  Load().
50
51
52 -- Filling of the DS
53
54     Load(me : in out; S : Shape from TopoDS);
55     ---Purpose: Loads the shape in DS.
56     --          
57
58     Load(me : in out; S1, S2 : in out Shape from TopoDS);
59     ---Purpose: Loads two shapes in the DS without intersecting them.
60
61     Intersect(me : in out);
62     ---Purpose: Intersects two shapes at input and loads the DS with
63     --          their intersection. Clears the TopOpeBRepBuild_HBuilder if
64     --          necessary
65
66     Intersect(me : in out; S1, S2 : Shape from TopoDS);
67     ---Purpose: Intersects the faces contained in two given shapes
68     --          and loads them in the DS. Clears the TopOpeBRepBuild_HBuilder
69     --          if necessary
70
71     SameDomain(me : in out;S1, S2 : Shape from TopoDS);
72     ---Purpose: This method does the same thing as the previous,
73     --          but faster. There is no intersection face/face 3D.
74     --          The faces have the same support(surface). No test of
75     --          tangency (that is why it is faster). Intersects in 2d
76     --          the faces tangent F1 anf F2.
77
78
79 -- Construction des Sections
80
81     GetSectionEdgeSet(me : in out; S1,S2 : Shape from TopoDS)
82     ---Purpose: returns compounds of Edge connected with section, which 
83     --          contains sections between faces contained in S1 and S2.
84     --          returns an empty list of Shape if S1 or S2 do not contain
85     --          face.
86     --          calls GetSectionEdgeSet() if it has not already been done
87     ---C++: return const &
88     returns ListOfShape from TopTools;
89
90     GetSectionEdgeSet(me : in out)
91     ---Purpose: returns all compounds of edges connected with section 
92     --          contained in the DS
93     ---C++: return const &
94     returns ListOfShape from TopTools;
95     
96     IsWire(me : in out;Compound : Shape from TopoDS) 
97     ---Purpose: NYI
98     returns Boolean from Standard;
99     
100     Wire(me : in out;Compound : Shape from TopoDS)
101     ---Purpose: NYI
102     ---C++: return const &
103     returns Shape from TopoDS;
104     
105     SectionVertex(me : in out;S1 : Shape from TopoDS;S2 : Shape from TopoDS)
106     ---Purpose: NYI
107     --          returns the vertex of section, which contains the section
108     --          between face S1 and edge S2 (returns an empty Shape
109     --          if S1 is not a face or if S2 is not an edge)
110     ---C++: return const &
111     returns ListOfShape from TopTools;
112
113
114 -- Edition de la SD
115
116     SuppressEdgeSet(me : in out; Compound : Shape from TopoDS);
117     ---Purpose: Invalidates a complete line of section. All  
118     --          Edges connected by Vertex or a Wire. Can be 
119     --          a group of connected Edges, which do not form a 
120     --          standard Wire. 
121               
122     ChangeEdgeSet(me : in out; Old,  New : Shape from TopoDS);
123     ---Purpose:  Modifies a line of section.  <New> -- should be a
124     --          Group of Edges connected by Vertex.  -- Can be a
125     --          Wire.  Can be a group of connected Edges that do not
126     --          form a standard Wire.   <New> should be sub-groupn of <Old>
127     --          
128     --          
129
130     SuppressSectionVertex(me : in out;V : Vertex from TopoDS);
131     ---Purpose: NYI
132     --          Make invalid a Vertex of section. The Vertex shoud be 
133     --          reconstructed from a point.
134
135     Suppress(me  :  in  out;  Compound  :  Shape  from TopoDS; 
136              KeepComp  :  Shape  from TopoDS) 
137     is  private; 
138
139 -- Reconstruction des Shapes
140
141     Merge(me : in out; state1 : State from TopAbs;
142                        state2 : State from TopAbs)
143     ---C++: return const &
144     returns Shape from TopoDS;
145
146     Merge(me : in out; state1 : State from TopAbs)
147     ---C++: return const &
148     returns Shape from TopoDS;
149
150     Propagate(me :in out;what  : State from TopAbs;
151                          FromShape : Shape from TopoDS;
152                          LoadShape : Shape from TopoDS)
153     ---Purpose:  NYI   Propagation  of a state starting from the shape
154     --          FromShape = edge or vertex of section, face or
155     --          Coumpound de section. LoadShape is either S1,
156     --          or S2  (see the method Load).   Propagation   from
157     --          FromShape, on the states <what> of LoadShape.
158     --          Return a Wire in 2d, a Shell in 3d.
159     --          Specifications are incomplete, to be redefined for the typologies
160     --          correpsonding to  <FromShape> and the result :
161     --          exemple :    FromShape        resultat
162     --                         vertex           wire (or edge)
163     --                    edge of section       face (or shell)
164     --                    compound of section   shell
165     --                      ...                  ...
166     ---C++: return const &
167     returns Shape from TopoDS;
168
169     PropagateFromSection(me : in out;SectionShape : Shape from TopoDS)
170     ---Purpose: SectionShape est soit un Vertex de section(NYI), soit
171     --          une Edge de section. Propagation  des shapes
172     --          de section en partant de SectionShape.
173     --          return un Compound de section.
174     ---C++:   return const &
175     returns Shape from TopoDS; 
176      
177      
178 -- History
179    Modified (me: in out; S : Shape from TopoDS)
180     ---Purpose: Returns the list of the descendant shapes of the shape <S>.
181     ---C++: return const & 
182     returns ListOfShape from TopTools ; 
183      
184    IsDeleted (me: in out; S : Shape from TopoDS)
185     ---Purpose: Returns the fact that the shape <S> has been deleted or not
186     --          by the boolean operation.
187     returns Boolean;     
188     
189 -- Verification de la DS
190
191     Check(me : in out)
192     ---Purpose: NYI
193     --          coherence of the internal Data Structure.
194     returns CheckStatus from BRepAlgo;
195
196 -- private
197
198     RemoveEdgeInterferences(me : in out;iF1 : Integer;
199                                         iF2 : Integer;
200                                         iCurve : Integer) 
201     ---purpose: case of SectEdge coming from Curve
202     --     for each of F1 and F2, find Edges
203     --     for each Edge :
204     --     remove the impact on geometry of vertexes
205     --     of  SectEdge. If there is no other impact at these edges 
206     --     and if these Edges are not SameDomain,
207     --     make unKeepShape.
208     is private;
209     
210     RemoveEdgeInterferences(me : in out;iE1  : Integer;
211                                         iE2 : Integer;
212                                         SectEdge :Shape from TopoDS) 
213     ---purpose: case of SectEdge coming from Edge(s)
214     --        if iE1 and iE2 are Edges :
215     --          Remove the impact of DSEdge(= iE1 or iE2) of 
216     --          geometry a vertex of SectEdge, and if there is nothing
217     --           else make unkeep on DSEdge 
218     --          if iE1 or iE2 == 0, no interference on Edges in the DS 
219     --        if iE1 and iE2 are Faces :
220     --          for each of faces F1 and F2, explode into Edges
221     --             for each Edge :
222     --              remove interferences a vertex of SectEdge as geometry.
223     --              If no other interferences are attached to 
224     --              these Edges, and if these Edges are not SameDomain,
225     --              make unKeepShape.
226     is private;
227     
228     RemoveFaceInterferences(me : in out;iF1 : Integer;
229                                         iF2 : Integer;
230                                         iE1 : Integer;
231                                         iE2 : Integer)
232     --purpose  : case of SectEdge coming from Edge(s)
233     --        Remove the interferences between F1 and F2 concerning 
234     --        DSEdge (= E1 or E2) :
235     --          a) if DSEdge is not SameDomain -> the edge is Removed
236     --          b) if there are no interferences of DSEdge of 
237     --                 GeomtryType == VERTEX 
238     --                 with Edge of DSFace(= F1 or F2)
239     --    if DSFace has no more interference and is not SameDomain,
240     --        make unkeep DSFace.
241     is private;
242
243     RemoveFaceInterferences(me : in out;iF1 : Integer;
244                                         iF2 : Integer;
245                                         iCurve : Integer)
246     ---purpose: case of SectEdge coming from Curve
247     --           remove the interferences of Geometry iCurve between F1 and F2.
248     --           if Face(= F1 or F2) has no other interferences, and if Face
249     --           is not SameDomain, make unKeepShape Face.
250     is private;
251
252     RemoveEdgeInterferencesFromFace(me : in out;
253                                     iF1 : Integer;
254                                     iF2 : Integer;
255                                     ipv1 : Integer;
256                                     kind1  : Kind from TopOpeBRepDS;
257                                     ipv2 : Integer;
258                                     kind2  : Kind from TopOpeBRepDS)
259     ---purpose: remove from iF1 or iF2 interferences of Edges
260     --          that have GeometryType kind1/kind2 and 
261     --          Geometry ipv1/ipv2.
262     --          if kind1/kind2 == TopAbs_VERTEX -> RemoveEdgeFromFace
263     is private;
264
265     RemoveEdgeFromFace(me : in out;iF : Integer;
266                                    iV : Integer)
267     ---purpose: remove from the DS the Edges that belong to iF
268     --          that have iV as Vertex if they do not have Geometry and
269     --          are not SameDomain.
270     is private;
271     
272     PntVtxOnCurve(me : in out; iCurve : Integer;
273                        ipv1 : in out Integer;
274                        ik1  : in out Kind from TopOpeBRepDS;
275                        ipv2 : in out Integer;
276                        ik2  : in out Kind from TopOpeBRepDS)
277     ---purpose: Find points/vertex on curves
278     is private;
279
280     PntVtxOnSectEdge(me : in out; SectEdge : Shape from TopoDS;
281                           ipv1 : in out Integer;
282                           ik1  : in out Kind from TopOpeBRepDS;
283                           ipv2 : in out Integer;
284                           ik2  : in out Kind from TopOpeBRepDS)
285     ---purpose  : Find points/Vertex on SectEdge
286     is private;
287
288     RemoveEdgeSameDomain(me : in out; iE1 : Integer;
289                                       iE2 : Integer)
290     is private;
291
292     RemoveFaceSameDomain(me : in out; C : Shape from TopoDS)
293     is private;
294
295     FindGoodFace(me : in out; iE : Integer;
296                               iF1 : in out Integer;
297                               b : in out Boolean)
298     ---C++: return &
299     returns ListOfInteger from TColStd is private;
300
301     
302     
303     RemoveFaceSameDomain(me : in out; iF1 : Integer;
304                                       iF2 : Integer)
305     is private;
306
307     GoodInterf(me : in out; SectEdge : Shape from TopoDS;
308                             kind : Kind from TopOpeBRepDS;
309                             iPointVertex : Integer)
310     returns Boolean is private;
311     
312     DS(me) returns HDataStructure from TopOpeBRepDS;
313     ---C++: return const &
314
315     ChangeDS(me : in out) returns HDataStructure from TopOpeBRepDS;
316     ---C++: return &
317
318     Builder(me) returns HBuilder from TopOpeBRepBuild;
319     ---C++: return const &
320
321     ChangeBuilder(me : in out) returns HBuilder from TopOpeBRepBuild;
322     ---C++: return &
323
324 fields
325
326     myHDS : HDataStructure from TopOpeBRepDS;
327     myDSFiller : DSFiller  from TopOpeBRep;
328     myHB  : HBuilder       from TopOpeBRepBuild;
329     myEC  : EdgeConnector  from BRepAlgo;
330     myS1  : Shape from TopoDS;
331     myS2  : Shape from TopoDS;
332     myState1,myState2 : State from TopAbs;
333     
334     myListOfCompoundOfEdgeConnected : ListOfShape from TopTools;
335     myCurrentList                   : ListOfShape from TopTools;
336     myRecomputeBuilderIsDone : Boolean from Standard;
337     myGetSectionIsDone       : Boolean from Standard;
338     myResultShape            : Shape from TopoDS;
339
340     myWire : Wire from TopoDS;
341     myListOfVertex : ListOfShape from TopTools; 
342     myModified     : ListOfShape from TopTools;
343     myEmptyShape : Shape from TopoDS;
344     myEmptyListOfShape : ListOfShape from TopTools;
345     myEmptyListOfInteger : ListOfInteger from TColStd;
346
347     myCompoundWireMap : DataMapOfShapeShape from TopTools; 
348     mySetOfKeepPoint  : SetOfInteger  from  TColStd;
349     
350 friends
351     
352     class BooleanOperations
353
354 end DSAccess from BRepAlgo;