b311480e |
1 | -- Created on: 1995-02-22 |
2 | -- Created by: Jacques GOUSSARD |
3 | -- Copyright (c) 1995-1999 Matra Datavision |
973c2be1 |
4 | -- Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | -- |
973c2be1 |
6 | -- This file is part of Open CASCADE Technology software library. |
b311480e |
7 | -- |
d5f74e42 |
8 | -- This library is free software; you can redistribute it and/or modify it under |
9 | -- the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
10 | -- by the Free Software Foundation, with special exception defined in the file |
11 | -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
12 | -- distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
13 | -- |
973c2be1 |
14 | -- Alternatively, this file may be used under the terms of Open CASCADE |
15 | -- commercial license or contractual agreement. |
7fd59977 |
16 | |
17 | class DraftAngle from BRepOffsetAPI inherits ModifyShape from BRepBuilderAPI |
18 | |
19 | ---Purpose: Taper-adding transformations on a shape. |
20 | -- The resulting shape is constructed by defining one face |
21 | -- to be tapered after another one, as well as the |
22 | -- geometric properties of their tapered transformation. |
23 | -- Each tapered transformation is propagated along the |
24 | -- series of faces which are tangential to one another and |
25 | -- which contains the face to be tapered. |
26 | -- This algorithm is useful in the construction of molds or |
27 | -- dies. It facilitates the removal of the article being produced. |
28 | -- A DraftAngle object provides a framework for: |
29 | -- - initializing the construction algorithm with a given shape, |
30 | -- - acquiring the data characterizing the faces to be tapered, |
31 | -- - implementing the construction algorithm, and |
32 | -- - consulting the results. |
33 | -- Warning |
34 | -- - This algorithm treats planar, cylindrical and conical faces. |
35 | -- - Do not use shapes, which with a draft angle added to |
36 | -- a face would modify the topology. This would, for |
37 | -- example, involve creation of new vertices, edges or |
38 | -- faces, or suppression of existing vertices, edges or faces. |
39 | -- - Any face, which is continuous in tangency with the |
40 | -- face to be tapered, will also be tapered. These |
41 | -- connected faces must also respect the above criteria. |
42 | |
43 | |
44 | uses |
45 | Shape from TopoDS, |
46 | Face from TopoDS, |
47 | ShapeModification from BRepBuilderAPI, |
48 | ListOfShape from TopTools, |
49 | Dir from gp, |
50 | Pln from gp, |
51 | ErrorStatus from Draft |
52 | |
53 | raises |
54 | NotDone from StdFail, |
55 | NullObject from Standard, |
56 | NoSuchObject from Standard, |
57 | ConstructionError from Standard |
58 | |
59 | is |
60 | |
61 | Create |
62 | |
63 | returns DraftAngle from BRepOffsetAPI; |
64 | ---Purpose: Constructs an empty algorithm to perform |
65 | -- taper-adding transformations on faces of a shape. |
66 | -- Use the Init function to define the shape to be tapered. |
67 | |
68 | Create(S: Shape from TopoDS) |
69 | returns DraftAngle from BRepOffsetAPI; |
70 | ---Purpose: Initializes an algorithm to perform taper-adding |
71 | -- transformations on faces of the shape S. |
72 | -- S will be referred to as the initial shape of the algorithm. |
73 | |
74 | Clear(me: in out) |
75 | |
76 | ---Purpose: Cancels the results of all taper-adding transformations |
77 | -- performed by this algorithm on the initial shape. These |
78 | -- results will have been defined by successive calls to the function Add. |
79 | is static; |
80 | |
81 | |
82 | Init(me: in out; S: Shape from TopoDS) |
83 | |
84 | ---Purpose: Initializes, or reinitializes this taper-adding algorithm with the shape S. |
85 | -- S will be referred to as the initial shape of this algorithm. |
86 | |
87 | is static; |
88 | |
89 | |
90 | Add(me: in out; F : Face from TopoDS; |
91 | Direction : Dir from gp; |
92 | Angle : Real from Standard; |
93 | NeutralPlane: Pln from gp; |
94 | Flag : Boolean from Standard = Standard_True) |
95 | ---Purpose: Adds the face F, the direction |
96 | -- Direction, the angle Angle, the plane NeutralPlane, and the flag |
97 | -- Flag to the framework created at construction time, and with this |
98 | -- data, defines the taper-adding transformation. |
99 | -- F is a face, which belongs to the initial shape of this algorithm or |
100 | -- to the shape loaded by the function Init. |
101 | -- Only planar, cylindrical or conical faces can be tapered: |
102 | -- - If the face F is planar, it is tapered by inclining it |
103 | -- through the angle Angle about the line of intersection between the |
104 | -- plane NeutralPlane and F. |
105 | -- Direction indicates the side of NeutralPlane from which matter is |
106 | -- removed if Angle is positive or added if Angle is negative. |
107 | -- - If F is cylindrical or conical, it is transformed in the |
108 | -- same way on a single face, resulting in a conical face if F |
109 | -- is cylindrical, and a conical or cylindrical face if it is already conical. |
110 | -- The taper-adding transformation is propagated from the face F along |
111 | -- the series of planar, cylindrical or conical faces containing F, |
112 | -- which are tangential to one another. |
113 | -- Use the function AddDone to check if this taper-adding transformation is successful. |
114 | -- Warning |
115 | -- Nothing is done if: |
116 | -- - the face F does not belong to the initial shape of this algorithm, or |
117 | -- - the face F is not planar, cylindrical or conical. |
118 | -- Exceptions |
119 | -- - Standard_NullObject if the initial shape is not |
120 | -- defined, i.e. if this algorithm has not been initialized |
121 | -- with the non-empty constructor or the Init function. |
122 | -- - Standard_ConstructionError if the previous call to |
123 | -- Add has failed. The function AddDone ought to have |
124 | -- been used to check for this, and the function Remove |
125 | -- to cancel the results of the unsuccessful taper-adding |
126 | -- transformation and to retrieve the previous shape. |
127 | raises NullObject from Standard, |
128 | ConstructionError from Standard |
129 | is static; |
130 | |
131 | |
132 | AddDone(me) |
133 | |
134 | ---Purpose: Returns true if the previous taper-adding |
135 | -- transformation performed by this algorithm in the last |
136 | -- call to Add, was successful. |
137 | -- If AddDone returns false: |
138 | -- - the function ProblematicShape returns the face |
139 | -- on which the error occurred, |
140 | -- - the function Remove has to be used to cancel the |
141 | -- results of the unsuccessful taper-adding |
142 | -- transformation and to retrieve the previous shape. |
143 | -- Exceptions |
144 | -- Standard_NullObject if the initial shape has not |
145 | -- been defined, i.e. if this algorithm has not been |
146 | -- initialized with the non-empty constructor or the .Init function. |
147 | returns Boolean from Standard |
148 | raises NullObject from Standard |
149 | |
150 | is static; |
151 | |
152 | |
153 | Remove(me: in out; F: Face from TopoDS) |
154 | ---Purpose: Cancels the taper-adding transformation previously |
155 | -- performed by this algorithm on the face F and the |
156 | -- series of tangential faces which contain F, and retrieves |
157 | -- the shape before the last taper-adding transformation. |
158 | -- Warning |
159 | -- You will have to use this function if the previous call to |
160 | -- Add fails. Use the function AddDone to check it. |
161 | -- Exceptions |
162 | -- - Standard_NullObject if the initial shape has not |
163 | -- been defined, i.e. if this algorithm has not been |
164 | -- initialized with the non-empty constructor or the Init function. |
165 | -- - Standard_NoSuchObject if F has not been added |
166 | -- or has already been removed. |
167 | raises NullObject from Standard, |
168 | NoSuchObject from Standard |
169 | |
170 | is static; |
171 | |
172 | |
173 | ProblematicShape(me) |
174 | |
175 | returns Shape from TopoDS |
176 | ---Purpose: Returns the shape on which an error occurred after an |
177 | -- unsuccessful call to Add or when IsDone returns false. |
178 | -- Exceptions |
179 | -- Standard_NullObject if the initial shape has not been |
180 | -- defined, i.e. if this algorithm has not been initialized with |
181 | -- the non-empty constructor or the Init function. |
182 | ---C++: return const& |
183 | raises NullObject from Standard |
184 | |
185 | is static; |
186 | |
187 | |
188 | |
189 | Status(me) |
190 | ---Purpose: Returns an error status when an error has occured |
191 | -- (Face, Edge or Vertex recomputaion problem). |
192 | -- Otherwise returns Draft_NoError. The method may be |
193 | -- called if AddDone returns Standard_False, or when |
194 | -- IsDone returns Standard_False. |
195 | |
196 | returns ErrorStatus from Draft |
197 | raises NullObject from Standard |
198 | -- The exception is raised if no shape has been |
199 | -- given(constructor or Init method). |
200 | |
201 | is static; |
202 | |
203 | |
204 | ConnectedFaces(me; F: Face from TopoDS) |
205 | |
206 | returns ListOfShape from TopTools |
207 | ---Purpose: Returns all the faces which have been added |
208 | -- together with the face <F>. |
209 | -- |
210 | ---C++: return const& |
211 | |
212 | raises NullObject from Standard, |
213 | -- The exception is raised if no shape has been |
214 | -- given(constructor or Init method). |
215 | NoSuchObject from Standard, |
216 | -- The exception is raised if F has not been added. |
217 | NotDone from StdFail |
218 | -- The exception is raised if AddDone returns False. |
219 | is static; |
220 | |
221 | |
222 | ModifiedFaces(me) |
223 | |
224 | returns ListOfShape from TopTools |
225 | ---Purpose: Returns all the faces on which a modification has |
226 | -- been given. |
227 | -- |
228 | ---C++: return const& |
229 | |
230 | raises NullObject from Standard, |
231 | -- The exception is raised if no shape has been |
232 | -- given(constructor or Init method). |
233 | NotDone from StdFail |
234 | -- The exception is raised if AddDone returns False. |
235 | is static; |
236 | |
237 | |
238 | Build(me : in out) |
239 | |
240 | ---Purpose: Builds the resulting shape (redefined from MakeShape). |
241 | ---Level: Public |
242 | is redefined; |
243 | |
244 | CorrectWires(me : in out); |
245 | |
246 | Generated (me: in out; S : Shape from TopoDS) |
247 | ---Purpose: Returns the list of shapes generated from the |
248 | -- shape <S>. |
249 | ---C++: return const & |
250 | ---Level: Public |
251 | returns ListOfShape from TopTools |
252 | is redefined virtual; |
253 | |
254 | |
255 | |
256 | Modified (me: in out; S : Shape from TopoDS) |
257 | ---Purpose: Returns the list of shapes modified from the shape |
258 | -- <S>. |
259 | ---C++: return const & |
260 | ---Level: Public |
261 | returns ListOfShape from TopTools |
262 | is redefined virtual; |
263 | |
264 | fields |
265 | |
266 | myModifiedShapes : ListOfShape from TopTools; |
267 | |
268 | end DraftAngle; |
269 | |
270 | |
271 | |
272 | |
273 | |