1 // Copyright (c) 1995-1999 Matra Datavision
2 // Copyright (c) 1999-2014 OPEN CASCADE SAS
4 // This file is part of Open CASCADE Technology software library.
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
19 #define No_Standard_RangeError
20 #define No_Standard_OutOfRange
24 IntImp_ZerCSParFunc::IntImp_ZerCSParFunc(const ThePSurface& S,
28 p = gp_Pnt(0.0,0.0,0.0);
32 Standard_Integer IntImp_ZerCSParFunc::NbVariables()const { return 3;}
34 Standard_Integer IntImp_ZerCSParFunc::NbEquations()const { return 3;}
36 Standard_Boolean IntImp_ZerCSParFunc::Value(const math_Vector& X,
39 gp_Pnt Psurf = ThePSurfaceTool::Value(surface,X(1),X(2));
40 gp_Pnt Pcurv = TheCurveTool::Value(curve,X(3));
41 Standard_Real f1,f2,f3;
42 F(1) = f1 = Psurf.X()-Pcurv.X();
43 F(2) = f2 = Psurf.Y()-Pcurv.Y();
44 F(3) = f3 = Psurf.Z()-Pcurv.Z();
45 f = f1*f1 + f2*f2 + f3*f3;
46 p = gp_Pnt((Psurf.XYZ()+Pcurv.XYZ())*0.5);
50 Standard_Boolean IntImp_ZerCSParFunc::Derivatives ( const math_Vector& X,
54 ThePSurfaceTool::D1(surface,X(1),X(2),Psurf,D1u,D1v);
55 TheCurveTool::D1(curve,X(3),Pcurv,D1w);
68 Standard_Boolean IntImp_ZerCSParFunc::Values( const math_Vector& X,
73 ThePSurfaceTool::D1(surface,X(1),X(2),Psurf,D1u,D1v);
74 TheCurveTool::D1(curve,X(3),Pcurv,D1w);
85 Standard_Real f1,f2,f3;
86 F(1) = f1 = Psurf.X()-Pcurv.X();
87 F(2) = f2 = Psurf.Y()-Pcurv.Y();
88 F(3) = f3 = Psurf.Z()-Pcurv.Z();
89 f = f1*f1 + f2*f2 + f3*f3;
90 p = gp_Pnt((Psurf.XYZ()+Pcurv.XYZ())*0.5);
94 const gp_Pnt& IntImp_ZerCSParFunc::Point() const { return p;}
96 Standard_Real IntImp_ZerCSParFunc::Root() const { return f;}
98 const ThePSurface& IntImp_ZerCSParFunc::AuxillarSurface() const {
101 const TheCurve& IntImp_ZerCSParFunc::AuxillarCurve() const {