Adding of testing cases from subgroups 937 940 and 941 of CHL group
[occt.git] / src / BRepFeat / BRepFeat_LocalOperation.cdl
1 -- Created on: 1995-06-13
2 -- Created by: Jacques GOUSSARD
3 -- Copyright (c) 1995-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
5 --
6 -- The content of this file is subject to the Open CASCADE Technology Public
7 -- License Version 6.5 (the "License"). You may not use the content of this file
8 -- except in compliance with the License. Please obtain a copy of the License
9 -- at http://www.opencascade.org and read it completely before using this file.
10 --
11 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 --
14 -- The Original Code and all software distributed under the License is
15 -- distributed on an "AS IS" basis, without warranty of any kind, and the
16 -- Initial Developer hereby disclaims all such warranties, including without
17 -- limitation, any warranties of merchantability, fitness for a particular
18 -- purpose or non-infringement. Please see the License for the specific terms
19 -- and conditions governing the rights and limitations under the License.
20
21
22
23 class LocalOperation from BRepFeat inherits Builder from BRepFeat
24
25         ---Purpose: One of the most significant
26         -- aspects of BRepFeat functionality is the use of local operations as
27         -- opposed to global ones. In a global operation, you would first
28         -- construct a form of the type you wanted in your final feature, and
29         -- then remove matter so that it could fit into your initial basis
30         -- object. In a local operation, however, you specify the domain
31         -- of the feature construction with aspects of the shape on which the
32         -- feature is being created. These semantics are expressed in terms
33         -- of a member shape of the basis shape from which - or up to which
34         -- - matter will be added or removed. As a result, local
35         -- operations make calculations simpler and faster than global operations.
36         -- In BRepFeat, the semantics of local operations define features
37         -- constructed from a contour or a part of the basis shape referred to as the tool.
38
39 uses 
40     Shape       from TopoDS,
41     ListOfShape from TopTools
42
43 raises
44     NotDone           from StdFail,
45     ConstructionError from Standard
46
47 is
48
49     Create
50         ---Purpose: Builds the framework to store the topological shape
51         -- which is to be created by the local operation.
52         -- Initializes the empty constructor.
53         returns LocalOperation from BRepFeat;
54         ---C++: inline  
55
56          
57     Create(S: Shape from TopoDS)
58         ---C++: inline
59         ---Purpose: Builds the framework to store the topological shape
60         -- which is to be created by the local operation.
61         -- Initializes shape S for a local operation.
62         -- The exception ConstructionError is raised if <S> is a null shape.
63         returns LocalOperation from BRepFeat
64         raises ConstructionError from Standard;
65
66
67     Create(S1,S2: Shape from TopoDS)
68         ---C++: inline
69         ---Purpose: Builds the framework to store the topological shape
70         -- which is to be created by the local operation.
71         -- Initializes S1 and S2 for a local operation.
72         -- The exception ConstructionError is raised if <S> is a null shape.
73         returns LocalOperation from BRepFeat
74         raises ConstructionError from Standard;
75
76 --  Init(me: in out; S: Shape from TopoDS) is inherited from BRepFeat_Builder.
77
78 --  Init(me: in out; S,T: Shape from TopoDS) is inherited from BRepFeat_Builder.
79
80
81     Perform(me: in out; T    : Shape from TopoDS;
82                         L    : ListOfShape from TopTools;
83                         Fuse : Boolean from Standard)
84         ---Purpose: Performs the local operation on the formerly given
85         --          shape,  with the tool <T>.  <L>  defines  a set of
86         --          faces  of  the shape.  The list  may not be empty.
87         --          The boolean <Fuse> gives the type of operation. If
88         --          set to  Standard_True, the operation  is a fusion.
89         --          If  set  to Standard_False,   the operation   is a
90         --          cutting one.
91         --          
92         --          The Perform process stops just before constructing
93         --          any result in order to authorize  the selection of
94         --          parts of the tool.  After a call to Perform, it is
95         --          possible   to call     BuilPartsOfTool,       then
96         --          RemovePart/ActivatePart to select valid parts, and
97         --          it  is necessary to  call PerformResult to get any
98         --          result. 
99         ---C++: inline
100
101         raises ConstructionError from Standard
102         --- The exception is raised if <T> is null or same as the shape.
103         is static;
104
105
106
107     Perform(me: in out; LShape : ListOfShape from TopTools;
108                         LTool  : ListOfShape from TopTools;
109                         Fuse   : Boolean from Standard)
110
111         ---Purpose: Performs the local operation on the formerly given
112         --          shape and tool.  <LShape>  defines a set  of faces
113         --          of the shape, <LTool> a set of  faces of the tool.
114         --          The boolean  <Fuse> gives the  type of  operation.
115         --          If  set  to   Standard_True,  the operation  is  a
116         --          fusion.   If  set to Standard_False, the operation
117         --          is a cutting one.  If <LShape> (resp.  <LTool>) is
118         --          empty, the whole shape (resp.  tool) is used. 
119         --          
120         --          The Perform process stops just before constructing
121         --          any result in  order to authorize the selection of
122         --          parts of the tool.  After a call to Perform, it is
123         --          possible     to   call     BuilPartsOfTool,   then
124         --          RemovePart/ActivatePart to select valid parts, and
125         --          it is necessary  to call PerformResult to  get any
126         --          result.  
127         ---C++: inline
128
129         raises ConstructionError from Standard
130         --- The exception is raised if <T> is a null shape.
131         is static;
132
133
134
135     BuildPartsOfTool(me: in out)
136         ---Purpose: Constructs the primitive which serves as the tool for the
137         -- feature construction. Gives faces concerned by the
138         -- construction and builds by performing one of the
139         -- Boolean operations on the two intersecting shapes.
140         --    Raises NotDone from StdFail if no call to Perform has been done.
141                 ---C++: inline
142                 raises NotDone from StdFail
143                 is static;
144     
145
146     PartsOfTool(me)
147         ---Purpose: Returns  the list of  the  parts of tool.  Each of
148         --          these parts is a TopoDS_Shell.
149         -- Raises NotDone  if no  call to BuildPartsOfTool has been done. 
150     returns ListOfShape from TopTools
151         ---C++: return const&
152         ---C++: inline
153         raises NotDone from StdFail
154         
155         is static;
156
157
158     RemovePart(me: in out; S: Shape from TopoDS)
159         ---Purpose: Removes <S> from the list of valid parts of tool.
160         -- Raises NotDone  if no  call to BuildPartsOfTool has
161         -- been done. 
162                 ---C++: inline
163                 raises NotDone from StdFail
164                 is static;
165
166
167     ActivatePart(me: in out; S: Shape from TopoDS)
168         ---Purpose: By default, all tool parts are valid for the local operation.
169         --        This method removes <S>  from  the list  of  invalid parts  of
170         --          tool. By default, all parts  of tool are valid for
171         --          the local operation.
172         ---C++: inline
173         raises NotDone from StdFail
174         -- The exception is raised if no  call to BuildPartsOfTool has
175         -- been done. 
176         is static;
177         
178 --- Redefinition of BRepBuilderAPI_MakeShape methods
179 --  
180 --  
181
182     Build(me: in out)
183         ---Purpose: Builds the    resulting shape  (redefined     from
184         --          MakeShape). Invalidates the  given parts  of tools
185         --          if  any,   and performs the  result   of the local
186         --          operation.
187
188         is redefined;
189
190 end LocalOperation;