0024005: Intersecting a slightly off angle plane with a cylinder takes 7+ seconds
[occt.git] / src / IntTools / IntTools_BeanFaceIntersector.cdl
1 -- Created on: 2001-06-29
2 -- Created by: Michael KLOKOV
3 -- Copyright (c) 2001-2012 OPEN CASCADE SAS
4 --
5 -- The content of this file is subject to the Open CASCADE Technology Public
6 -- License Version 6.5 (the "License"). You may not use the content of this file
7 -- except in compliance with the License. Please obtain a copy of the License
8 -- at http://www.opencascade.org and read it completely before using this file.
9 --
10 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
12 --
13 -- The Original Code and all software distributed under the License is
14 -- distributed on an "AS IS" basis, without warranty of any kind, and the
15 -- Initial Developer hereby disclaims all such warranties, including without
16 -- limitation, any warranties of merchantability, fitness for a particular
17 -- purpose or non-infringement. Please see the License for the specific terms
18 -- and conditions governing the rights and limitations under the License.
19
20
21 class BeanFaceIntersector from IntTools
22
23     ---Purpose: The class BeanFaceIntersector computes ranges of parameters on 
24     --          the curve of a bean(part of edge) that bound the parts of bean which 
25     --          are on the surface of a face according to edge and face tolerances.    
26     --  Warning: The real boundaries of the face are not taken into account,
27     --          Most of the result parts of the bean lays only inside the region of the surface,
28     --          which includes the inside of the face. And the parts which are out of this region can be
29     --          excluded from the result.
30     
31 uses
32
33     SequenceOfRoots    from IntTools,
34     MarkedRangeSet     from IntTools,
35     SequenceOfRanges   from IntTools,
36     Context            from BOPInt,
37     ExtCS              from Extrema,
38     ProjectPointOnSurf from GeomAPI,
39     Edge               from TopoDS,
40     Face               from TopoDS,
41     Curve              from BRepAdaptor,
42     Surface            from BRepAdaptor,
43     Box                from Bnd,
44     CurveRangeSample   from IntTools,
45     SurfaceRangeSample from IntTools,
46     ListOfCurveRangeSample   from IntTools,
47     ListOfSurfaceRangeSample from IntTools,
48     CurveRangeLocalizeData   from IntTools,
49     SurfaceRangeLocalizeData from IntTools,
50     Surface            from Geom
51
52 is
53     Create returns BeanFaceIntersector from IntTools;
54
55     Create(theEdge: Edge from TopoDS;
56            theFace: Face from TopoDS)
57            returns BeanFaceIntersector from IntTools;
58         ---Purpose: 
59         --- Initializes the algorithm
60         ---
61         --  Warning: 
62         --- The parts of the edge which are on
63         --- the surface of the face and belong to
64         --- the whole in the face (if there is)
65         --- is considered as result
66         ---
67
68     Create(theCurve        : Curve   from BRepAdaptor;
69            theSurface      : Surface from BRepAdaptor;
70            theBeanTolerance: Real    from Standard;
71            theFaceTolerance: Real    from Standard)
72            returns BeanFaceIntersector from IntTools;
73         ---Purpose: 
74         --- Initializes the algorithm
75         ---
76
77     Create(theCurve          : Curve   from BRepAdaptor;
78            theSurface        : Surface from BRepAdaptor;
79            theFirstParOnCurve: Real from Standard;
80            theLastParOnCurve : Real from Standard;
81            theUMinParameter  : Real from Standard;
82            theUMaxParameter  : Real from Standard;
83            theVMinParameter  : Real from Standard;
84            theVMaxParameter  : Real from Standard;
85            theBeanTolerance  : Real from Standard;
86            theFaceTolerance  : Real from Standard)
87            returns BeanFaceIntersector from IntTools;
88         ---Purpose: 
89         --- Initializes the algorithm
90         --- theUMinParameter, ... are used for
91         --- optimization purposes
92         ---
93
94     Init(me: in out;theEdge: Edge from TopoDS;
95                     theFace: Face from TopoDS);
96         ---Purpose: 
97         --- Initializes the algorithm
98         ---
99         --  Warning: 
100         --- The parts of the edge which are on
101         --- the surface of the face and belong to
102         --- the whole in the face (if there is)
103         --- is considered as result
104         ---
105
106     Init(me: in out;theCurve        : Curve   from BRepAdaptor;
107                     theSurface      : Surface from BRepAdaptor;
108                     theBeanTolerance: Real from Standard;
109                     theFaceTolerance: Real from Standard);
110         ---Purpose: 
111         --- Initializes the algorithm
112         ---
113
114     Init(me: in out;theCurve          : Curve   from BRepAdaptor;
115                     theSurface        : Surface from BRepAdaptor;
116                     theFirstParOnCurve: Real from Standard;
117                     theLastParOnCurve : Real from Standard;
118                     theUMinParameter  : Real from Standard;
119                     theUMaxParameter  : Real from Standard;
120                     theVMinParameter  : Real from Standard;
121                     theVMaxParameter  : Real from Standard;
122                     theBeanTolerance  : Real from Standard;
123                     theFaceTolerance  : Real from Standard);
124         ---Purpose: 
125         --- Initializes the algorithm
126         --- theUMinParameter, ... are used for
127         --- optimization purposes
128         ---
129
130     SetContext(me: in out;  
131             theContext: Context from BOPInt);
132         ---Purpose:
133         --- Sets the intersecton context
134         ---
135     Context(me) 
136         returns Context from BOPInt; 
137     ---C++:  return const &     
138     ---Purpose:
139         --- Gets the intersecton context
140         ---       
141     SetBeanParameters(me: in out;theFirstParOnCurve : Real from Standard;
142                                  theLastParOnCurve  : Real from Standard);
143         ---Purpose: 
144         --- Set restrictions for curve
145         ---
146
147     SetSurfaceParameters(me: in out;theUMinParameter : Real from Standard;
148                                     theUMaxParameter : Real from Standard;
149                                     theVMinParameter : Real from Standard;
150                                     theVMaxParameter : Real from Standard);
151         ---Purpose: 
152         --- Set restrictions for surface
153         ---
154
155     Perform(me: in out);
156         ---Purpose: 
157         --- Launches the algorithm
158         ---
159
160     IsDone(me) returns Boolean from Standard;
161         ---C++: inline
162
163     Result(me)
164         returns SequenceOfRanges from IntTools;
165         ---C++: return const &
166
167     Result(me; theResults: out SequenceOfRanges from IntTools);
168
169     -- private
170
171     ComputeAroundExactIntersection(me: in out)
172         is private;
173
174     ComputeLinePlane(me: in out)
175         is private;
176  
177     FastComputeExactIntersection(me: in out)
178         returns Integer from Standard is private; 
179
180     ComputeUsingExtremum(me: in out)
181         is private;
182
183     ComputeNearRangeBoundaries(me: in out)
184         is private;
185
186     ComputeLocalized(me: in out)
187         returns Boolean from Standard is private;
188         
189     ComputeRangeFromStartPoint(me: in out; ToIncreaseParameter : Boolean from Standard;
190                                            theParameter        : Real from Standard;
191                                            theUParameter       : Real from Standard;
192                                            theVParameter       : Real from Standard)
193         is private;
194
195     ComputeRangeFromStartPoint(me: in out; ToIncreaseParameter : Boolean from Standard;
196                                            theParameter        : Real from Standard;
197                                            theUParameter       : Real from Standard;
198                                            theVParameter       : Real from Standard;
199                                            theIndex            : Integer from Standard)
200         is private;
201
202     Distance(me: in out; theArg       : Real from Standard;
203                          theUParameter: out Real from Standard;
204                          theVParameter: out Real from Standard)
205         returns Real from Standard
206         is private;
207
208     Distance(me: in out; theArg: Real from Standard)
209         returns Real from Standard
210         is private;
211
212     LocalizeSolutions(me: in out; theCurveRange  : CurveRangeSample from IntTools;
213                                   theBoxCurve    : Box from Bnd;
214                                   theSurfaceRange: SurfaceRangeSample from IntTools;
215                                   theBoxSurface  : Box from Bnd;
216                                   theCurveData   : in out CurveRangeLocalizeData   from IntTools;
217                                   theSurfaceData : in out SurfaceRangeLocalizeData from IntTools;
218                                   theListCurveRange: in out ListOfCurveRangeSample from IntTools;
219                                   theListSurfaceRange: in out ListOfSurfaceRangeSample from IntTools)
220         returns Boolean from Standard
221         is private;
222
223     TestComputeCoinside(me: in out)
224         returns Boolean from Standard
225         is private;
226
227 fields
228
229     -- sources    
230     myCurve          : Curve   from BRepAdaptor;
231     mySurface        : Surface from BRepAdaptor;
232     myTrsfSurface    : Surface from Geom;
233     myFirstParameter : Real from Standard;
234     myLastParameter  : Real from Standard;
235     myUMinParameter  : Real from Standard;
236     myUMaxParameter  : Real from Standard;
237     myVMinParameter  : Real from Standard;
238     myVMaxParameter  : Real from Standard;
239     myBeanTolerance  : Real from Standard;
240     myFaceTolerance  : Real from Standard;
241     
242     myCurveResolution: Real from Standard;
243     myCriteria       : Real from Standard;
244     
245     -- tools
246     myExtrema        : ExtCS from Extrema;
247     myProjector      : ProjectPointOnSurf from GeomAPI;
248     myRangeManager   : MarkedRangeSet from IntTools;
249     myDeflection     : Real from Standard;
250     myContext        : Context from BOPInt;
251     
252     -- results
253     myResults        : SequenceOfRanges from IntTools;
254     myIsDone         : Boolean from Standard;
255     
256 end BeanFaceIntersector from IntTools;