1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +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

@@ -60,7 +60,7 @@ Convert_CircleToBSplineCurve::Convert_CircleToBSplineCurve
isperiodic = Standard_False;
Convert_ConicToBSplineCurve::
BuildCosAndSin(Parameterisation,
0, 2*PI,
0, 2*M_PI,
CosNumeratorPtr,
SinNumeratorPtr,
weights,
@@ -124,7 +124,7 @@ Convert_CircleToBSplineCurve::Convert_CircleToBSplineCurve
Standard_Real delta = ULast - UFirst ;
Standard_Real Eps = Precision::PConfusion();
if ( (delta > (2*PI + Eps)) || (delta <= 0.0e0) ) {
if ( (delta > (2*M_PI + Eps)) || (delta <= 0.0e0) ) {
Standard_DomainError::Raise( "Convert_CircleToBSplineCurve");
}

View File

@@ -28,7 +28,7 @@ static void ComputePoles( const Standard_Real R,
// Number of spans : maximum opening = 150 degrees ( = PI / 1.2 rds)
Standard_Integer
nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / PI) + 1;
nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / M_PI) + 1;
Standard_Real AlfaU = deltaU / ( nbUSpans * 2);
Standard_Real x[TheNbVPoles];
@@ -78,7 +78,7 @@ Convert_ConeToBSplineSurface::Convert_ConeToBSplineSurface
{
Standard_Real deltaU = U2 - U1;
Standard_DomainError_Raise_if( (Abs(V2-V1) <= Abs(Epsilon(V1))) ||
(deltaU > 2*PI) ||
(deltaU > 2*M_PI) ||
(deltaU < 0. ),
"Convert_ConeToBSplineSurface");
@@ -90,7 +90,7 @@ Convert_ConeToBSplineSurface::Convert_ConeToBSplineSurface
// Number of spans : maximum opening = 150 degrees ( = PI / 1.2 rds)
Standard_Integer
nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / PI) + 1;
nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / M_PI) + 1;
Standard_Real AlfaU = deltaU / ( nbUSpans * 2);
nbUPoles = 2 * nbUSpans + 1;
@@ -156,7 +156,7 @@ Convert_ConeToBSplineSurface::Convert_ConeToBSplineSurface
Standard_Real R = C.RefRadius();
Standard_Real A = C.SemiAngle();
ComputePoles( R, A, 0., 2.*PI, V1, V2, poles);
ComputePoles( R, A, 0., 2.*M_PI, V1, V2, poles);
nbUPoles = 6;
nbUKnots = 4;
@@ -164,7 +164,7 @@ Convert_ConeToBSplineSurface::Convert_ConeToBSplineSurface
nbVKnots = 2;
for ( i = 1; i <= nbUKnots; i++) {
uknots(i) = ( i-1) * 2. * PI /3.;
uknots(i) = ( i-1) * 2. * M_PI /3.;
umults(i) = 2;
}
vknots(1) = V1; vmults(1) = 2;

View File

