1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0022792: Globally defined symbol PI conflicts with VTK definition (Intel compiler)

This commit is contained in:
DBV
2011-12-16 08:50:03 +00:00
committed by bugmaster
parent bc650d4170
commit c6541a0c86
438 changed files with 2142 additions and 2188 deletions

View File

@@ -122,9 +122,9 @@ static gp_Pnt2d Function_Value(const Standard_Real U,
if ( VCouture) {
if(SType == GeomAbs_Sphere) {
if ( Abs( S - U1 ) > PI ) {
T = PI - T;
S = PI + S;
if ( Abs( S - U1 ) > M_PI ) {
T = M_PI - T;
S = M_PI + S;
}
S = ElCLib::InPeriod(S, U1, U2);
}
@@ -236,7 +236,7 @@ static void Function_SetUVBounds(Standard_Real& myU1,
}
else {
UCouture = Standard_True;
myU2 = myU1 + 2*PI;
myU2 = myU1 + 2*M_PI;
}
}
@@ -257,17 +257,17 @@ static void Function_SetUVBounds(Standard_Real& myU1,
ElSLib::Parameters( Cone, P, U, V);
U += Delta;
d = U - U1;
if(d > PI) {
if( ( (IsEqual(U,(2*PI),1.e-10) && (U1 >= 0. && U1 <= PI)) &&
if(d > M_PI) {
if( ( (IsEqual(U,(2*M_PI),1.e-10) && (U1 >= 0. && U1 <= M_PI)) &&
(IsEqual(U,Ul,1.e-10) && !IsEqual(Uf,0.,1.e-10)) ) && isclandper ) U = 0.;
else Delta -= 2*PI;
else Delta -= 2*M_PI;
U += Delta;
d = U - U1;
}
else if(d < -PI) {
if( ( (IsEqual(U,0.,1.e-10) && (U1 >= PI && U1 <= (2*PI))) &&
(IsEqual(U,Ul,1.e-10) && !IsEqual(Uf,(2*PI),1.e-10)) ) && isclandper ) U = 2*PI;
else Delta += 2*PI;
else if(d < -M_PI) {
if( ( (IsEqual(U,0.,1.e-10) && (U1 >= M_PI && U1 <= (2*M_PI))) &&
(IsEqual(U,Ul,1.e-10) && !IsEqual(Uf,(2*M_PI),1.e-10)) ) && isclandper ) U = 2*M_PI;
else Delta += 2*M_PI;
U += Delta;
d = U - U1;
}
@@ -280,11 +280,11 @@ static void Function_SetUVBounds(Standard_Real& myU1,
if(!(Abs(pmin - W1) <= Precision::PConfusion() || Abs(pmin - W2) <= Precision::PConfusion()) ) myU1 -= dmax*.5;
if(!(Abs(pmax - W1) <= Precision::PConfusion() || Abs(pmax - W2) <= Precision::PConfusion()) ) myU2 += dmax*.5;
if((myU1 >=0. && myU1 <= 2*PI) && (myU2 >=0. && myU2 <= 2*PI) ) UCouture = Standard_False;
if((myU1 >=0. && myU1 <= 2*M_PI) && (myU2 >=0. && myU2 <= 2*M_PI) ) UCouture = Standard_False;
else{
U = ( myU1 + myU2 ) /2.;
myU1 = U - PI;
myU2 = U + PI;
myU1 = U - M_PI;
myU2 = U + M_PI;
UCouture = Standard_True;
}
}
@@ -309,18 +309,18 @@ static void Function_SetUVBounds(Standard_Real& myU1,
if ( !myCurve->IsClosed()) {
if ( myU1 < U && U < myU2) {
U = ( myU1 + myU2 ) /2.;
myU1 = U - PI;
myU2 = U + PI;
myU1 = U - M_PI;
myU2 = U + M_PI;
}
else {
U = ( myU1 + myU2 ) /2.;
if ( myU1 < U) {
myU1 = U - 2*PI;
myU1 = U - 2*M_PI;
myU2 = U;
}
else {
myU1 = U;
myU2 = U + 2*PI;
myU2 = U + 2*M_PI;
}
}
UCouture = Standard_True;
@@ -335,11 +335,11 @@ static void Function_SetUVBounds(Standard_Real& myU1,
UCouture = Standard_True;
if ( dU > 0.) {
myU2 = myU1 + 2*PI;
myU2 = myU1 + 2*M_PI;
}
else {
myU2 = myU1;
myU1 -= 2*PI;
myU1 -= 2*M_PI;
}
}
}
@@ -347,7 +347,7 @@ static void Function_SetUVBounds(Standard_Real& myU1,
Standard_Real U1, V1, U , V;
ElSLib::Parameters( Cylinder, P1, U1, V1);
Standard_Real Step = .1, Delta = 0.;
Standard_Real eps = PI, dmax = 0., d = 0.;
Standard_Real eps = M_PI, dmax = 0., d = 0.;
Standard_Integer nbp = (Standard_Integer)((W2 - W1) / Step + 1);
nbp = Max(nbp, 3);
Step = (W2 - W1) / (nbp - 1);
@@ -360,13 +360,13 @@ static void Function_SetUVBounds(Standard_Real& myU1,
d = U - U1;
if(d > eps) {
U -= Delta;
Delta -= 2*PI;
Delta -= 2*M_PI;
U += Delta;
d = U - U1;
}
else if(d < -eps) {
U -= Delta;
Delta += 2*PI;
Delta += 2*M_PI;
U += Delta;
d = U - U1;
}
@@ -381,14 +381,14 @@ static void Function_SetUVBounds(Standard_Real& myU1,
if(!(Abs(pmax - W1) <= Precision::PConfusion() ||
Abs(pmax - W2) <= Precision::PConfusion()) ) myU2 += dmax*.5;
if((myU1 >=0. && myU1 <= 2*PI) &&
(myU2 >=0. && myU2 <= 2*PI) ) {
if((myU1 >=0. && myU1 <= 2*M_PI) &&
(myU2 >=0. && myU2 <= 2*M_PI) ) {
UCouture = Standard_False;
}
else {
U = ( myU1 + myU2 ) /2.;
myU1 = U - PI;
myU2 = U + PI;
myU1 = U - M_PI;
myU2 = U + M_PI;
UCouture = Standard_True;
}
}
@@ -465,7 +465,7 @@ static void Function_SetUVBounds(Standard_Real& myU1,
ElSLib::Parameters(SP, P, UU, V1);
Standard_Real UUmi = Min(Min(U1,UU),Min(UU,U2));
Standard_Real UUma = Max(Max(U1,UU),Max(UU,U2));
Standard_Boolean reCalc = ((UUmi >= 0. && UUmi <= PI) && (UUma >= 0. && UUma <= PI));
Standard_Boolean reCalc = ((UUmi >= 0. && UUmi <= M_PI) && (UUma >= 0. && UUma <= M_PI));
// box+sphere <<
ElSLib::Parameters(SP, P1, U1, V1);//*
@@ -473,28 +473,28 @@ static void Function_SetUVBounds(Standard_Real& myU1,
Parameters(myCurve, mySurface, P1, 1, aTPC, U1, V1);
//
//
P2 = myCurve->Value(W1+PI/8);
P2 = myCurve->Value(W1+M_PI/8);
ElSLib::Parameters(SP,P2,U2,V2);
//
if ( NbSolutions == 1) {
if ( Abs(U1-U2) > PI) { // on traverse la couture
if ( U1 > PI) {
if ( Abs(U1-U2) > M_PI) { // on traverse la couture
if ( U1 > M_PI) {
myU1 = U1;
myU2 = U1+2*PI;
myU2 = U1+2*M_PI;
}
else {
myU2 = U1;
myU1 = U1-2*PI;
myU1 = U1-2*M_PI;
}
}
else { // on ne traverse pas la couture
if ( U1 > U2) {
myU2 = U1;
myU1 = U1-2*PI;
myU1 = U1-2*M_PI;
}
else {
myU1 = U1;
myU2 = U1+2*PI;
myU2 = U1+2*M_PI;
}
}
}
@@ -502,8 +502,8 @@ static void Function_SetUVBounds(Standard_Real& myU1,
gp_Pnt Center = Circle.Location();
Standard_Real U,V;
ElSLib::SphereParameters(gp_Ax3(gp::XOY()),1,Center, U, V);
myU1 = U-PI;
myU2 = U+PI;
myU1 = U-M_PI;
myU2 = U+M_PI;
}
//
// eval the VCouture.
@@ -515,12 +515,12 @@ static void Function_SetUVBounds(Standard_Real& myU1,
UCouture = Standard_True;
if ( D/C < 0.) {
myV1 = - PI / 2.;
myV2 = 3 * PI / 2.;
myV1 = - M_PI / 2.;
myV2 = 3 * M_PI / 2.;
}
else {
myV1 = -3 * PI / 2.;
myV2 = PI / 2.;
myV1 = -3 * M_PI / 2.;
myV2 = M_PI / 2.;
}
// si P1.Z() vaut +/- R on est sur le sommet : pas significatif.
@@ -530,8 +530,8 @@ static void Function_SetUVBounds(Standard_Real& myU1,
gp_Pnt Center = Circle.Location();
Standard_Real U,V;
ElSLib::SphereParameters(gp_Ax3(gp::XOY()),1,Center, U, V);
myU1 = U-PI;
myU2 = U+PI;
myU1 = U-M_PI;
myU2 = U+M_PI;
VCouture = Standard_False;
}
else {
@@ -539,27 +539,27 @@ static void Function_SetUVBounds(Standard_Real& myU1,
//
Parameters(myCurve, mySurface, P1, 1, aTPC, U1, V1);
//
P2 = myCurve->Value(W1+PI/8);
P2 = myCurve->Value(W1+M_PI/8);
ElSLib::Parameters(SP,P2,U2,V2);
if ( Abs(U1-U2) > PI) { // on traverse la couture
if ( U1 > PI) {
if ( Abs(U1-U2) > M_PI) { // on traverse la couture
if ( U1 > M_PI) {
myU1 = U1;
myU2 = U1+2*PI;
myU2 = U1+2*M_PI;
}
else {
myU2 = U1;
myU1 = U1-2*PI;
myU1 = U1-2*M_PI;
}
}
else { // on ne traverse pas la couture
if ( U1 > U2) {
myU2 = U1;
myU1 = U1-2*PI;
myU1 = U1-2*M_PI;
}
else {
myU1 = U1;
myU2 = U1+2*PI;
myU2 = U1+2*M_PI;
}
}
}
@@ -568,12 +568,12 @@ static void Function_SetUVBounds(Standard_Real& myU1,
// box+sphere >>
myV1 = -1.e+100; myV2 = 1.e+100;
Standard_Real UU1 = myU1, UU2 = myU2;
if((Abs(UU1) <= (2.*PI) && Abs(UU2) <= (2.*PI)) && NbSolutions == 1 && reCalc) {
if((Abs(UU1) <= (2.*M_PI) && Abs(UU2) <= (2.*M_PI)) && NbSolutions == 1 && reCalc) {
gp_Pnt Center = Circle.Location();
Standard_Real U,V;
ElSLib::SphereParameters(gp_Ax3(gp::XOY()),1,Center, U, V);
myU1 = U-PI;
myU2 = U+PI;
myU1 = U-M_PI;
myU2 = U+M_PI;
myU1 = Min(UU1,myU1);
myU2 = Max(UU2,myU2);
}
@@ -585,7 +585,7 @@ static void Function_SetUVBounds(Standard_Real& myU1,
Standard_Real U1, V1, U , V;
ElSLib::Parameters( SP, P1, U1, V1);
Standard_Real Step = .1, Delta = 0.;
Standard_Real eps = PI, dmax = 0., d = 0.;
Standard_Real eps = M_PI, dmax = 0., d = 0.;
Standard_Integer nbp = (Standard_Integer)((W2 - W1) / Step + 1);
nbp = Max(nbp, 3);
Step = (W2 - W1) / (nbp - 1);
@@ -598,13 +598,13 @@ static void Function_SetUVBounds(Standard_Real& myU1,
d = U - U1;
if(d > eps) {
U -= Delta;
Delta -= 2*PI;
Delta -= 2*M_PI;
U += Delta;
d = U - U1;
}
else if(d < -eps) {
U -= Delta;
Delta += 2*PI;
Delta += 2*M_PI;
U += Delta;
d = U - U1;
}
@@ -619,16 +619,16 @@ static void Function_SetUVBounds(Standard_Real& myU1,
if(!(Abs(pmax - W1) <= Precision::PConfusion() ||
Abs(pmax - W2) <= Precision::PConfusion()) ) myU2 += dmax*.5;
if((myU1 >=0. && myU1 <= 2*PI) &&
(myU2 >=0. && myU2 <= 2*PI) ) {
if((myU1 >=0. && myU1 <= 2*M_PI) &&
(myU2 >=0. && myU2 <= 2*M_PI) ) {
myU1 = 0.;
myU2 = 2.*PI;
myU2 = 2.*M_PI;
UCouture = Standard_False;
}
else {
U = ( myU1 + myU2 ) /2.;
myU1 = U - PI;
myU2 = U + PI;
myU1 = U - M_PI;
myU2 = U + M_PI;
UCouture = Standard_True;
}
@@ -642,7 +642,7 @@ static void Function_SetUVBounds(Standard_Real& myU1,
Standard_Real U1, V1, U , V;
ElSLib::Parameters( TR, P1, U1, V1);
Standard_Real Step = .1, DeltaU = 0., DeltaV = 0.;
Standard_Real eps = PI, dmaxU = 0., dU = 0., dmaxV = 0., dV = 0.;
Standard_Real eps = M_PI, dmaxU = 0., dU = 0., dmaxV = 0., dV = 0.;
Standard_Integer nbp = (Standard_Integer)((W2 - W1) / Step + 1);
nbp = Max(nbp, 3);
Step = (W2 - W1) / (nbp - 1);
@@ -659,25 +659,25 @@ static void Function_SetUVBounds(Standard_Real& myU1,
dV = V - V1;
if(dU > eps) {
U -= DeltaU;
DeltaU -= 2*PI;
DeltaU -= 2*M_PI;
U += DeltaU;
dU = U - U1;
}
else if(dU < -eps) {
U -= DeltaU;
DeltaU += 2*PI;
DeltaU += 2*M_PI;
U += DeltaU;
dU = U - U1;
}
if(dV > eps) {
V -= DeltaV;
DeltaV -= 2*PI;
DeltaV -= 2*M_PI;
V += DeltaV;
dV = V - V1;
}
else if(dV < -eps) {
V -= DeltaV;
DeltaV += 2*PI;
DeltaV += 2*M_PI;
V += DeltaV;
dV = V - V1;
}
@@ -700,26 +700,26 @@ static void Function_SetUVBounds(Standard_Real& myU1,
if(!(Abs(pmaxV - W1) <= Precision::PConfusion() ||
Abs(pmaxV - W2) <= Precision::PConfusion()) ) myV2 += dmaxV*.5;
if((myU1 >=0. && myU1 <= 2*PI) &&
(myU2 >=0. && myU2 <= 2*PI) ) {
if((myU1 >=0. && myU1 <= 2*M_PI) &&
(myU2 >=0. && myU2 <= 2*M_PI) ) {
myU1 = 0.;
myU2 = 2.*PI;
myU2 = 2.*M_PI;
UCouture = Standard_False;
}
else {
U = ( myU1 + myU2 ) /2.;
myU1 = U - PI;
myU2 = U + PI;
myU1 = U - M_PI;
myU2 = U + M_PI;
UCouture = Standard_True;
}
if((myV1 >=0. && myV1 <= 2*PI) &&
(myV2 >=0. && myV2 <= 2*PI) ) {
if((myV1 >=0. && myV1 <= 2*M_PI) &&
(myV2 >=0. && myV2 <= 2*M_PI) ) {
VCouture = Standard_False;
}
else {
V = ( myV1 + myV2 ) /2.;
myV1 = V - PI;
myV2 = V + PI;
myV1 = V - M_PI;
myV2 = V + M_PI;
VCouture = Standard_True;
}
@@ -753,7 +753,7 @@ void Parameters(const Handle(Adaptor3d_HCurve)& myCurve,
GeomAbs_CurveType aCType;
gp_Pnt aP2;
//
aTwoPI=2.*PI;
aTwoPI=2.*M_PI;
//
aSType=mySurface->GetType();
aCType=myCurve->GetType();
@@ -779,7 +779,7 @@ void Parameters(const Handle(Adaptor3d_HCurve)& myCurve,
ElSLib::Parameters(aSp, aP2, aU2, aV2);
//
aU1=0.;
if (aU2>PI) {
if (aU2>M_PI) {
aU1=aTwoPI;
}
}
@@ -1097,11 +1097,11 @@ ProjLib_ComputeApprox::ProjLib_ComputeApprox
Standard_Integer number;
if (F.VCouture)
{
if (SType == GeomAbs_Sphere && Abs(u-F.myU1) > PI)
if (SType == GeomAbs_Sphere && Abs(u-F.myU1) > M_PI)
{
ToMirror = Standard_True;
dv = -PI;
v = PI - v;
dv = -M_PI;
v = M_PI - v;
}
Standard_Real newV = ElCLib::InPeriod( v, F.myV1, F.myV2 );
number = (Standard_Integer) (Floor((newV-v)/(F.myV2-F.myV1)));
@@ -1110,8 +1110,8 @@ ProjLib_ComputeApprox::ProjLib_ComputeApprox
if (F.UCouture || F.VCouture && SType == GeomAbs_Sphere)
{
gp_Pnt2d P2d = F.Value( UFirst );
number = (Standard_Integer) (Floor((P2d.X()-u)/PI + Epsilon(PI)));
du = -number*PI;
number = (Standard_Integer) (Floor((P2d.X()-u)/M_PI + Epsilon(M_PI)));
du = -number*M_PI;
}
if (!myBSpline.IsNull())

View File

@@ -114,36 +114,36 @@ static gp_Pnt2d Function_Value(const Standard_Real U,
{
gp_Cylinder Cylinder = Surf->Cylinder();
ElSLib::Parameters( Cylinder, p, S, T);
if(U0 < Uinf) decalU = -int((Uinf - U0)/(2*PI))-1;
if(U0 > Usup) decalU = int((U0 - Usup)/(2*PI))+1;
S += decalU*2*PI;
if(U0 < Uinf) decalU = -int((Uinf - U0)/(2*M_PI))-1;
if(U0 > Usup) decalU = int((U0 - Usup)/(2*M_PI))+1;
S += decalU*2*M_PI;
break;
}
case GeomAbs_Cone:
{
gp_Cone Cone = Surf->Cone();
ElSLib::Parameters( Cone, p, S, T);
if(U0 < Uinf) decalU = -int((Uinf - U0)/(2*PI))-1;
if(U0 > Usup) decalU = int((U0 - Usup)/(2*PI))+1;
S += decalU*2*PI;
if(U0 < Uinf) decalU = -int((Uinf - U0)/(2*M_PI))-1;
if(U0 > Usup) decalU = int((U0 - Usup)/(2*M_PI))+1;
S += decalU*2*M_PI;
break;
}
case GeomAbs_Sphere:
{
gp_Sphere Sphere = Surf->Sphere();
ElSLib::Parameters( Sphere, p, S, T);
if(U0 < Uinf) decalU = -int((Uinf - U0)/(2*PI))-1;
if(U0 > Usup) decalU = int((U0 - Usup)/(2*PI))+1;
S += decalU*2*PI;
if(V0 < Vinf) decalV = -int((Vinf - V0)/(2*PI))-1;
if(V0 > (Vsup+(Vsup-Vinf))) decalV = int((V0 - Vsup+(Vsup-Vinf))/(2*PI))+1;
T += decalV*2*PI;
if(0.4*PI < Abs(U0 - S) && Abs(U0 - S) < 1.6*PI) {
T = PI - T;
if(U0 < Uinf) decalU = -int((Uinf - U0)/(2*M_PI))-1;
if(U0 > Usup) decalU = int((U0 - Usup)/(2*M_PI))+1;
S += decalU*2*M_PI;
if(V0 < Vinf) decalV = -int((Vinf - V0)/(2*M_PI))-1;
if(V0 > (Vsup+(Vsup-Vinf))) decalV = int((V0 - Vsup+(Vsup-Vinf))/(2*M_PI))+1;
T += decalV*2*M_PI;
if(0.4*M_PI < Abs(U0 - S) && Abs(U0 - S) < 1.6*M_PI) {
T = M_PI - T;
if(U0 < S)
S -= PI;
S -= M_PI;
else
S += PI;
S += M_PI;
}
break;
}
@@ -151,11 +151,11 @@ static gp_Pnt2d Function_Value(const Standard_Real U,
{
gp_Torus Torus = Surf->Torus();
ElSLib::Parameters( Torus, p, S, T);
if(U0 < Uinf) decalU = -int((Uinf - U0)/(2*PI))-1;
if(U0 > Usup) decalU = int((U0 - Usup)/(2*PI))+1;
if(V0 < Vinf) decalV = -int((Vinf - V0)/(2*PI))-1;
if(V0 > Vsup) decalV = int((V0 - Vsup)/(2*PI))+1;
S += decalU*2*PI; T += decalV*2*PI;
if(U0 < Uinf) decalU = -int((Uinf - U0)/(2*M_PI))-1;
if(U0 > Usup) decalU = int((U0 - Usup)/(2*M_PI))+1;
if(V0 < Vinf) decalV = -int((Vinf - V0)/(2*M_PI))-1;
if(V0 > Vsup) decalV = int((V0 - Vsup)/(2*M_PI))+1;
S += decalU*2*M_PI; T += decalV*2*M_PI;
break;
}
default:
@@ -740,12 +740,12 @@ Handle(Adaptor2d_HCurve2d)
for ( i = 2 ; i <= NbOfPnts ; i++) {
Sloc = S;
ElSLib::Parameters( Cylinder, Pts(i), S, T);
if(Abs(Sloc - S) > PI)
if(Abs(Sloc - S) > M_PI)
if(Sloc > S)
usens++;
else
usens--;
Pts2d(i).SetCoord(S+usens*2*PI,T);
Pts2d(i).SetCoord(S+usens*2*M_PI,T);
}
myProjIsDone = Standard_True;
break;
@@ -761,12 +761,12 @@ Handle(Adaptor2d_HCurve2d)
for ( i = 2 ; i <= NbOfPnts ; i++) {
Sloc = S;
ElSLib::Parameters( Cone, Pts(i), S, T);
if(Abs(Sloc - S) > PI)
if(Abs(Sloc - S) > M_PI)
if(Sloc > S)
usens++;
else
usens--;
Pts2d(i).SetCoord(S+usens*2*PI,T);
Pts2d(i).SetCoord(S+usens*2*M_PI,T);
}
myProjIsDone = Standard_True;
break;
@@ -782,12 +782,12 @@ Handle(Adaptor2d_HCurve2d)
for ( i = 2 ; i <= NbOfPnts ; i++) {
Sloc = S;Tloc = T;
ElSLib::Parameters( Sphere, Pts(i), S, T);
if(1.6*PI < Abs(Sloc - S))
if(1.6*M_PI < Abs(Sloc - S))
if(Sloc > S)
usens += 2;
else
usens -= 2;
if(1.6*PI > Abs(Sloc - S) && Abs(Sloc - S) > 0.4*PI) {
if(1.6*M_PI > Abs(Sloc - S) && Abs(Sloc - S) > 0.4*M_PI) {
vparit = !vparit;
if(Sloc > S)
usens++;
@@ -799,10 +799,10 @@ Handle(Adaptor2d_HCurve2d)
vsens--;
}
if(vparit) {
Pts2d(i).SetCoord(S+usens*PI,(PI - T)*(vsens-1));
Pts2d(i).SetCoord(S+usens*M_PI,(M_PI - T)*(vsens-1));
}
else {
Pts2d(i).SetCoord(S+usens*PI,T+vsens*PI);
Pts2d(i).SetCoord(S+usens*M_PI,T+vsens*M_PI);
}
}
@@ -819,17 +819,17 @@ Handle(Adaptor2d_HCurve2d)
for ( i = 2 ; i <= NbOfPnts ; i++) {
Sloc = S; Tloc = T;
ElSLib::Parameters( Torus, Pts(i), S, T);
if(Abs(Sloc - S) > PI)
if(Abs(Sloc - S) > M_PI)
if(Sloc > S)
usens++;
else
usens--;
if(Abs(Tloc - T) > PI)
if(Abs(Tloc - T) > M_PI)
if(Tloc > T)
vsens++;
else
vsens--;
Pts2d(i).SetCoord(S+usens*2*PI,T+vsens*2*PI);
Pts2d(i).SetCoord(S+usens*2*M_PI,T+vsens*2*M_PI);
}
myProjIsDone = Standard_True;
break;
@@ -1259,8 +1259,8 @@ Handle(Geom2d_BSplineCurve)
gp_Pnt p22 = BSS->Pole(2,2);
gp_Vec V1(p11,p12);
gp_Vec V2(p21,p22);
if(V1.IsEqual(V2,Tol3d,Tol3d/(p11.Distance(p12)*180/PI))){ //OCC217
//if(V1.IsEqual(V2,myTolerance,myTolerance/(p11.Distance(p12)*180/PI))){
if(V1.IsEqual(V2,Tol3d,Tol3d/(p11.Distance(p12)*180/M_PI))){ //OCC217
//if(V1.IsEqual(V2,myTolerance,myTolerance/(p11.Distance(p12)*180/M_PI))){
// so the polar surface is plane
// and if it is enough to projet the poles of Curve
Standard_Integer Dist2Min = IntegerLast();
@@ -1360,8 +1360,8 @@ Handle(Geom2d_BSplineCurve)
gp_Pnt p22 = BS->Pole(2,2);
gp_Vec V1(p11,p12);
gp_Vec V2(p21,p22);
if(V1.IsEqual(V2,Tol3d,Tol3d/(p11.Distance(p12)*180/PI))){ //OCC217
//if (V1.IsEqual(V2,myTolerance,myTolerance/(p11.Distance(p12)*180/PI))){
if(V1.IsEqual(V2,Tol3d,Tol3d/(p11.Distance(p12)*180/M_PI))){ //OCC217
//if (V1.IsEqual(V2,myTolerance,myTolerance/(p11.Distance(p12)*180/M_PI))){
// and if it is enough to project the poles of Curve
Standard_Integer Dist2Min = IntegerLast();
Standard_Real u,v;

View File

@@ -136,9 +136,9 @@ void ProjLib_Cone::Project(const gp_Lin& L)
(ZCone.IsEqual(CPos.Direction(), Precision::Angular())) ? 1 : -1;
Standard_Integer a2 =
(myCone.SemiAngle() > 0) ? 1 : -1;
if ( ( a1 * a2) == -1) U -= PI;
if ( ( a1 * a2) == -1) U -= M_PI;
if ( U < 0.) U += 2.*PI;
if ( U < 0.) U += 2.*M_PI;
gp_Pnt P;
gp_Vec Vu, Vv;
@@ -196,7 +196,7 @@ void ProjLib_Cone::Project(const gp_Circ& C)
else {
U = ATan2( y, x);
}
if ( U < 0.) U += 2*PI;
if ( U < 0.) U += 2*M_PI;
V = z / Cos(myCone.SemiAngle());

View File

@@ -122,7 +122,7 @@ void ProjLib_Cylinder::Project(const gp_Lin& L)
gp_Pnt2d P2d = EvalPnt2d(L.Location(),myCylinder);
if ( P2d.X() < 0.) {
P2d.SetX(P2d.X()+2*PI);
P2d.SetX(P2d.X()+2*M_PI);
}
Standard_Real Signe
= L.Direction().Dot(myCylinder.Position().Direction());

View File

@@ -88,7 +88,7 @@ static gp_Pnt2d EvalPnt2d( const gp_Vec P, const gp_Sphere& Sp)
if ( Abs(X) > Precision::PConfusion() ||
Abs(Y) > Precision::PConfusion() ) {
Standard_Real UU = ATan2(Y,X);
U = ElCLib::InPeriod(UU, 0., 2*PI);
U = ElCLib::InPeriod(UU, 0., 2*M_PI);
}
else {
U = 0.;
@@ -142,21 +142,21 @@ void ProjLib_Sphere::Project(const gp_Circ& C)
P2d1 = EvalPnt2d(gp_Vec(Xc),mySphere);
P2d2 = EvalPnt2d(gp_Vec(Yc),mySphere);
if (isIsoU && (Abs(P2d1.Y()-PI/2.) < Precision::PConfusion() ||
Abs(P2d1.Y()+PI/2.) < Precision::PConfusion() )) {
if (isIsoU && (Abs(P2d1.Y()-M_PI/2.) < Precision::PConfusion() ||
Abs(P2d1.Y()+M_PI/2.) < Precision::PConfusion() )) {
// then P1 is on the apex of the sphere and U is undefined
// The value of U is given by P2d2.Y() .
P2d1.SetX(P2d2.X());
}
else if ( Abs( Abs(P2d1.X()-P2d2.X()) - PI) < Precision::PConfusion()) {
else if ( Abs( Abs(P2d1.X()-P2d2.X()) - M_PI) < Precision::PConfusion()) {
// then we have U2 = U1 + PI; V2;
// we have to assume that U1 = U2
// so V2 = PI - V2;
P2d2.SetX( P2d1.X());
if (P2d2.Y() < 0.)
P2d2.SetY( -PI - P2d2.Y());
P2d2.SetY( -M_PI - P2d2.Y());
else
P2d2.SetY( PI - P2d2.Y());
P2d2.SetY( M_PI - P2d2.Y());
}
else {
P2d2.SetX( P2d1.X());
@@ -171,7 +171,7 @@ void ProjLib_Sphere::Project(const gp_Circ& C)
//P2d(U,V) :first point of the PCurve.
Standard_Real U = Xs.AngleWithRef(Xc, Xs^Ys);
if (U<0)
U += 2*PI;
U += 2*M_PI;
Standard_Real Z = gp_Vec(O,C.Location()).Dot(Zs);
Standard_Real V = ASin(Z/mySphere.Radius());
P2d1 = gp_Pnt2d(U,V);
@@ -214,7 +214,7 @@ void ProjLib_Sphere::SetInBounds(const Standard_Real U)
// first set the y of the first point in -pi/2 pi/2
Standard_Real newY, Y = ElCLib::Value(U,myLin).Y();
newY = ElCLib::InPeriod( Y, -PI, PI);
newY = ElCLib::InPeriod( Y, -M_PI, M_PI);
myLin.Translate(gp_Vec2d(0.,newY-Y));
@@ -224,18 +224,18 @@ void ProjLib_Sphere::SetInBounds(const Standard_Real U)
Standard_Real Tol = 1.e-7;
gp_Dir2d D2d = myLin.Direction();
// Modified by skv - Tue Aug 1 16:29:59 2006 OCC13116 Begin
// if ((P.Y() > PI/2) ||
if ((P.Y() - PI/2 > Tol) ||
// if ((P.Y() > M_PI/2) ||
if ((P.Y() - M_PI/2 > Tol) ||
// Modified by skv - Tue Aug 1 16:29:59 2006 OCC13116 End
(Abs(P.Y()-PI/2)<Tol && D2d.IsEqual(gp::DY2d(),Tol))) {
Axis = gp_Ax2d( gp_Pnt2d( 0., PI/2.), gp::DX2d());
(Abs(P.Y()-M_PI/2)<Tol && D2d.IsEqual(gp::DY2d(),Tol))) {
Axis = gp_Ax2d( gp_Pnt2d( 0., M_PI/2.), gp::DX2d());
}
// Modified by skv - Tue Aug 1 16:29:59 2006 OCC13116 Begin
// else if ((P.Y() < -PI/2) ||
else if ((P.Y() + PI/2 < -Tol) ||
// else if ((P.Y() < -M_PI/2) ||
else if ((P.Y() + M_PI/2 < -Tol) ||
// Modified by skv - Tue Aug 1 16:29:59 2006 OCC13116 End
(Abs(P.Y()+PI/2)<Tol && D2d.IsOpposite(gp::DY2d(),Tol))) {
Axis = gp_Ax2d( gp_Pnt2d( 0., -PI/2.), gp::DX2d());
(Abs(P.Y()+M_PI/2)<Tol && D2d.IsOpposite(gp::DY2d(),Tol))) {
Axis = gp_Ax2d( gp_Pnt2d( 0., -M_PI/2.), gp::DX2d());
}
else
return;
@@ -243,10 +243,10 @@ void ProjLib_Sphere::SetInBounds(const Standard_Real U)
Trsf.SetMirror(Axis);
myLin.Transform(Trsf);
myLin.Translate(gp_Vec2d(PI,0.));
myLin.Translate(gp_Vec2d(M_PI,0.));
// il faut maintenant recadrer en U
Standard_Real newX, X = ElCLib::Value(U,myLin).X();
newX = ElCLib::InPeriod( X, 0., 2.*PI);
newX = ElCLib::InPeriod( X, 0., 2.*M_PI);
myLin.Translate(gp_Vec2d(newX-X,0.));
}

View File

@@ -125,43 +125,43 @@ void ProjLib_Torus::Project(const gp_Circ& C)
Standard_Real V;
if ( Z > 1.) {
V = PI/2.; // protection stupide
V = M_PI/2.; // protection stupide
} // contre les erreurs de calcul
else if ( Z < -1.) { // il arrive que Z soit legerement
V = -PI/2; // superieur a 1.
V = -M_PI/2; // superieur a 1.
}
else {
V = ASin(Z);
}
if (C.Radius() < myTorus.MajorRadius()) {
V = PI - V;
V = M_PI - V;
}
else if ( V < 0.) {
V += 2*PI;
V += 2*M_PI;
}
P1.SetY(V);
P2.SetY(V);
gp_Vec2d V2d ( P1, P2);
// Normalement Abs( P1.X() - P2.X()) = PI/2
// Si != PI/2, on a traverse la periode => On reverse la Direction
if ( Abs( P1.X() - P2.X()) > PI) V2d.Reverse();
if ( Abs( P1.X() - P2.X()) > M_PI) V2d.Reverse();
gp_Dir2d D2( V2d);
if ( P1.X() < 0)
P1.SetX( 2*PI + P1.X());
P1.SetX( 2*M_PI + P1.X());
myLin = gp_Lin2d( P1, D2);
}
else {
// Iso U -> U = angle( Xt, OC)
Standard_Real U = Xt.AngleWithRef( OC, Xt^Yt);
if ( U < 0.)
U += 2*PI;
U += 2*M_PI;
// Origine de la droite
Standard_Real V1 = OC.AngleWithRef(Xc, OC^Zt);
if ( V1 < 0.)
V1 += 2*PI;
V1 += 2*M_PI;
gp_Pnt2d P1( U, V1);