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