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