1 -- Created on: 1991-04-30
2 -- Created by: Isabelle GRIGNON
3 -- Copyright (c) 1991-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
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.
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.
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.
23 generic class Int2S from IntImp
25 ThePSurfaceTool as any) -- as PSurfaceTool from IntImp (ThePSurface)
28 ---Purpose: Determination of the intersection between 2 surfaces
29 -- from an point close to the solution.
32 uses Array1OfReal from TColStd,
33 ConstIsoparametric from IntImp,
37 FunctionSetRoot from math
39 raises NotDone from StdFail,
40 DomainError from Standard,
41 ConstructionError from Standard,
42 UndefinedDerivative from StdFail
45 class TheFunction instantiates ZerParFunc from IntImp
46 (ThePSurface, ThePSurfaceTool);
52 ---Purpose: Raises Construction Error
54 returns Int2S from IntImp;
56 Create( Param: Array1OfReal from TColStd;
60 ---Purpose: compute the solution point with the close point
62 returns Int2S from IntImp;
65 Create( S1,S2: ThePSurface;
66 TolTangency: Real from Standard)
68 ---Purpose: initialize the parameters to compute the solution point
69 -- it 's possible to write to optimize:
70 -- IntImp_Int2S inter(S1,S2,Func,TolTangency);
71 -- math_FunctionSetRoot rsnld(inter.Function());
76 -- inter.Perform(Param,rsnld);
79 returns Int2S from IntImp;
82 Perform(me : in out; Param : Array1OfReal from TColStd;
83 Rsnld : in out FunctionSetRoot from math)
85 ---Purpose: returns the best constant isoparametric to find
86 -- the next intersection's point +stores the solution
87 -- point (the solution point is found with the close point
88 -- to intersect the isoparametric with the other patch;
89 -- the choice of the isoparametic is calculated)
91 returns ConstIsoparametric from IntImp
97 Param : Array1OfReal from TColStd;
98 Rsnld : in out FunctionSetRoot from math;
99 ChoixIso : ConstIsoparametric from IntImp)
101 ---Purpose: returns the best constant isoparametric to find
102 -- the next intersection's point +stores the solution
103 -- point (the solution point is found with the close point
104 -- to intersect the isoparametric with the other patch;
105 -- the choice of the isoparametic is given by ChoixIso)
107 returns ConstIsoparametric from IntImp
114 ---Purpose: Returns TRUE if the creation completed without failure.
116 returns Boolean from Standard
124 ---Purpose: Returns TRUE when there is no solution to the problem.
126 returns Boolean from Standard
129 raises NotDone from StdFail
135 ---Purpose: Returns the intersection point.
137 returns PntOn2S from IntSurf
138 ---C++: return const&
141 raises NotDone from StdFail,
142 DomainError from Standard
143 -- The exception NotDone is raised if IsDone is false.
144 -- The exception DomainError is raised if IsEmpty is true.
151 ---Purpose: Returns True if the surfaces are tangent at the
152 -- intersection point.
154 returns Boolean from Standard
157 raises NotDone from StdFail,
158 DomainError from Standard
159 -- The exception NotDone is raised if IsDone is false.
160 -- The exception DomainError is raised if IsEmpty is true.
167 ---Purpose: Returns the tangent at the intersection line.
170 ---C++: return const&
173 raises NotDone from StdFail,
174 DomainError from Standard,
175 UndefinedDerivative from StdFail
176 -- The exception NotDone is raised if IsDone is false.
177 -- The exception DomainError is raised if IsEmpty is true.
178 -- The exception UndefinedDerivative is raised if IsTangent
186 ---Purpose: Returns the tangent at the intersection line in the
187 -- parametric space of the first surface.
189 returns Dir2d from gp
190 ---C++: return const&
193 raises NotDone from StdFail,
194 DomainError from Standard,
195 UndefinedDerivative from StdFail
196 -- The exception NotDone is raised if IsDone is false.
197 -- The exception DomainError is raised if IsEmpty is true.
198 -- The exception UndefinedDerivative is raised if IsTangent
206 ---Purpose: Returns the tangent at the intersection line in the
207 -- parametric space of the second surface.
209 returns Dir2d from gp
210 ---C++: return const&
213 raises NotDone from StdFail,
214 DomainError from Standard,
215 UndefinedDerivative from StdFail
216 -- The exception NotDone is raised if IsDone is false.
217 -- The exception DomainError is raised if IsEmpty is true.
218 -- The exception UndefinedDerivative is raised if IsTangent
225 ---Purpose: return the math function which
226 -- is used to compute the intersection
237 done : Boolean from Standard;
238 empty : Boolean from Standard;
239 pint : PntOn2S from IntSurf;
240 tangent : Boolean from Standard;
242 d2d1 : Dir2d from gp;
243 d2d2 : Dir2d from gp;
244 myZerParFunc : TheFunction;
245 tol : Real from Standard;
247 ua0,va0,ua1,va1 : Real from Standard; -- surf1
248 ub0,vb0,ub1,vb1 : Real from Standard; -- surf2
249 ures1,ures2,vres1,vres2 : Real from Standard; -- U et V Resolution