Integration of OCCT 6.5.0 from SVN
[occt.git] / src / IntCurveSurface / IntCurveSurface_QuadricCurveFunc.gxx
CommitLineData
7fd59977 1// File: IntCurveSurface_QuadricCurveFunc.gxx
2// Created: Thu Aug 19 10:55:26 1993
3// Author: Laurent BUCHARD
4// <lbr@nonox>
5//-Copyright: Matra Datavision 1993
6
7#include <gp_Vec.hxx>
8
9
10//================================================================================
11IntCurveSurface_QuadricCurveFunc::IntCurveSurface_QuadricCurveFunc(const TheQuadric& Q,
12 const TheCurve& C)
13 : myQuadric(Q), myCurve(C)
14{
15}
16//================================================================================
17Standard_Boolean IntCurveSurface_QuadricCurveFunc::Value(const Standard_Real Param,
18 Standard_Real& F) {
19 F = myQuadric.Distance(TheCurveTool::Value(myCurve,Param));
20 return(Standard_True);
21}
22
23Standard_Boolean IntCurveSurface_QuadricCurveFunc::Derivative(const Standard_Real Param,
24 Standard_Real& D) {
25 gp_Pnt P;
26 gp_Vec T;
27 TheCurveTool::D1(myCurve,Param,P,T);
28 D = T.Dot(myQuadric.Gradient(P));
29 return(Standard_True);
30}
31
32Standard_Boolean IntCurveSurface_QuadricCurveFunc::Values(const Standard_Real Param,
33 Standard_Real& F,
34 Standard_Real& D) {
35 gp_Pnt P;
36 gp_Vec T,Grad;
37 TheCurveTool::D1(myCurve,Param,P,T);
38 myQuadric.ValAndGrad(P,F,Grad);
39 D = T.Dot(Grad);
40 return(Standard_True);
41}
42
43
44