0024002: Overall code and build procedure refactoring -- automatic
[occt.git] / src / BiTgte / BiTgte_Blend.cdl
1 -- Created on: 1996-12-16
2 -- Created by: Bruno DUMORTIER
3 -- Copyright (c) 1996-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 Blend from BiTgte 
18
19         ---Purpose: Root class
20
21 uses
22
23     Shape                            from TopoDS,
24     Face                             from TopoDS,
25     Edge                             from TopoDS,
26     MapOfShape                       from TopTools,
27     ListOfShape                      from TopTools,
28     Curve                            from Geom2d,
29     Curve                            from Geom,
30     Surface                          from Geom,
31     Analyse                          from BRepOffset,
32     Inter3d                          from BRepOffset,
33     Offset                           from BRepOffset,
34     Image                            from BRepAlgo,
35     AsDes                            from BRepAlgo,
36     DataMapOfShapeOffset             from BRepOffset,
37     DataMapOfShapeBox                from BiTgte,
38     ContactType                      from BiTgte,
39     DataMapOfShapeListOfShape        from TopTools,
40     IndexedMapOfShape                from TopTools,
41     IndexedDataMapOfShapeListOfShape from TopTools,
42     DataMapOfShapeDataMapOfShapeListOfShape from BRepFill,
43     HArray1OfInteger                 from TColStd
44
45 raises
46     NotDone    from StdFail,
47     OutOfRange from Standard
48     
49
50 is
51     --- 
52     ---  Initilisations
53     --- 
54
55     Create
56     returns Blend from BiTgte;
57     
58     Create (S      : Shape   from TopoDS;
59             Radius : Real    from Standard;
60             Tol    : Real    from Standard;
61             NUBS   : Boolean from Standard)
62         ---Purpose: <S>: Shape to be rounded
63         --          <Radius>: radius of the fillet
64         --          <Tol>: Tol3d used in approximations
65         --          <NUBS>: if true,  generate only NUBS surfaces,
66         --                  if false, generate analytical surfaces if possible
67         --                  
68     returns Blend from BiTgte;
69     
70     Init (me     : in out;
71           S      : Shape   from TopoDS;
72           Radius : Real    from Standard;
73           Tol    : Real    from Standard;
74           NUBS   : Boolean from Standard)
75     is static;
76     
77     Clear (me : in out)
78         ---Purpose: Clear all the Fields.
79     is static;
80
81     SetFaces(me     : in out;
82              F1, F2 : Face from TopoDS)
83         ---Purpose:  Set two faces   of <myShape> on which the  Sphere
84     --                    must roll.
85     is static;
86
87     SetEdge(me   : in out;
88             Edge : Edge from TopoDS)
89         ---Purpose: Set an edge of <myShape> to be rounded.
90     is static;
91     
92     SetStoppingFace (me   : in out;
93                      Face : Face from TopoDS)
94         ---Purpose: Set a face on which the fillet must stop.
95     is static;
96
97
98     ---
99     ---  Computation
100     --- 
101
102     Perform (me         : in out;
103              BuildShape : Boolean from Standard = Standard_True)
104         ---Purpose: Compute the generated surfaces.
105         --          If <BuildShape> is true, compute the resulting Shape.
106         --          If false, only the blending surfaces are computed.
107     is static;    
108
109
110     ---
111     ---  Quering
112     --- 
113
114     IsDone(me) 
115     returns Boolean from Standard
116         ---Purpose: 
117     is static;
118
119
120     Shape(me) 
121         ---Purpose: returns the result
122     returns Shape from TopoDS
123         ---C++: return const &
124     is static;
125
126
127     NbSurfaces(me)
128         ---Purpose: returns the Number of generated surfaces.
129     returns Integer from Standard
130     raises
131         NotDone from StdFail
132     is static;
133
134     Surface(me; Index : Integer from Standard) 
135     returns Surface from Geom
136         ---Purpose: returns the surface of range Index
137     raises
138         NotDone from StdFail,
139         OutOfRange from Standard
140     is static;
141
142     Face(me; Index : Integer from Standard) 
143     returns Face from TopoDS
144         ---Purpose: returns the surface of range Index
145         ---C++: return const &
146     raises
147         NotDone from StdFail,
148         OutOfRange from Standard
149     is static;
150
151     CenterLines(me;
152                 LC : in out ListOfShape from TopTools ) 
153         ---Purpose: set in <LC> all the center lines
154     is static;
155
156     Surface(me; CenterLine : Shape from TopoDS)
157     returns Surface from Geom
158         ---Purpose: returns  the surface generated  by the centerline.
159         --          <CenterLine> may be
160         --             - an edge  : generate a pipe.
161         --             - a vertex : generate a sphere.
162         --  Warning: returns a Null Handle if <CenterLine> generates 
163         --          no surface.
164     raises
165         NotDone from StdFail
166     is static;
167
168     Face(me; CenterLine : Shape from TopoDS)
169     returns Face from TopoDS
170         ---Purpose: returns  the face generated  by the centerline.
171         --          <CenterLine> may be
172         --             - an edge  : generate a pipe.
173         --             - a vertex : generate a sphere.
174         --  Warning: returns a Null Shape if <CenterLine> generates 
175         --          no surface.
176         ---C++: return const &
177     raises
178         NotDone from StdFail
179     is static;
180
181
182     ---
183     --- Information about FilletGeometry:
184     --- 
185     
186     ContactType(me; Index: Integer from Standard) 
187         ---Purpose: returns the type of contact
188     returns ContactType from BiTgte
189     is static;
190     
191     ---
192     --- SupportShape: may be a Face, an Edge or a Vertex
193     --- 
194
195     SupportShape1 (me; Index: Integer from Standard)  
196     returns Shape from TopoDS
197         ---Purpose: gives the first support shape relative to 
198         --          SurfaceFillet(Index);
199         ---C++: return const & 
200     raises  
201         NotDone    from StdFail,
202         OutOfRange from Standard
203     is static;  
204     
205     SupportShape2 (me; Index : Integer from Standard) 
206     returns Shape from TopoDS
207         ---Purpose: gives the second support shape relative to 
208         --          SurfaceFillet(Index);
209         ---C++:return const &
210     raises NotDone    from StdFail,
211            OutOfRange from Standard
212     is static;
213    
214    
215     ---
216     --- 3d Curves: the guide - lines
217     --- 
218
219     CurveOnShape1 (me; Index : Integer from Standard) 
220     returns Curve from Geom
221         ---Purpose: gives the 3d curve of SurfaceFillet(Index)
222         --          on SupportShape1(Index)  
223     raises NotDone    from StdFail,
224            OutOfRange from Standard
225     is static;
226
227     CurveOnShape2 (me; Index : Integer from Standard)
228     returns Curve from Geom
229         ---Purpose: gives the 3d curve of SurfaceFillet(Index)
230         --          on SupportShape2(Index)
231     raises NotDone    from StdFail,
232            OutOfRange from Standard
233     is static;
234
235
236     ---
237     --- 2d curves:
238     --- 
239
240
241     PCurveOnFace1 (me; Index : Integer from Standard)
242     returns Curve from Geom2d
243         ---Purpose: gives the PCurve associated to CurvOnShape1(Index)
244         --          on the support face 
245         --  Warning: returns a Null Handle if SupportShape1 is not a Face
246     raises NotDone    from StdFail,
247            OutOfRange from Standard
248     is static;
249
250     PCurve1OnFillet (me; Index : Integer from Standard)
251     returns Curve from Geom2d
252         ---Purpose: gives the PCurve associated to CurveOnShape1(Index)
253         --          on the Fillet
254     raises  NotDone    from StdFail,
255             OutOfRange from Standard
256     is static;
257     
258     PCurveOnFace2 (me; Index : Integer from Standard)
259     returns Curve from Geom2d
260         ---Purpose: gives the PCurve  associated to CurveOnShape2(Index)
261         --          on the  support face 
262         --  Warning: returns a Null Handle if SupportShape2 is not a Face
263     raises  NotDone    from StdFail,
264             OutOfRange from Standard
265     is static;
266    
267     PCurve2OnFillet (me; Index : Integer from Standard)
268     returns Curve from Geom2d
269         ---Purpose: gives the PCurve associated to CurveOnShape2(Index)
270         --          on the fillet
271     raises  NotDone    from StdFail,
272              OutOfRange from Standard
273     is static;
274
275
276     ---
277     --- Branches Solutions
278     --- 
279
280     NbBranches(me : in out) 
281     returns Integer from Standard
282     raises  
283         NotDone    from StdFail
284     is static;
285
286
287     IndicesOfBranche(me; 
288                      Index    :        Integer from Standard;
289                      From, To : in out Integer from Standard)
290         ---Purpose:  Set in <From>,<To>   the indices of the faces  of
291         --  the branche <Index>.
292         --  
293         --  i.e: Branche<Index> = Face(From) + Face(From+1) + ..+ Face(To)
294     is static;
295
296     --- 
297     --- Internal methods:
298     --- 
299
300
301     ComputeCenters (me : in out)
302         ---Purpose: Computes the center lines
303     is static;
304
305     ComputeSurfaces( me    : in out)
306         ---Purpose: Perform the generated surfaces.
307     is static private;
308
309     ComputeShape(me : in out)
310         ---Purpose: Build the resulting shape
311         --          All the faces must be computed
312     is static private;
313     
314     Intersect(me : in out;
315               Init    :        Shape             from TopoDS; 
316               Face    :        Face              from TopoDS;
317               MapSBox :        DataMapOfShapeBox from BiTgte;
318               OF1     :        Offset            from BRepOffset;
319               Inter   : in out Inter3d           from BRepOffset)
320     returns Boolean from Standard
321         ---Purpose: Computes the intersections with <Face> and all the
322         --           OffsetFaces stored  in <myMapSF>.  Returns <True>
323         --          if an intersections ends on a boundary of a Face.
324     is static private;
325     
326     
327 fields
328
329     myRadius         : Real                 from Standard;   
330     myTol            : Real                 from Standard; 
331     myNubs           : Boolean              from Standard;
332     myShape          : Shape                from TopoDS;     -- Shape Initial
333     myResult         : Shape                from TopoDS;     -- Shape Resultat
334     myBuildShape     : Boolean              from Standard;
335
336     myAncestors      : IndexedDataMapOfShapeListOfShape from TopTools;
337     myCreated        : DataMapOfShapeDataMapOfShapeListOfShape from BRepFill;
338     myCutEdges       : DataMapOfShapeListOfShape from TopTools;
339
340     myFaces          : IndexedMapOfShape           from TopTools;
341     myEdges          : IndexedMapOfShape           from TopTools;
342      
343     myStopFaces      : MapOfShape           from TopTools;
344     myAnalyse        : Analyse              from BRepOffset;
345     
346     myCenters        : IndexedMapOfShape    from TopTools;
347     myMapSF          : DataMapOfShapeOffset from BRepOffset;
348     myInitOffsetFace : Image                from BRepAlgo;      
349     myImage          : Image                from BRepAlgo;           
350     myImageOffset    : Image                from BRepAlgo;
351     myAsDes          : AsDes                from BRepAlgo;
352
353     myNbBranches     : Integer              from Standard;
354     myIndices        : HArray1OfInteger     from TColStd;     
355     myDone           : Boolean              from Standard;
356
357 end Blend;