void IntAna_IntConicQuad::Perform (const gp_Circ& C, const gp_Pln& P,
const Standard_Real Tolang,
const Standard_Real Tol)
{
done=Standard_False;
gp_Pln Plconic(gp_Ax3(C.Position()));
IntAna_QuadQuadGeo IntP(Plconic,P,Tolang,Tol);
if (!IntP.IsDone()) {return;}
if (IntP.TypeInter() == IntAna_Empty) {
parallel=Standard_True;
Standard_Real distmax = P.Distance(C.Location()) + C.Radius()*Tolang;
if (distmax < Tol) {
inquadric = Standard_True;
}
else {
inquadric = Standard_False;
}
done=Standard_True;
}
else if(IntP.TypeInter() == IntAna_Same) {
inquadric = Standard_True;
done = Standard_True;
}
else {
inquadric=Standard_False;
parallel=Standard_False;
gp_Lin Ligsol(IntP.Line(1));
gp_Vec V0(Plconic.Location(),Ligsol.Location());
gp_Vec Axex(Plconic.Position().XDirection());
gp_Vec Axey(Plconic.Position().YDirection());
gp_Pnt2d Orig(Axex.Dot(V0),Axey.Dot(V0));
gp_Vec2d Dire(Axex.Dot(Ligsol.Direction()),
Axey.Dot(Ligsol.Direction()));
gp_Lin2d Ligs(Orig,Dire);
gp_Pnt2d Pnt2dBid(0.0,0.0);
gp_Dir2d Dir2dBid(1.0,0.0);
gp_Ax2d Ax2dBid(Pnt2dBid,Dir2dBid);
gp_Circ2d Cir(Ax2dBid,C.Radius());
IntAna2d_AnaIntersection Int2d(Ligs,Cir);
if (!Int2d.IsDone()) {return;}
nbpts=Int2d.NbPoints();
for (Standard_Integer i=1; i<=nbpts; i++) {
gp_Pnt2d resul(Int2d.Point(i).Value());
Standard_Real X= resul.X();
Standard_Real Y= resul.Y();
pnts[i-1].SetCoord(Plconic.Location().X() + X*Axex.X() + Y*Axey.X(),
Plconic.Location().Y() + X*Axex.Y() + Y*Axey.Y(),
Plconic.Location().Z() + X*Axex.Z() + Y*Axey.Z());
paramonc[i-1]=Int2d.Point(i).ParamOnSecond();
}
done=Standard_True;
}
}