1 -- Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 -- Copyright (C) 2003-2007 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 -- File : Partition_Spliter.cdl
23 -- Author : Benedicte MARTIN
26 class Spliter from Partition
28 ---Purpose: Split solids, shells and faces into parts of the
29 -- same topology if reconstruction level is not
33 Inter3d from Partition,
34 Loop2d from Partition,
36 ShapeEnum from TopAbs,
41 MapOfOrientedShape from TopTools,
42 IndexedMapOfShape from TopTools,
43 DataMapOfShapeShape from TopTools,
44 ListOfShape from TopTools,
45 MapOfShape from TopTools,
50 Create returns Spliter from Partition;
51 ---Purpose: constructor
53 AddShape ( me : in out; S : Shape from TopoDS);
54 ---Purpose: add object Shape to be splitted.
55 -- If S is a COMPOUND or COMPSOLID, it will be
56 -- exploded in order to get more simple object
58 -- Object shapes that are vertices, edges or wires
59 -- won't be splitted and won't be in a result.
61 AddTool ( me : in out; S : Shape from TopoDS);
62 ---Purpose: add cutting tool
64 Compute (me : in out; Limit : ShapeEnum from TopAbs
66 ---Purpose: produce a result which is a compound of parts of
67 -- object shapes. A part can be either a vertex,
68 -- edge, wire, face, shell or solid.
69 -- By default, a part is of the same topology as an
70 -- object shape, else <Limit> restricts parts
72 -- If <Limit> == TopAbs_VERTEX, only new vertices are
73 -- returned in the result
75 KeepShapesInside (me : in out; S : Shape from TopoDS);
76 ---Purpose: remove shapes that are outside of S from result.
77 -- S should be an object shape.
78 ---Warning: call it after Compute()
80 RemoveShapesInside (me : in out; S : Shape from TopoDS);
81 ---Purpose: remove shapes that are inside S from result.
82 -- S should be an object shape.
83 ---Warning: call it after Compute()
85 Shape ( me ) returns Shape from TopoDS;
86 ---Purpose: return resulting compound
89 ---Purpose: clear fields
92 ---Category: private methods
95 MakeSolids (me: in out; Solid : Shape from TopoDS;
96 Shells: in out ListOfShape from TopTools)
98 ---Purpose: make solids out of Shells
100 MakeShells (me: in out; S : Shape from TopoDS;
101 NS: in out ListOfShape from TopTools) is private;
102 ---Purpose: split S into shells
104 MakeFaces (me: in out; S : Shape from TopoDS)
105 returns Shape from TopoDS is private;
106 ---Purpose: split faces of S, return compound of new faces
109 E : Edge from TopoDS;
110 VOnE : ListOfShape from TopTools;
111 NE : in out ListOfShape from TopTools)
113 ---Purpose: cut E by vertices VOnE, return list of new edges
116 FindFacesInside (me: in out; S : Shape from TopoDS;
117 CheckClosed : Boolean = Standard_False;
118 All : Boolean = Standard_False)
119 returns Shape from TopoDS is private;
120 ---Purpose: return compound of faces of other shapes that are
121 -- inside <S>. <S> must have image in myImageShape.
122 -- <CheckClosed> makes avoid faces that do not form a
124 -- <All> makes return already added faces
126 CheckTool ( me: in out; S : Shape from TopoDS)
127 returns Boolean from Standard is private;
128 ---Purpose: Return True if <S> is a tool shape. Prepare tool
129 -- faces of <S> for the search of internal faces.
131 MergeEqualEdges (me: in out; LE : ListOfShape from TopTools) is private;
132 ---Purpose: among LE, find equal edges, choose ones to keep
133 -- and make them have pcurves on all faces they are
135 -- <LE> contains edge splits
137 IsInside (myclass; S1,S2 : Shape from TopoDS)
138 returns Boolean from Standard is private;
139 ---Purpose: Return True if the first vertex of S1 inside S2.
140 -- If S1.IsNull(), check infinite point against S2.
142 GetOriginalShape(me; aShape : Shape from TopoDS)
143 returns Shape from TopoDS is private;
144 ---Purpose: Return the shape aShape originates from. aShape
145 -- should be a face or more complex result shape
147 FindToolsToReconstruct(me: in out) is private;
148 ---Purpose: find and store as objects tools which interfere
149 -- with solids or are inside solids without
154 myDoneStep : ShapeEnum from TopAbs; -- rebuilt level
155 myShape : Compound from TopoDS; -- result
156 myBuilder : Builder from BRep;
158 myListShapes : ListOfShape from TopTools; -- object shapes
159 myMapFaces : MapOfShape from TopTools; -- object faces
160 myMapTools : MapOfShape from TopTools; -- tool faces
161 myEqualEdges : MapOfShape from TopTools; -- equal splits
162 myNewSection : MapOfShape from TopTools; -- new secton edges
163 myClosedShapes : MapOfShape from TopTools;
164 mySharedFaces : MapOfShape from TopTools; -- faces shared by several shapes
165 myWrappingSolid: MapOfShape from TopTools; -- solids having other shapes inside
166 myFaceShapeMap : DataMapOfShapeShape from TopTools; -- to find a shape by face
168 myInternalFaces: DataMapOfShapeShape from TopTools; -- shape and its internal faces
169 myIntNotClFaces: DataMapOfShapeShape from TopTools; -- internal but not closed
172 myAsDes : AsDes from BRepAlgo;
173 myImagesFaces : Image from BRepAlgo;
174 myImagesEdges : Image from BRepAlgo;
175 myImageShape : Image from BRepAlgo;
177 -- contains info of same domain shapes and section edges
178 myInter3d : Inter3d from Partition;
180 -- avoid rebuilding twice commont part of solids
181 myAddedFacesMap: MapOfOrientedShape from TopTools;