0021762: Integration of new Boolean Operation algorithm to OCCT.
[occt.git] / src / BRepFeat / BRepFeat_Builder.cdl
1 -- Created on: 2012-06-01
2 -- Created by: Eugeny MALTCHIKOV
3 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
4 --
5 -- The content of this file is subject to the Open CASCADE Technology Public
6 -- License Version 6.5 (the "License"). You may not use the content of this file
7 -- except in compliance with the License. Please obtain a copy of the License
8 -- at http://www.opencascade.org and read it completely before using this file.
9 --
10 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
12 --
13 -- The Original Code and all software distributed under the License is
14 -- distributed on an "AS IS" basis, without warranty of any kind, and the
15 -- Initial Developer hereby disclaims all such warranties, including without
16 -- limitation, any warranties of merchantability, fitness for a particular
17 -- purpose or non-infringement. Please see the License for the specific terms
18 -- and conditions governing the rights and limitations under the License.
19  
20 class Builder from BRepFeat
21     inherits BOP from BOPAlgo 
22  
23     ---Purpose: Provides a basic tool to implement features topological  
24     --          operations. The main goal of the algorithm is to perform
25     --          the result of the operation according to the  
26     --          kept parts of the tool.
27     --          Input data: a) DS;
28     --                      b) The kept parts of the tool;
29     --                      c) Operation required.
30     --          Steps: a) Fill myShapes, myRemoved maps; 
31     --                 b) Rebuild edges and faces; 
32     --                 c) Build images of the object; 
33     --                 d) Build the result of the operation.
34     --          Result: Result shape of the operation required.
35      
36 uses 
37     Shape from TopoDS,  
38     Face from TopoDS,  
39     ListOfShape from TopTools, 
40     MapOfOrientedShape from BOPCol,  
41     MapOfShape from BOPCol,  
42     IndexedMapOfShape from BOPCol, 
43     DataMapOfShapeListOfShape from BOPCol, 
44     DataMapOfShapeShape from BOPCol,  
45     BaseAllocator from BOPCol,
46     ListOfShape from BOPCol,
47     BOP from BOPAlgo
48      
49 is 
50     Create 
51       returns Builder from BRepFeat;  
52     ---C++: alias "Standard_EXPORT virtual ~BRepFeat_Builder();"
53  
54     Clear(me:out) 
55       is redefined;
56     ---Purpose:  Clears internal fields and arguments.
57  
58     Init(me:out; 
59         theShape : Shape from TopoDS); 
60     ---Purpose: Initialyzes the object of local boolean operation.
61     --          
62  
63     Init(me:out; 
64         theShape : Shape from TopoDS; 
65         theTool  : Shape from TopoDS);
66     ---Purpose: Initialyzes the arguments of local boolean operation.
67     --          
68   
69     SetOperation(me:out; 
70         theFuse : Integer from Standard);
71     ---Purpose: Sets the operation of local boolean operation.  
72     --          If theFuse = 0 than the operation is CUT, otherwise FUSE.
73  
74     SetOperation(me:out; 
75         theFuse : Integer from Standard;
76         theFlag : Boolean from Standard);
77     ---Purpose: Sets the operation of local boolean operation.
78     --          If theFlag = TRUE it means that no selection of parts 
79     --          of the tool is needed, t.e. no second part. In that case 
80     --          if theFuse = 0 than operation is COMMON, otherwise CUT21. 
81     --          If theFlag = FALSE SetOperation(theFuse) function  is called.
82     
83     Prepare(me:out) 
84     is redefined protected;   
85     ---Purpose: Prepares builder of local operation.
86     --          
87     
88     PartsOfTool(me:out; 
89         theLT  :  out ListOfShape from TopTools); 
90     ---Purpose: Collects parts of the tool.
91      
92     KeepParts(me:out;
93         theIm : ListOfShape from TopTools);
94     ---Purpose: Initialyzes parts of the tool for second step of algorithm.
95     --          Collects shapes and all sub-shapes into myShapes map.
96  
97     KeepPart(me:out;
98         theS : Shape from TopoDS);
99     ---Purpose: Adds shape theS and all its sub-shapes into myShapes map.
100     --          
101  
102     PerformResult(me:out);
103     ---Purpose: Main function to build the result of the 
104     --          local operation required.
105     
106     RebuildFaces(me:out); 
107     ---Purpose: Rebuilds faces in accordance with the kept parts of the tool.
108     --          
109      
110     RebuildEdge(me:out; 
111         theE:Shape from TopoDS; 
112         theF:Face from TopoDS; 
113         theME:MapOfShape from BOPCol; 
114         aLEIm:out ListOfShape from BOPCol); 
115     ---Purpose: Rebuilds edges in accordance with the kept parts of the tool.
116     --          
117     
118     CheckSolidImages(me:out);
119     ---Purpose: Collects the images of the object, that contains in 
120     --          the images of the tool.
121         
122     FillRemoved(me:out); 
123     ---Purpose: Collects the removed parts of the tool into myRemoved map.
124     --          
125     
126     FillRemoved(me:out; 
127         theS : Shape from TopoDS;
128         theM : in out MapOfShape from BOPCol);  
129     ---Purpose: Adds the shape S and its sub-shapes into myRemoved map.
130     --          
131          
132     FillIn3DParts(me:out; 
133         theInParts:out DataMapOfShapeListOfShape from BOPCol; 
134         theDraftSolids:out DataMapOfShapeShape from BOPCol; 
135         theAllocator:BaseAllocator from BOPCol)  
136     is redefined protected;   
137     ---Purpose: Function is redefined to avoid the usage of removed faces.
138     --          
139
140 fields 
141     myShapes : MapOfShape from BOPCol is protected;
142     myRemoved : MapOfShape from BOPCol is protected; 
143     myFuse : Integer from Standard is protected; 
144  
145 end Builder;