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 MakeShells (me: in out; S : Shape from TopoDS;
98 NS: in out ListOfShape from TopTools) is private;
99 ---Purpose: split S into shells
101 MakeFaces (me: in out; S : Shape from TopoDS)
102 returns Shape from TopoDS is private;
103 ---Purpose: split faces of S, return compound of new faces
106 E : Edge from TopoDS;
107 VOnE : ListOfShape from TopTools;
108 NE : in out ListOfShape from TopTools)
110 ---Purpose: cut E by vertices VOnE, return list of new edges
113 FindFacesInside (me: in out; S : Shape from TopoDS;
114 CheckClosed : Boolean = Standard_False;
115 All : Boolean = Standard_False)
116 returns Shape from TopoDS is private;
117 ---Purpose: return compound of faces of other shapes that are
118 -- inside <S>. <S> must have image in myImageShape.
119 -- <CheckClosed> makes avoid faces that do not form a
121 -- <All> makes return already added faces
123 CheckTool ( me: in out; S : Shape from TopoDS)
124 returns Boolean from Standard is private;
125 ---Purpose: Return True if <S> is a tool shape. Prepare tool
126 -- faces of <S> for the search of internal faces.
128 MergeEqualEdges (me: in out; LE : ListOfShape from TopTools) is private;
129 ---Purpose: among LE, find equal edges, choose ones to keep
130 -- and make them have pcurves on all faces they are
132 -- <LE> contains edge splits
136 myDoneStep : ShapeEnum from TopAbs; -- reconstructed topology
137 myShape : Compound from TopoDS; -- result
138 myBuilder : Builder from BRep;
140 myListShapes : ListOfShape from TopTools; -- object shapes
141 myMapFaces : MapOfShape from TopTools; -- object faces
142 myMapTools : MapOfShape from TopTools; -- tool faces
143 myFaceShapeMap : DataMapOfShapeShape from TopTools; -- to find a shape by face
145 myNewSection : MapOfShape from TopTools; -- new secton edges
147 myAsDes : AsDes from BRepAlgo;
148 myImagesFaces : Image from BRepAlgo;
149 myImagesEdges : Image from BRepAlgo;
150 myImageShape : Image from BRepAlgo;
152 -- contains info of same domain shapes and section edges
153 myInter3d : Inter3d from Partition;
155 -- avoid rebuilding twice commont part of solids
156 myAddedFacesMap: MapOfOrientedShape from TopTools;
159 myEqualEdges : MapOfShape from TopTools;
161 -- shape and its internal faces
162 myInternalFaces: DataMapOfShapeShape from TopTools;
163 myIntNotClFaces: DataMapOfShapeShape from TopTools;-- internal but not closed