Salome HOME
NRI : Merge from V1_2.
[modules/geom.git] / src / PARTITION / Partition_Spliter.cdl
1 --  GEOM PARTITION : partition algorithm
2 --
3 --  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 --  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
5 -- 
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. 
10 -- 
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. 
15 -- 
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 
19 -- 
20 --  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 --
22 --
23 --
24 --  File   : Partition_Spliter.cdl
25 --  Author : Benedicte MARTIN
26 --  Module : GEOM
27
28 class Spliter from Partition
29
30         ---Purpose: Split solids, shells and  faces  into parts of the
31         --          same  topology  if  reconstruction  level  is  not
32         --          limited.
33
34 uses
35     Inter3d             from Partition,
36     Loop2d              from Partition,
37     Builder             from BRep,
38     ShapeEnum           from TopAbs,
39     Compound            from TopoDS,
40     Face                from TopoDS,
41     Edge                from TopoDS,
42     Shape               from TopoDS,
43     MapOfOrientedShape  from TopTools,
44     IndexedMapOfShape   from TopTools,
45     DataMapOfShapeShape from TopTools,
46     ListOfShape         from TopTools,
47     MapOfShape          from TopTools,
48     AsDes               from BRepAlgo,
49     Image               from BRepAlgo
50
51 is
52     Create  returns Spliter from Partition;
53         ---Purpose: constructor
54
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
59         --          shapes. 
60         --          Object shapes that  are  vertices,  edges or wires
61         --          won't be splitted and won't be in a result.
62
63     AddTool  ( me : in out; S : Shape from TopoDS);
64         ---Purpose: add cutting tool
65
66     Compute (me : in out; Limit : ShapeEnum from TopAbs
67                           = TopAbs_SHAPE);
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
73         --          reconstruction.
74         --          If <Limit> == TopAbs_VERTEX, only new vertices are
75         --          returned in the result
76
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()
81
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()
86
87     Shape ( me ) returns Shape from TopoDS;
88         ---Purpose: return resulting compound
89
90     Clear ( me : in out);
91         ---Purpose: clear fields
92
93
94         ---Category: private methods
95
96
97     MakeShells (me: in out; S : Shape from TopoDS;
98                             NS: in out ListOfShape from TopTools) is private;
99         ---Purpose: split S into shells
100
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
104
105     MakeEdges (me; 
106                E : Edge from TopoDS;
107                VOnE : ListOfShape from TopTools;
108                NE : in out ListOfShape from TopTools) 
109         is private;
110         ---Purpose: cut E by vertices  VOnE,  return list of new edges
111         --          NE
112     
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
120         --          closed shell
121         --          <All> makes return already added faces
122
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.
127
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
131         --          shared by
132         --          <LE> contains edge splits
133
134 fields
135
136     myDoneStep     : ShapeEnum           from TopAbs;   -- reconstructed topology
137     myShape        : Compound            from TopoDS;   -- result
138     myBuilder      : Builder             from BRep;
139                                            
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
144                                            
145     myNewSection   : MapOfShape          from TopTools; -- new secton edges
146                                            
147     myAsDes        : AsDes               from BRepAlgo;
148     myImagesFaces  : Image               from BRepAlgo;   
149     myImagesEdges  : Image               from BRepAlgo;    
150     myImageShape   : Image               from BRepAlgo;
151     
152         -- contains info of same domain shapes and section edges
153     myInter3d      : Inter3d             from Partition;
154     
155         -- avoid rebuilding twice commont part of solids
156     myAddedFacesMap: MapOfOrientedShape  from TopTools;
157     
158         -- equal splits
159     myEqualEdges   : MapOfShape          from TopTools;
160     
161         -- shape and its internal faces
162     myInternalFaces: DataMapOfShapeShape from TopTools;
163     myIntNotClFaces: DataMapOfShapeShape from TopTools;-- internal but not closed 
164     
165 end Spliter;