Salome HOME
Update copyright information
[modules/geom.git] / src / PARTITION / Partition_Spliter.cdl
1 --  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 --
3 --  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 --
22 --  File   : Partition_Spliter.cdl
23 --  Author : Benedicte MARTIN
24 --  Module : GEOM
25
26 class Spliter from Partition
27
28         ---Purpose: Split solids, shells and  faces  into parts of the
29         --          same  topology  if  reconstruction  level  is  not
30         --          limited.
31
32 uses
33     Inter3d             from Partition,
34     Loop2d              from Partition,
35     Builder             from BRep,
36     ShapeEnum           from TopAbs,
37     Compound            from TopoDS,
38     Face                from TopoDS,
39     Edge                from TopoDS,
40     Shape               from TopoDS,
41     MapOfOrientedShape  from TopTools,
42     IndexedMapOfShape   from TopTools,
43     DataMapOfShapeShape from TopTools,
44     ListOfShape         from TopTools,
45     MapOfShape          from TopTools,
46     AsDes               from BRepAlgo,
47     Image               from BRepAlgo
48
49 is
50     Create  returns Spliter from Partition;
51         ---Purpose: constructor
52
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
57         --          shapes. 
58         --          Object shapes that  are  vertices,  edges or wires
59         --          won't be splitted and won't be in a result.
60
61     AddTool  ( me : in out; S : Shape from TopoDS);
62         ---Purpose: add cutting tool
63
64     Compute (me : in out; Limit : ShapeEnum from TopAbs
65                           = TopAbs_SHAPE);
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
71         --          reconstruction.
72         --          If <Limit> == TopAbs_VERTEX, only new vertices are
73         --          returned in the result
74
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()
79
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()
84
85     Shape ( me ) returns Shape from TopoDS;
86         ---Purpose: return resulting compound
87
88     Clear ( me : in out);
89         ---Purpose: clear fields
90
91
92         ---Category: private methods
93
94
95     MakeSolids (me: in out; Solid : Shape from TopoDS;
96                             Shells: in out ListOfShape from TopTools) 
97         is private;
98         ---Purpose: make solids out of Shells
99
100     MakeShells (me: in out; S : Shape from TopoDS;
101                             NS: in out ListOfShape from TopTools) is private;
102         ---Purpose: split S into shells
103
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
107
108     MakeEdges (me; 
109                E : Edge from TopoDS;
110                VOnE : ListOfShape from TopTools;
111                NE : in out ListOfShape from TopTools) 
112         is private;
113         ---Purpose: cut E by vertices  VOnE,  return list of new edges
114         --          NE
115     
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
123         --          closed shell
124         --          <All> makes return already added faces
125
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.
130
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
134         --          shared by
135         --          <LE> contains edge splits
136
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.
141
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
146
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
150         --          an interference
151
152 fields
153
154     myDoneStep     : ShapeEnum           from TopAbs;   -- rebuilt level
155     myShape        : Compound            from TopoDS;   -- result
156     myBuilder      : Builder             from BRep;
157                                            
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
167                                            
168     myInternalFaces: DataMapOfShapeShape from TopTools; -- shape and its internal faces
169     myIntNotClFaces: DataMapOfShapeShape from TopTools; -- internal but not closed 
170
171                                            
172     myAsDes        : AsDes               from BRepAlgo;
173     myImagesFaces  : Image               from BRepAlgo;   
174     myImagesEdges  : Image               from BRepAlgo;    
175     myImageShape   : Image               from BRepAlgo;
176     
177         -- contains info of same domain shapes and section edges
178     myInter3d      : Inter3d             from Partition;
179     
180         -- avoid rebuilding twice commont part of solids
181     myAddedFacesMap: MapOfOrientedShape  from TopTools;
182     
183 end Spliter;