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 | |
7c104885 |
75 | SetCheckInterior(me: in out; ToCheckInterior: Boolean from Standard) |
76 | ---Purpose: Set the flag of check internal intersections |
77 | -- default value is True (to check) |
78 | ---C++: inline |
79 | is static; |
7fd59977 |
80 | |
81 | Add(me: in out; W: Wire from TopoDS; |
82 | F: Face from TopoDS) |
83 | ---Purpose: Adds the wire <W> on the face <F>. |
84 | -- Raises NoSuchObject if <F> does not belong to the original shape. |
85 | ---C++: inline |
86 | raises NoSuchObject from Standard, |
87 | ConstructionError from Standard |
88 | |
89 | is static; |
90 | |
91 | |
92 | |
93 | Add(me: in out; E: Edge from TopoDS; |
94 | F: Face from TopoDS) |
95 | ---Purpose: Adds the edge <E> on the face <F>. |
96 | ---C++: inline |
97 | raises NoSuchObject from Standard, |
98 | -- if <F> does not belong to the original shape. |
99 | ConstructionError from Standard |
100 | |
101 | is static; |
102 | |
ed60a55e |
103 | Add(me: in out; Comp: Compound from TopoDS; |
104 | F: Face from TopoDS) |
105 | ---Purpose: Adds the compound <Comp> on the face <F>. The |
106 | -- compound <Comp> must consist of edges lying on the |
107 | -- face <F>. If edges are geometrically connected, |
108 | -- they must be connected topologically, i.e. they |
109 | -- must share common vertices. |
110 | -- |
111 | -- Raises NoSuchObject if <F> does not belong to the original shape. |
112 | ---C++: inline |
113 | raises NoSuchObject from Standard, |
114 | ConstructionError from Standard |
115 | |
116 | is static; |
7fd59977 |
117 | |
118 | |
119 | Add(me: in out; E : Edge from TopoDS; |
120 | EOn: Edge from TopoDS) |
121 | ---Purpose: Adds the edge <E> on the existing edge <EOn>. |
122 | ---C++: inline |
123 | raises NoSuchObject from Standard, |
124 | -- if <EOn> does not belong to the original shape. |
125 | ConstructionError from Standard |
126 | |
127 | is static; |
128 | |
129 | |
130 | DirectLeft(me) |
131 | ---Purpose: Returns the faces which are the left of the |
132 | -- projected wires. |
133 | returns ListOfShape from TopTools |
134 | ---C++: return const& |
135 | raises NotDone from StdFail |
136 | --- The exception is raised when IsDone returns <Standard_False>. |
137 | is static; |
138 | |
139 | |
140 | Left(me) |
141 | ---Purpose: Returns the faces of the "left" part on the shape. |
142 | -- (It is build from DirectLeft, with the faces |
143 | -- connected to this set, and so on...). |
144 | -- Raises NotDone if IsDone returns <Standard_False>. |
145 | ---C++: return const& |
146 | returns ListOfShape from TopTools |
147 | raises NotDone from StdFail |
148 | is static; |
149 | |
150 | |
151 | --- Methods inherited from MakeShape, that must be redefined. |
152 | |
153 | |
154 | Build(me: in out) |
155 | |
156 | is redefined static; |
157 | --- Purpose: Builds the cut and the resulting faces and edges as well. |
158 | IsDeleted (me: in out; S : Shape from TopoDS) |
159 | returns Boolean |
160 | is redefined; |
161 | ---Purpose: Returns true if the shape has been deleted. |
162 | |
163 | Modified(me: in out; F: Shape from TopoDS) |
164 | ---Purpose: Returns the list of generated Faces. |
165 | ---C++: return const & |
166 | returns ListOfShape from TopTools |
167 | is redefined static; |
168 | |
169 | fields |
170 | |
171 | mySShape : Spliter from LocOpe; |
172 | myWOnShape : WiresOnShape from LocOpe; |
173 | |
174 | end SplitShape; |