1 -- Created on: 1991-04-30
2 -- Created by: Isabelle GRIGNON
3 -- Copyright (c) 1991-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
6 -- This file is part of Open CASCADE Technology software library.
8 -- This library is free software; you can redistribute it and / or modify it
9 -- under the terms of the GNU Lesser General Public 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.
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
17 generic class Int2S from IntImp
19 ThePSurfaceTool as any) -- as PSurfaceTool from IntImp (ThePSurface)
22 ---Purpose: Determination of the intersection between 2 surfaces
23 -- from an point close to the solution.
26 uses Array1OfReal from TColStd,
27 ConstIsoparametric from IntImp,
31 FunctionSetRoot from math
33 raises NotDone from StdFail,
34 DomainError from Standard,
35 ConstructionError from Standard,
36 UndefinedDerivative from StdFail
39 class TheFunction instantiates ZerParFunc from IntImp
40 (ThePSurface, ThePSurfaceTool);
46 ---Purpose: Raises Construction Error
48 returns Int2S from IntImp;
50 Create( Param: Array1OfReal from TColStd;
54 ---Purpose: compute the solution point with the close point
56 returns Int2S from IntImp;
59 Create( S1,S2: ThePSurface;
60 TolTangency: Real from Standard)
62 ---Purpose: initialize the parameters to compute the solution point
63 -- it 's possible to write to optimize:
64 -- IntImp_Int2S inter(S1,S2,Func,TolTangency);
65 -- math_FunctionSetRoot rsnld(inter.Function());
70 -- inter.Perform(Param,rsnld);
73 returns Int2S from IntImp;
76 Perform(me : in out; Param : Array1OfReal from TColStd;
77 Rsnld : in out FunctionSetRoot from math)
79 ---Purpose: returns the best constant isoparametric to find
80 -- the next intersection's point +stores the solution
81 -- point (the solution point is found with the close point
82 -- to intersect the isoparametric with the other patch;
83 -- the choice of the isoparametic is calculated)
85 returns ConstIsoparametric from IntImp
91 Param : Array1OfReal from TColStd;
92 Rsnld : in out FunctionSetRoot from math;
93 ChoixIso : ConstIsoparametric from IntImp)
95 ---Purpose: returns the best constant isoparametric to find
96 -- the next intersection's point +stores the solution
97 -- point (the solution point is found with the close point
98 -- to intersect the isoparametric with the other patch;
99 -- the choice of the isoparametic is given by ChoixIso)
101 returns ConstIsoparametric from IntImp
108 ---Purpose: Returns TRUE if the creation completed without failure.
110 returns Boolean from Standard
118 ---Purpose: Returns TRUE when there is no solution to the problem.
120 returns Boolean from Standard
123 raises NotDone from StdFail
129 ---Purpose: Returns the intersection point.
131 returns PntOn2S from IntSurf
132 ---C++: return const&
135 raises NotDone from StdFail,
136 DomainError from Standard
137 -- The exception NotDone is raised if IsDone is false.
138 -- The exception DomainError is raised if IsEmpty is true.
145 ---Purpose: Returns True if the surfaces are tangent at the
146 -- intersection point.
148 returns Boolean from Standard
151 raises NotDone from StdFail,
152 DomainError from Standard
153 -- The exception NotDone is raised if IsDone is false.
154 -- The exception DomainError is raised if IsEmpty is true.
161 ---Purpose: Returns the tangent at the intersection line.
164 ---C++: return const&
167 raises NotDone from StdFail,
168 DomainError from Standard,
169 UndefinedDerivative from StdFail
170 -- The exception NotDone is raised if IsDone is false.
171 -- The exception DomainError is raised if IsEmpty is true.
172 -- The exception UndefinedDerivative is raised if IsTangent
180 ---Purpose: Returns the tangent at the intersection line in the
181 -- parametric space of the first surface.
183 returns Dir2d from gp
184 ---C++: return const&
187 raises NotDone from StdFail,
188 DomainError from Standard,
189 UndefinedDerivative from StdFail
190 -- The exception NotDone is raised if IsDone is false.
191 -- The exception DomainError is raised if IsEmpty is true.
192 -- The exception UndefinedDerivative is raised if IsTangent
200 ---Purpose: Returns the tangent at the intersection line in the
201 -- parametric space of the second surface.
203 returns Dir2d from gp
204 ---C++: return const&
207 raises NotDone from StdFail,
208 DomainError from Standard,
209 UndefinedDerivative from StdFail
210 -- The exception NotDone is raised if IsDone is false.
211 -- The exception DomainError is raised if IsEmpty is true.
212 -- The exception UndefinedDerivative is raised if IsTangent
219 ---Purpose: return the math function which
220 -- is used to compute the intersection
231 done : Boolean from Standard;
232 empty : Boolean from Standard;
233 pint : PntOn2S from IntSurf;
234 tangent : Boolean from Standard;
236 d2d1 : Dir2d from gp;
237 d2d2 : Dir2d from gp;
238 myZerParFunc : TheFunction;
239 tol : Real from Standard;
241 ua0,va0,ua1,va1 : Real from Standard; -- surf1
242 ub0,vb0,ub1,vb1 : Real from Standard; -- surf2
243 ures1,ures2,vres1,vres2 : Real from Standard; -- U et V Resolution