1 -- GEOM PARTITION : partition algorithm
3 -- Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 -- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 -- This library is free software; you can redistribute it and/or
7 -- modify it under the terms of the GNU Lesser General Public
8 -- License as published by the Free Software Foundation; either
9 -- version 2.1 of the License.
11 -- This library is distributed in the hope that it will be useful,
12 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
13 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 -- Lesser General Public License for more details.
16 -- You should have received a copy of the GNU Lesser General Public
17 -- License along with this library; if not, write to the Free Software
18 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 -- See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 -- File : Partition_Spliter.cdl
25 -- Author : Benedicte MARTIN
28 class Spliter from Partition
30 ---Purpose: Split solids, shells and faces into parts of the
31 -- same topology if reconstruction level is not
35 Inter3d from Partition,
36 Loop2d from Partition,
38 ShapeEnum from TopAbs,
43 MapOfOrientedShape from TopTools,
44 IndexedMapOfShape from TopTools,
45 DataMapOfShapeShape from TopTools,
46 ListOfShape from TopTools,
47 MapOfShape from TopTools,
52 Create returns Spliter from Partition;
53 ---Purpose: constructor
55 AddShape ( me : in out; S : Shape from TopoDS);
56 ---Purpose: add object Shape to be splitted.
57 -- If S is a COMPOUND or COMPSOLID, it will be
58 -- exploded in order to get more simple object
60 -- Object shapes that are vertices, edges or wires
61 -- won't be splitted and won't be in a result.
63 AddTool ( me : in out; S : Shape from TopoDS);
64 ---Purpose: add cutting tool
66 Compute (me : in out; Limit : ShapeEnum from TopAbs
68 ---Purpose: produce a result which is a compound of parts of
69 -- object shapes. A part can be either a vertex,
70 -- edge, wire, face, shell or solid.
71 -- By default, a part is of the same topology as an
72 -- object shape, else <Limit> restricts parts
74 -- If <Limit> == TopAbs_VERTEX, only new vertices are
75 -- returned in the result
77 KeepShapesInside (me : in out; S : Shape from TopoDS);
78 ---Purpose: remove shapes that are outside of S from result.
79 -- S should be an object shape.
80 ---Warning: call it after Compute()
82 RemoveShapesInside (me : in out; S : Shape from TopoDS);
83 ---Purpose: remove shapes that are inside S from result.
84 -- S should be an object shape.
85 ---Warning: call it after Compute()
87 Shape ( me ) returns Shape from TopoDS;
88 ---Purpose: return resulting compound
91 ---Purpose: clear fields
94 ---Category: private methods
97 MakeSolids (me: in out; Solid : Shape from TopoDS;
98 Shells: in out ListOfShape from TopTools)
100 ---Purpose: make solids out of Shells
102 MakeShells (me: in out; S : Shape from TopoDS;
103 NS: in out ListOfShape from TopTools) is private;
104 ---Purpose: split S into shells
106 MakeFaces (me: in out; S : Shape from TopoDS)
107 returns Shape from TopoDS is private;
108 ---Purpose: split faces of S, return compound of new faces
111 E : Edge from TopoDS;
112 VOnE : ListOfShape from TopTools;
113 NE : in out ListOfShape from TopTools)
115 ---Purpose: cut E by vertices VOnE, return list of new edges
118 FindFacesInside (me: in out; S : Shape from TopoDS;
119 CheckClosed : Boolean = Standard_False;
120 All : Boolean = Standard_False)
121 returns Shape from TopoDS is private;
122 ---Purpose: return compound of faces of other shapes that are
123 -- inside <S>. <S> must have image in myImageShape.
124 -- <CheckClosed> makes avoid faces that do not form a
126 -- <All> makes return already added faces
128 CheckTool ( me: in out; S : Shape from TopoDS)
129 returns Boolean from Standard is private;
130 ---Purpose: Return True if <S> is a tool shape. Prepare tool
131 -- faces of <S> for the search of internal faces.
133 MergeEqualEdges (me: in out; LE : ListOfShape from TopTools) is private;
134 ---Purpose: among LE, find equal edges, choose ones to keep
135 -- and make them have pcurves on all faces they are
137 -- <LE> contains edge splits
139 IsInside (myclass; S1,S2 : Shape from TopoDS)
140 returns Boolean from Standard is private;
141 ---Purpose: Return True if the first vertex of S1 inside S2.
142 -- If S1.IsNull(), check infinite point against S2.
144 GetOriginalShape(me; aShape : Shape from TopoDS)
145 returns Shape from TopoDS is private;
146 ---Purpose: Return the shape aShape originates from. aShape
147 -- should be a face or more complex result shape
149 FindToolsToReconstruct(me: in out) is private;
150 ---Purpose: find and store as objects tools which interfere
151 -- with solids or are inside solids without
156 myDoneStep : ShapeEnum from TopAbs; -- rebuilt level
157 myShape : Compound from TopoDS; -- result
158 myBuilder : Builder from BRep;
160 myListShapes : ListOfShape from TopTools; -- object shapes
161 myMapFaces : MapOfShape from TopTools; -- object faces
162 myMapTools : MapOfShape from TopTools; -- tool faces
163 myEqualEdges : MapOfShape from TopTools; -- equal splits
164 myNewSection : MapOfShape from TopTools; -- new secton edges
165 myClosedShapes : MapOfShape from TopTools;
166 mySharedFaces : MapOfShape from TopTools; -- faces shared by several shapes
167 myWrappingSolid: MapOfShape from TopTools; -- solids having other shapes inside
168 myFaceShapeMap : DataMapOfShapeShape from TopTools; -- to find a shape by face
170 myInternalFaces: DataMapOfShapeShape from TopTools; -- shape and its internal faces
171 myIntNotClFaces: DataMapOfShapeShape from TopTools; -- internal but not closed
174 myAsDes : AsDes from BRepAlgo;
175 myImagesFaces : Image from BRepAlgo;
176 myImagesEdges : Image from BRepAlgo;
177 myImageShape : Image from BRepAlgo;
179 -- contains info of same domain shapes and section edges
180 myInter3d : Inter3d from Partition;
182 -- avoid rebuilding twice commont part of solids
183 myAddedFacesMap: MapOfOrientedShape from TopTools;