0024624: Lost word in license statement in source files
[occt.git] / src / BRepFilletAPI / BRepFilletAPI_MakeChamfer.cdl
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
5 --
6 -- This file is part of Open CASCADE Technology software library.
7 --
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.
13 --
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
16
17 class MakeChamfer from BRepFilletAPI inherits LocalOperation from BRepFilletAPI
18
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.    
26         
27 uses
28
29     Vertex            from TopoDS,      
30     Edge              from TopoDS,
31     Face              from TopoDS,
32     Shape             from TopoDS,
33     ChBuilder         from ChFi3d,
34     MapOfShape        from TopTools,
35     ListOfShape       from TopTools,
36     SecHArray1        from ChFiDS,
37     HBuilder          from TopOpeBRepBuild,
38     ShapeModification from BRepBuilderAPI
39     
40     
41     
42     
43 raises
44     NotDone     from StdFail
45
46 is
47
48
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.
52                             
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.
64         -- Warning
65         -- Nothing is done if edge E or the face F does not belong to the initial shape. 
66     is static; 
67
68     Add(me:in out; 
69         Dis : Real from Standard; 
70         E   : Edge from TopoDS; 
71         F   : Face from  TopoDS)
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.
83         -- Warning
84         -- Nothing is done if edge E or the face F does not belong to the initial shape. 
85     is static; 
86     
87     
88     SetDist(me: in out; 
89              Dis : Real    from Standard; 
90              IC  : Integer from Standard;
91              F   : Face    from TopoDS)
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.
97         -- Warning
98         -- Nothing is done if either the edge E or the face F
99         -- does not belong to the initial shape.
100     is static;
101     
102    
103     GetDist(me;
104             IC   : Integer from Standard;
105              Dis : out Real from Standard)
106     is static;
107
108     
109     Add(me:in out; 
110         Dis1, Dis2 : Real; 
111         E: Edge from TopoDS; 
112         F: Face from  TopoDS)
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 ) ).
116         ---Level: Public
117     is static; 
118     
119     
120     SetDists(me: in out; 
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.
129         -- Warning
130         -- Nothing is done if either the edge E or the face F
131         -- does not belong to the initial shape.
132     is static;
133     
134    
135
136     Dists(me;
137           IC         : Integer from Standard;
138           Dis1, Dis2 : out Real from Standard)
139     is static;    
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.
143         -- Warning
144         -- -1. is returned if IC is outside the bounds of the table of contours.
145
146
147     AddDA(me:in out; 
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 ) ).
155         ---Level: Public
156     is static; 
157
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> 
167     is static; 
168
169     
170      GetDistAngle(me ; 
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     
177      is static;         
178
179
180     IsSymetric(me;
181                IC     : Integer from Standard) 
182         ---Purpose: return True if chamfer symetric false else.
183     returns Boolean from Standard is static;
184
185
186     IsTwoDistances(me;
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;
190
191    
192     IsDistanceAngle(me;
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;
196
197
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.
203         -- Warning
204         -- Nothing is done if IC is outside the bounds of the table of contours.
205     is static;
206     
207     NbContours(me) 
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;
211     
212     
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.
217         -- Warning
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;
221     
222     
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.
226         -- Warning
227         -- Returns 0 if I is outside the bounds of the table of contours.
228     returns Integer from Standard       
229     is static;
230     
231     
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.
235         -- Warning
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 
241     is static;
242     
243     
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.
247         -- Warning
248         -- Nothing is done if the edge E does not belong to the
249         -- contour in the internal data structure of this algorithm.
250     is static;
251   
252      
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.
256         -- Warning
257         -- Returns -1. if IC is outside the bounds of the table of contours.
258     is static; 
259
260
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.
264         -- Warning
265         -- Returns a null shape if IC is outside the bounds of the table of contours.
266     is static;
267
268
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.
272         -- Warning
273         -- Returns a null shape if IC is outside the bounds of the table of contours.
274     is static;
275
276
277     Abscissa(me; 
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.
283         -- Warning
284         -- Returns -1. if:
285         -- -   IC is outside the bounds of the table of contours, or
286         -- -   V is not on the contour of index IC.
287     is static;
288
289
290     RelativeAbscissa(me; 
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.
297         -- Warning
298         -- Returns -1. if:
299         -- -   IC is outside the bounds of the table of contours, or
300         -- -   V is not on the contour of index IC.
301     is static;
302
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.
307         -- Warning
308         -- Returns false if IC is outside the bounds of the table of contours.
309     is static; 
310
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.
315         -- Warning
316         -- Returns false if IC is outside the bounds of the table of contours.
317     is static; 
318     
319     Build(me: in out)
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.
324         -- Warning
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.
338       is redefined;
339     
340     Reset(me : in out)
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.
344     is static;
345     
346     Builder(me) returns HBuilder from TopOpeBRepBuild
347         ---Purpose: Returns the internal filleting algorithm.
348         ---Level: Advanced
349     is static;
350
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
356         --          shape <EorV>. 
357         ---C++: return const & 
358         ---Level: Public
359     returns ListOfShape from TopTools
360     is redefined virtual;
361     
362
363     Modified (me: in out; F : Shape from TopoDS)
364         ---Purpose: Returns the list  of shapes modified from the shape
365         --          <F>. 
366         ---C++: return const & 
367         ---Level: Public
368     returns ListOfShape from TopTools
369     is redefined virtual;
370
371
372     IsDeleted (me: in out; F : Shape from TopoDS)
373     returns Boolean
374     is redefined virtual;
375
376     -------------------------------
377     ---Methods for quick simulation
378     -------------------------------
379
380     Simulate(me : in out; 
381              IC : Integer from Standard);
382
383     NbSurf(me; IC : Integer from Standard)
384     returns Integer from Standard;
385          
386     Sect(me; IC, IS : Integer from Standard)
387     returns mutable SecHArray1 from ChFiDS;
388     
389 fields
390
391     myBuilder : ChBuilder  from ChFi3d;
392     myMap     : MapOfShape from TopTools;
393     
394 end MakeChamfer;
395
396
397