@@ -347,20 +347,20 @@ void Convert_ConicToBSplineCurve::BuildCosAndSin(
switch (Parameterisation) {
case Convert_TgtThetaOver2:
num_spans =
(Standard_Integer)IntegerPart( 1.2 * delta / PI) + 1;
(Standard_Integer)IntegerPart( 1.2 * delta / M_PI) + 1;
tgt_theta_flag = 1 ;
break ;
case Convert_TgtThetaOver2_1:
num_spans = 1 ;
if (delta > 0.9999 * PI) {
if (delta > 0.9999 * M_PI) {
Standard_ConstructionError::Raise() ;
}
tgt_theta_flag = 1 ;
break ;
case Convert_TgtThetaOver2_2:
num_spans = 2 ;
if (delta > 1.9999 * PI) {
if (delta > 1.9999 * M_PI) {
Standard_ConstructionError::Raise() ;
}
tgt_theta_flag = 1 ;
@@ -490,7 +490,7 @@ void Convert_ConicToBSplineCurve::BuildCosAndSin(
alpha_2 = alpha * 0.5e0 ;
p_param = - 1.0e0 / (alpha_2 * alpha_2) ;
if (alpha_2 < PI * 0.5e0) {
if (alpha_2 < M_PI * 0.5e0) {
tan_alpha_2 = Tan(alpha_2) ;
value1 = 3.0e0 * (tan_alpha_2 - alpha_2) ;
value1 = alpha_2 / value1 ;
@@ -624,7 +624,7 @@ void Convert_ConicToBSplineCurve::BuildCosAndSin(
if (Parameterisation == Convert_TgtThetaOver2) {
BuildCosAndSin(Convert_TgtThetaOver2_3,
0.0e0,
2 * PI,
2 * M_PI,
temp_cos_ptr,
temp_sin_ptr,
temp_denominator_ptr,
@@ -649,7 +649,7 @@ void Convert_ConicToBSplineCurve::BuildCosAndSin(
else if (Parameterisation == Convert_RationalC1)
{
first_param = 0.0e0 ;
last_param = PI ;
last_param = M_PI ;
BuildCosAndSin(Convert_RationalC1,
first_param,
last_param,
@@ -675,7 +675,7 @@ void Convert_ConicToBSplineCurve::BuildCosAndSin(
DenominatorPtr =
new TColStd_HArray1OfReal(1,num_periodic_poles) ;
half_pi = PI * 0.5e0 ;
half_pi = M_PI * 0.5e0 ;
index = 1 ;
for (jj = 1 ; jj <= 2 ; jj++) {
flat_knots(index) = - half_pi ;
@@ -690,7 +690,7 @@ void Convert_ConicToBSplineCurve::BuildCosAndSin(
}
}
for (jj = 1 ; jj <= 2 ; jj++) {
flat_knots(index) = 2 * PI + half_pi ;
flat_knots(index) = 2 * M_PI + half_pi ;
index += 1 ;
}
KnotsPtr =
@@ -712,9 +712,9 @@ void Convert_ConicToBSplineCurve::BuildCosAndSin(
inverse = 1.0e0 ;
for (ii = parameters.Lower() ; ii <= parameters.Upper() ; ii++) {
param = parameters(ii) ;
if (param > PI) {
if (param > M_PI) {
inverse = -1.0e0 ;
param -= PI ;
param -= M_PI ;
}
BSplCLib::D0(param,
0,

View File

@@ -28,7 +28,7 @@ static void ComputePoles( const Standard_Real R,
// Number of spans : maximum opening = 150 degrees ( = PI / 1.2 rds)
Standard_Integer
nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / PI) + 1;
nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / M_PI) + 1;
Standard_Real AlfaU = deltaU / ( nbUSpans * 2);
Standard_Real UStart = U1;
@@ -70,7 +70,7 @@ Convert_CylinderToBSplineSurface::Convert_CylinderToBSplineSurface
{
Standard_Real deltaU = U2 - U1;
Standard_DomainError_Raise_if( (Abs(V2-V1) <= Abs(Epsilon(V1))) ||
(deltaU > 2*PI) ||
(deltaU > 2*M_PI) ||
(deltaU < 0. ),
"Convert_CylinderToBSplineSurface");
@@ -82,7 +82,7 @@ Convert_CylinderToBSplineSurface::Convert_CylinderToBSplineSurface
// Number of spans : maximum opening = 150 degrees ( = PI / 1.2 rds)
Standard_Integer
nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / PI) + 1;
nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / M_PI) + 1;
Standard_Real AlfaU = deltaU / ( nbUSpans * 2);
nbUPoles = 2 * nbUSpans + 1;
@@ -146,7 +146,7 @@ Convert_CylinderToBSplineSurface::Convert_CylinderToBSplineSurface
Standard_Real R = Cyl.Radius();
ComputePoles( R, 0., 2.*PI, V1, V2, poles);
ComputePoles( R, 0., 2.*M_PI, V1, V2, poles);
nbUPoles = 6;
nbUKnots = 4;
@@ -154,7 +154,7 @@ Convert_CylinderToBSplineSurface::Convert_CylinderToBSplineSurface
nbVKnots = 2;
for ( i = 1; i <= nbUKnots; i++) {
uknots(i) = ( i-1) * 2. * PI /3.;
uknots(i) = ( i-1) * 2. * M_PI /3.;
umults(i) = 2;
}
vknots(1) = V1; vmults(1) = 2;

View File

@@ -67,7 +67,7 @@ Convert_EllipseToBSplineCurve::Convert_EllipseToBSplineCurve
isperiodic = Standard_False;
Convert_ConicToBSplineCurve::
BuildCosAndSin(Parameterisation,
0, 2*PI,
0, 2*M_PI,
CosNumeratorPtr,
SinNumeratorPtr,
weights,
@@ -131,7 +131,7 @@ Convert_EllipseToBSplineCurve::Convert_EllipseToBSplineCurve
Standard_Real Tol = Precision::PConfusion();
Standard_Real delta = ULast - UFirst;
#endif
Standard_DomainError_Raise_if( (delta > (2*PI+Tol)) || (delta <= 0.0e0),
Standard_DomainError_Raise_if( (delta > (2*M_PI+Tol)) || (delta <= 0.0e0),
"Convert_EllipseToBSplineCurve");
Standard_Integer ii;
Standard_Real R, r, value;

View File

@@ -34,7 +34,7 @@ static Standard_Real Locate(const Standard_Real Angfin,
BSplCLib::D0(ptest,TPoles,BSplCLib::NoWeights(),valP);
Standard_Real theta = ATan2(valP.Y(),valP.X());
if (theta < 0.) {
theta +=2.*PI;
theta +=2.*M_PI;
}
if (Abs(theta - Angfin) < Ptol) {
return ptest;
@@ -69,7 +69,7 @@ void BuildPolynomialCosAndSin
trim_max,
middle,
Angle,
PI2 = 2*PI ;
PI2 = 2*M_PI ;
Standard_Integer ii, degree = num_poles -1 ;
locUFirst = UFirst ;
@@ -91,7 +91,7 @@ void BuildPolynomialCosAndSin
// parametre 1/2 of Bezier was exactly a point of the bissectrice
// of the required angular sector.
//
Angle = middle - PI ;
Angle = middle - M_PI ;
//
// Circle of radius 1. See Euclid
//
@@ -113,10 +113,10 @@ void BuildPolynomialCosAndSin
}
t_min = 1.0e0 - (Delta * 1.3e0 / PI) ;
t_min = 1.0e0 - (Delta * 1.3e0 / M_PI) ;
t_min *= 0.5e0 ;
t_min = Max(t_min,0.0e0) ;
t_max = 1.0e0 + (Delta * 1.3e0 / PI) ;
t_max = 1.0e0 + (Delta * 1.3e0 / M_PI) ;
t_max *= 0.5e0 ;
t_max = Min(t_max,1.0e0) ;
trim_max = Locate(Delta,

View File

@@ -28,9 +28,9 @@ static void ComputePoles ( const Standard_Real R,
// Number of spans : maximum opening = 150 degrees ( = PI / 1.2 rds)
Standard_Integer
nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / PI) + 1;
nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / M_PI) + 1;
Standard_Integer
nbVSpans = (Standard_Integer)IntegerPart( 1.2 * deltaV / PI) + 1;
nbVSpans = (Standard_Integer)IntegerPart( 1.2 * deltaV / M_PI) + 1;
Standard_Real AlfaU = deltaU / ( nbUSpans * 2);
Standard_Real AlfaV = deltaV / ( nbVSpans * 2);
@@ -86,8 +86,8 @@ Convert_SphereToBSplineSurface::Convert_SphereToBSplineSurface
{
Standard_Real deltaU = U2 - U1;
Standard_Real deltaV = V2 - V1;
Standard_DomainError_Raise_if( (deltaU>2*PI) || (deltaU<0.) ||
(V1 < -PI/2.0) || (V2 > PI/2),
Standard_DomainError_Raise_if( (deltaU>2*M_PI) || (deltaU<0.) ||
(V1 < -M_PI/2.0) || (V2 > M_PI/2),
"Convert_SphereToBSplineSurface");
isuperiodic = Standard_False;
@@ -98,9 +98,9 @@ Convert_SphereToBSplineSurface::Convert_SphereToBSplineSurface
// Number of spans : maximum opening = 150 degrees ( = PI / 1.2 rds)
Standard_Integer
nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / PI) + 1;
nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / M_PI) + 1;
Standard_Integer
nbVSpans = (Standard_Integer)IntegerPart( 1.2 * deltaV / PI) + 1;
nbVSpans = (Standard_Integer)IntegerPart( 1.2 * deltaV / M_PI) + 1;
Standard_Real AlfaU = deltaU / ( nbUSpans * 2);
Standard_Real AlfaV = deltaV / ( nbVSpans * 2);
@@ -163,7 +163,7 @@ Convert_SphereToBSplineSurface::Convert_SphereToBSplineSurface
#ifndef No_Exception
Standard_Real delta = Param2 - Param1;
#endif
Standard_DomainError_Raise_if( (delta>2*PI) || (delta<0.),
Standard_DomainError_Raise_if( (delta>2*M_PI) || (delta<0.),
"Convert_SphereToBSplineSurface");
Standard_Integer i, j;
@@ -177,20 +177,20 @@ Convert_SphereToBSplineSurface::Convert_SphereToBSplineSurface
Standard_Real W1, W2, CosU, CosV;
if ( isuperiodic) {
ComputePoles(R, 0., 2.*PI, Param1, Param2, poles);
ComputePoles(R, 0., 2.*M_PI, Param1, Param2, poles);
nbUPoles = 6;
nbUKnots = 4;
deltaV = Param2 - Param1;
Standard_Integer
nbVSpans = (Standard_Integer)IntegerPart( 1.2 * deltaV / PI) + 1;
nbVSpans = (Standard_Integer)IntegerPart( 1.2 * deltaV / M_PI) + 1;
Standard_Real AlfaV = deltaV / ( nbVSpans * 2);
nbVPoles = 2 * nbVSpans + 1;
nbVKnots = nbVSpans + 1;
for ( i = 1; i <= nbUKnots; i++) {
uknots(i) = ( i-1) * 2. * PI /3.;
uknots(i) = ( i-1) * 2. * M_PI /3.;
umults(i) = 2;
}
for ( i = 1; i <= nbVKnots; i++) {
@@ -203,21 +203,21 @@ Convert_SphereToBSplineSurface::Convert_SphereToBSplineSurface
CosV = Cos(AlfaV);
}
else {
ComputePoles(R, Param1, Param2, -PI/2., PI/2., poles);
ComputePoles(R, Param1, Param2, -M_PI/2., M_PI/2., poles);
nbVPoles = 5;
nbVKnots = 3;
deltaU = Param2 - Param1;
Standard_Integer
nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / PI) + 1;
nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / M_PI) + 1;
Standard_Real AlfaU = deltaU / ( nbUSpans * 2);
nbUPoles = 2 * nbUSpans + 1;
nbUKnots = nbUSpans + 1;
vknots(1) = -PI/2.; vmults(1) = 3;
vknots(1) = -M_PI/2.; vmults(1) = 3;
vknots(2) = 0.; vmults(2) = 2;
vknots(3) = PI/2.; vmults(3) = 3;
vknots(3) = M_PI/2.; vmults(3) = 3;
for ( i = 1; i <= nbUKnots; i++) {
uknots(i) = Param1 + (i-1) * 2 * AlfaU;
umults(i) = 2;
@@ -274,15 +274,15 @@ Convert_SphereToBSplineSurface::Convert_SphereToBSplineSurface
Standard_Real R = Sph.Radius();
ComputePoles( R, 0., 2.*PI, -PI/2., PI/2., poles);
ComputePoles( R, 0., 2.*M_PI, -M_PI/2., M_PI/2., poles);
uknots( 1) = 0.;
uknots( 2) = 2. * PI / 3.;
uknots( 3) = 4. * PI / 3.;
uknots( 4) = 2. * PI;
vknots( 1) = -PI/2.;
uknots( 2) = 2. * M_PI / 3.;
uknots( 3) = 4. * M_PI / 3.;
uknots( 4) = 2. * M_PI;
vknots( 1) = -M_PI/2.;
vknots( 2) = 0.;
vknots( 3) = PI/2.;
vknots( 3) = M_PI/2.;
for ( i = 1; i <= 4; i++) {
umults( i) = 2;
}

View File

@@ -29,9 +29,9 @@ static void ComputePoles ( const Standard_Real R,
// Number of spans : maximum opening = 150 degrees ( = PI / 1.2 rds)
Standard_Integer
nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / PI) + 1;
nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / M_PI) + 1;
Standard_Integer
nbVSpans = (Standard_Integer)IntegerPart( 1.2 * deltaV / PI) + 1;
nbVSpans = (Standard_Integer)IntegerPart( 1.2 * deltaV / M_PI) + 1;
Standard_Real AlfaU = deltaU / ( nbUSpans * 2);
Standard_Real AlfaV = deltaV / ( nbVSpans * 2);
@@ -88,8 +88,8 @@ Convert_TorusToBSplineSurface::Convert_TorusToBSplineSurface
{
Standard_Real deltaU = U2 - U1;
Standard_Real deltaV = V2 - V1;
Standard_DomainError_Raise_if( (deltaU>2*PI) || (deltaU<0.) ||
(deltaV>2*PI) || (deltaV<0.),
Standard_DomainError_Raise_if( (deltaU>2*M_PI) || (deltaU<0.) ||
(deltaV>2*M_PI) || (deltaV<0.),
"Convert_TorusToBSplineSurface");
isuperiodic = Standard_False;
@@ -100,9 +100,9 @@ Convert_TorusToBSplineSurface::Convert_TorusToBSplineSurface
// Number of spans : maximum opening = 150 degrees ( = PI / 1.2 rds)
Standard_Integer
nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / PI) + 1;
nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / M_PI) + 1;
Standard_Integer
nbVSpans = (Standard_Integer)IntegerPart( 1.2 * deltaV / PI) + 1;
nbVSpans = (Standard_Integer)IntegerPart( 1.2 * deltaV / M_PI) + 1;
Standard_Real AlfaU = deltaU / ( nbUSpans * 2);
Standard_Real AlfaV = deltaV / ( nbVSpans * 2);
@@ -166,7 +166,7 @@ Convert_TorusToBSplineSurface::Convert_TorusToBSplineSurface
#ifndef No_Exception
Standard_Real delta = Param2 - Param1;
#endif
Standard_DomainError_Raise_if( (delta>2*PI) || (delta<0.),
Standard_DomainError_Raise_if( (delta>2*M_PI) || (delta<0.),
"Convert_TorusToBSplineSurface");
Standard_Integer i, j;
@@ -181,20 +181,20 @@ Convert_TorusToBSplineSurface::Convert_TorusToBSplineSurface
Standard_Real W1, W2, CosU, CosV;
if ( isuperiodic) {
ComputePoles(R, r, 0, 2.*PI, Param1, Param2, poles);
ComputePoles(R, r, 0, 2.*M_PI, Param1, Param2, poles);
nbUPoles = 6;
nbUKnots = 4;
deltaV = Param2 - Param1;
Standard_Integer
nbVSpans = (Standard_Integer)IntegerPart( 1.2 * deltaV / PI) + 1;
nbVSpans = (Standard_Integer)IntegerPart( 1.2 * deltaV / M_PI) + 1;
Standard_Real AlfaV = deltaV / ( nbVSpans * 2);
nbVPoles = 2 * nbVSpans + 1;
nbVKnots = nbVSpans + 1;
for ( i = 1; i <= nbUKnots; i++) {
uknots(i) = ( i-1) * 2. * PI /3.;
uknots(i) = ( i-1) * 2. * M_PI /3.;
umults(i) = 2;
}
for ( i = 1; i <= nbVKnots; i++) {
@@ -207,20 +207,20 @@ Convert_TorusToBSplineSurface::Convert_TorusToBSplineSurface
CosV = Cos(AlfaV);
}
else {
ComputePoles(R, r, Param1, Param2, 0., 2.*PI, poles);
ComputePoles(R, r, Param1, Param2, 0., 2.*M_PI, poles);
nbVPoles = 6;
nbVKnots = 4;
deltaU = Param2 - Param1;
Standard_Integer
nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / PI) + 1;
nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / M_PI) + 1;
Standard_Real AlfaU = deltaU / ( nbUSpans * 2);
nbUPoles = 2 * nbUSpans + 1;
nbUKnots = nbUSpans + 1;
for ( i = 1; i <= nbVKnots; i++) {
vknots(i) = ( i-1) * 2. * PI /3.;
vknots(i) = ( i-1) * 2. * M_PI /3.;
vmults(i) = 2;
}
for ( i = 1; i <= nbUKnots; i++) {
@@ -281,12 +281,12 @@ Convert_TorusToBSplineSurface::Convert_TorusToBSplineSurface
Standard_Real R = T.MajorRadius();
Standard_Real r = T.MinorRadius();
ComputePoles( R, r, 0., 2.*PI, 0., 2.*PI, poles);
ComputePoles( R, r, 0., 2.*M_PI, 0., 2.*M_PI, poles);
uknots( 1) = vknots( 1) = 0.;
uknots( 2) = vknots( 2) = 2. * PI / 3.;
uknots( 3) = vknots( 3) = 4. * PI / 3.;
uknots( 4) = vknots( 4) = 2. * PI;
uknots( 2) = vknots( 2) = 2. * M_PI / 3.;
uknots( 3) = vknots( 3) = 4. * M_PI / 3.;
uknots( 4) = vknots( 4) = 2. * M_PI;
for ( i = 1; i <= 4; i++) {
umults( i) = vmults( i) = 2;
}