1 -- Created on: 1995-06-22
2 -- Created by: Flore Lantheaume
3 -- Copyright (c) 1995-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
6 -- This file is part of Open CASCADE Technology software library.
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
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.
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
17 class MakeChamfer from BRepFilletAPI inherits LocalOperation from BRepFilletAPI
19 ---Purpose: Describes functions to build chamfers on edges of a shell or solid.
20 -- Chamfered Edge of a Shell or Solid
21 -- A MakeChamfer object provides a framework for:
22 -- - initializing the construction algorithm with a given shape,
23 -- - acquiring the data characterizing the chamfers,
24 -- - building the chamfers and constructing the resulting shape, and
25 -- - consulting the result.
33 ChBuilder from ChFi3d,
34 MapOfShape from TopTools,
35 ListOfShape from TopTools,
36 SecHArray1 from ChFiDS,
37 HBuilder from TopOpeBRepBuild,
38 ShapeModification from BRepBuilderAPI
49 Create(S: Shape from TopoDS) returns MakeChamfer from BRepFilletAPI;
50 ---Purpose: Initializes an algorithm for computing chamfers on the shape S.
51 -- The edges on which chamfers are built are defined using the Add function.
53 Add(me:in out; E: Edge from TopoDS)
54 ---Purpose: Adds edge E to the table of edges used by this
55 -- algorithm to build chamfers, where the parameters
56 -- of the chamfer must be set after the
57 --contour is added using the function SetDists
58 -- The Add function results in a contour being built by
59 -- propagation from the edge E (i.e. the contour contains at
60 -- least this edge). This contour is composed of edges of
61 -- the shape which are tangential to one another and
62 -- which delimit two series of tangential faces, with one
63 -- series of faces being located on either side of the contour.
65 -- Nothing is done if edge E or the face F does not belong to the initial shape.
69 Dis : Real from Standard;
72 ---Purpose: Adds edge E to the table of edges used by this
73 -- algorithm to build chamfers, where
74 -- the parameters of the chamfer are given by the two
75 -- distances Dis1 and Dis2; the face F identifies the side
76 -- where Dis1 is measured.
77 -- The Add function results in a contour being built by
78 -- propagation from the edge E (i.e. the contour contains at
79 -- least this edge). This contour is composed of edges of
80 -- the shape which are tangential to one another and
81 -- which delimit two series of tangential faces, with one
82 -- series of faces being located on either side of the contour.
84 -- Nothing is done if edge E or the face F does not belong to the initial shape.
89 Dis : Real from Standard;
90 IC : Integer from Standard;
92 ---Purpose: Sets the distances Dis1 and Dis2 which give the
93 -- parameters of the chamfer along the contour of index
94 -- IC generated using the Add function in the internal
95 -- data structure of this algorithm. The face F identifies
96 -- the side where Dis1 is measured.
98 -- Nothing is done if either the edge E or the face F
99 -- does not belong to the initial shape.
104 IC : Integer from Standard;
105 Dis : out Real from Standard)
113 ---Purpose: Adds a fillet contour in the builder (builds a
114 -- contour of tangent edges to <E> and sets the two
115 -- distances <Dis1> and <Dis2> ( parameters of the chamfer ) ).
121 Dis1, Dis2 : Real from Standard;
122 IC : Integer from Standard;
123 F : Face from TopoDS)
124 ---Purpose: Sets the distances Dis1 and Dis2 which give the
125 -- parameters of the chamfer along the contour of index
126 -- IC generated using the Add function in the internal
127 -- data structure of this algorithm. The face F identifies
128 -- the side where Dis1 is measured.
130 -- Nothing is done if either the edge E or the face F
131 -- does not belong to the initial shape.
137 IC : Integer from Standard;
138 Dis1, Dis2 : out Real from Standard)
140 ---Purpose: Returns the distances Dis1 and Dis2 which give the
141 -- parameters of the chamfer along the contour of index IC
142 -- in the internal data structure of this algorithm.
144 -- -1. is returned if IC is outside the bounds of the table of contours.
148 Dis : Real from Standard;
149 Angle : Real from Standard;
150 E : Edge from TopoDS;
151 F : Face from TopoDS)
152 ---Purpose: Adds a fillet contour in the builder (builds a
153 -- contour of tangent edges to <E> and sets the
154 -- distance <Dis1> and angle <Angle> ( parameters of the chamfer ) ).
158 SetDistAngle(me : in out;
159 Dis : Real from Standard;
160 Angle : Real from Standard;
161 IC : Integer from Standard;
162 F : Face from TopoDS)
163 ---Purpose: set the distance <Dis> and <Angle> of the fillet
164 -- contour of index <IC> in the DS with <Dis> on <F>.
165 ---Purpose: if the face <F> is not one of common faces
166 -- of an edge of the contour <IC>
171 IC : Integer from Standard;
172 Dis : in out Real from Standard;
173 Angle : in out Real from Standard;
174 DisOnFace1 : in out Boolean from Standard)
175 ---Purpose: gives the distances <Dis> and <Angle> of the fillet
176 -- contour of index <IC> in the DS
181 IC : Integer from Standard)
182 ---Purpose: return True if chamfer symetric false else.
183 returns Boolean from Standard is static;
187 IC : Integer from Standard)
188 ---Purpose: return True if chamfer is made with two distances false else.
189 returns Boolean from Standard is static;
193 IC : Integer from Standard)
194 ---Purpose: return True if chamfer is made with distance and angle false else.
195 returns Boolean from Standard is static;
198 ResetContour(me : in out;
199 IC : Integer from Standard)
200 ---Purpose: Erases the chamfer parameters on the contour of
201 -- index IC in the internal data structure of this algorithm.
202 -- Use the SetDists function to reset this data.
204 -- Nothing is done if IC is outside the bounds of the table of contours.
208 ---Purpose: Returns the number of contours generated using the
209 -- Add function in the internal data structure of this algorithm.
210 returns Integer from Standard is static;
213 Contour(me; E : Edge from TopoDS )
214 ---Purpose: Returns the index of the contour in the internal data
215 -- structure of this algorithm, which contains the edge E of the shape.
216 -- This function returns 0 if the edge E does not belong to any contour.
218 -- This index can change if a contour is removed from the
219 -- internal data structure of this algorithm using the function Remove.
220 returns Integer from Standard is static;
223 NbEdges(me; I : Integer from Standard)
224 ---Purpose: Returns the number of edges in the contour of index I in
225 -- the internal data structure of this algorithm.
227 -- Returns 0 if I is outside the bounds of the table of contours.
228 returns Integer from Standard
232 Edge(me; I,J : Integer from Standard)
233 ---Purpose: Returns the edge of index J in the contour of index I in
234 -- the internal data structure of this algorithm.
236 -- Returns a null shape if:
237 -- - I is outside the bounds of the table of contours, or
238 -- - J is outside the bounds of the table of edges of the contour of index I.
239 ---C++: return const &
240 returns Edge from TopoDS
244 Remove(me : in out; E : Edge from TopoDS)
245 ---Purpose: Removes the contour in the internal data structure of
246 -- this algorithm which contains the edge E of the shape.
248 -- Nothing is done if the edge E does not belong to the
249 -- contour in the internal data structure of this algorithm.
253 Length(me; IC : Integer from Standard) returns Real from Standard
254 ---Purpose: Returns the length of the contour of index IC in the
255 -- internal data structure of this algorithm.
257 -- Returns -1. if IC is outside the bounds of the table of contours.
261 FirstVertex(me; IC : Integer from Standard) returns Vertex from TopoDS
262 ---Purpose: Returns the first vertex of the contour of index IC
263 -- in the internal data structure of this algorithm.
265 -- Returns a null shape if IC is outside the bounds of the table of contours.
269 LastVertex(me; IC : Integer from Standard) returns Vertex from TopoDS
270 ---Purpose: Returns the last vertex of the contour of index IC
271 -- in the internal data structure of this algorithm.
273 -- Returns a null shape if IC is outside the bounds of the table of contours.
278 IC : Integer from Standard;
279 V : Vertex from TopoDS)
280 returns Real from Standard
281 ---Purpose: Returns the curvilinear abscissa of the vertex V on the
282 -- contour of index IC in the internal data structure of this algorithm.
285 -- - IC is outside the bounds of the table of contours, or
286 -- - V is not on the contour of index IC.
291 IC : Integer from Standard;
292 V : Vertex from TopoDS)
293 returns Real from Standard
294 ---Purpose: Returns the relative curvilinear abscissa (i.e. between 0
295 -- and 1) of the vertex V on the contour of index IC in the
296 -- internal data structure of this algorithm.
299 -- - IC is outside the bounds of the table of contours, or
300 -- - V is not on the contour of index IC.
303 ClosedAndTangent(me; IC : Integer from Standard)
304 returns Boolean from Standard
305 ---Purpose: eturns true if the contour of index IC in the internal
306 -- data structure of this algorithm is closed and tangential at the point of closure.
308 -- Returns false if IC is outside the bounds of the table of contours.
311 Closed(me; IC : Integer from Standard)
312 returns Boolean from Standard
313 ---Purpose: Returns true if the contour of index IC in the internal
314 -- data structure of this algorithm is closed.
316 -- Returns false if IC is outside the bounds of the table of contours.
320 ---Purpose: Builds the chamfers on all the contours in the internal
321 -- data structure of this algorithm and constructs the resulting shape.
322 -- Use the function IsDone to verify that the chamfered
323 -- shape is built. Use the function Shape to retrieve the chamfered shape.
325 -- The construction of chamfers implements highly complex
326 -- construction algorithms. Consequently, there may be
327 -- instances where the algorithm fails, for example if the
328 -- data defining the parameters of the chamfer is not
329 -- compatible with the geometry of the initial shape. There
330 -- is no initial analysis of errors and these only become
331 -- evident at the construction stage.
332 -- Additionally, in the current software release, the following
333 -- cases are not handled:
334 -- - the end point of the contour is the point of
335 -- intersection of 4 or more edges of the shape, or
336 -- - the intersection of the chamfer with a face which
337 -- limits the contour is not fully contained in this face.
341 ---Purpose: Reinitializes this algorithm, thus canceling the effects of the Build function.
342 -- This function allows modifications to be made to the
343 -- contours and chamfer parameters in order to rebuild the shape.
346 Builder(me) returns HBuilder from TopOpeBRepBuild
347 ---Purpose: Returns the internal filleting algorithm.
351 -------------------------------------------
352 -- Methods usefull for historical utilities --
353 -------------------------------------------
354 Generated (me: in out; EorV : Shape from TopoDS)
355 ---Purpose: Returns the list of shapes generated from the
357 ---C++: return const &
359 returns ListOfShape from TopTools
360 is redefined virtual;
363 Modified (me: in out; F : Shape from TopoDS)
364 ---Purpose: Returns the list of shapes modified from the shape
366 ---C++: return const &
368 returns ListOfShape from TopTools
369 is redefined virtual;
372 IsDeleted (me: in out; F : Shape from TopoDS)
374 is redefined virtual;
376 -------------------------------
377 ---Methods for quick simulation
378 -------------------------------
380 Simulate(me : in out;
381 IC : Integer from Standard);
383 NbSurf(me; IC : Integer from Standard)
384 returns Integer from Standard;
386 Sect(me; IC, IS : Integer from Standard)
387 returns SecHArray1 from ChFiDS;
391 myBuilder : ChBuilder from ChFi3d;
392 myMap : MapOfShape from TopTools;