//#include #include #include #include GccGeo_ParGenCurve:: GccGeo_ParGenCurve () { Dep = 0.; } GccGeo_ParGenCurve:: GccGeo_ParGenCurve (const TheCurve& C , const Standard_Real D ) { Cu = C; Dep = D; } Standard_Real GccGeo_ParGenCurve::GetResolution() { return Cu.GetResolution(); } Standard_Integer GccGeo_ParGenCurve::GetIntervals() { return Cu.GetIntervals(); } gp_Pnt2d GccGeo_ParGenCurve::Value (const Standard_Real U) { gp_Pnt2d P; gp_Vec2d V; Standard_Real NorTan; if (deport!=0.) { Cu.D1(U,P,V); NorTan= V.Magnitude(); V.SetCoord(V.Y(),-V.X()); if (NorTan >= gp::Resolution()) { return gp_Pnt2d(P.XY()+deport*V.XY()/NorTan); } else { gp_VectorWithNullMagnitude::Raise(); } } else { return Cu.Value(U); } } void GccGeo_ParGenCurve::D1(const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& T) { gp_Vec2d V1,V2,V3; gp_Pnt2d PP; Standard_Real Nor1,Alfa; Standard_Integer Index,firstKnot,lastKnot; if (deport != 0.) { Cu.D2(U,PP,V1,V2); Nor1= V1.Magnitude(); V3.SetCoord(V1.Y(),-V1.X()); V2.SetCoord(V2.Y(),-V2.X()); if (Nor1 >= gp::Resolution()) { P = gp_Pnt2d(PP.XY()+deport*V3.XY()/Nor1); Alfa = V1.XY()/Nor1*V2.XY()/Nor1; T = gp_Vec2d( V1.XY() + (deport/Nor1)*(V2.XY()-Alfa*V3.XY())); } else { gp_VectorWithNullMagnitude::Raise(); } } else { Cu.D1(U,P,T); } } void GccGeo_ParGenCurve::D2(const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& T, gp_Vec2d& N) { gp_Pnt2d PP; gp_Vec2d V11,V22,V1t,V2t,V33; Standard_Real Nor1,Alfa,Dalfa; Standard_Integer Index,firstKnot,lastKnot; if (deport!=0.) { Cu.D3(U,PP,V11,V22,V33); Nor1= V1.Magnitude(); V1t.SetCoord(V11.Y(),-V11.X()); V2t.SetCoord(V22.Y(),-V22.X()); V33.SetCoord(V33.Y(),-V33.X()); if (Nor1 >= gp::Resolution()) { P = gp_Pnt2d(PP.XY()+deport*V1t.XY()/Nor1); Alfa = V1t.XY()/Nor1*V2t.XY()/Nor1; Dalfa= (V2t.XY()/Nor1*V2t.XY()/Nor1)+ (V1t.XY()/Nor1*V33.XY()/Nor1)- 2.*Alfa*Alfa; T = gp_Vec2d( V11.XY() + (deport/Nor1)*(V2t.XY()-Alfa*V1t.XY())); N = gp_Vec2d( V22.XY() + (deport/Nor1)*(V33.XY()-2.*Alfa*V2t.XY()- (Dalfa-Alfa*Alfa)*V1t.XY())); } else { gp_VectorWithNullMagnitude::Raise(); } } else { Cu.D2(U,P,T,N); } }