Salome HOME
sources v1.2
[modules/geom.git] / src / PARTITION / Partition_Spliter.cdl
1 -- File   :     Partition_Spliter.cdl
2 -- Created:     Thu Aug 02 16:07:39 2001
3 -- Author :     Benedicte MARTIN
4 ---Copyright:    OPEN CASCADE  2001
5
6 class Spliter from Partition
7
8         ---Purpose: Split solids, shells and  faces  into parts of the
9         --          same  topology  if  reconstruction  level  is  not
10         --          limited.
11
12 uses
13     Inter3d             from Partition,
14     Loop2d              from Partition,
15     Builder             from BRep,
16     ShapeEnum           from TopAbs,
17     Compound            from TopoDS,
18     Face                from TopoDS,
19     Edge                from TopoDS,
20     Shape               from TopoDS,
21     MapOfOrientedShape  from TopTools,
22     IndexedMapOfShape   from TopTools,
23     DataMapOfShapeShape from TopTools,
24     ListOfShape         from TopTools,
25     MapOfShape          from TopTools,
26     AsDes               from BRepAlgo,
27     Image               from BRepAlgo
28
29 is
30     Create  returns Spliter from Partition;
31         ---Purpose: constructor
32
33     AddShape ( me : in out; S : Shape from TopoDS);
34         ---Purpose: add object Shape to be splitted.
35         --          If S  is  a  COMPOUND  or  COMPSOLID,  it  will be
36         --          exploded  in  order  to  get  more  simple  object
37         --          shapes. 
38         --          Object shapes that  are  vertices,  edges or wires
39         --          won't be splitted and won't be in a result.
40
41     AddTool  ( me : in out; S : Shape from TopoDS);
42         ---Purpose: add cutting tool
43
44     Compute (me : in out; Limit : ShapeEnum from TopAbs
45                           = TopAbs_SHAPE);
46         ---Purpose: produce a result which  is  a compound of parts of
47         --          object shapes.  A  part  can  be  either a vertex,
48         --          edge, wire, face, shell or solid.
49         --          By default, a part is  of  the same topology as an
50         --          object  shape,   else   <Limit>   restricts  parts
51         --          reconstruction.
52         --          If <Limit> == TopAbs_VERTEX, only new vertices are
53         --          returned in the result
54
55     KeepShapesInside (me : in out; S : Shape from TopoDS);
56         ---Purpose: remove shapes that are outside of S from result.
57         --          S should be an object shape.
58         ---Warning: call it after Compute()
59
60     RemoveShapesInside (me : in out; S : Shape from TopoDS);
61         ---Purpose: remove shapes that are inside S from result.
62         --          S should be an object shape.
63         ---Warning: call it after Compute()
64
65     Shape ( me ) returns Shape from TopoDS;
66         ---Purpose: return resulting compound
67
68     Clear ( me : in out);
69         ---Purpose: clear fields
70
71
72         ---Category: private methods
73
74
75     MakeShells (me: in out; S : Shape from TopoDS;
76                             NS: in out ListOfShape from TopTools) is private;
77         ---Purpose: split S into shells
78
79     MakeFaces (me: in out; S : Shape from TopoDS)
80         returns Shape from TopoDS is private;
81         ---Purpose: split faces of S, return compound of new faces
82
83     MakeEdges (me; 
84                E : Edge from TopoDS;
85                VOnE : ListOfShape from TopTools;
86                NE : in out ListOfShape from TopTools) 
87         is private;
88         ---Purpose: cut E by vertices  VOnE,  return list of new edges
89         --          NE
90     
91     FindFacesInside (me: in out; S : Shape from TopoDS;
92                                  CheckClosed : Boolean = Standard_False;
93                                  All         : Boolean = Standard_False)
94         returns Shape from TopoDS is private;
95         ---Purpose: return compound of faces  of other shapes that are
96         --          inside <S>. <S>  must  have image in myImageShape.
97         --          <CheckClosed> makes avoid faces that do not form a
98         --          closed shell
99         --          <All> makes return already added faces
100
101     CheckTool ( me: in out; S : Shape from TopoDS)
102         returns Boolean from Standard is private;
103         ---Purpose: Return True if <S>  is  a tool shape. Prepare tool
104         --          faces of <S> for the search of internal faces.
105
106     MergeEqualEdges (me: in out; LE : ListOfShape from TopTools) is private;
107         ---Purpose: among LE, find  equal  edges,  choose ones to keep
108         --          and make them have  pcurves  on all faces they are
109         --          shared by
110         --          <LE> contains edge splits
111
112 fields
113
114     myDoneStep     : ShapeEnum           from TopAbs;   -- reconstructed topology
115     myShape        : Compound            from TopoDS;   -- result
116     myBuilder      : Builder             from BRep;
117                                            
118     myListShapes   : ListOfShape         from TopTools; -- object shapes
119     myMapFaces     : MapOfShape          from TopTools; -- object faces
120     myMapTools     : MapOfShape          from TopTools; -- tool faces
121     myFaceShapeMap : DataMapOfShapeShape from TopTools; -- to find a shape by face
122                                            
123     myNewSection   : MapOfShape          from TopTools; -- new secton edges
124                                            
125     myAsDes        : AsDes               from BRepAlgo;
126     myImagesFaces  : Image               from BRepAlgo;   
127     myImagesEdges  : Image               from BRepAlgo;    
128     myImageShape   : Image               from BRepAlgo;
129     
130         -- contains info of same domain shapes and section edges
131     myInter3d      : Inter3d             from Partition;
132     
133         -- avoid rebuilding twice commont part of solids
134     myAddedFacesMap: MapOfOrientedShape  from TopTools;
135     
136         -- equal splits
137     myEqualEdges   : MapOfShape          from TopTools;
138     
139         -- shape and its internal faces
140     myInternalFaces: DataMapOfShapeShape from TopTools;
141     
142 end Spliter;