Salome HOME
Fix for bug IPAL18899 : 4x REGRESS: Dump python on the study leads to fatal error...
[modules/geom.git] / src / PARTITION / Partition_Spliter.cdl
1 // Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3 // 
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.
8 // 
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.
13 //
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
17 //
18 -- See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 //
20 --  GEOM PARTITION : partition algorithm
21 --
22 --  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
23 --  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
24 -- 
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. 
29 -- 
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. 
34 -- 
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 
38 -- 
39 -- See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
40 --
41 --
42 --
43 --  File   : Partition_Spliter.cdl
44 --  Author : Benedicte MARTIN
45 --  Module : GEOM
46
47 class Spliter from Partition
48
49         ---Purpose: Split solids, shells and  faces  into parts of the
50         --          same  topology  if  reconstruction  level  is  not
51         --          limited.
52
53 uses
54     Inter3d             from Partition,
55     Loop2d              from Partition,
56     Builder             from BRep,
57     ShapeEnum           from TopAbs,
58     Compound            from TopoDS,
59     Face                from TopoDS,
60     Edge                from TopoDS,
61     Shape               from TopoDS,
62     MapOfOrientedShape  from TopTools,
63     IndexedMapOfShape   from TopTools,
64     DataMapOfShapeShape from TopTools,
65     ListOfShape         from TopTools,
66     MapOfShape          from TopTools,
67     AsDes               from BRepAlgo,
68     Image               from BRepAlgo
69
70 is
71     Create  returns Spliter from Partition;
72         ---Purpose: constructor
73
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
78         --          shapes. 
79         --          Object shapes that  are  vertices,  edges or wires
80         --          won't be splitted and won't be in a result.
81
82     AddTool  ( me : in out; S : Shape from TopoDS);
83         ---Purpose: add cutting tool
84
85     Compute (me : in out; Limit : ShapeEnum from TopAbs
86                           = TopAbs_SHAPE);
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
92         --          reconstruction.
93         --          If <Limit> == TopAbs_VERTEX, only new vertices are
94         --          returned in the result
95
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()
100
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()
105
106     Shape ( me ) returns Shape from TopoDS;
107         ---Purpose: return resulting compound
108
109     Clear ( me : in out);
110         ---Purpose: clear fields
111
112
113         ---Category: private methods
114
115
116     MakeSolids (me: in out; Solid : Shape from TopoDS;
117                             Shells: in out ListOfShape from TopTools) 
118         is private;
119         ---Purpose: make solids out of Shells
120
121     MakeShells (me: in out; S : Shape from TopoDS;
122                             NS: in out ListOfShape from TopTools) is private;
123         ---Purpose: split S into shells
124
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
128
129     MakeEdges (me; 
130                E : Edge from TopoDS;
131                VOnE : ListOfShape from TopTools;
132                NE : in out ListOfShape from TopTools) 
133         is private;
134         ---Purpose: cut E by vertices  VOnE,  return list of new edges
135         --          NE
136     
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
144         --          closed shell
145         --          <All> makes return already added faces
146
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.
151
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
155         --          shared by
156         --          <LE> contains edge splits
157
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.
162
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
167
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
171         --          an interference
172
173 fields
174
175     myDoneStep     : ShapeEnum           from TopAbs;   -- rebuilt level
176     myShape        : Compound            from TopoDS;   -- result
177     myBuilder      : Builder             from BRep;
178                                            
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
188                                            
189     myInternalFaces: DataMapOfShapeShape from TopTools; -- shape and its internal faces
190     myIntNotClFaces: DataMapOfShapeShape from TopTools; -- internal but not closed 
191
192                                            
193     myAsDes        : AsDes               from BRepAlgo;
194     myImagesFaces  : Image               from BRepAlgo;   
195     myImagesEdges  : Image               from BRepAlgo;    
196     myImageShape   : Image               from BRepAlgo;
197     
198         -- contains info of same domain shapes and section edges
199     myInter3d      : Inter3d             from Partition;
200     
201         -- avoid rebuilding twice commont part of solids
202     myAddedFacesMap: MapOfOrientedShape  from TopTools;
203     
204 end Spliter;