summaryrefslogtreecommitdiff
path: root/inc/IntCurveSurface_QuadricCurveFunc.gxx
blob: 18ef5e182136a77dd22f5a71e2da9199bdd0f34c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// File:	IntCurveSurface_QuadricCurveFunc.gxx
// Created:	Thu Aug 19 10:55:26 1993
// Author:	Laurent BUCHARD
//		<lbr@nonox>
//-Copyright:	 Matra Datavision 1993

#include <gp_Vec.hxx>


//================================================================================
IntCurveSurface_QuadricCurveFunc::IntCurveSurface_QuadricCurveFunc(const TheQuadric& Q,
								   const TheCurve&   C) 
     : myQuadric(Q), myCurve(C) 
{  
} 
//================================================================================
Standard_Boolean IntCurveSurface_QuadricCurveFunc::Value(const Standard_Real Param,
							 Standard_Real& F) { 
  F = myQuadric.Distance(TheCurveTool::Value(myCurve,Param));
  return(Standard_True);
}

Standard_Boolean IntCurveSurface_QuadricCurveFunc::Derivative(const Standard_Real Param,
							      Standard_Real& D) { 
  gp_Pnt P;
  gp_Vec T;
  TheCurveTool::D1(myCurve,Param,P,T);  
  D = T.Dot(myQuadric.Gradient(P));
  return(Standard_True);
}

Standard_Boolean IntCurveSurface_QuadricCurveFunc::Values(const Standard_Real Param,
							  Standard_Real& F,
							  Standard_Real& D) { 
  gp_Pnt P;
  gp_Vec T,Grad;
  TheCurveTool::D1(myCurve,Param,P,T);  
  myQuadric.ValAndGrad(P,F,Grad);
  D = T.Dot(Grad);
  return(Standard_True);
}