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

@@ -240,7 +240,7 @@ void IntPatch_ALine::ComputeVertexParameters(const Standard_Real Tol) {
for(i=1; i<=nbvtx; i++) {
IntPatch_Point& VTX = svtx.ChangeValue(i);
Standard_Real p=VTX.ParameterOnLine();
Standard_Real pmpimpi=p-PI-PI;
Standard_Real pmpimpi=p-M_PI-M_PI;
if(pmpimpi >= ParamMinOnLine) {
gp_Pnt P1 = Value(pmpimpi);
Standard_Real d1 = P1.Distance(VTX.Value());
@@ -250,7 +250,7 @@ void IntPatch_ALine::ComputeVertexParameters(const Standard_Real Tol) {
svtx.Append(OVTX);
}
}
pmpimpi=p+PI+PI;
pmpimpi=p+M_PI+M_PI;
if(pmpimpi <= ParamMaxOnLine) {
gp_Pnt P1 = Value(pmpimpi);
Standard_Real d1 = P1.Distance(VTX.Value());

View File

@@ -845,7 +845,7 @@ static
case GeomAbs_Cylinder:
case GeomAbs_Cone:
case GeomAbs_Sphere:
pu1=PI+PI;
pu1=M_PI+M_PI;
break;
default:
break;
@@ -854,7 +854,7 @@ static
case GeomAbs_Cylinder:
case GeomAbs_Cone:
case GeomAbs_Sphere:
pu2=PI+PI;
pu2=M_PI+M_PI;
break;
default:
break;
@@ -928,7 +928,7 @@ void RecadreMemePeriode(const IntSurf_Quadric aQuad1,
bBothCylinders=(aType1==GeomAbs_Cylinder && aType2==GeomAbs_Cylinder);
//
while(anu1-u1 > 5.0) {
u1+=PI+PI;
u1+=M_PI+M_PI;
}
while(u1-anu1 > 5.0) {
//
@@ -942,28 +942,28 @@ void RecadreMemePeriode(const IntSurf_Quadric aQuad1,
//
// In any case the pb does not deal with apex problem.
//
if (u1-PI-PI<0.) {
if (u1-M_PI-M_PI<0.) {
break;
}
}
*/
//
u1-=PI+PI;
u1-=M_PI+M_PI;
}
while(anu2-u2 > 5.0) {
u2+=PI+PI;
u2+=M_PI+M_PI;
}
while(u2-anu2 > 5.0) {
//
/*
if (!bBothCylinders) {//cfe900/H6
if (u2-PI-PI<0.) {
if (u2-M_PI-M_PI<0.) {
break;
}
}
*/
//
u2-=PI+PI;
u2-=M_PI+M_PI;
}
}
@@ -1028,7 +1028,7 @@ Standard_Boolean IsApex(const IntSurf_Quadric& aQuadric,
//
// apex on the Sphere
if(aType==GeomAbs_Sphere) {
aHalfPi=0.5*PI;
aHalfPi=0.5*M_PI;
if (fabs(aVx-aHalfPi)<aEpsilon) {
bFlag=!bFlag;
}
@@ -1112,7 +1112,7 @@ void RefineParameters(const Handle(IntPatch_ALine)& aALine,
//
// apex on the Sphere
if(aType==GeomAbs_Sphere) {
aHalfPi=0.5*PI;
aHalfPi=0.5*M_PI;
//
if (fabs(aVx-aHalfPi)<aEpsilon) {
aLimV=aHalfPi;
@@ -1122,7 +1122,7 @@ void RefineParameters(const Handle(IntPatch_ALine)& aALine,
}
else {
//Check: aUx must be 0 or 2*pi
if(fabs(aUx) < aEpsilon || fabs(aUx - 2.*PI) < aEpsilon) {
if(fabs(aUx) < aEpsilon || fabs(aUx - 2.*M_PI) < aEpsilon) {
//aUx = 0 or 2*pi, but may be it must be 2*pi or 0?
bFound=FindNearParameter(aALine, aTx, iDir, aTol3D, aT1);
if(!bFound) {
@@ -1136,8 +1136,8 @@ void RefineParameters(const Handle(IntPatch_ALine)& aALine,
aP1=aALine->Value(aT1);
aQuadric.Parameters(aP1, aU1, aV1);
if(fabs(aU1) > fabs(aU1 - 2.*PI)) {
aUx = 2.*PI;
if(fabs(aU1) > fabs(aU1 - 2.*M_PI)) {
aUx = 2.*M_PI;
}
else {
aUx = 0.;

View File

@@ -327,8 +327,8 @@ void IntPatch_GLine::AddVertex (const IntPatch_Point& Pnt)
if(ArcType()==IntPatch_Circle || ArcType()==IntPatch_Ellipse)
{
if(fipt && lapt) {
while(par<pf) par+=PI+PI;
while(par>pl) par-=PI+PI;
while(par<pf) par+=M_PI+M_PI;
while(par>pl) par-=M_PI+M_PI;
if(par<pf) {
const Standard_Real PrecisionPConfusion ( Precision::PConfusion()*1000.0 );
if((pf-par)>PrecisionPConfusion) {
@@ -640,7 +640,7 @@ void IntPatch_GLine::ComputeVertexParameters(const Standard_Real /*Tol*/)
Standard_Real ponline = VTX.ParameterOnLine();
// eap, =>>
Standard_Real newParam = ponline;
const Standard_Real PiPi = PI+PI;
const Standard_Real PiPi = M_PI+M_PI;
Standard_Boolean is2PI = ( Abs(ponline-PiPi) <= PrecisionPConfusion );
if (nbvtx > 2 && // do this check if seam edge only gives vertices
@@ -654,7 +654,7 @@ void IntPatch_GLine::ComputeVertexParameters(const Standard_Real /*Tol*/)
else
newParam -= PiPi;
// if( (Abs(ponline)<=PrecisionPConfusion)
// ||(Abs(ponline-PI-PI) <=PrecisionPConfusion))
// ||(Abs(ponline-M_PI-M_PI) <=PrecisionPConfusion))
// eap, <<=
Standard_Real u1a,v1a,u2a,v2a,u1b,v1b,u2b,v2b;
VTXM1.Parameters(u1a,v1a,u2a,v2a);
@@ -701,7 +701,7 @@ void IntPatch_GLine::ComputeVertexParameters(const Standard_Real /*Tol*/)
///////////////////////////////////////////////
// eap, =>>
// if (Abs(ponline) <= PrecisionPConfusion) {
// const Standard_Real PiPi = PI+PI;
// const Standard_Real PiPi = M_PI+M_PI;
if(newParam >= ParamMinOnLine && newParam <= ParamMaxOnLine
/*PiPi >= ParamMinOnLine && PiPi<=ParamMaxOnLine*/) {
SortAgain = Standard_True;
@@ -743,7 +743,7 @@ void IntPatch_GLine::ComputeVertexParameters(const Standard_Real /*Tol*/)
///////////////////////////////////////////////
// eap, =>>
// if (Abs(ponline) <= PrecisionPConfusion) {
// const Standard_Real PiPi = PI+PI;
// const Standard_Real PiPi = M_PI+M_PI;
if(newParam >= ParamMinOnLine && newParam <= ParamMaxOnLine
/*PiPi >= ParamMinOnLine && PiPi<=ParamMaxOnLine*/) {
SortAgain = Standard_True;

View File

@@ -300,7 +300,7 @@ static void Recadre(const Handle(Adaptor3d_HSurface)& myHS1,
}
}
if(myHS1IsUPeriodic) {
lmf = PI+PI; //-- myHS1->UPeriod();
lmf = M_PI+M_PI; //-- myHS1->UPeriod();
f = myHS1->FirstUParameter();
l = myHS1->LastUParameter();
fpls2=0.5*(f+l);
@@ -309,7 +309,7 @@ static void Recadre(const Handle(Adaptor3d_HSurface)& myHS1,
}
if(myHS1IsVPeriodic) {
lmf = PI+PI; //-- myHS1->VPeriod();
lmf = M_PI+M_PI; //-- myHS1->VPeriod();
f = myHS1->FirstVParameter();
l = myHS1->LastVParameter();
fpls2=0.5*(f+l);
@@ -319,7 +319,7 @@ static void Recadre(const Handle(Adaptor3d_HSurface)& myHS1,
//-- while(v1 > l) { v1-=lmf; }
}
if(myHS2IsUPeriodic) {
lmf = PI+PI; //-- myHS2->UPeriod();
lmf = M_PI+M_PI; //-- myHS2->UPeriod();
f = myHS2->FirstUParameter();
l = myHS2->LastUParameter();
fpls2=0.5*(f+l);
@@ -329,7 +329,7 @@ static void Recadre(const Handle(Adaptor3d_HSurface)& myHS1,
//-- while(u2 > l) { u2-=lmf; }
}
if(myHS2IsVPeriodic) {
lmf = PI+PI; //-- myHS2->VPeriod();
lmf = M_PI+M_PI; //-- myHS2->VPeriod();
f = myHS2->FirstVParameter();
l = myHS2->LastVParameter();
fpls2=0.5*(f+l);
@@ -957,8 +957,8 @@ Standard_Boolean FindLine (gp_Pnt& Psurf,
{
para = ElCLib::Parameter((*((Handle(IntPatch_GLine)*)&lin))->Circle(),Psurf);
if ((para <= upper && para >= lower) ||
(para + 2.*PI <=upper && para + 2.*PI >= lower) ||
(para - 2.*PI <=upper && para - 2.*PI >= lower)) {
(para + 2.*M_PI <=upper && para + 2.*M_PI >= lower) ||
(para - 2.*M_PI <=upper && para - 2.*M_PI >= lower)) {
pt = ElCLib::Value(para,(*((Handle(IntPatch_GLine)*)&lin))->Circle());
dist = Psurf.Distance(pt);
if (dist< distmin) {
@@ -973,8 +973,8 @@ Standard_Boolean FindLine (gp_Pnt& Psurf,
{
para = ElCLib::Parameter((*((Handle(IntPatch_GLine)*)&lin))->Ellipse(),Psurf);
if ((para <= upper && para >= lower) ||
(para + 2.*PI <=upper && para + 2.*PI >= lower) ||
(para - 2.*PI <=upper && para - 2.*PI >= lower)) {
(para + 2.*M_PI <=upper && para + 2.*M_PI >= lower) ||
(para - 2.*M_PI <=upper && para - 2.*M_PI >= lower)) {
pt = ElCLib::Value(para,(*((Handle(IntPatch_GLine)*)&lin))->Ellipse());
dist = Psurf.Distance(pt);
if (dist< distmin) {

View File

@@ -432,7 +432,7 @@ void IntPatch_ImpImpIntersection::Perform(const Handle(Adaptor3d_HSurface)& S1,
}
break;
case GeomAbs_Sphere: {
Ptreference = ElSLib::Value(PI/4.,PI/4.,S1->Sphere());
Ptreference = ElSLib::Value(M_PI/4.,M_PI/4.,S1->Sphere());
}
break;
case GeomAbs_Cone: {
@@ -558,7 +558,7 @@ void IntPatch_ImpImpIntersection::Perform(const Handle(Adaptor3d_HSurface)& S1,
quad2.Parameters(P,u2,v2);
point.SetValue(P,TolArc,Standard_False);
point.SetParameters(u1,v1,u2,v2);
point.SetParameter(PI+PI);
point.SetParameter(M_PI+M_PI);
glin->AddVertex(point);
}
}
@@ -581,7 +581,7 @@ void IntPatch_ImpImpIntersection::Perform(const Handle(Adaptor3d_HSurface)& S1,
quad2.Parameters(P,u2,v2);
point.SetValue(P,TolArc,Standard_False);
point.SetParameters(u1,v1,u2,v2);
point.SetParameter(PI+PI);
point.SetParameter(M_PI+M_PI);
glin->AddVertex(point);
}
}

View File

@@ -311,8 +311,8 @@ Standard_Boolean IntCyCy(const IntSurf_Quadric& Quad1,
IntPatch_Point pmult1;
IntPatch_Point pmult2;
elipsol = inter.Ellipse(1);
gp_Pnt pttang1(ElCLib::Value(PI*0.5,elipsol));
gp_Pnt pttang2(ElCLib::Value(1.5*PI,elipsol));
gp_Pnt pttang1(ElCLib::Value(M_PI*0.5,elipsol));
gp_Pnt pttang2(ElCLib::Value(1.5*M_PI,elipsol));
Multpoint = Standard_True;
pmult1.SetValue(pttang1,Tol,Standard_True);
@@ -349,17 +349,17 @@ Standard_Boolean IntCyCy(const IntSurf_Quadric& Quad1,
//-- Transition calculee au point 0 -> Trans2 , Trans1
//-- car ici, on devarit calculer en PI
Handle(IntPatch_GLine) glig = new IntPatch_GLine(elipsol,Standard_False,trans2,trans1);
pmult1.SetParameter(PI/2.);
pmult1.SetParameter(M_PI/2.);
glig->AddVertex(pmult1);
glig->SetFirstPoint(1);
pmult2.SetParameter(1.5*PI);
pmult2.SetParameter(1.5*M_PI);
glig->AddVertex(pmult2);
glig->SetLastPoint(2);
slin.Append(glig);
//-- Transitions calculee au point 0 OK
glig = new IntPatch_GLine(elipsol,Standard_False,trans1,trans2);
pmult2.SetParameter(-PI/2.);
pmult2.SetParameter(-M_PI/2.);
glig->AddVertex(pmult2);
glig->SetFirstPoint(1);
glig->AddVertex(pmult1);
@@ -375,13 +375,13 @@ Standard_Boolean IntCyCy(const IntSurf_Quadric& Quad1,
Standard_Real param2 = ElCLib::Parameter(elipsol,pttang2);
Standard_Real parampourtransition;
if (param1 < param2) {
pmult1.SetParameter(PI*0.5);
pmult2.SetParameter(1.5*PI);
parampourtransition = PI;
pmult1.SetParameter(M_PI*0.5);
pmult2.SetParameter(1.5*M_PI);
parampourtransition = M_PI;
}
else {
pmult1.SetParameter(-PI*0.5);
pmult2.SetParameter(PI*0.5);
pmult1.SetParameter(-M_PI*0.5);
pmult2.SetParameter(M_PI*0.5);
parampourtransition = 0.0;
}
@@ -408,10 +408,10 @@ Standard_Boolean IntCyCy(const IntSurf_Quadric& Quad1,
slin.Append(glig);
if (param1 < param2) {
pmult2.SetParameter(-PI*0.5);
pmult2.SetParameter(-M_PI*0.5);
}
else {
pmult1.SetParameter(1.5*PI);
pmult1.SetParameter(1.5*M_PI);
}
//-- Sur l'autre ligne, on invertse la transition

View File

@@ -352,24 +352,24 @@ void Recadre(const Standard_Boolean ,
switch(typeS1)
{
case GeomAbs_Torus:
while(V1<(V1p-1.5*PI)) V1+=PI+PI;
while(V1>(V1p+1.5*PI)) V1-=PI+PI;
while(V1<(V1p-1.5*M_PI)) V1+=M_PI+M_PI;
while(V1>(V1p+1.5*M_PI)) V1-=M_PI+M_PI;
case GeomAbs_Cylinder:
case GeomAbs_Cone:
case GeomAbs_Sphere:
while(U1<(U1p-1.5*PI)) U1+=PI+PI;
while(U1>(U1p+1.5*PI)) U1-=PI+PI;
while(U1<(U1p-1.5*M_PI)) U1+=M_PI+M_PI;
while(U1>(U1p+1.5*M_PI)) U1-=M_PI+M_PI;
}
switch(typeS2)
{
case GeomAbs_Torus:
while(V2<(V2p-1.5*PI)) V2+=PI+PI;
while(V2>(V2p+1.5*PI)) V2-=PI+PI;
while(V2<(V2p-1.5*M_PI)) V2+=M_PI+M_PI;
while(V2>(V2p+1.5*M_PI)) V2-=M_PI+M_PI;
case GeomAbs_Cylinder:
case GeomAbs_Cone:
case GeomAbs_Sphere:
while(U2<(U2p-1.5*PI)) U2+=PI+PI;
while(U2>(U2p+1.5*PI)) U2-=PI+PI;
while(U2<(U2p-1.5*M_PI)) U2+=M_PI+M_PI;
while(U2>(U2p+1.5*M_PI)) U2-=M_PI+M_PI;
}
pt.SetParameters(U1,V1,U2,V2);
}
@@ -629,26 +629,26 @@ void IntPatch_ImpPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
Standard_Real aCf, aTwoPI;
//
aCf=0.;
aTwoPI=PI+PI;
if ((U1-AnU1) > 1.5*PI) {
while ((U1-AnU1) > (1.5*PI+aCf*aTwoPI)) {
aTwoPI=M_PI+M_PI;
if ((U1-AnU1) > 1.5*M_PI) {
while ((U1-AnU1) > (1.5*M_PI+aCf*aTwoPI)) {
aCf=aCf+1.;
}
U1=U1-aCf*aTwoPI;
}
//
else {
while ((U1-AnU1) < (-1.5*PI-aCf*aTwoPI)) {
while ((U1-AnU1) < (-1.5*M_PI-aCf*aTwoPI)) {
aCf=aCf+1.;
}
U1=U1+aCf*aTwoPI;
}
// was:
//if ((U1-AnU1) > 1.5*PI) {
// U1-=PI+PI;
//if ((U1-AnU1) > 1.5*M_PI) {
// U1-=M_PI+M_PI;
//}
//else if ((U1-AnU1) < -1.5*PI) {
// U1+=PI+PI;
//else if ((U1-AnU1) < -1.5*M_PI) {
// U1+=M_PI+M_PI;
//}
//modified by NIZNHY-PKV Fri Mar 28 15:06:11 2008t
}
@@ -662,15 +662,15 @@ void IntPatch_ImpPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
case GeomAbs_Cone:
case GeomAbs_Sphere:
case GeomAbs_Torus:
while(U2<(AnU2-1.5*PI)) U2+=PI+PI;
while(U2>(AnU2+1.5*PI)) U2-=PI+PI;
while(U2<(AnU2-1.5*M_PI)) U2+=M_PI+M_PI;
while(U2>(AnU2+1.5*M_PI)) U2-=M_PI+M_PI;
break;
default:
break;
}
if(typeS2==GeomAbs_Torus) {
while(V2<(AnV2-1.5*PI)) V2+=PI+PI;
while(V2>(AnV2+1.5*PI)) V2-=PI+PI;
while(V2<(AnV2-1.5*M_PI)) V2+=M_PI+M_PI;
while(V2>(AnV2+1.5*M_PI)) V2-=M_PI+M_PI;
}
thelin->SetUV(k,Standard_True,U2,V2);
}
@@ -683,15 +683,15 @@ void IntPatch_ImpPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
case GeomAbs_Cone:
case GeomAbs_Sphere:
case GeomAbs_Torus:
while(U2<(AnU2-1.5*PI)) U2+=PI+PI;
while(U2>(AnU2+1.5*PI)) U2-=PI+PI;
while(U2<(AnU2-1.5*M_PI)) U2+=M_PI+M_PI;
while(U2>(AnU2+1.5*M_PI)) U2-=M_PI+M_PI;
break;
default:
break;
}
if(typeS2==GeomAbs_Torus) {
while(V2<(AnV2-1.5*PI)) V2+=PI+PI;
while(V2>(AnV2+1.5*PI)) V2-=PI+PI;
while(V2<(AnV2-1.5*M_PI)) V2+=M_PI+M_PI;
while(V2>(AnV2+1.5*M_PI)) V2-=M_PI+M_PI;
}
thelin->SetUV(k,Standard_False,U2,V2);
@@ -1333,49 +1333,49 @@ static Standard_Real AdjustUFirst(Standard_Real U1,Standard_Real U2)
Standard_Real u = U1;
// case: no adjustment
if( U1 > 0. && U1 < (2.*PI) )
if( U1 > 0. && U1 < (2.*M_PI) )
return u;
// case: near '0'
if( U1 == 0. || fabs(U1) <= 1.e-9 ) {
if( U2 > 0. && U2 < (2.*PI) )
u = ( U2 < ((2.*PI)-U2) ) ? 0. : (2.*PI);
if( U2 > 0. && U2 < (2.*M_PI) )
u = ( U2 < ((2.*M_PI)-U2) ) ? 0. : (2.*M_PI);
else {
Standard_Real uu = U2;
if( U2 > (2.*PI) )
while( uu > (2.*PI) )
uu -= (2.*PI);
if( U2 > (2.*M_PI) )
while( uu > (2.*M_PI) )
uu -= (2.*M_PI);
else
while( uu < 0.)
uu += (2.*PI);
uu += (2.*M_PI);
u = ( uu < ((2.*PI)-uu) ) ? 0. : (2.*PI);
u = ( uu < ((2.*M_PI)-uu) ) ? 0. : (2.*M_PI);
}
}
// case: near '2PI'
else if( U1 == (2.*PI) || fabs((2.*PI)-fabs(U1)) <= 1.e-9 ) {
if( U2 > 0. && U2 < (2.*PI) )
u = ( U2 < ((2.*PI)-U2) ) ? 0. : (2.*PI);
else if( U1 == (2.*M_PI) || fabs((2.*M_PI)-fabs(U1)) <= 1.e-9 ) {
if( U2 > 0. && U2 < (2.*M_PI) )
u = ( U2 < ((2.*M_PI)-U2) ) ? 0. : (2.*M_PI);
else {
Standard_Real uu = U2;
if( U2 > (2.*PI) )
while( uu > (2.*PI) )
uu -= (2.*PI);
if( U2 > (2.*M_PI) )
while( uu > (2.*M_PI) )
uu -= (2.*M_PI);
else
while( uu < 0.)
uu += (2.*PI);
uu += (2.*M_PI);
u = ( uu < ((2.*PI)-uu) ) ? 0. : (2.*PI);
u = ( uu < ((2.*M_PI)-uu) ) ? 0. : (2.*M_PI);
}
}
// case: '<0. || >2PI'
else {
if(U1 < 0.)
while(u < 0.)
u += 2.*PI;
if(U1 > (2.*PI))
while(u > (2.*PI))
u -= (2.*PI);
u += 2.*M_PI;
if(U1 > (2.*M_PI))
while(u > (2.*M_PI))
u -= (2.*M_PI);
}
return u;
@@ -1387,15 +1387,15 @@ static Standard_Real AdjustUNext(Standard_Real Un,Standard_Real Up)
Standard_Real u = Un;
if( Un < 0. )
while(u < 0.)
u += (2.*PI);
else if( Un > (2.*PI) )
while( u > (2.*PI) )
u -= (2.*PI);
u += (2.*M_PI);
else if( Un > (2.*M_PI) )
while( u > (2.*M_PI) )
u -= (2.*M_PI);
else if(Un == 0. || fabs(Un) <= 1.e-9)
u = (fabs(Up) < fabs(2.*PI-Up)) ? 0. : (2.*PI);
else if(Un == (2.*PI) || fabs(Un-(2.*PI)) <= 1.e-9)
u = (fabs(Up) < fabs(2.*PI-Up)) ? 0. : (2.*PI);
else //( Un > 0. && Un < (2.*PI) )
u = (fabs(Up) < fabs(2.*M_PI-Up)) ? 0. : (2.*M_PI);
else if(Un == (2.*M_PI) || fabs(Un-(2.*M_PI)) <= 1.e-9)
u = (fabs(Up) < fabs(2.*M_PI-Up)) ? 0. : (2.*M_PI);
else //( Un > 0. && Un < (2.*M_PI) )
return u;
return u;
}
@@ -1514,7 +1514,7 @@ static void ForcedPurgePoints(Handle(IntSurf_LineOn2S)& Result,
}
if(Quad.TypeQuadric() == GeomAbs_Sphere) {
Standard_Real Vapx1 = PI/2., Vapx2 = -PI/2.;
Standard_Real Vapx1 = M_PI/2., Vapx2 = -M_PI/2.;
Standard_Real U1 = 0., V1 = 0., U2 = 0., V2 = 0.;
if(IsReversed) {
Result->Value(1).ParametersOnS2(U1,V1);
@@ -1588,12 +1588,12 @@ static void SearchVertices(const Handle(IntSurf_LineOn2S)& Line,
static inline Standard_Boolean IsSeamParameter(const Standard_Real U,
const Standard_Real TOL2D)
{
return (fabs(U) <= TOL2D || fabs(2.*PI - U) <= TOL2D);
return (fabs(U) <= TOL2D || fabs(2.*M_PI - U) <= TOL2D);
}
static inline Standard_Real AdjustU(const Standard_Real U)
{
Standard_Real u = U, DBLPI = 2.*PI;
Standard_Real u = U, DBLPI = 2.*M_PI;
if(u < 0. || u > DBLPI) {
if(u < 0.)
while(u < 0.)
@@ -1679,7 +1679,7 @@ static Standard_Boolean InsertSeamVertices(Handle(IntSurf_LineOn2S)& Line,
else
Line->Value(ipp).ParametersOnS1(U1,V1); // S1 - quadric
Standard_Real u = AdjustUFirst(U,U1);
if(fabs(u-U) >= 1.5*PI) {
if(fabs(u-U) >= 1.5*M_PI) {
Standard_Real U2 = 0., V2 = 0.;
if(IsReversed) {
Line->Value(ip).ParametersOnS1(U2,V2); // prm
@@ -1707,11 +1707,11 @@ static Standard_Boolean InsertSeamVertices(Handle(IntSurf_LineOn2S)& Line,
}
U1 = AdjustU(U1);
U2 = AdjustU(U2);
Standard_Boolean pnearZero = (fabs(U1) < fabs(2.*PI-U1)) ? Standard_True : Standard_False;
Standard_Boolean cnearZero = (fabs(U) < fabs(2.*PI-U)) ? Standard_True : Standard_False;
Standard_Boolean pnearZero = (fabs(U1) < fabs(2.*M_PI-U1)) ? Standard_True : Standard_False;
Standard_Boolean cnearZero = (fabs(U) < fabs(2.*M_PI-U)) ? Standard_True : Standard_False;
if(pnearZero == cnearZero) {
if(!IsSeamParameter(U2,TOL2D) && !IsSeamParameter(U1,TOL2D)) {
Standard_Real nU = (cnearZero) ? (2.*PI) : 0.;
Standard_Real nU = (cnearZero) ? (2.*M_PI) : 0.;
IntSurf_PntOn2S nP;
nP.SetValue(aP.Value());
Standard_Real U3 = 0., V3 = 0.;
@@ -1733,7 +1733,7 @@ static Standard_Boolean InsertSeamVertices(Handle(IntSurf_LineOn2S)& Line,
}
else {
if(!IsSeamParameter(U2,TOL2D) && !IsSeamParameter(U1,TOL2D)) {
Standard_Real nU = (cnearZero) ? (2.*PI) : 0.;
Standard_Real nU = (cnearZero) ? (2.*M_PI) : 0.;
IntSurf_PntOn2S nP;
nP.SetValue(aP.Value());
Standard_Real U3 = 0., V3 = 0.;
@@ -1829,10 +1829,10 @@ static void ToSmooth(Handle(IntSurf_LineOn2S)& Line,
}
if(!doU && Quad.TypeQuadric() == GeomAbs_Sphere) {
if(fabs(fabs(U1)-fabs(U2)) > (PI/16.)) doU = Standard_True;
if(fabs(fabs(U1)-fabs(U2)) > (M_PI/16.)) doU = Standard_True;
if(doU && (fabs(U1) <= 1.e-9 || fabs(U1-2.*PI) <= 1.e-9)) {
if(fabs(V1-PI/2.) <= 1.e-9 || fabs(V1+PI/2.) <= 1.e-9) {}
if(doU && (fabs(U1) <= 1.e-9 || fabs(U1-2.*M_PI) <= 1.e-9)) {
if(fabs(V1-M_PI/2.) <= 1.e-9 || fabs(V1+M_PI/2.) <= 1.e-9) {}
else {
doU = Standard_False;
}
@@ -1843,9 +1843,9 @@ static void ToSmooth(Handle(IntSurf_LineOn2S)& Line,
Standard_Real Uapx = 0., Vapx = 0.;
Quad.Parameters(Quad.Cone().Apex(),Uapx,Vapx);
if(fabs(fabs(U1)-fabs(U2)) > PI/32.) doU = Standard_True;
if(fabs(fabs(U1)-fabs(U2)) > M_PI/32.) doU = Standard_True;
if(doU && (fabs(U1) <= 1.e-9 || fabs(U1-2.*PI) <= 1.e-9)) {
if(doU && (fabs(U1) <= 1.e-9 || fabs(U1-2.*M_PI) <= 1.e-9)) {
if(fabs(V1-Vapx) <= 1.e-9) {}
else {
doU = Standard_False;
@@ -1957,7 +1957,7 @@ static void VerifyVertices(Handle(IntSurf_LineOn2S)& Line,
FConjugated = 0;
}
if(IsSeamParameter(Uv,TOL2D)) {
Standard_Real Ucv = (fabs(Uv) < fabs(2.*PI-Uv)) ? (2.*PI) : 0.;
Standard_Real Ucv = (fabs(Uv) < fabs(2.*M_PI-Uv)) ? (2.*M_PI) : 0.;
gp_Pnt2d a2DCV(Ucv,Vv);
Standard_Real CDist = a2DCV.Distance(a2DPF);
if(CDist < DistMinF) {
@@ -1990,7 +1990,7 @@ static void VerifyVertices(Handle(IntSurf_LineOn2S)& Line,
LConjugated = 0;
}
if(IsSeamParameter(Uv,TOL2D)) {
Standard_Real Ucv = (fabs(Uv) < fabs(2.*PI-Uv)) ? (2.*PI) : 0.;
Standard_Real Ucv = (fabs(Uv) < fabs(2.*M_PI-Uv)) ? (2.*M_PI) : 0.;
gp_Pnt2d a2DCV(Ucv,Vv);
Standard_Real CDist = a2DCV.Distance(a2DPL);
if(CDist < DistMinL) {
@@ -2014,7 +2014,7 @@ static void VerifyVertices(Handle(IntSurf_LineOn2S)& Line,
else
aV.ParametersOnS1(Uv,Vv);
if(IsSeamParameter(Uv,TOL2D)) {
Standard_Real Ucv = (fabs(Uv) < fabs(2.*PI-Uv)) ? (2.*PI) : 0.;
Standard_Real Ucv = (fabs(Uv) < fabs(2.*M_PI-Uv)) ? (2.*M_PI) : 0.;
Standard_Boolean test = TestMiddleOnPrm(aPF,aV,IsReversed,ArcTol,PDomain);
if(test) {
VrtF.SetValue(aV.Value());
@@ -2057,7 +2057,7 @@ static void VerifyVertices(Handle(IntSurf_LineOn2S)& Line,
else
aV.ParametersOnS1(Uv,Vv);
if(IsSeamParameter(Uv,TOL2D)) {
Standard_Real Ucv = (fabs(Uv) < fabs(2.*PI-Uv)) ? (2.*PI) : 0.;
Standard_Real Ucv = (fabs(Uv) < fabs(2.*M_PI-Uv)) ? (2.*M_PI) : 0.;
Standard_Boolean test = TestMiddleOnPrm(aPL,aV,IsReversed,ArcTol,PDomain);
if(test) {
VrtL.SetValue(aV.Value());
@@ -2334,8 +2334,8 @@ void DecomposeResult(Handle(IntPatch_Line)& Line,
Standard_Integer NbPnts = SSLine->NbPoints();
Standard_Real BSEAM = 1.5*PI; // delta U crossing seam
Standard_Real BAPEX = PI/16.; // delta U crossing apex
Standard_Real BSEAM = 1.5*M_PI; // delta U crossing seam
Standard_Real BAPEX = M_PI/16.; // delta U crossing apex
Standard_Integer i = 0, k = 0;
Standard_Real U1 = 0., U2 = 0., V1 = 0., V2 = 0., AnU1 = 0., AnV1 = 0., DU1 = 0., DV1 = 0.;

View File

@@ -285,7 +285,7 @@ static void FUN_GetUiso(const Handle(Geom_Surface)& GS,
if(T != GeomAbs_OffsetSurface)
{
Handle(Geom_Curve) gc = GS->UIso(U);
if(IsVP && (FirstV == 0.0 && LastV == (2.*PI))) I = gc;
if(IsVP && (FirstV == 0.0 && LastV == (2.*M_PI))) I = gc;
else
{
Handle(Geom_TrimmedCurve) gtc = new Geom_TrimmedCurve(gc,FirstV,LastV);
@@ -303,7 +303,7 @@ static void FUN_GetUiso(const Handle(Geom_Surface)& GS,
if(IsVP || IsVC || GACT == GeomAbs_BSplineCurve || GACT == GeomAbs_BezierCurve || Abs(LastV - FirstV) < 1.e+5)
{
Handle(Geom_Curve) gc = gos->UIso(U);
if(IsVP && (FirstV == 0.0 && LastV == (2*PI))) I = gc;
if(IsVP && (FirstV == 0.0 && LastV == (2*M_PI))) I = gc;
else
{
Handle(Geom_TrimmedCurve) gtc = new Geom_TrimmedCurve(gc,FirstV,LastV);
@@ -355,7 +355,7 @@ static void FUN_GetViso(const Handle(Geom_Surface)& GS,
if(T != GeomAbs_OffsetSurface)
{
Handle(Geom_Curve) gc = GS->VIso(V);
if(IsUP && (FirstU == 0.0 && LastU == (2*PI))) I = gc;
if(IsUP && (FirstU == 0.0 && LastU == (2*M_PI))) I = gc;
else
{
Handle(Geom_TrimmedCurve) gtc = new Geom_TrimmedCurve(gc,FirstU,LastU);
@@ -373,7 +373,7 @@ static void FUN_GetViso(const Handle(Geom_Surface)& GS,
if(IsUP || IsUC || GACT == GeomAbs_BSplineCurve || GACT == GeomAbs_BezierCurve || Abs(LastU - FirstU) < 1.e+5)
{
Handle(Geom_Curve) gc = gos->VIso(V);
if(IsUP && (FirstU == 0.0 && LastU == (2*PI))) I = gc;
if(IsUP && (FirstU == 0.0 && LastU == (2*M_PI))) I = gc;
else
{
Handle(Geom_TrimmedCurve) gtc = new Geom_TrimmedCurve(gc,FirstU,LastU);

View File

@@ -88,28 +88,28 @@ static void Recadre(const Handle(Adaptor3d_HSurface)& myHS1,
}
}
if(myHS1IsUPeriodic) {
lmf = PI+PI; //-- myHS1->UPeriod();
lmf = M_PI+M_PI; //-- myHS1->UPeriod();
f = myHS1->FirstUParameter();
l = myHS1->LastUParameter();
while(u1 < f) { u1+=lmf; }
while(u1 > l) { u1-=lmf; }
}
if(myHS1IsVPeriodic) {
lmf = PI+PI; //-- myHS1->VPeriod();
lmf = M_PI+M_PI; //-- myHS1->VPeriod();
f = myHS1->FirstVParameter();
l = myHS1->LastVParameter();
while(v1 < f) { v1+=lmf; }
while(v1 > l) { v1-=lmf; }
}
if(myHS2IsUPeriodic) {
lmf = PI+PI; //-- myHS2->UPeriod();
lmf = M_PI+M_PI; //-- myHS2->UPeriod();
f = myHS2->FirstUParameter();
l = myHS2->LastUParameter();
while(u2 < f) { u2+=lmf; }
while(u2 > l) { u2-=lmf; }
}
if(myHS2IsVPeriodic) {
lmf = PI+PI; //-- myHS2->VPeriod();
lmf = M_PI+M_PI; //-- myHS2->VPeriod();
f = myHS2->FirstVParameter();
l = myHS2->LastVParameter();
while(v2 < f) { v2+=lmf; }
@@ -318,7 +318,7 @@ static Standard_Real LocalLastParameter (const Handle(IntPatch_Line)& L)
case IntPatch_Circle:
case IntPatch_Ellipse:
lastp = PI+PI;
lastp = M_PI+M_PI;
break;
default:
{
@@ -694,9 +694,9 @@ static void AddLine(const Handle(IntPatch_Line)& L,
if(i!=j) {
if ((typl == IntPatch_Circle || typl == IntPatch_Ellipse) && i>j) {
IntPatch_Point Vtx=GLine->Vertex(j);
Vtx.SetParameter(GLine->Vertex(j).ParameterOnLine()+PI+PI);
Vtx.SetParameter(GLine->Vertex(j).ParameterOnLine()+M_PI+M_PI);
glig->AddVertex(Vtx);
IndexLastVertex+=AppendSameVertexG(glig,GLine,j,PI+PI,TabIndex);
IndexLastVertex+=AppendSameVertexG(glig,GLine,j,M_PI+M_PI,TabIndex);
}
else {
glig->AddVertex(GLine->Vertex(j));
@@ -1468,12 +1468,12 @@ void IntPatch_LineConstructor::Perform(const IntPatch_SequenceOfLine& slinref,
}
if(typl == IntPatch_Circle || typl == IntPatch_Ellipse) {
firstp = GLine->Vertex(nbvtx).ParameterOnLine();
lastp = PI + PI + GLine->Vertex(1).ParameterOnLine();
lastp = M_PI + M_PI + GLine->Vertex(1).ParameterOnLine();
Standard_Real cadrinf = LocalFirstParameter(L);
Standard_Real cadrsup = LocalLastParameter(L);
Standard_Real acadr = (firstp+lastp)*0.5;
while(acadr < cadrinf) { acadr+=PI+PI; }
while(acadr > cadrsup) { acadr-=PI+PI; }
while(acadr < cadrinf) { acadr+=M_PI+M_PI; }
while(acadr > cadrsup) { acadr-=M_PI+M_PI; }
if(acadr>=cadrinf && acadr<=cadrsup) {
if(Abs(firstp-lastp)>Precision::PConfusion()) {
intrvtested = Standard_True;

View File

@@ -56,15 +56,15 @@ static void Recadre(GeomAbs_SurfaceType typeS1,
case GeomAbs_Cone:
case GeomAbs_Sphere:
case GeomAbs_Torus:
while(U1<(U1p-1.5*PI)) U1+=PI+PI;
while(U1>(U1p+1.5*PI)) U1-=PI+PI;
while(U1<(U1p-1.5*M_PI)) U1+=M_PI+M_PI;
while(U1>(U1p+1.5*M_PI)) U1-=M_PI+M_PI;
break;
default:
break;
}
if(typeS1==GeomAbs_Torus) {
while(V1<(V1p-1.5*PI)) V1+=PI+PI;
while(V1>(V1p+1.5*PI)) V1-=PI+PI;
while(V1<(V1p-1.5*M_PI)) V1+=M_PI+M_PI;
while(V1>(V1p+1.5*M_PI)) V1-=M_PI+M_PI;
}
switch(typeS2) {
@@ -72,15 +72,15 @@ static void Recadre(GeomAbs_SurfaceType typeS1,
case GeomAbs_Cone:
case GeomAbs_Sphere:
case GeomAbs_Torus:
while(U2<(U2p-1.5*PI)) U2+=PI+PI;
while(U2>(U2p+1.5*PI)) U2-=PI+PI;
while(U2<(U2p-1.5*M_PI)) U2+=M_PI+M_PI;
while(U2>(U2p+1.5*M_PI)) U2-=M_PI+M_PI;
break;
default:
break;
}
if(typeS2==GeomAbs_Torus) {
while(V2<(V1p-1.5*PI)) V2+=PI+PI;
while(V2>(V2p+1.5*PI)) V2-=PI+PI;
while(V2<(V1p-1.5*M_PI)) V2+=M_PI+M_PI;
while(V2>(V2p+1.5*M_PI)) V2-=M_PI+M_PI;
}
}
@@ -579,8 +579,8 @@ void IntPatch_RstInt::PutVertexOnLine (Handle(IntPatch_Line)& L,
BPLin.Get(xmin,ymin,xmax,ymax);
g = BPLin.GetGap();
BPLin.SetVoid();
BPLin.Update(xmin-PI-PI,ymin,
xmax+PI+PI,ymax);
BPLin.Update(xmin-M_PI-M_PI,ymin,
xmax+M_PI+M_PI,ymax);
BPLin.SetGap(g);
}
if(SurfaceIsBiPeriodic) {
@@ -588,8 +588,8 @@ void IntPatch_RstInt::PutVertexOnLine (Handle(IntPatch_Line)& L,
BPLin.Get(xmin,ymin,xmax,ymax);
g = BPLin.GetGap();
BPLin.SetVoid();
BPLin.Update(xmin,ymin-PI-PI,
xmax,ymax+PI+PI);
BPLin.Update(xmin,ymin-M_PI-M_PI,
xmax,ymax+M_PI+M_PI);
BPLin.SetGap(g);
}
@@ -627,15 +627,15 @@ void IntPatch_RstInt::PutVertexOnLine (Handle(IntPatch_Line)& L,
do {
if(IndiceOffsetBiPeriodic == 1)
OffsetV = -PI-PI;
OffsetV = -M_PI-M_PI;
else if(IndiceOffsetBiPeriodic == 2)
OffsetV = PI+PI;
OffsetV = M_PI+M_PI;
do {
if(IndiceOffsetPeriodic == 1)
OffsetU = -PI-PI;
OffsetU = -M_PI-M_PI;
else if(IndiceOffsetPeriodic == 2)
OffsetU = PI+PI;
OffsetU = M_PI+M_PI;
Brise.SetOffset(OffsetU,OffsetV);
@@ -1134,10 +1134,10 @@ void IntPatch_RstInt::PutVertexOnLine (Handle(IntPatch_Line)& L,
case GeomAbs_Cylinder:
case GeomAbs_Cone:
case GeomAbs_Sphere:
pu1=PI+PI;
pu1=M_PI+M_PI;
break;
case GeomAbs_Torus:
pu1=pv1=PI+PI;
pu1=pv1=M_PI+M_PI;
break;
default:
{
@@ -1165,10 +1165,10 @@ void IntPatch_RstInt::PutVertexOnLine (Handle(IntPatch_Line)& L,
case GeomAbs_Cone:
case GeomAbs_Sphere:
pu2=PI+PI;
pu2=M_PI+M_PI;
break;
case GeomAbs_Torus:
pu2=pv2=PI+PI;
pu2=pv2=M_PI+M_PI;
break;
default:
{