0023024: Update headers of OCCT files
[occt.git] / src / BRepLib / BRepLib.cdl
1 -- Created on: 1993-12-15
2 -- Created by: Remi LEQUETTE
3 -- Copyright (c) 1993-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
21
22
23
24 package BRepLib 
25
26         ---Purpose: The BRepLib package provides general utilities for
27         --          BRep.
28         --          
29         --          * FindSurface : Class to compute a surface through
30         --          a set of edges.
31         --          
32         --          * Compute missing 3d curve on an edge.
33
34 uses
35     Standard,
36     StdFail,
37     gp,
38     Geom, 
39     GeomAbs,
40     Geom2d,
41     TopoDS,
42     TopLoc,
43     TopTools, 
44     TopAbs
45
46 is
47
48     enumeration EdgeError is 
49         ---Purpose: Errors that can occur at edge construction.
50         EdgeDone, -- no error
51         PointProjectionFailed, 
52         ParameterOutOfRange,
53         DifferentPointsOnClosedCurve, 
54         PointWithInfiniteParameter,
55         DifferentsPointAndParameter,
56         LineThroughIdenticPoints
57     end EdgeError;
58
59     
60     enumeration WireError is 
61         ---Purpose: Errors that can occur at wire construction.
62         WireDone, -- no error
63         EmptyWire,
64         DisconnectedWire,
65         NonManifoldWire
66
67     end WireError;
68
69
70     enumeration  FaceError is 
71         ---Purpose: Errors that can occur at face construction.
72         FaceDone, -- no error
73         NoFace,   -- not initialised
74         NotPlanar,
75         CurveProjectionFailed,
76         ParametersOutOfRange
77         
78     end FaceError;
79     
80     
81     enumeration ShellError is 
82         ---Purpose: Errors that can occur at shell construction.
83
84         ShellDone, -- no error
85         EmptyShell,
86         DisconnectedShell,
87         ShellParametersOutOfRange
88         
89     end ShellError;
90
91     enumeration ShapeModification is
92         ---Purpose: Modification type after a topologic operation.
93         
94         Preserved,   -- no  modification
95         Deleted, 
96         Trimmed,
97         Merged,
98         BoundaryModified
99         
100     end ShapeModification;
101
102     deferred class Command;
103         ---Purpose: Root class for all BRepBuilderAPI commands.
104
105     deferred class MakeShape;
106         ---Purpose: Root class for all shape constructions.
107
108     -- 
109     -- Construction of topology from geometry
110     -- 
111     
112     class MakeVertex;
113     
114     class MakeEdge;
115     
116     class MakeEdge2d;
117         
118     class MakePolygon;
119         
120     class MakeFace;
121
122     --
123     --  Construction of composite topologies
124     --  
125
126     class MakeWire;
127     
128     class MakeShell;
129     
130     class MakeSolid;
131
132
133
134
135     --- END of API commands.
136
137
138
139
140     class FindSurface;
141         ---Purpose: Find a surface in a set of edges.
142
143     class FuseEdges;
144         ---Purpose: 
145
146
147     --
148     --   Default precison methods.
149     --   The default precision is initialized with Precision::Confusion()
150     --   
151
152     Precision(P : Real);
153         ---Purpose: Sets the default precision.  The current Precision
154         --          is returned.
155         ---Level: Public
156         
157     Precision returns Real;
158         ---Purpose: Returns the default precision.
159         ---Level: Public 
160
161
162     --         
163     --   Default plane for 2d edges.
164     --   
165
166     Plane(P : Plane from Geom);
167         ---Purpose: Sets the current plane to P.
168         ---Level: Public
169     
170     Plane returns Plane from Geom;
171         ---Purpose: Returns the current plane.
172         --          
173         ---C++: return const &
174         ---Level: Public
175
176
177
178     CheckSameRange(E : Edge from TopoDS ;
179                    Confusion  : Real from Standard = 1.0e-12) 
180     returns Boolean;
181
182         ---Purpose: checks if the Edge is same range IGNORING 
183         --          the same range flag of the edge
184         --          Confusion argument is to compare real numbers
185         --          idenpendently of any model space tolerance 
186         --          
187      
188     
189     SameRange(E : Edge from TopoDS ;
190                  Tolerance : Real from Standard = 1.0e-5) ;
191         ---Purpose: will make all the curve representation have
192         --          the same range domain for the parameters.
193         --          This will IGNORE the same range flag value
194         --          to proceed.
195         --          If there is a 3D curve there it will the
196         --          range of that curve. If not the first curve representation
197         --          encountered in the list will give its range to
198         --          the all the other curves. 
199
200     BuildCurve3d(E : Edge from TopoDS ;
201                  Tolerance : Real from Standard = 1.0e-5 ;
202                  Continuity       : Shape  from  GeomAbs  =  GeomAbs_C1;
203                  MaxDegree        : Integer  =  14; 
204                  MaxSegment       : Integer  =  0 --30
205         ) returns Boolean;
206         ---Purpose: Computes the 3d curve for the edge  <E> if it does
207         --          not exist. Returns True  if the curve was computed
208         --          or  existed. Returns False  if there is no  planar
209         --          pcurve or the computation failed. 
210         --          <MaxSegment> >= 30 in approximation
211
212     BuildCurves3d(S : Shape from TopoDS ;
213                   Tolerance  : Real from Standard; 
214                   Continuity : Shape  from  GeomAbs  =  GeomAbs_C1;
215                   MaxDegree  : Integer  =  14; 
216                   MaxSegment : Integer  =  0 --30
217         ) returns Boolean;
218         
219         ---Purpose: Computes  the 3d curves  for all the  edges of <S>
220         --          return False if one of the computation failed.
221         --          <MaxSegment> >= 30 in approximation
222
223     BuildCurves3d(S : Shape from TopoDS)
224                   returns Boolean;
225         
226         ---Purpose: Computes  the 3d curves  for all the  edges of <S>
227         --          return False if one of the computation failed.
228
229
230        --          
231        --           
232     UpdateEdgeTol(  E  :  Edge  from  TopoDS  ;  
233                    MinToleranceRequest :  Real  from  Standard  ;
234                    MaxToleranceToCheck  :  Real  from  Standard) 
235        ---Purpose:       Checks if the edge has a  Tolerance smaller than -- --
236        --       -- -- MaxToleranceToCheck  if  so it will compute  the
237        --       radius    of  -- the   cylindrical  pipe  surface that
238        --       MinToleranceRequest is the minimum tolerance before it
239        --       is usefull to start testing. Usually it should be arround
240        --       10e-5
241        --       contains all  --  the curve represenation of  the edge
242        --       returns True if the Edge tolerance had to be updated
243     returns  Boolean  ;
244
245
246     UpdateEdgeTolerance(S : Shape  from  TopoDS;   
247                         MinToleranceRequest :  Real  from  Standard  ;
248                         MaxToleranceToCheck :  Real  from  Standard) 
249                         
250        ---Purpose: -- Checks all the edges of the shape whose -- -- --
251        --          Tolerance  is  smaller than  MaxToleranceToCheck --
252        --           Returns True if at  least  one edge was updated --
253        --          MinToleranceRequest is the minimum tolerance before
254        --          --  it -- is  usefull to start  testing. Usually it
255        --          should be arround -- 10e-5-- 
256        --          
257        --  Warning :The  method is  very  slow  as it  checks all.
258        --         Use  only  in interfaces or  processing assimilate batch 
259        --         
260
261      returns  Boolean  ;
262
263     SameParameter(E: Edge from TopoDS;
264                   Tolerance : Real from Standard = 1.0e-5);
265         ---Purpose: Computes new 2d curve(s)  for the edge <E> to have 
266         --          the same parameter  as  the  3d curve.  
267         --          The algorithm is not done if the flag SameParameter 
268         --          was True  on the  Edge.
269
270
271
272     SameParameter(S: Shape from TopoDS ;
273                   Tolerance : Real from Standard = 1.0e-5;
274                   forced : Boolean from Standard = Standard_False);
275         ---Purpose: Computes new 2d curve(s) for all the edges of  <S>
276         --          to have the same parameter  as  the  3d curve.  
277         --          The algorithm is not done if the flag SameParameter 
278         --          was True  on an  Edge.
279
280     UpdateTolerances(S: Shape from TopoDS;
281                      verifyFaceTolerance : Boolean from Standard = Standard_False);
282         ---Purpose:  Replaces tolerance   of  FACE EDGE VERTEX  by  the
283         --          tolerance Max of their connected handling shapes.
284         --          It is not necessary to use this call after
285         --          SameParameter. (called in)
286
287     OrientClosedSolid(solid : in out Solid from TopoDS)
288         ---Purpose:  Orients the solid forward  and the  shell with the
289         --           orientation to have  matter in the solid. Returns
290         --          False if the solid is unOrientable (open or incoherent)
291      returns  Boolean;
292
293
294     EncodeRegularity(S      : Shape from TopoDS;
295                      TolAng : Real  from Standard = 1.0e-10);
296         ---Purpose: Encodes the Regularity of edges on a Shape.
297         --  Warning: <TolAng> is an angular tolerance, expressed in Rad.
298         --  Warning: If the edges's regularity are coded before, nothing 
299         --          is done.
300
301     EncodeRegularity(S  : in  out  Edge from TopoDS; 
302                      F1,  F2  :  Face  from  TopoDS;
303                      TolAng : Real  from Standard = 1.0e-10);
304         ---Purpose: Encodes the Regularity beetween <F1> and <F2> by <E>
305         -- Warning: <TolAng> is an angular tolerance, expressed in Rad.
306         -- Warning: If the edge's regularity is coded before, nothing 
307         --          is done.
308
309     SortFaces (S  :        Shape       from TopoDS;
310                LF : in out ListOfShape from TopTools);
311         ---Purpose: Sorts in  LF the Faces of   S on the  complexity of
312         --                             their                  surfaces
313         --          (Plane,Cylinder,Cone,Sphere,Torus,other)
314                         
315     ReverseSortFaces (S  :        Shape       from TopoDS;
316                       LF : in out ListOfShape from TopTools);
317         ---Purpose:    Sorts in  LF  the   Faces  of S   on the reverse
318         --               complexity       of       their      surfaces
319         --          (other,Torus,Sphere,Cone,Cylinder,Plane)
320                         
321 end BRepLib;