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

@@ -912,8 +912,8 @@ void BRepFill::SearchOrigin(TopoDS_Wire & W,
Ve *= -1;
}
angle = Ve.Angle(Dir);
if (angle > PI) angle = 2*PI - angle;
forward = (angle <= PI/2);
if (angle > M_PI) angle = 2*M_PI - angle;
forward = (angle <= M_PI/2);
// Reconstruction
MakeWire( Edges, rangdeb, forward, W);

View File

@@ -554,8 +554,8 @@ static void Transform (const Standard_Boolean WithRotation,
gp_Ax1 Norm(Pos2,norm2);
Standard_Real ang = axe1.AngleWithRef(axe2,norm2);
if (!WithRotation) {
if (ang>PI/2) ang = ang - PI;
if (ang<-PI/2) ang = ang + PI;
if (ang>M_PI/2) ang = ang - M_PI;
if (ang<-M_PI/2) ang = ang + M_PI;
}
ang *= sign;
Pnew = Pnew.Rotated (Norm,ang);
@@ -1742,7 +1742,7 @@ void BRepFill_CompatibleWires::ComputeOrigin(const Standard_Boolean polar )
// recherche du vertex correspondant a la projection conique
Standard_Real angmin, angV, eta = Precision::Angular();
TopoDS_Vertex Vopti;
angmin = PI/2;
angmin = M_PI/2;
distmini = Precision::Infinite();
gp_Dir dir0(gp_Vec(Pnew,P.Location()));
for (Standard_Integer ii=1;ii<=SeqV.Length();ii++) {
@@ -1755,7 +1755,7 @@ void BRepFill_CompatibleWires::ComputeOrigin(const Standard_Boolean polar )
gp_Dir dir1(gp_Vec(Pnew,P1));
angV = dir1.Angle(dir0);
}
if (angV>PI/2) angV = PI - angV;
if (angV>M_PI/2) angV = M_PI - angV;
if (angmin>angV+eta) {
distmini = dist;
angmin = angV;
@@ -2009,11 +2009,11 @@ void BRepFill_CompatibleWires::SearchOrigin()
norm = vec1 ^ vec2;
gp_Ax1 Norm(P.Location(),norm);
Standard_Real ang = vec1.AngleWithRef(vec2,norm);
if (ang > PI/2.0)
ang = PI - ang;
if (ang < -PI/2.0)
ang = -PI - ang;
if (Abs(ang-PI/2.0)<Precision::Angular()) {
if (ang > M_PI/2.0)
ang = M_PI - ang;
if (ang < -M_PI/2.0)
ang = -M_PI - ang;
if (Abs(ang-M_PI/2.0)<Precision::Angular()) {
// cas d'ambiguite
gp_Vec Vtrans(P0.Location(),P.Location()),Vsign;
Standard_Real alpha,beta,sign=1;
@@ -2037,7 +2037,7 @@ void BRepFill_CompatibleWires::SearchOrigin()
};
gp_Vec VDebFin0(P1o,P2o), VDebFin(P1,P2);
Standard_Real AStraight = VDebFin0.Angle(VDebFin);
parcours = (AStraight < PI/2.0? Standard_True: Standard_False);
parcours = (AStraight < M_PI/2.0? Standard_True: Standard_False);
}
// reconstruction of the wire

View File

@@ -479,7 +479,7 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B,
gp_Dir BN(M.Column(2));
Standard_Real ang = myDir.Angle(BN);
if (ang > PI/2) D.Reverse();
if (ang > M_PI/2) D.Reverse();
Handle(Geom_Line) L = new (Geom_Line) (P, D);
Handle(Geom_Curve) TC = new (Geom_TrimmedCurve) (L, 0, Length);
@@ -534,7 +534,7 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B,
V = V1.Crossed(V2);
if (F.Orientation() == TopAbs_REVERSED) V.Reverse();
if (V.Magnitude() > 1.e-10) {
out = myDir.Angle(V) > PI/2;
out = myDir.Angle(V) > M_PI/2;
}
if (out == IsInternal) {
myShell.Reverse();
@@ -705,7 +705,7 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B,
}
// Subtract State1
if (myDir.Angle(SP.Normal()) < PI/2) State1 = TopAbs_IN;
if (myDir.Angle(SP.Normal()) < M_PI/2) State1 = TopAbs_IN;
else State1 = TopAbs_OUT;
}

View File

@@ -2189,7 +2189,7 @@ void BRepFill_Evolved::MakePipe(const TopoDS_Edge& SE,
gp_Trsf trsf;
if (Side(myProfile,BRepFill_Confusion()) > 3) { // side right
trsf.SetRotation(gp::OZ(),PI);
trsf.SetRotation(gp::OZ(),M_PI);
}
TopLoc_Location DumLoc (trsf);
TopoDS_Shape aLocalShape = myProfile.Moved(DumLoc);
@@ -2276,7 +2276,7 @@ void BRepFill_Evolved::MakeRevol(const TopoDS_Edge& SE,
gp_Trsf trsf;
if (Side(myProfile,BRepFill_Confusion()) > 3) { // side right
trsf.SetRotation(gp::OZ(),PI);
trsf.SetRotation(gp::OZ(),M_PI);
}
TopLoc_Location DumLoc (trsf);
TopoDS_Shape aLocalShape = myProfile.Moved(DumLoc);
@@ -2294,7 +2294,7 @@ void BRepFill_Evolved::MakeRevol(const TopoDS_Edge& SE,
// Position of the sewing on the edge of the spine
// so that the bissectrices didn't cross the sewings.
gp_Trsf dummy;
dummy.SetRotation(AxeRev, 1.5*PI);
dummy.SetRotation(AxeRev, 1.5*M_PI);
TopLoc_Location DummyLoc(dummy);
GenProf.Move(DummyLoc);

View File

@@ -396,7 +396,7 @@ void BRepFill_Filling::FindExtremitiesOfHoles( TopTools_MapOfShape& WireMap, TCo
#else
Standard_Boolean IsLast ;
#endif
Standard_Real MinAngle = PI;
Standard_Real MinAngle = M_PI;
for (MapIt.Initialize( WireMap ); MapIt.More(); MapIt.Next())
{

View File

@@ -215,11 +215,11 @@ myKPart(0)
}
if (GAS1.GetType() == GeomAbs_Sphere) {
if (myIsoU1)
ElCLib::AdjustPeriodic(-PI/2.,PI/2.,
ElCLib::AdjustPeriodic(-M_PI/2.,M_PI/2.,
Precision::PConfusion(),
Umin, Umax);
else
ElCLib::AdjustPeriodic(-PI/2.,PI/2.,
ElCLib::AdjustPeriodic(-M_PI/2.,M_PI/2.,
Precision::PConfusion(),
Vmin, Vmax);
}
@@ -331,11 +331,11 @@ myKPart(0)
}
if (GAS2.GetType() == GeomAbs_Sphere) {
if (myIsoU2)
ElCLib::AdjustPeriodic(-PI/2.,PI/2.,
ElCLib::AdjustPeriodic(-M_PI/2.,M_PI/2.,
Precision::PConfusion(),
Umin, Umax);
else
ElCLib::AdjustPeriodic(-PI/2.,PI/2.,
ElCLib::AdjustPeriodic(-M_PI/2.,M_PI/2.,
Precision::PConfusion(),
Vmin, Vmax);
}
@@ -612,7 +612,7 @@ static gp_Pnt2d ValueOnFace(const Standard_Real U,
Standard_Real Ang = Axis.Angle(D12d);
if ( !TheU.Circle().IsDirect()) Ang = -Ang;
UU = ElCLib::InPeriod( Ang, TheU.FirstParameter(),
TheU.FirstParameter() + 2*PI);
TheU.FirstParameter() + 2*M_PI);
Dist = TheU.Circle().Radius();
}
else {

View File

@@ -1601,7 +1601,7 @@ Standard_Integer CutEdge (const TopoDS_Edge& E,
//if (E.Orientation() == TopAbs_REVERSED) CT2d->Reverse();
if (CT2d->BasisCurve()->IsKind(STANDARD_TYPE(Geom2d_Circle)) &&
( Abs(f-l) >= PI) ) {
( Abs(f-l) >= M_PI) ) {
return 0;
//---------------------------
// Cut closed circle.
@@ -1844,7 +1844,7 @@ void MakeOffset (const TopoDS_Edge& E,
Adaptor3d_OffsetCurve Off(AHC,-anOffset);
Handle(Geom2d_Circle) CC = new Geom2d_Circle(Off.Circle());
Standard_Real Delta = 2*PI - l + f;
Standard_Real Delta = 2*M_PI - l + f;
f -= 0.2*Delta; l += 0.2*Delta;
G2dOC = new Geom2d_TrimmedCurve(CC,f,l);

View File

@@ -842,11 +842,11 @@ static Standard_Boolean Filling(const TopoDS_Shape& EF,
Standard_Boolean ToReverseResult = Standard_False;
gp_Vec d1u;
d1u = Surf->DN(0, (f1+l1)/2, 1, 0);
if (d1u.Angle(TangentOnPart1) > PI/2) { //Invert everything
if (d1u.Angle(TangentOnPart1) > M_PI/2) { //Invert everything
ToReverseResult = Standard_True;
/*
axe.Reverse();
Angle = 2*PI - Angle;
Angle = 2*M_PI - Angle;
Rev = new (Geom_SurfaceOfRevolution) (Prof1, axe);
Surf = new (Geom_RectangularTrimmedSurface)
(Rev, 0, Angle, f1, l1);
@@ -1148,7 +1148,7 @@ static Standard_Boolean Filling(const TopoDS_Shape& EF,
AS->D1(P2d.X(), P2d.Y(), P, D1U, D1V);
N2 = D1U^D1V;
if ( (F1.Orientation() == TopAbs_REVERSED) ^ (N1.Angle(N2)>PI/2) )
if ( (F1.Orientation() == TopAbs_REVERSED) ^ (N1.Angle(N2)>M_PI/2) )
Result.Orientation(TopAbs_REVERSED);
else Result.Orientation(TopAbs_FORWARD);

View File

@@ -2281,8 +2281,8 @@ static Standard_Boolean ChooseSection(const TopoDS_Shape& Comp,
continue;
Standard_Real Angle = aPln.Axis().Angle( bis.Axis() );
if (Angle > PI/2)
Angle = PI - Angle;
if (Angle > M_PI/2)
Angle = M_PI - Angle;
if (Angle < MinAngle)
{
@@ -2341,7 +2341,7 @@ static Standard_Boolean ChoosePlane(const TopoDS_Shape& Comp,
TColgp_Array1OfPnt Origins( 0, NumberOfEdges*2-1 );
TColgp_Array1OfDir Normals( 0, NumberOfEdges*2-1 );
TColStd_Array1OfBoolean IsSingular( 0, NumberOfEdges*2-1 );
Standard_Real MinAngle = PI/2;
Standard_Real MinAngle = M_PI/2;
Standard_Integer MinInd;
for (ind = 0; ind < NumberOfEdges*2; ind++)
{
@@ -2355,8 +2355,8 @@ static Standard_Boolean ChoosePlane(const TopoDS_Shape& Comp,
Origins(ind) = Axe.Location();
Normals(ind) = Axe.Direction();
Standard_Real Angle = bis.Angle( Axe );
if (Angle > PI/2)
Angle = PI - Angle;
if (Angle > M_PI/2)
Angle = M_PI - Angle;
if (Angle < MinAngle)
{
MinAngle = Angle;
@@ -2366,15 +2366,15 @@ static Standard_Boolean ChoosePlane(const TopoDS_Shape& Comp,
}
gp_Ax2 TheAxe( Origins(MinInd), Normals(MinInd) );
Standard_Real MaxAngleWithPln = PI/16;
Standard_Real MaxAngleWithPln = M_PI/16;
TColStd_SequenceOfInteger iseq;
TColgp_SequenceOfPnt Pseq;
for (ind = 0; ind < NumberOfEdges*2; ind++)
if (!IsSingular(ind))
{
Standard_Real Angle = Normals(ind).Angle( TheAxe.Direction() );
if (Angle > PI/2)
Angle = PI - Angle;
if (Angle > M_PI/2)
Angle = M_PI - Angle;
if (Angle <= MaxAngleWithPln)
{
iseq.Append(ind);

View File

@@ -166,7 +166,7 @@ static Standard_Real EvalPhase(const TopoDS_Edge& Edge,
gp_Pnt P = GAS.Value(0., V);
if ( gp_Vec(Axis.Location(), P).Dot(Axis.XDirection()) < 0.)
return PI;
return M_PI;
else
return 0.;
}
@@ -339,7 +339,7 @@ static void EvalParameters(const TopoDS_Edge& Edge,
case GeomAbs_Cone: {
//----------------------------------------------------------
// if myFace1 is not at the same side of the apex as the point
// of parameter 0 0 on the cone => phase = PI.
// of parameter 0 0 on the cone => phase = M_PI.
//----------------------------------------------------------
Axis = GAS.Cone().Position();
Phase = EvalPhase(Edge,Face,GAS,Axis);
@@ -352,7 +352,7 @@ static void EvalParameters(const TopoDS_Edge& Edge,
case GeomAbs_SurfaceOfRevolution: {
//----------------------------------------------------------
// if myFace1 is not at the same side of the apex as the point
// of parameter 0 0 on the cone => phase = PI.
// of parameter 0 0 on the cone => phase = M_PI.
//----------------------------------------------------------
Handle(Geom_SurfaceOfRevolution) GSRev =
Handle(Geom_SurfaceOfRevolution)::DownCast(GS);
@@ -373,7 +373,7 @@ static void EvalParameters(const TopoDS_Edge& Edge,
Standard_Real U = Axis.XDirection().
AngleWithRef(D1,Axis.XDirection()^Axis.YDirection());
U += Phase;
if ( U < 0.) U += 2*PI;
if ( U < 0.) U += 2*M_PI;
P = gp_Pnt(Bis->FirstParameter(), U, 0.);
Seq.Append(P);