0024023: Revamp the OCCT Handle -- ambiguity
[occt.git] / src / BOPAlgo / BOPAlgo_MakerVolume.cdl
CommitLineData
92ae0f2f 1-- Created by: Eugeny MALTCHIKOV
2-- Copyright (c) 2014 OPEN CASCADE SAS
3--
4-- This file is part of Open CASCADE Technology software library.
5--
6-- This library is free software; you can redistribute it and/or modify it under
7-- the terms of the GNU Lesser General Public License version 2.1 as published
8-- by the Free Software Foundation, with special exception defined in the file
9-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10-- distribution for complete text of the license and disclaimer of any warranty.
11--
12-- Alternatively, this file may be used under the terms of Open CASCADE
13-- commercial license or contractual agreement.
14
15class MakerVolume from BOPAlgo
16 inherits Builder from BOPAlgo
17 ---Purpose:
18 -- The algorithm is to build solids from set of shapes.
19 -- It uses the BOPAlgo_Builder algorithm to intersect the given shapes
20 -- and build the images of faces (if needed) and BOPAlgo_BuilderSolid
21 -- algorithm to build the solids.
22 --
23 -- Steps of the algorithm:
24 -- 1. Collect all faces: intersect the shapes if necessary and collect
25 -- the images of faces, otherwise just collect the faces to the
26 -- <myFaces> list;
27 -- All faces on this step added twice, with orientation FORWARD
28 -- and REVERSED;
29 --
30 -- 2. Create bounding box covering all the faces from <myFaces> and
31 -- create solid box from corner points of that bounding box
32 -- (myBBox, mySBox). Add faces from that box to <myFaces>;
33 --
34 -- 3. Build solids from <myFaces> using BOPAlgo_BuilderSolid algorithm;
35 --
36 -- 4. Treat the result: Eliminate solid containig faces from <mySBox>;
37 --
38 -- 5. Fill internal shapes: add internal vertices and edges into
39 -- created solids;
40 --
41 -- 6. Prepare the history.
42 --
43 -- Fields:
44 -- <myIntersect> - boolean flag. It defines whether intersect shapes
45 -- from <myArguments> (if set to TRUE) or not (FALSE).
46 -- The default value is TRUE. By setting it to FALSE
47 -- the user should guarantee that shapes in <myArguments>
48 -- do not interfere with each other, otherwise the result
49 -- is unpredictable.
50 --
51 -- <myBBox> - bounding box, covering all faces from <myFaces>.
52 --
53 -- <mySBox> - Solid box created from the corner points of <myBBox>.
54 --
55 -- <myFaces> - the list is to keep the "final" faces, that will be
56 -- given to the BOPAlgo_BuilderSolid algorithm.
57 -- If the shapes have been interfered it should contain
58 -- the images of the source shapes, otherwise its just
59 -- the original faces.
60 -- It also contains the faces from <mySBox>.
61 --
62 --
63 -- Fields inherited from BOPAlgo_Builder:
64 --
65 -- <myArguments> - list of the source shapes. The source shapes can have
66 -- any type, but each shape must not be self-interfered.
67 --
68 -- <myShape> - Result shape:
69 -- - empty compound - if no solids were created;
70 -- - solid - if created only one solid;
71 -- - compound of solids - if created more than one solid.
72 --
73 --
74 -- Fields inherited from BOPAlgo_Algo:
75 --
76 -- <myRunParallel> - Defines whether the parallel processing is
77 -- switched on or not.
78 -- <myErrorStatus> - Error status of the operation:
79 -- 0 - operation successful;
80 -- 100 - no shapes to process;
81 -- 102 - BOPAlgo_PaveFiller algorithm has failed;
82 -- 103 - BOPAlgo_BuilderSolid algorithm has failed.
83 --
84 -- Example:
85 --
86 -- BOPAlgo_MakerVolume aMV;
87 -- //
88 -- aMV.SetArguments(aLS); //source shapes
89 -- aMV.SetRunParallel(bRunParallel); //parallel or single mode
90 -- aMV.SetIntersect(bIntersect); //intersect or not the shapes from <aLS>
91 -- //
92 -- aMV.Perform(); //perform the operation
93 -- if (aMV.ErrorStatus()) { //check error status
94 -- return;
95 -- }
96 -- //
97 -- const TopoDS_Shape& aResult = aMV.Shape(); //result of the operation
98 --
99
100uses
101 Shape from TopoDS,
102 BaseAllocator from BOPCol,
103 ListOfShape from BOPCol,
104 MapOfShape from BOPCol,
105 Box from Bnd,
106 Solid from TopoDS,
107 PaveFiller from BOPAlgo
108
109is
110
111 Create
112 returns MakerVolume from BOPAlgo;
113 ---C++: alias "virtual ~BOPAlgo_MakerVolume();"
114 ---C++: inline
115 ---Purpose:
116 -- Empty contructor.
117
118 Create(theAllocator: BaseAllocator from BOPCol)
119 returns MakerVolume from BOPAlgo;
120 ---C++: inline
121 ---Purpose:
122 -- Empty contructor.
123
124 Clear(me:out)
125 is redefined;
126 ---C++: inline
127 ---Purpose:
128 -- Clears the data.
129
130 SetIntersect(me:out;
131 bIntersect : Boolean from Standard);
132 ---C++: inline
133 ---Purpose:
134 -- Sets the flag myIntersect:
135 -- if <bIntersect> is TRUE the shapes from <myArguments> will be intersected.
136 -- if <bIntersect> is FALSE no intersection will be done.
137
138 IsIntersect(me)
139 returns Boolean from Standard;
140 ---C++: inline
141 ---Purpose:
142 -- Returns the flag <myIntersect>.
143
144 Box(me)
145 returns Solid from TopoDS;
146 ---C++: return const&
147 ---C++: inline
148 ---Purpose:
149 -- Returns the solid box <mySBox>.
150
151 Faces(me)
152 returns ListOfShape from BOPCol;
153 ---C++: return const&
154 ---C++: inline
155 ---Purpose:
156 -- Returns the processed faces <myFaces>.
157
158 CheckData(me:out)
159 is redefined protected;
160 ---Purpose:
161 -- Checks the data.
162
163 Perform(me:out)
164 is redefined;
165 ---Purpose:
166 -- Performs the operation.
167
168 PerformInternal1(me:out;
169 thePF: PaveFiller from BOPAlgo)
170 is redefined protected;
171 ---Purpose:
172 -- Performs the operation.
173
174 CollectFaces(me:out)
175 is protected;
176 ---Purpose:
177 -- Collects all faces.
178
179 MakeBox(me:out;
180 theBoxFaces : out MapOfShape from BOPCol)
181 is protected;
182 ---Purpose:
183 -- Makes solid box.
184
185 BuildSolids(me:out;
186 theLSR : out ListOfShape from BOPCol)
187 is protected;
188 ---Purpose:
189 -- Builds solids.
190
191 RemoveBox(me:out;
192 theLSR : out ListOfShape from BOPCol;
193 theBoxFaces : MapOfShape from BOPCol)
194 is protected;
195 ---Purpose:
196 -- Removes the covering box.
197
198 FillInternalShapes(me:out;
199 theLSR : ListOfShape from BOPCol)
200 is protected;
201 ---Purpose:
202 -- Fills the solids with internal shapes.
203
204 BuildShape(me:out;
205 theLSR : ListOfShape from BOPCol)
206 is protected;
207 ---Purpose:
208 -- Builds the result.
209
210fields
211
212 myIntersect : Boolean from Standard is protected;
213 myBBox : Box from Bnd is protected;
214 mySBox : Solid from TopoDS is protected;
215 myFaces : ListOfShape from BOPCol is protected;
216
217end MakerVolume;
218