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
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.
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.
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.
23 class LocalOperation from BRepFeat inherits Builder from BRepFeat
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.
41 ListOfShape from TopTools
45 ConstructionError from Standard
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;
57 Create(S: Shape from TopoDS)
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;
67 Create(S1,S2: Shape from TopoDS)
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;
76 -- Init(me: in out; S: Shape from TopoDS) is inherited from BRepFeat_Builder.
78 -- Init(me: in out; S,T: Shape from TopoDS) is inherited from BRepFeat_Builder.
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
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
101 raises ConstructionError from Standard
102 --- The exception is raised if <T> is null or same as the shape.
107 Perform(me: in out; LShape : ListOfShape from TopTools;
108 LTool : ListOfShape from TopTools;
109 Fuse : Boolean from Standard)
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.
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
129 raises ConstructionError from Standard
130 --- The exception is raised if <T> is a null shape.
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.
142 raises NotDone from StdFail
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&
153 raises NotDone from StdFail
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
163 raises NotDone from StdFail
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.
173 raises NotDone from StdFail
174 -- The exception is raised if no call to BuildPartsOfTool has
178 --- Redefinition of BRepBuilderAPI_MakeShape methods
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