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.
15 //#include <GccGeo_ParGenCurve_Gen.hxx>
19 #include <Standard_NotImplemented.hxx>
22 GccGeo_ParGenCurve () {
27 GccGeo_ParGenCurve (const TheCurve& C ,
28 const Standard_Real D ) {
34 Standard_Real GccGeo_ParGenCurve::GetResolution() {
35 return Cu.GetResolution();
38 Standard_Integer GccGeo_ParGenCurve::GetIntervals() {
39 return Cu.GetIntervals();
43 GccGeo_ParGenCurve::Value (const Standard_Real U) {
50 NorTan= V.Magnitude();
51 V.SetCoord(V.Y(),-V.X());
52 if (NorTan >= gp::Resolution()) {
53 return gp_Pnt2d(P.XY()+deport*V.XY()/NorTan);
56 gp_VectorWithNullMagnitude::Raise();
64 void GccGeo_ParGenCurve::D1(const Standard_Real U,
69 Standard_Real Nor1,Alfa;
70 Standard_Integer Index,firstKnot,lastKnot;
74 V3.SetCoord(V1.Y(),-V1.X());
75 V2.SetCoord(V2.Y(),-V2.X());
76 if (Nor1 >= gp::Resolution()) {
77 P = gp_Pnt2d(PP.XY()+deport*V3.XY()/Nor1);
78 Alfa = V1.XY()/Nor1*V2.XY()/Nor1;
79 T = gp_Vec2d( V1.XY() + (deport/Nor1)*(V2.XY()-Alfa*V3.XY()));
82 gp_VectorWithNullMagnitude::Raise();
90 void GccGeo_ParGenCurve::D2(const Standard_Real U,
95 gp_Vec2d V11,V22,V1t,V2t,V33;
96 Standard_Real Nor1,Alfa,Dalfa;
97 Standard_Integer Index,firstKnot,lastKnot;
99 Cu.D3(U,PP,V11,V22,V33);
100 Nor1= V1.Magnitude();
101 V1t.SetCoord(V11.Y(),-V11.X());
102 V2t.SetCoord(V22.Y(),-V22.X());
103 V33.SetCoord(V33.Y(),-V33.X());
104 if (Nor1 >= gp::Resolution()) {
105 P = gp_Pnt2d(PP.XY()+deport*V1t.XY()/Nor1);
106 Alfa = V1t.XY()/Nor1*V2t.XY()/Nor1;
107 Dalfa= (V2t.XY()/Nor1*V2t.XY()/Nor1)+
108 (V1t.XY()/Nor1*V33.XY()/Nor1)-
110 T = gp_Vec2d( V11.XY() + (deport/Nor1)*(V2t.XY()-Alfa*V1t.XY()));
111 N = gp_Vec2d( V22.XY() + (deport/Nor1)*(V33.XY()-2.*Alfa*V2t.XY()-
112 (Dalfa-Alfa*Alfa)*V1t.XY()));
115 gp_VectorWithNullMagnitude::Raise();