b311480e |
1 | -- Created on: 1995-09-04 |
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 | |
7fd59977 |
21 | |
22 | |
23 | class SplitShape from BRepFeat inherits MakeShape from BRepBuilderAPI |
24 | |
25 | ---Purpose: One of the most significant aspects of BRepFeat functionality is the use of local |
26 | -- operations as opposed to global ones. In a global operation, you would first construct a |
27 | -- form of the type you wanted in your final feature, and then remove matter so that it could |
28 | -- fit into your initial basis object. In a local operation, however, you specify the domain of |
29 | -- the feature construction with aspects of the shape on which the feature is being created. |
30 | -- These semantics are expressed in terms of a member shape of the basis shape from which - |
31 | -- or up to which - matter will be added or removed. As a result, local operations make |
32 | -- calculations simpler and faster than global operations. |
33 | -- In BRepFeat, the semantics of local operations define features constructed from a contour or a |
34 | -- part of the basis shape referred to as the tool. In a SplitShape object, wires or edges of a |
35 | -- face in the basis shape to be used as a part of the feature are cut out and projected to a plane |
36 | -- outside or inside the basis shape. By rebuilding the initial shape incorporating the edges and |
37 | -- the faces of the tool, protrusion or depression features can be constructed. |
38 | |
39 | |
40 | uses Spliter from LocOpe, |
41 | WiresOnShape from LocOpe, |
42 | Shape from TopoDS, |
43 | Face from TopoDS, |
44 | Wire from TopoDS, |
45 | Edge from TopoDS, |
ed60a55e |
46 | Compound from TopoDS, |
7fd59977 |
47 | Vertex from TopoDS, |
48 | ListOfShape from TopTools, |
49 | ShapeModification from BRepBuilderAPI |
50 | |
51 | raises NotDone from StdFail, |
52 | ConstructionError from Standard, |
53 | NoSuchObject from Standard |
54 | |
55 | is |
56 | |
57 | |
58 | Create |
59 | ---Purpose: Empty constructor |
60 | returns SplitShape from BRepFeat; |
61 | ---C++: inline |
62 | |
63 | |
64 | Create(S: Shape from TopoDS) |
65 | ---Purpose: Creates the process with the shape <S>. |
66 | returns SplitShape from BRepFeat; |
67 | ---C++: inline |
68 | |
69 | |
70 | Init(me: in out; S: Shape from TopoDS) |
71 | ---Purpose: Initializes the process on the shape <S>. |
72 | ---C++: inline |
73 | is static; |
74 | |
75 | |
76 | Add(me: in out; W: Wire from TopoDS; |
77 | F: Face from TopoDS) |
78 | ---Purpose: Adds the wire <W> on the face <F>. |
79 | -- Raises NoSuchObject if <F> does not belong to the original shape. |
80 | ---C++: inline |
81 | raises NoSuchObject from Standard, |
82 | ConstructionError from Standard |
83 | |
84 | is static; |
85 | |
86 | |
87 | |
88 | Add(me: in out; E: Edge from TopoDS; |
89 | F: Face from TopoDS) |
90 | ---Purpose: Adds the edge <E> on the face <F>. |
91 | ---C++: inline |
92 | raises NoSuchObject from Standard, |
93 | -- if <F> does not belong to the original shape. |
94 | ConstructionError from Standard |
95 | |
96 | is static; |
97 | |
ed60a55e |
98 | Add(me: in out; Comp: Compound from TopoDS; |
99 | F: Face from TopoDS) |
100 | ---Purpose: Adds the compound <Comp> on the face <F>. The |
101 | -- compound <Comp> must consist of edges lying on the |
102 | -- face <F>. If edges are geometrically connected, |
103 | -- they must be connected topologically, i.e. they |
104 | -- must share common vertices. |
105 | -- |
106 | -- Raises NoSuchObject if <F> does not belong to the original shape. |
107 | ---C++: inline |
108 | raises NoSuchObject from Standard, |
109 | ConstructionError from Standard |
110 | |
111 | is static; |
7fd59977 |
112 | |
113 | |
114 | Add(me: in out; E : Edge from TopoDS; |
115 | EOn: Edge from TopoDS) |
116 | ---Purpose: Adds the edge <E> on the existing edge <EOn>. |
117 | ---C++: inline |
118 | raises NoSuchObject from Standard, |
119 | -- if <EOn> does not belong to the original shape. |
120 | ConstructionError from Standard |
121 | |
122 | is static; |
123 | |
124 | |
125 | DirectLeft(me) |
126 | ---Purpose: Returns the faces which are the left of the |
127 | -- projected wires. |
128 | returns ListOfShape from TopTools |
129 | ---C++: return const& |
130 | raises NotDone from StdFail |
131 | --- The exception is raised when IsDone returns <Standard_False>. |
132 | is static; |
133 | |
134 | |
135 | Left(me) |
136 | ---Purpose: Returns the faces of the "left" part on the shape. |
137 | -- (It is build from DirectLeft, with the faces |
138 | -- connected to this set, and so on...). |
139 | -- Raises NotDone if IsDone returns <Standard_False>. |
140 | ---C++: return const& |
141 | returns ListOfShape from TopTools |
142 | raises NotDone from StdFail |
143 | is static; |
144 | |
145 | |
146 | --- Methods inherited from MakeShape, that must be redefined. |
147 | |
148 | |
149 | Build(me: in out) |
150 | |
151 | is redefined static; |
152 | --- Purpose: Builds the cut and the resulting faces and edges as well. |
153 | IsDeleted (me: in out; S : Shape from TopoDS) |
154 | returns Boolean |
155 | is redefined; |
156 | ---Purpose: Returns true if the shape has been deleted. |
157 | |
158 | Modified(me: in out; F: Shape from TopoDS) |
159 | ---Purpose: Returns the list of generated Faces. |
160 | ---C++: return const & |
161 | returns ListOfShape from TopTools |
162 | is redefined static; |
163 | |
164 | fields |
165 | |
166 | mySShape : Spliter from LocOpe; |
167 | myWOnShape : WiresOnShape from LocOpe; |
168 | |
169 | end SplitShape; |