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