1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-21 10:13:43 +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

@ -979,7 +979,7 @@ void AIS::ComputeAngleBetweenCurvilinearFaces( const TopoDS_Face & FirstFac
if (! Xdirection.IsEqual( ToFirstAttach, Precision::Angular() ) && if (! Xdirection.IsEqual( ToFirstAttach, Precision::Angular() ) &&
! Xdirection.IsOpposite( ToFirstAttach, Precision::Angular() ) && ! Xdirection.IsOpposite( ToFirstAttach, Precision::Angular() ) &&
(Xdirection ^ ToFirstAttach) * Cone2->Cone().Axis().Direction() < 0.0e0) (Xdirection ^ ToFirstAttach) * Cone2->Cone().Axis().Direction() < 0.0e0)
SecondU = 2*PI - SecondU ; SecondU = 2*M_PI - SecondU ;
SecondLine = Handle( Geom_Line )::DownCast( Cone2->UIso( SecondU ) ); SecondLine = Handle( Geom_Line )::DownCast( Cone2->UIso( SecondU ) );
@ -1233,18 +1233,18 @@ Standard_Boolean AIS::InDomain(const Standard_Real fpar,
if(lpar > fpar) if(lpar > fpar)
return ((para >= fpar) && (para <= lpar)); return ((para >= fpar) && (para <= lpar));
else { // fpar > lpar else { // fpar > lpar
Standard_Real delta = 2*PI-fpar; Standard_Real delta = 2*M_PI-fpar;
Standard_Real lp, par, fp; Standard_Real lp, par, fp;
lp = lpar + delta; lp = lpar + delta;
par = para + delta; par = para + delta;
while(lp > 2*PI) lp-=2*PI; while(lp > 2*M_PI) lp-=2*M_PI;
while(par > 2*PI) par-=2*PI; while(par > 2*M_PI) par-=2*M_PI;
fp = 0.; fp = 0.;
return ((par >= fp) && (par <= lp)); return ((par >= fp) && (par <= lp));
} }
} }
if (para >= (fpar+2*PI)) return Standard_True; if (para >= (fpar+2*M_PI)) return Standard_True;
if (para <= lpar) return Standard_True; if (para <= lpar) return Standard_True;
return Standard_False; return Standard_False;
} }
@ -1260,37 +1260,37 @@ Standard_Real AIS::DistanceFromApex(const gp_Elips & elips,
{ {
Standard_Real dist; Standard_Real dist;
Standard_Real parApex = ElCLib::Parameter ( elips, Apex ); Standard_Real parApex = ElCLib::Parameter ( elips, Apex );
if(parApex == 0.0 || parApex == PI) if(parApex == 0.0 || parApex == M_PI)
{//Major case {//Major case
if(parApex == 0.0) //pos Apex if(parApex == 0.0) //pos Apex
dist = (par < PI) ? par : (2*PI - par); dist = (par < M_PI) ? par : (2*M_PI - par);
else //neg Apex else //neg Apex
dist = (par < PI) ? ( PI - par) : ( par - PI ); dist = (par < M_PI) ? ( M_PI - par) : ( par - M_PI );
} }
else else
{// Minor case {// Minor case
if(parApex == PI / 2) //pos Apex if(parApex == M_PI / 2) //pos Apex
{ {
if(par <= parApex + PI && par > parApex) // 3/2*PI < par < PI/2 if(par <= parApex + M_PI && par > parApex) // 3/2*M_PI < par < M_PI/2
dist = par - parApex; dist = par - parApex;
else else
{ {
if(par > parApex + PI) // 3/2*PI < par < 2*PI if(par > parApex + M_PI) // 3/2*M_PI < par < 2*M_PI
dist = 2*PI - par + parApex; dist = 2*M_PI - par + parApex;
else else
dist = parApex - par; dist = parApex - par;
} }
} }
else //neg Apex == 3/2*PI else //neg Apex == 3/2*M_PI
{ {
if(par <= parApex && par >= PI/2) // PI/2 < par < 3/2*PI if(par <= parApex && par >= M_PI/2) // M_PI/2 < par < 3/2*M_PI
dist = parApex - par; dist = parApex - par;
else else
{ {
if(par > parApex) // 3/2*PI < par < 2*PI if(par > parApex) // 3/2*M_PI < par < 2*M_PI
dist = par - parApex; dist = par - parApex;
else else
dist = par + PI/2; // 0 < par < PI/2 dist = par + M_PI/2; // 0 < par < M_PI/2
} }
} }
} }

View File

@ -592,7 +592,7 @@ void AIS_AngleDimension::ComputeConeAngle(const Handle(Prs3d_Presentation)& aPre
aCurve = aSurf->VIso(midV); aCurve = aSurf->VIso(midV);
myCircle = Handle(Geom_Circle)::DownCast(aCurve)->Circ(); myCircle = Handle(Geom_Circle)::DownCast(aCurve)->Circ();
myPosition = ElCLib::Value(Standard_PI/2.0, myCircle); myPosition = ElCLib::Value(M_PI / 2.0, myCircle);
myAutomaticPosition = Standard_False; myAutomaticPosition = Standard_False;
} }
else { else {
@ -678,7 +678,7 @@ void AIS_AngleDimension::ComputeTwoCurvilinearFacesAngle(const Handle(Prs3d_Pres
#endif #endif
if (myVal <= Precision::Angular() || Abs( PI-myVal ) <= Precision::Angular()) if (myVal <= Precision::Angular() || Abs( M_PI-myVal ) <= Precision::Angular())
DsgPrs_AnglePresentation::Add(aPresentation, DsgPrs_AnglePresentation::Add(aPresentation,
myDrawer, myDrawer,
myVal, myVal,
@ -931,7 +931,7 @@ void AIS_AngleDimension::ComputeTwoEdgesNotNullAngle(const Handle(Prs3d_Presenta
Standard_Boolean In1(Standard_False); Standard_Boolean In1(Standard_False);
Standard_Boolean In2(Standard_False); Standard_Boolean In2(Standard_False);
if ( !(Abs(d1.Angle(d2) - Abs(myVal)) <= Precision::Confusion()) if ( !(Abs(d1.Angle(d2) - Abs(myVal)) <= Precision::Confusion())
&& (Abs(myVal) < PI) ) { && (Abs(myVal) < M_PI) ) {
Standard_Real parcent1 = ElCLib::Parameter(l1->Lin(), myCenter); Standard_Real parcent1 = ElCLib::Parameter(l1->Lin(), myCenter);
Standard_Real par11 = ElCLib::Parameter(l1->Lin(), ptat11); Standard_Real par11 = ElCLib::Parameter(l1->Lin(), ptat11);
Standard_Real par12 = ElCLib::Parameter(l1->Lin(), ptat12); Standard_Real par12 = ElCLib::Parameter(l1->Lin(), ptat12);
@ -961,7 +961,7 @@ void AIS_AngleDimension::ComputeTwoEdgesNotNullAngle(const Handle(Prs3d_Presenta
gp_Lin gpl2 = l2->Lin(); gp_Lin gpl2 = l2->Lin();
theaxis = gp_Lin(myCenter,myFDir^mySDir); theaxis = gp_Lin(myCenter,myFDir^mySDir);
if (myVal > PI) { if (myVal > M_PI) {
theaxis.Reverse(); theaxis.Reverse();
} }
@ -1022,7 +1022,7 @@ void AIS_AngleDimension::ComputeTwoEdgesNotNullAngle(const Handle(Prs3d_Presenta
mySAttach = ElCLib::Value(par_p2_attach,gpl2); mySAttach = ElCLib::Value(par_p2_attach,gpl2);
} }
} }
if ( myVal < PI) curpos.SetXYZ(.5*(myFAttach.XYZ()+mySAttach.XYZ())); if ( myVal < M_PI) curpos.SetXYZ(.5*(myFAttach.XYZ()+mySAttach.XYZ()));
else { else {
curpos.SetXYZ(.5*(myFAttach.XYZ()+mySAttach.XYZ())); curpos.SetXYZ(.5*(myFAttach.XYZ()+mySAttach.XYZ()));
gp_Vec transl(curpos, myCenter); gp_Vec transl(curpos, myCenter);
@ -1074,9 +1074,9 @@ void AIS_AngleDimension::ComputeTwoEdgesNotNullAngle(const Handle(Prs3d_Presenta
Standard_Real udeb = uc1; Standard_Real udeb = uc1;
Standard_Real ufin = uc2; Standard_Real ufin = uc2;
if (uco > ufin) { if (uco > ufin) {
if (Abs(myVal)<PI) { if (Abs(myVal)<M_PI) {
// test if uco is in the opposite sector // test if uco is in the opposite sector
if (uco > udeb+PI && uco < ufin+PI){ if (uco > udeb+M_PI && uco < ufin+M_PI){
dist = -dist; dist = -dist;
} }
} }
@ -1493,7 +1493,7 @@ void AIS_AngleDimension::Compute3DSelection( const Handle( SelectMgr_Selection )
Standard_Real FirstParAngleCirc, LastParAngleCirc, FirstParAttachCirc, LastParAttachCirc; Standard_Real FirstParAngleCirc, LastParAngleCirc, FirstParAttachCirc, LastParAttachCirc;
gp_Pnt EndOfArrow1, EndOfArrow2, ProjAttachPoint2; gp_Pnt EndOfArrow1, EndOfArrow2, ProjAttachPoint2;
gp_Dir DirOfArrow1, DirOfArrow2; gp_Dir DirOfArrow1, DirOfArrow2;
gp_Dir axisdir = (myVal <= Precision::Angular() || Abs( PI-myVal ) <= Precision::Angular())? gp_Dir axisdir = (myVal <= Precision::Angular() || Abs( M_PI-myVal ) <= Precision::Angular())?
myPlane->Pln().Axis().Direction() : (myFDir ^ mySDir); myPlane->Pln().Axis().Direction() : (myFDir ^ mySDir);
Standard_Boolean isPlane = (myFirstSurfType == AIS_KOS_Plane)? Standard_True : Standard_False; Standard_Boolean isPlane = (myFirstSurfType == AIS_KOS_Plane)? Standard_True : Standard_False;
@ -1527,7 +1527,7 @@ void AIS_AngleDimension::Compute3DSelection( const Handle( SelectMgr_Selection )
Handle( Select3D_SensitiveCurve ) SensCurve; Handle( Select3D_SensitiveCurve ) SensCurve;
// Angle's arc or line // Angle's arc or line
if (myVal > Precision::Angular() && Abs( PI-myVal ) > Precision::Angular()) if (myVal > Precision::Angular() && Abs( M_PI-myVal ) > Precision::Angular())
{ {
curve = new Geom_TrimmedCurve( new Geom_Circle( AngleCirc ), FirstParAngleCirc, LastParAngleCirc ); curve = new Geom_TrimmedCurve( new Geom_Circle( AngleCirc ), FirstParAngleCirc, LastParAngleCirc );
SensCurve = new Select3D_SensitiveCurve( own, curve ); SensCurve = new Select3D_SensitiveCurve( own, curve );
@ -1611,12 +1611,12 @@ void AIS_AngleDimension::Compute2DSelection(const Handle(SelectMgr_Selection)& a
gp_Lin l2(cu2.Line()); gp_Lin l2(cu2.Line());
// it is patch! // it is patch!
if (Abs( myVal ) <= Precision::Angular() || Abs( PI - myVal ) <= Precision::Angular()) if (Abs( myVal ) <= Precision::Angular() || Abs( M_PI - myVal ) <= Precision::Angular())
/* /*
//--------------------------------------------------------- //---------------------------------------------------------
// Cas de droites paralleles ( <=> angle nul a PI pres) // Cas de droites paralleles ( <=> angle nul a M_PI pres)
if ((Abs(l1.Angle(l2)) < Precision::Angular()) || if ((Abs(l1.Angle(l2)) < Precision::Angular()) ||
(Abs((l1.Angle(l2) - PI)) < Precision::Angular()) ) (Abs((l1.Angle(l2) - M_PI)) < Precision::Angular()) )
*/ */
{ {
@ -1677,19 +1677,19 @@ void AIS_AngleDimension::Compute2DSelection(const Handle(SelectMgr_Selection)& a
Standard_Real ufin = uc2; Standard_Real ufin = uc2;
if (uco > ufin) { if (uco > ufin) {
if (Abs(myVal)<PI) { if (Abs(myVal)<M_PI) {
// test if uco is in the opposing sector // test if uco is in the opposing sector
if (uco > udeb+PI && uco < ufin+PI){ if (uco > udeb+M_PI && uco < ufin+M_PI){
udeb = udeb + PI; udeb = udeb + M_PI;
ufin = ufin + PI; ufin = ufin + M_PI;
uc1 = udeb; uc1 = udeb;
uc2 = ufin; uc2 = ufin;
} }
} }
} }
if (uco > ufin) { if (uco > ufin) {
if ((uco-uc2) < (uc1-uco+(2*PI))) ufin = uco; if ((uco-uc2) < (uc1-uco+(2*M_PI))) ufin = uco;
else udeb = uco - 2*PI; else udeb = uco - 2*M_PI;
} }
p1 = ElCLib::Value(udeb,cer); p1 = ElCLib::Value(udeb,cer);
p2 = ElCLib::Value(ufin,cer); p2 = ElCLib::Value(ufin,cer);
@ -1770,11 +1770,11 @@ void AIS_AngleDimension::ComputeNull2DSelection(
Standard_Real ufin = uc2; Standard_Real ufin = uc2;
if (uco > ufin) { if (uco > ufin) {
if (Abs(myVal)<PI) { if (Abs(myVal)<M_PI) {
// test if uco is in the opposing sector // test if uco is in the opposing sector
if (uco > udeb+PI && uco < ufin+PI){ if (uco > udeb+M_PI && uco < ufin+M_PI){
udeb = udeb + PI; udeb = udeb + M_PI;
ufin = ufin + PI; ufin = ufin + M_PI;
uc1 = udeb; uc1 = udeb;
uc2 = ufin; uc2 = ufin;
} }
@ -1782,11 +1782,11 @@ void AIS_AngleDimension::ComputeNull2DSelection(
} }
if (uco > ufin) { if (uco > ufin) {
if ((uco-uc2) < (uc1-uco+(2*PI))) { if ((uco-uc2) < (uc1-uco+(2*M_PI))) {
ufin = uco; ufin = uco;
} }
else { else {
udeb = uco - 2*PI; udeb = uco - 2*M_PI;
} }
} }
@ -1929,7 +1929,7 @@ void AIS_AngleDimension::ComputeConeAngleSelection(const Handle(SelectMgr_Select
aCurve = aSurf->VIso(midV); aCurve = aSurf->VIso(midV);
myCircle = Handle(Geom_Circle)::DownCast(aCurve)->Circ(); myCircle = Handle(Geom_Circle)::DownCast(aCurve)->Circ();
myPosition = ElCLib::Value(Standard_PI / 2.0, myCircle); myPosition = ElCLib::Value(M_PI / 2.0, myCircle);
myAutomaticPosition = Standard_False; myAutomaticPosition = Standard_False;
} }
else { else {
@ -1966,7 +1966,7 @@ void AIS_AngleDimension::ComputeConeAngleSelection(const Handle(SelectMgr_Select
aPnt = Apex; aPnt = Apex;
gp_Pnt P1 = ElCLib::Value(0., myCircle); gp_Pnt P1 = ElCLib::Value(0., myCircle);
gp_Pnt P2 = ElCLib::Value(Standard_PI, myCircle); gp_Pnt P2 = ElCLib::Value(M_PI, myCircle);
gce_MakePln mkPln(P1, P2, aPnt); // create a plane whitch defines plane for projection aPosition on it gce_MakePln mkPln(P1, P2, aPnt); // create a plane whitch defines plane for projection aPosition on it
@ -1994,8 +1994,8 @@ void AIS_AngleDimension::ComputeConeAngleSelection(const Handle(SelectMgr_Select
Standard_Real AttParam = ElCLib::Parameter(aCircle2, AttachmentPnt); Standard_Real AttParam = ElCLib::Parameter(aCircle2, AttachmentPnt);
Standard_Real OppParam = ElCLib::Parameter(aCircle2, OppositePnt); Standard_Real OppParam = ElCLib::Parameter(aCircle2, OppositePnt);
while ( AttParam >= 2*Standard_PI ) AttParam -= 2*Standard_PI; while ( AttParam >= 2 * M_PI ) AttParam -= 2 * M_PI;
while ( OppParam >= 2*Standard_PI ) OppParam -= 2*Standard_PI; while ( OppParam >= 2 * M_PI ) OppParam -= 2 * M_PI;
if( myPosition.Distance( myCircle.Location() ) <= myCircle.Radius() ) if( myPosition.Distance( myCircle.Location() ) <= myCircle.Radius() )
if( 2 * myCircle.Radius() > aCircle2.Radius() * 0.4 ) IsArrowOut = Standard_False; //four times more than an arrow size if( 2 * myCircle.Radius() > aCircle2.Radius() * 0.4 ) IsArrowOut = Standard_False; //four times more than an arrow size
@ -2006,10 +2006,10 @@ void AIS_AngleDimension::ComputeConeAngleSelection(const Handle(SelectMgr_Select
param = ElCLib::Parameter(aCircle2, tmpPnt); param = ElCLib::Parameter(aCircle2, tmpPnt);
if(IsArrowOut) { if(IsArrowOut) {
angle = OppParam - AttParam + Standard_PI/6; //An angle between AttParam and OppParam + 30 degrees angle = OppParam - AttParam + M_PI / 6; //An angle between AttParam and OppParam + 30 degrees
param = AttParam - Standard_PI/12; //out parts of dimension line are 15 degrees param = AttParam - M_PI / 12; //out parts of dimension line are 15 degrees
while ( angle > 2*Standard_PI ) angle -= 2*Standard_PI; while ( angle > 2 * M_PI ) angle -= 2 * M_PI;
for( i = 0; i <= 11; i++ ) { //calculating of arc for( i = 0; i <= 11; i++ ) { //calculating of arc
aPnt = ElCLib::Value(param + angle/11 * i, aCircle2); aPnt = ElCLib::Value(param + angle/11 * i, aCircle2);
aPnt.Coord(X, Y, Z); aPnt.Coord(X, Y, Z);
@ -2020,7 +2020,7 @@ void AIS_AngleDimension::ComputeConeAngleSelection(const Handle(SelectMgr_Select
else { else {
angle = OppParam - AttParam; angle = OppParam - AttParam;
param = AttParam; param = AttParam;
while ( angle > 2*Standard_PI ) angle -= 2*Standard_PI; while ( angle > 2 * M_PI ) angle -= 2 * M_PI;
for( i = 0; i <= 11; i++ ) { //calculating of arc for( i = 0; i <= 11; i++ ) { //calculating of arc
aPnt = ElCLib::Value(param + angle/11 * i, aCircle2); aPnt = ElCLib::Value(param + angle/11 * i, aCircle2);
aPnt.Coord(X, Y, Z); aPnt.Coord(X, Y, Z);

View File

@ -34,7 +34,7 @@ AIS_Circle::AIS_Circle(const Handle(Geom_Circle)& aComponent):
AIS_InteractiveObject(PrsMgr_TOP_AllView), AIS_InteractiveObject(PrsMgr_TOP_AllView),
myComponent(aComponent), myComponent(aComponent),
myUStart(0.), myUStart(0.),
myUEnd(2*PI), myUEnd(2*M_PI),
myCircleIsArc(Standard_False) myCircleIsArc(Standard_False)
{ {
} }

View File

@ -266,8 +266,8 @@ void AIS_ConcentricRelation::ComputeSelection(const Handle(SelectMgr_Selection)&
aSelection->Add(seg); aSelection->Add(seg);
gp_Ax1 RotateAxis(myCenter, myDir); gp_Ax1 RotateAxis(myCenter, myDir);
gp_Pnt FPnt = myCenter.Rotated(RotateAxis, PI/2); gp_Pnt FPnt = myCenter.Rotated(RotateAxis, M_PI/2);
gp_Pnt SPnt = myCenter.Rotated(RotateAxis, -PI/2); gp_Pnt SPnt = myCenter.Rotated(RotateAxis, -M_PI/2);
seg = new Select3D_SensitiveSegment(own, seg = new Select3D_SensitiveSegment(own,
FPnt, FPnt,
SPnt); SPnt);

View File

@ -242,17 +242,17 @@ void AIS_DiameterDimension::ComputeArcSelection(const Handle(SelectMgr_Selection
Handle(SelectMgr_EntityOwner) own = new SelectMgr_EntityOwner(this,7); Handle(SelectMgr_EntityOwner) own = new SelectMgr_EntityOwner(this,7);
gp_Pnt theCenter = myCircle.Location(); gp_Pnt theCenter = myCircle.Location();
while (lpara > 2*PI) { while (lpara > 2*M_PI) {
fpara -= 2*PI; fpara -= 2*M_PI;
lpara -= 2*PI; lpara -= 2*M_PI;
} }
Standard_Real parat = ElCLib::Parameter(myCircle,myPosition); Standard_Real parat = ElCLib::Parameter(myCircle,myPosition);
Standard_Boolean otherside(Standard_False); Standard_Boolean otherside(Standard_False);
gp_Pnt attpoint = myPosition; gp_Pnt attpoint = myPosition;
if (!AIS::InDomain(fpara,lpara,parat)) { if (!AIS::InDomain(fpara,lpara,parat)) {
Standard_Real otherpar = parat + PI; Standard_Real otherpar = parat + M_PI;
if (otherpar > 2*PI) otherpar -= 2*PI; if (otherpar > 2*M_PI) otherpar -= 2*M_PI;
if (AIS::InDomain(fpara,lpara,otherpar)) { if (AIS::InDomain(fpara,lpara,otherpar)) {
parat = otherpar; parat = otherpar;
otherside = Standard_True; otherside = Standard_True;
@ -530,7 +530,7 @@ void AIS_DiameterDimension::ComputeArcDiameter(
myFirstPar = parfirst; myFirstPar = parfirst;
myLastPar = parend; myLastPar = parend;
if ( parfirst > parend) { if ( parfirst > parend) {
parfirst -= 2*PI; parfirst -= 2*M_PI;
} }
if (myAutomaticPosition) { if (myAutomaticPosition) {
Standard_Real pcurpos = (parfirst + parend)/2.; Standard_Real pcurpos = (parfirst + parend)/2.;
@ -667,7 +667,7 @@ void AIS_DiameterDimension::ComputeOnePlanarFaceDiameter(const Handle(Prs3d_Pres
parfirst = ElCLib::Parameter(myCircle, ptfirst); parfirst = ElCLib::Parameter(myCircle, ptfirst);
parend = ElCLib::Parameter(myCircle, ptend); parend = ElCLib::Parameter(myCircle, ptend);
if ( parfirst > parend) { if ( parfirst > parend) {
parfirst -= 2*PI; parfirst -= 2*M_PI;
} }
Standard_Real parcurPos = (parfirst + parend) * 0.5; Standard_Real parcurPos = (parfirst + parend) * 0.5;
curPos = ElCLib::Value(parcurPos, myCircle); curPos = ElCLib::Value(parcurPos, myCircle);

View File

@ -79,10 +79,10 @@ void AIS_EllipseRadiusDimension::ComputeGeometry()
default: default:
break; break;
} }
while (myFirstPar > 2*PI) myFirstPar -= 2*PI; while (myFirstPar > 2*M_PI) myFirstPar -= 2*M_PI;
while (myLastPar > 2*PI) myLastPar -= 2*PI; while (myLastPar > 2*M_PI) myLastPar -= 2*M_PI;
while (myFirstPar < 0.0) myFirstPar += 2*PI; while (myFirstPar < 0.0) myFirstPar += 2*M_PI;
while (myLastPar < 0.0) myLastPar += 2*PI; while (myLastPar < 0.0) myLastPar += 2*M_PI;
} }
//======================================================================= //=======================================================================

View File

@ -278,7 +278,7 @@ void AIS_EqualDistanceRelation::ComputeSelection( const Handle( SelectMgr_Select
Handle(Geom_Circle) aCircle = Handle(Geom_Circle)::DownCast(aCurve.Curve().Curve()); Handle(Geom_Circle) aCircle = Handle(Geom_Circle)::DownCast(aCurve.Curve().Curve());
Standard_Real FirstPar = ElCLib::Parameter(aCircle->Circ(), myAttachPoint1), Standard_Real FirstPar = ElCLib::Parameter(aCircle->Circ(), myAttachPoint1),
LastPar = ElCLib::Parameter(aCircle->Circ(), myPoint1); LastPar = ElCLib::Parameter(aCircle->Circ(), myPoint1);
if (LastPar < FirstPar ) LastPar+=PI*2; if (LastPar < FirstPar ) LastPar+=M_PI*2;
//add sensetive arc //add sensetive arc
Handle(Select3D_SensitiveCircle) circ = Handle(Select3D_SensitiveCircle) circ =
new Select3D_SensitiveCircle( own, aCircle, FirstPar, LastPar); new Select3D_SensitiveCircle( own, aCircle, FirstPar, LastPar);
@ -301,7 +301,7 @@ void AIS_EqualDistanceRelation::ComputeSelection( const Handle( SelectMgr_Select
Handle(Geom_Circle) aCircle = Handle(Geom_Circle)::DownCast(aCurve.Curve().Curve()); Handle(Geom_Circle) aCircle = Handle(Geom_Circle)::DownCast(aCurve.Curve().Curve());
Standard_Real FirstPar = ElCLib::Parameter(aCircle->Circ(), myAttachPoint2), Standard_Real FirstPar = ElCLib::Parameter(aCircle->Circ(), myAttachPoint2),
LastPar = ElCLib::Parameter(aCircle->Circ(), myPoint2); LastPar = ElCLib::Parameter(aCircle->Circ(), myPoint2);
if (LastPar < FirstPar ) LastPar+=PI*2; if (LastPar < FirstPar ) LastPar+=M_PI*2;
//add sensetive arc //add sensetive arc
Handle(Select3D_SensitiveCircle) circ = Handle(Select3D_SensitiveCircle) circ =
new Select3D_SensitiveCircle( own,aCircle, FirstPar, LastPar); new Select3D_SensitiveCircle( own,aCircle, FirstPar, LastPar);
@ -324,7 +324,7 @@ void AIS_EqualDistanceRelation::ComputeSelection( const Handle( SelectMgr_Select
Handle(Geom_Circle) aCircle = Handle(Geom_Circle)::DownCast(aCurve.Curve().Curve()); Handle(Geom_Circle) aCircle = Handle(Geom_Circle)::DownCast(aCurve.Curve().Curve());
Standard_Real FirstPar = ElCLib::Parameter(aCircle->Circ(), myAttachPoint3), Standard_Real FirstPar = ElCLib::Parameter(aCircle->Circ(), myAttachPoint3),
LastPar = ElCLib::Parameter(aCircle->Circ(), myPoint3); LastPar = ElCLib::Parameter(aCircle->Circ(), myPoint3);
if (LastPar < FirstPar ) LastPar+=PI*2; if (LastPar < FirstPar ) LastPar+=M_PI*2;
Handle(Select3D_SensitiveCircle) circ = Handle(Select3D_SensitiveCircle) circ =
new Select3D_SensitiveCircle( own, aCircle, FirstPar, LastPar); new Select3D_SensitiveCircle( own, aCircle, FirstPar, LastPar);
aSelection->Add( circ ); aSelection->Add( circ );
@ -350,7 +350,7 @@ void AIS_EqualDistanceRelation::ComputeSelection( const Handle( SelectMgr_Select
Handle(Geom_Circle) aCircle = Handle(Geom_Circle)::DownCast(aCurve.Curve().Curve()); Handle(Geom_Circle) aCircle = Handle(Geom_Circle)::DownCast(aCurve.Curve().Curve());
Standard_Real FirstPar = ElCLib::Parameter(aCircle->Circ(), myAttachPoint4), Standard_Real FirstPar = ElCLib::Parameter(aCircle->Circ(), myAttachPoint4),
LastPar = ElCLib::Parameter(aCircle->Circ(), myPoint4); LastPar = ElCLib::Parameter(aCircle->Circ(), myPoint4);
if (LastPar < FirstPar ) LastPar+=PI*2; if (LastPar < FirstPar ) LastPar+=M_PI*2;
//add sensetive arc //add sensetive arc
Handle(Select3D_SensitiveCircle) circ = Handle(Select3D_SensitiveCircle) circ =
new Select3D_SensitiveCircle( own,aCircle, FirstPar, LastPar); new Select3D_SensitiveCircle( own,aCircle, FirstPar, LastPar);
@ -530,18 +530,18 @@ void AIS_EqualDistanceRelation::ComputeTwoEdgesLength( const Handle( Prs3d_Prese
if (PrPnt12.Distance(PrCenter) >Precision::Confusion()) if (PrPnt12.Distance(PrCenter) >Precision::Confusion())
{ {
gp_Dir aDir1(PrPnt12.XYZ() - PrCenter.XYZ()); gp_Dir aDir1(PrPnt12.XYZ() - PrCenter.XYZ());
Standard_Real anAngle = aDir1.Angle(XDir); //Get the angle in range [0, PI] Standard_Real anAngle = aDir1.Angle(XDir); //Get the angle in range [0, M_PI]
if (aDir1.Dot(YDir) < 0) if (aDir1.Dot(YDir) < 0)
anAngle = 2*Standard_PI - anAngle; anAngle = 2 * M_PI - anAngle;
par1 = anAngle; par1 = anAngle;
} }
if (PrPnt22.Distance(PrCenter) >Precision::Confusion()) if (PrPnt22.Distance(PrCenter) >Precision::Confusion())
{ {
gp_Dir aDir2(PrPnt22.XYZ() - PrCenter.XYZ()); gp_Dir aDir2(PrPnt22.XYZ() - PrCenter.XYZ());
Standard_Real anAngle = aDir2.Angle(XDir); //Get the angle in range [0, PI] Standard_Real anAngle = aDir2.Angle(XDir); //Get the angle in range [0, M_PI]
if (aDir2.Dot(YDir) < 0) if (aDir2.Dot(YDir) < 0)
anAngle = 2*Standard_PI - anAngle; anAngle = 2 * M_PI - anAngle;
par2 = anAngle; par2 = anAngle;
} }
@ -627,7 +627,7 @@ void AIS_EqualDistanceRelation::ComputeTwoVerticesLength( const Handle( Prs3d_Pr
else { else {
if (!samePoint) { if (!samePoint) {
DirAttach.SetXYZ(SecondAttach.XYZ() - FirstAttach.XYZ()); DirAttach.SetXYZ(SecondAttach.XYZ() - FirstAttach.XYZ());
DirAttach.Rotate(Plane->Pln().Axis(),PI/2.); DirAttach.Rotate(Plane->Pln().Axis(),M_PI/2.);
} }
} }

View File

@ -84,8 +84,8 @@ void AIS_EqualRadiusRelation::Compute( const Handle( PrsMgr_PresentationManager3
} }
else { else {
Standard_Real aPar = ElCLib::Parameter(FirstCirc, myFirstPoint); Standard_Real aPar = ElCLib::Parameter(FirstCirc, myFirstPoint);
if (IntegerPart(0.5*LastPar1/PI) != 0 && aPar < FirstPar1 ) if (IntegerPart(0.5*LastPar1/M_PI) != 0 && aPar < FirstPar1 )
aPar +=2*PI*IntegerPart(0.5*LastPar1/PI); aPar +=2*M_PI*IntegerPart(0.5*LastPar1/M_PI);
Standard_Real aRadius = FirstCirc.Radius(); Standard_Real aRadius = FirstCirc.Radius();
if (Abs(myFirstPoint.Distance(myFirstCenter) - aRadius) >= Precision::Confusion()) if (Abs(myFirstPoint.Distance(myFirstCenter) - aRadius) >= Precision::Confusion())
@ -104,8 +104,8 @@ void AIS_EqualRadiusRelation::Compute( const Handle( PrsMgr_PresentationManager3
aPar = ElCLib::Parameter(SecondCirc, mySecondPoint); aPar = ElCLib::Parameter(SecondCirc, mySecondPoint);
if (IntegerPart(0.5*LastPar2/PI) != 0 && aPar < FirstPar2 ) if (IntegerPart(0.5*LastPar2/M_PI) != 0 && aPar < FirstPar2 )
aPar +=2*PI*IntegerPart(0.5*LastPar2/PI); aPar +=2*M_PI*IntegerPart(0.5*LastPar2/M_PI);
aRadius = SecondCirc.Radius(); aRadius = SecondCirc.Radius();
if (Abs(mySecondPoint.Distance(mySecondCenter) - aRadius) >= Precision::Confusion()) if (Abs(mySecondPoint.Distance(mySecondCenter) - aRadius) >= Precision::Confusion())

View File

@ -61,7 +61,7 @@ static Standard_Boolean InDomain(const Standard_Real fpar,
if (fpar >= 0.) { if (fpar >= 0.) {
return ((para >= fpar) && (para <= lpar)); return ((para >= fpar) && (para <= lpar));
} }
if (para >= (fpar+2*PI)) return Standard_True; if (para >= (fpar+2*M_PI)) return Standard_True;
if (para <= lpar) return Standard_True; if (para <= lpar) return Standard_True;
return Standard_False; return Standard_False;
} }
@ -270,7 +270,7 @@ void AIS_FixRelation::ComputeSelection(const Handle(SelectMgr_Selection)& aSelec
dirac.Normalize(); dirac.Normalize();
gp_Vec norac = dirac.Crossed(gp_Vec(norm)); gp_Vec norac = dirac.Crossed(gp_Vec(norm));
gp_Ax1 ax(myPosition, norm); gp_Ax1 ax(myPosition, norm);
norac.Rotate(ax, PI/8); norac.Rotate(ax, M_PI/8);
norac*=(myArrowSize/2); norac*=(myArrowSize/2);
gp_Pnt P1 = myPosition.Translated(norac); gp_Pnt P1 = myPosition.Translated(norac);
@ -414,7 +414,7 @@ gp_Pnt AIS_FixRelation::ComputePosition(const Handle(Geom_Curve)& curv,
gp_Vec transvec = vec*myArrowSize; gp_Vec transvec = vec*myArrowSize;
curpos = myPntAttach.Translated(transvec); curpos = myPntAttach.Translated(transvec);
gp_Ax1 RotAx( myPntAttach, NormPln); gp_Ax1 RotAx( myPntAttach, NormPln);
curpos.Rotate(RotAx, PI/10); curpos.Rotate(RotAx, M_PI/10);
} }
return curpos; return curpos;
@ -526,10 +526,10 @@ void AIS_FixRelation::ComputeCirclePosition(
Standard_Real& plast) Standard_Real& plast)
{ {
// readjust parametres on the circle // readjust parametres on the circle
if (plast > 2*PI ) { if (plast > 2*M_PI ) {
Standard_Real nbtours = Floor(plast / (2*PI)); Standard_Real nbtours = Floor(plast / (2*M_PI));
plast -= nbtours*2*PI; plast -= nbtours*2*M_PI;
pfirst -= nbtours*2*PI; pfirst -= nbtours*2*M_PI;
} }
if (myAutomaticPosition) { if (myAutomaticPosition) {
@ -539,8 +539,8 @@ void AIS_FixRelation::ComputeCirclePosition(
Standard_Real circparam = (pfirst + plast)/2.; Standard_Real circparam = (pfirst + plast)/2.;
if ( !InDomain(pfirst,plast,circparam)) { if ( !InDomain(pfirst,plast,circparam)) {
Standard_Real otherpar = circparam + PI; Standard_Real otherpar = circparam + M_PI;
if (otherpar > 2*PI) otherpar -= 2*PI; if (otherpar > 2*M_PI) otherpar -= 2*M_PI;
circparam = otherpar; circparam = otherpar;
} }
@ -563,8 +563,8 @@ void AIS_FixRelation::ComputeCirclePosition(
Standard_Real circparam = ElCLib::Parameter(gcirc, pos); Standard_Real circparam = ElCLib::Parameter(gcirc, pos);
if ( !InDomain(pfirst,plast,circparam)) { if ( !InDomain(pfirst,plast,circparam)) {
Standard_Real otherpar = circparam + PI; Standard_Real otherpar = circparam + M_PI;
if (otherpar > 2*PI) otherpar -= 2*PI; if (otherpar > 2*M_PI) otherpar -= 2*M_PI;
circparam = otherpar; circparam = otherpar;
} }

View File

@ -58,8 +58,8 @@
static Standard_Real Modulo2PI(const Standard_Real ANGLE) static Standard_Real Modulo2PI(const Standard_Real ANGLE)
{ {
if ( ANGLE < 0 ) return Modulo2PI(ANGLE + 2*PI); if ( ANGLE < 0 ) return Modulo2PI(ANGLE + 2*M_PI);
else if ( ANGLE >= 2*PI ) return Modulo2PI(ANGLE - 2*PI); else if ( ANGLE >= 2*M_PI ) return Modulo2PI(ANGLE - 2*M_PI);
return ANGLE; return ANGLE;
} }
@ -68,7 +68,7 @@ static Standard_Boolean IsEqual2PI(const Standard_Real angle1,
{ {
Standard_Real diff = Abs(angle1-angle2); Standard_Real diff = Abs(angle1-angle2);
if ( diff < precision ) return Standard_True; if ( diff < precision ) return Standard_True;
else if ( Abs(diff-2*PI) < precision ) return Standard_True; else if ( Abs(diff-2*M_PI) < precision ) return Standard_True;
return Standard_False; return Standard_False;
} }
// jfa 15/10/2000 end // jfa 15/10/2000 end
@ -187,18 +187,18 @@ static Standard_Boolean ComputeAttach(const gp_Circ& thecirc,
Standard_Real deltap = pSAttachM - pFAttach; Standard_Real deltap = pSAttachM - pFAttach;
if ( deltap < 0 ) if ( deltap < 0 )
{ {
deltap += 2*Standard_PI; deltap += 2 * M_PI;
pSAttachM += 2*Standard_PI; pSAttachM += 2 * M_PI;
} }
pSAttachM -= pFAttach; pSAttachM -= pFAttach;
Standard_Real pmiddleout = pSAttachM/2.0 + Standard_PI; Standard_Real pmiddleout = pSAttachM/2.0 + M_PI;
Standard_Real pcurpos1 = pcurpos; Standard_Real pcurpos1 = pcurpos;
// define where curpos lays // define where curpos lays
if ( pcurpos1 < pFAttach ) if ( pcurpos1 < pFAttach )
{ {
pcurpos1 = pcurpos1 + 2*Standard_PI - pFAttach; pcurpos1 = pcurpos1 + 2 * M_PI - pFAttach;
if ( pcurpos1 > pSAttachM ) // out if ( pcurpos1 > pSAttachM ) // out
{ {
if ( pcurpos1 > pmiddleout ) pcurpos = pFAttach; if ( pcurpos1 > pmiddleout ) pcurpos = pFAttach;
@ -255,18 +255,18 @@ static Standard_Boolean ComputeAttach(const gp_Elips& theEll,
Standard_Real deltap = pSAttachM - pFAttach; Standard_Real deltap = pSAttachM - pFAttach;
if ( deltap < 0 ) if ( deltap < 0 )
{ {
deltap += 2*Standard_PI; deltap += 2 * M_PI;
pSAttachM += 2*Standard_PI; pSAttachM += 2 * M_PI;
} }
pSAttachM -= pFAttach; pSAttachM -= pFAttach;
Standard_Real pmiddleout = pSAttachM/2.0 + Standard_PI; Standard_Real pmiddleout = pSAttachM/2.0 + M_PI;
Standard_Real pcurpos1 = pcurpos; Standard_Real pcurpos1 = pcurpos;
// define where curpos lays // define where curpos lays
if ( pcurpos1 < pFAttach ) if ( pcurpos1 < pFAttach )
{ {
pcurpos1 = pcurpos1 + 2*Standard_PI - pFAttach; pcurpos1 = pcurpos1 + 2 * M_PI - pFAttach;
if ( pcurpos1 > pSAttachM ) // out if ( pcurpos1 > pSAttachM ) // out
{ {
if ( pcurpos1 > pmiddleout ) pcurpos = pFAttach; if ( pcurpos1 > pmiddleout ) pcurpos = pFAttach;
@ -746,7 +746,7 @@ void AIS_IdenticRelation::ComputeTwoCirclesPresentation(const Handle(Prs3d_Prese
myCenter = thecirc->Location(); myCenter = thecirc->Location();
Standard_Real aSegSize = thecirc->Radius()/5.0; Standard_Real aSegSize = thecirc->Radius()/5.0;
Standard_Real rad = Standard_PI/5.0; Standard_Real rad = M_PI / 5.0;
// I. Case of 2 complete circles // I. Case of 2 complete circles
if ( circ1complete && circ2complete ) if ( circ1complete && circ2complete )
@ -984,7 +984,7 @@ void AIS_IdenticRelation::ComputeAutoArcPresentation(const Handle(Geom_Circle)&
const Standard_Boolean isstatic) const Standard_Boolean isstatic)
{ {
Standard_Real aSegSize = thecirc->Radius()/5.0; Standard_Real aSegSize = thecirc->Radius()/5.0;
Standard_Real rad = Standard_PI/5.0; Standard_Real rad = M_PI / 5.0;
Standard_Real pFA = ElCLib::Parameter(thecirc->Circ(),firstp); Standard_Real pFA = ElCLib::Parameter(thecirc->Circ(),firstp);
Standard_Real pSA = ElCLib::Parameter(thecirc->Circ(),lastp); Standard_Real pSA = ElCLib::Parameter(thecirc->Circ(),lastp);
@ -1027,7 +1027,7 @@ void AIS_IdenticRelation::ComputeNotAutoCircPresentation(const Handle(Geom_Circl
curpos.Translate(vprec*1e-5); curpos.Translate(vprec*1e-5);
} }
Standard_Real rad = Standard_PI/5.0; Standard_Real rad = M_PI / 5.0;
Standard_Real pcurpos = ElCLib::Parameter(cirNotAuto->Circ(),curpos); Standard_Real pcurpos = ElCLib::Parameter(cirNotAuto->Circ(),curpos);
Standard_Real pFAttach = pcurpos - rad; Standard_Real pFAttach = pcurpos - rad;
Standard_Real pSAttach = pcurpos + rad; Standard_Real pSAttach = pcurpos + rad;
@ -1055,7 +1055,7 @@ void AIS_IdenticRelation::ComputeNotAutoArcPresentation(const Handle(Geom_Circle
Standard_Real pSPnt = ElCLib::Parameter(cirNotAuto, pntlast); Standard_Real pSPnt = ElCLib::Parameter(cirNotAuto, pntlast);
Standard_Real deltap = Modulo2PI(pSPnt - pFPnt)/2.0; Standard_Real deltap = Modulo2PI(pSPnt - pFPnt)/2.0;
Standard_Real rad = Standard_PI/5; Standard_Real rad = M_PI / 5;
if ( deltap < rad ) if ( deltap < rad )
{ {
myFAttach = pntfirst; myFAttach = pntfirst;
@ -1101,7 +1101,7 @@ void AIS_IdenticRelation::ComputeTwoEllipsesPresentation(const Handle(Prs3d_Pres
myCenter = theEll->Location(); myCenter = theEll->Location();
Standard_Real aSegSize = theEll->MajorRadius()/5.0; Standard_Real aSegSize = theEll->MajorRadius()/5.0;
Standard_Real rad = Standard_PI/5.0; Standard_Real rad = M_PI / 5.0;
// I. Case of 2 complete ellipses // I. Case of 2 complete ellipses
if ( circ1complete && circ2complete ) if ( circ1complete && circ2complete )
@ -1338,7 +1338,7 @@ void AIS_IdenticRelation::ComputeAutoArcPresentation(const Handle(Geom_Ellipse)&
const Standard_Boolean isstatic) const Standard_Boolean isstatic)
{ {
Standard_Real aSegSize = theEll->MajorRadius()/5.0; Standard_Real aSegSize = theEll->MajorRadius()/5.0;
Standard_Real rad = Standard_PI/5.0; Standard_Real rad = M_PI / 5.0;
gp_Elips anEll = theEll->Elips(); gp_Elips anEll = theEll->Elips();
@ -1383,7 +1383,7 @@ void AIS_IdenticRelation::ComputeNotAutoElipsPresentation(const Handle(Geom_Elli
curpos.Translate(vprec*1e-5); curpos.Translate(vprec*1e-5);
} }
Standard_Real rad = Standard_PI/5.0; Standard_Real rad = M_PI / 5.0;
// Standard_Real pcurpos = ElCLib::Parameter(anEll,curpos); // Standard_Real pcurpos = ElCLib::Parameter(anEll,curpos);
GeomAPI_ProjectPointOnCurve aProj (curpos, theEll); GeomAPI_ProjectPointOnCurve aProj (curpos, theEll);
Standard_Real pcurpos = aProj.LowerDistanceParameter(); Standard_Real pcurpos = aProj.LowerDistanceParameter();
@ -1414,7 +1414,7 @@ void AIS_IdenticRelation::ComputeNotAutoArcPresentation(const Handle(Geom_Ellips
Standard_Real pSPnt = ElCLib::Parameter(anEll, pntlast); Standard_Real pSPnt = ElCLib::Parameter(anEll, pntlast);
Standard_Real deltap = Modulo2PI(pSPnt - pFPnt)/2.0; Standard_Real deltap = Modulo2PI(pSPnt - pFPnt)/2.0;
Standard_Real rad = Standard_PI/5; Standard_Real rad = M_PI / 5;
if ( deltap < rad ) if ( deltap < rad )
{ {
myFAttach = pntfirst; myFAttach = pntfirst;

View File

@ -1650,7 +1650,7 @@ void AIS_InteractiveContext::SetDeviationAngle(const Standard_Real anAngle)
Standard_Real AIS_InteractiveContext::DeviationAngle() const Standard_Real AIS_InteractiveContext::DeviationAngle() const
{ {
return PI/180.0e0 ; return M_PI/180.0e0 ;
// return myDefaultDrawer->DeviationAngle(); // return myDefaultDrawer->DeviationAngle();
} }
@ -1963,7 +1963,7 @@ void AIS_InteractiveContext::SetColor(const Handle(AIS_InteractiveObject)& anIOb
// gp_Dir D =Tr->Component()->XDirection(); // gp_Dir D =Tr->Component()->XDirection();
// gp_Pnt O = Tr->Component()->Location(); // gp_Pnt O = Tr->Component()->Location();
// gp_Vec V(D);V*=Lx/5.; // gp_Vec V(D);V*=Lx/5.;
// T.SetRotation(gp_Ax1(O,D),PI/6.); // T.SetRotation(gp_Ax1(O,D),M_PI/6.);
// T.SetTranslationPart(V); // T.SetTranslationPart(V);
// TopLoc_Location L,IncLoc(T); // TopLoc_Location L,IncLoc(T);
@ -2128,7 +2128,7 @@ void AIS_InteractiveContext::SetAngleAndDeviation(
{ {
// cout<<" Angle:"<< anAngle <<endl; // cout<<" Angle:"<< anAngle <<endl;
if(anIObj.IsNull()) return ; if(anIObj.IsNull()) return ;
// Standard_Real anAngleRad = PI*anAngle/180; test rob... // Standard_Real anAngleRad = M_PI*anAngle/180; test rob...
if(!anIObj->HasInteractiveContext()) if(!anIObj->HasInteractiveContext())
anIObj->SetContext(this); anIObj->SetContext(this);

View File

@ -930,7 +930,7 @@ void AIS_LengthDimension::ComputeTwoVerticesLength( const Handle( Prs3d_Presenta
else { else {
if (!samePoint) { if (!samePoint) {
DirAttach = gce_MakeDir(FirstAttach,SecondAttach); DirAttach = gce_MakeDir(FirstAttach,SecondAttach);
DirAttach.Rotate(Plane->Pln().Axis(),PI/2.); DirAttach.Rotate(Plane->Pln().Axis(),M_PI/2.);
} }
} }

View File

@ -487,7 +487,7 @@ void AIS_MidPointRelation::ComputePointsOnCirc(const gp_Circ& aCirc,
Standard_Real pcurpos = ElCLib::Parameter(aCirc,curpos); Standard_Real pcurpos = ElCLib::Parameter(aCirc,curpos);
Standard_Real rad = Standard_PI/5.0; Standard_Real rad = M_PI / 5.0;
Standard_Real segm; Standard_Real segm;
Standard_Real pFPnt; Standard_Real pFPnt;
@ -507,18 +507,18 @@ void AIS_MidPointRelation::ComputePointsOnCirc(const gp_Circ& aCirc,
Standard_Real deltap = pSAttachM - pFAttach; Standard_Real deltap = pSAttachM - pFAttach;
if ( deltap < 0 ) if ( deltap < 0 )
{ {
deltap += 2*Standard_PI; deltap += 2 * M_PI;
pSAttachM += 2*Standard_PI; pSAttachM += 2 * M_PI;
} }
pSAttachM -= pFAttach; pSAttachM -= pFAttach;
Standard_Real pmiddleout = pSAttachM/2.0 + Standard_PI; Standard_Real pmiddleout = pSAttachM/2.0 + M_PI;
Standard_Real pcurpos1 = pcurpos; Standard_Real pcurpos1 = pcurpos;
// define where curpos lays // define where curpos lays
if ( pcurpos1 < pFAttach ) if ( pcurpos1 < pFAttach )
{ {
pcurpos1 = pcurpos1 + 2*Standard_PI - pFAttach; pcurpos1 = pcurpos1 + 2 * M_PI - pFAttach;
if ( pcurpos1 > pSAttachM ) // out if ( pcurpos1 > pSAttachM ) // out
{ {
segm = Min(rad,deltap*0.75); segm = Min(rad,deltap*0.75);
@ -614,7 +614,7 @@ void AIS_MidPointRelation::ComputePointsOnElips(const gp_Elips& anEll,
Standard_Real pcurpos = ElCLib::Parameter(anEll,curpos); Standard_Real pcurpos = ElCLib::Parameter(anEll,curpos);
Standard_Real rad = Standard_PI/5.0; Standard_Real rad = M_PI / 5.0;
Standard_Real segm; Standard_Real segm;
Standard_Real pFPnt; Standard_Real pFPnt;
@ -634,18 +634,18 @@ void AIS_MidPointRelation::ComputePointsOnElips(const gp_Elips& anEll,
Standard_Real deltap = pSAttachM - pFAttach; Standard_Real deltap = pSAttachM - pFAttach;
if ( deltap < 0 ) if ( deltap < 0 )
{ {
deltap += 2*Standard_PI; deltap += 2 * M_PI;
pSAttachM += 2*Standard_PI; pSAttachM += 2 * M_PI;
} }
pSAttachM -= pFAttach; pSAttachM -= pFAttach;
Standard_Real pmiddleout = pSAttachM/2.0 + Standard_PI; Standard_Real pmiddleout = pSAttachM / 2.0 + M_PI;
Standard_Real pcurpos1 = pcurpos; Standard_Real pcurpos1 = pcurpos;
// define where curpos lays // define where curpos lays
if ( pcurpos1 < pFAttach ) if ( pcurpos1 < pFAttach )
{ {
pcurpos1 = pcurpos1 + 2*Standard_PI - pFAttach; pcurpos1 = pcurpos1 + 2 * M_PI - pFAttach;
if ( pcurpos1 > pSAttachM ) // out if ( pcurpos1 > pSAttachM ) // out
{ {
segm = Min(rad,deltap*0.75); segm = Min(rad,deltap*0.75);

View File

@ -232,10 +232,10 @@ void AIS_RadiusDimension::InitFirstShape()
myCenter = myCircle.Location(); myCenter = myCircle.Location();
myCircle.SetRadius(myVal); myCircle.SetRadius(myVal);
while (myFirstPar > 2*PI) myFirstPar -= 2*PI; while (myFirstPar > 2*M_PI) myFirstPar -= 2*M_PI;
while (myFirstPar < 0.0 ) myFirstPar += 2*PI; while (myFirstPar < 0.0 ) myFirstPar += 2*M_PI;
while (myLastPar > 2*PI) myLastPar -= 2*PI; while (myLastPar > 2*M_PI) myLastPar -= 2*M_PI;
while (myLastPar < 0.0 ) myLastPar += 2*PI; while (myLastPar < 0.0 ) myLastPar += 2*M_PI;
myPlane = new Geom_Plane(gp_Pln(gp_Ax3(myCircle.Position()))); myPlane = new Geom_Plane(gp_Pln(gp_Ax3(myCircle.Position())));
myFirstLine = gce_MakeLin( myCenter, ElCLib::Value( myFirstPar, myCircle ) ); myFirstLine = gce_MakeLin( myCenter, ElCLib::Value( myFirstPar, myCircle ) );
myLastLine = gce_MakeLin( myCenter, ElCLib::Value( myLastPar, myCircle ) ); myLastLine = gce_MakeLin( myCenter, ElCLib::Value( myLastPar, myCircle ) );
@ -359,18 +359,18 @@ void AIS_RadiusDimension::ComputeRadius( const Handle( Prs3d_Presentation )& aPr
Standard_Real PosPar = ElCLib::Parameter( myCircle, myPosition ); Standard_Real PosPar = ElCLib::Parameter( myCircle, myPosition );
if (!AIS::InDomain(myFirstPar, myLastPar, PosPar)) if (!AIS::InDomain(myFirstPar, myLastPar, PosPar))
{ // not in domain { // not in domain
Standard_Real otherpar = PosPar + PI; Standard_Real otherpar = PosPar + M_PI;
if (otherpar > 2*PI) otherpar -= 2*PI; if (otherpar > 2*M_PI) otherpar -= 2*M_PI;
if (AIS::InDomain(myFirstPar, myLastPar, otherpar)){ if (AIS::InDomain(myFirstPar, myLastPar, otherpar)){
PosPar = otherpar;// parameter on circle PosPar = otherpar;// parameter on circle
myEndOfArrow = ElCLib::Value( PosPar, myCircle ); myEndOfArrow = ElCLib::Value( PosPar, myCircle );
} }
else { else {
Standard_Real Teta1 = Abs( PosPar - myFirstPar ), Teta2 = Abs( PosPar - myLastPar ); Standard_Real Teta1 = Abs( PosPar - myFirstPar ), Teta2 = Abs( PosPar - myLastPar );
if (Teta1 > PI) if (Teta1 > M_PI)
Teta1 = 2.0*PI - Teta1; Teta1 = 2.0*M_PI - Teta1;
if (Teta2 > PI) if (Teta2 > M_PI)
Teta2 = 2.0*PI - Teta2; Teta2 = 2.0*M_PI - Teta2;
if (Teta1 < Teta2) if (Teta1 < Teta2)
{ {
if(myFirstLine.Contains(myPosition,Precision::Confusion())) if(myFirstLine.Contains(myPosition,Precision::Confusion()))

View File

@ -227,7 +227,7 @@ static Standard_Boolean ComputeTangencyPoint(const Handle(Geom_Curve)& GC1,
ElCLib::D1(par_inter,ellipse->Elips(),P2,aVector2); ElCLib::D1(par_inter,ellipse->Elips(),P2,aVector2);
} }
// if ( aVector1.IsParallel(aVector2, 100*Precision::Angular()) ) break; // if ( aVector1.IsParallel(aVector2, 100*Precision::Angular()) ) break;
if ( aVector1.IsParallel(aVector2, Standard_PI/360.0) ) break; // 0.5 graduce if ( aVector1.IsParallel(aVector2, M_PI / 360.0) ) break; // 0.5 graduce
} }
} }
aPoint = PC1; aPoint = PC1;

View File

@ -1323,7 +1323,7 @@ void Adaptor3d_CurveOnSurface::EvalKPart()
if ( D.IsParallel(gp::DX2d(),Precision::Angular())) { // Iso V. if ( D.IsParallel(gp::DX2d(),Precision::Angular())) { // Iso V.
if ( STy == GeomAbs_Sphere) { if ( STy == GeomAbs_Sphere) {
gp_Pnt2d P = myCurve->Line().Location(); gp_Pnt2d P = myCurve->Line().Location();
if ( Abs( Abs(P.Y()) -PI/2. ) >= Precision::PConfusion()) { if ( Abs( Abs(P.Y()) -M_PI/2. ) >= Precision::PConfusion()) {
myType = GeomAbs_Circle; myType = GeomAbs_Circle;
gp_Sphere Sph = mySurface->Sphere(); gp_Sphere Sph = mySurface->Sphere();
gp_Ax3 Axis = Sph.Position(); gp_Ax3 Axis = Sph.Position();

View File

@ -160,7 +160,7 @@ Standard_Real Adaptor3d_SurfaceOfRevolution::FirstUParameter() const
Standard_Real Adaptor3d_SurfaceOfRevolution::LastUParameter() const Standard_Real Adaptor3d_SurfaceOfRevolution::LastUParameter() const
{ {
return 2*PI; return 2*M_PI;
} }
//======================================================================= //=======================================================================
@ -236,7 +236,7 @@ void Adaptor3d_SurfaceOfRevolution::UIntervals (TColStd_Array1OfReal& T,
const GeomAbs_Shape ) const const GeomAbs_Shape ) const
{ {
T(T.Lower() ) = 0.; T(T.Lower() ) = 0.;
T(T.Lower()+1) = 2*PI; T(T.Lower()+1) = 2*M_PI;
} }
@ -276,7 +276,7 @@ Handle(Adaptor3d_HSurface) Adaptor3d_SurfaceOfRevolution::UTrim
Standard_Real Eps = Precision::PConfusion(); Standard_Real Eps = Precision::PConfusion();
#endif #endif
Standard_OutOfRange_Raise_if Standard_OutOfRange_Raise_if
( Abs(First) > Eps || Abs(Last - 2.*PI) > Eps, ( Abs(First) > Eps || Abs(Last - 2.*M_PI) > Eps,
"Adaptor3d_SurfaceOfRevolution : UTrim : Parameters out of range"); "Adaptor3d_SurfaceOfRevolution : UTrim : Parameters out of range");
Handle(Adaptor3d_HSurfaceOfRevolution) HR = Handle(Adaptor3d_HSurfaceOfRevolution) HR =
@ -341,7 +341,7 @@ Standard_Boolean Adaptor3d_SurfaceOfRevolution::IsUPeriodic() const
Standard_Real Adaptor3d_SurfaceOfRevolution::UPeriod() const Standard_Real Adaptor3d_SurfaceOfRevolution::UPeriod() const
{ {
return 2*PI; return 2*M_PI;
} }
//======================================================================= //=======================================================================
@ -493,7 +493,7 @@ gp_Vec Adaptor3d_SurfaceOfRevolution::DN(const Standard_Real U,
} }
else { else {
Standard_Real DNR = DNv * myAxeRev.XDirection(); Standard_Real DNR = DNv * myAxeRev.XDirection();
gp_Vec DNu = ( myAxeRev.XDirection()).Rotated( myAxis, U + NU*PI/2); gp_Vec DNu = ( myAxeRev.XDirection()).Rotated( myAxis, U + NU*M_PI/2);
return ( DNR * DNu); return ( DNR * DNu);
} }
} }

View File

@ -30,7 +30,7 @@ static void GetConeApexParam(const gp_Cone& C, Standard_Real& U, Standard_Real&
else { else {
U = atan2(Ploc.Y(),Ploc.X()); U = atan2(Ploc.Y(),Ploc.X());
} }
if (U < -1.e-16) U += (PI+PI); if (U < -1.e-16) U += (M_PI+M_PI);
else if (U < 0) U = 0; else if (U < 0) U = 0;
V = sin(SAngle) * ( Ploc.X() * cos(U) + Ploc.Y() * sin(U) - Radius) V = sin(SAngle) * ( Ploc.X() * cos(U) + Ploc.Y() * sin(U) - Radius)

View File

@ -315,7 +315,7 @@ void AppParCurves_Variational::Init()
Vt2d=TabV2d.Value(jp2d); Vt2d=TabV2d.Value(jp2d);
Vt2d.Normalize(); Vt2d.Normalize();
Vc2d=TabV2dcurv.Value(jp2d); Vc2d=TabV2dcurv.Value(jp2d);
if (Abs(Abs(Vc2d.Angle(Vt2d)) - PI/2.) > Precision::Angular()) if (Abs(Abs(Vc2d.Angle(Vt2d)) - M_PI/2.) > Precision::Angular())
Standard_ConstructionError::Raise(); Standard_ConstructionError::Raise();
myTabConstraints->SetValue(jndex++,Vt2d.X()); myTabConstraints->SetValue(jndex++,Vt2d.X());
myTabConstraints->SetValue(jndex++,Vt2d.Y()); myTabConstraints->SetValue(jndex++,Vt2d.Y());
@ -373,7 +373,7 @@ void AppParCurves_Variational::Init()
Vt2d=TabV2d.Value(jp2d); Vt2d=TabV2d.Value(jp2d);
Vt2d.Normalize(); Vt2d.Normalize();
Vc2d=TabV2dcurv.Value(jp2d); Vc2d=TabV2dcurv.Value(jp2d);
if (Abs(Abs(Vc2d.Angle(Vt2d)) - PI/2.) > Precision::Angular()) if (Abs(Abs(Vc2d.Angle(Vt2d)) - M_PI/2.) > Precision::Angular())
Standard_ConstructionError::Raise(); Standard_ConstructionError::Raise();
myTabConstraints->SetValue(jndex++,Vt2d.X()); myTabConstraints->SetValue(jndex++,Vt2d.X());
myTabConstraints->SetValue(jndex++,Vt2d.Y()); myTabConstraints->SetValue(jndex++,Vt2d.Y());

View File

@ -329,8 +329,8 @@ Standard_Boolean ApproxInt_ImpPrmSvSurfaces::Compute( Standard_Real& u1
v2 = X(2)-TranslationV; v2 = X(2)-TranslationV;
ComputeParametersOnImplicitSurface(MyISurf,P,u1,v1); ComputeParametersOnImplicitSurface(MyISurf,P,u1,v1);
if(MyISurf.TypeQuadric() != GeomAbs_Plane) { if(MyISurf.TypeQuadric() != GeomAbs_Plane) {
while(u1-tu1>PI) u1-=PI+PI; while(u1-tu1>M_PI) u1-=M_PI+M_PI;
while(tu1-u1>PI) u1+=PI+PI; while(tu1-u1>M_PI) u1+=M_PI+M_PI;
} }
MyParOnS1.SetCoord(tu1,tv1); MyParOnS1.SetCoord(tu1,tv1);
MyParOnS2.SetCoord(tu2,tv2); MyParOnS2.SetCoord(tu2,tv2);
@ -342,8 +342,8 @@ Standard_Boolean ApproxInt_ImpPrmSvSurfaces::Compute( Standard_Real& u1
v1 = X(2)-TranslationV; v1 = X(2)-TranslationV;
ComputeParametersOnImplicitSurface(MyISurf,P,u2,v2); ComputeParametersOnImplicitSurface(MyISurf,P,u2,v2);
if(MyISurf.TypeQuadric() != GeomAbs_Plane) { if(MyISurf.TypeQuadric() != GeomAbs_Plane) {
while(u2-tu2>PI) u2-=PI+PI; while(u2-tu2>M_PI) u2-=M_PI+M_PI;
while(tu2-u2>PI) u2+=PI+PI; while(tu2-u2>M_PI) u2+=M_PI+M_PI;
} }
MyParOnS1.SetCoord(tu1,tv1); MyParOnS1.SetCoord(tu1,tv1);
MyParOnS2.SetCoord(tu2,tu2); MyParOnS2.SetCoord(tu2,tu2);

View File

@ -71,7 +71,7 @@ void Aspect_CircularGrid::Compute(const Quantity_Length X,
Standard_Real cosinus = (X-xo)/d; Standard_Real cosinus = (X-xo)/d;
Standard_Real a = ACos(cosinus); Standard_Real a = ACos(cosinus);
Standard_Real ra = RotationAngle(); Standard_Real ra = RotationAngle();
if ( Y < yo ) a = 2*Standard_PI - a; if ( Y < yo ) a = 2 * M_PI - a;
#ifdef OCC192_193 #ifdef OCC192_193
n = (Standard_Integer ) ((a-ra)/myAlpha + Sign(0.5, a-ra)) ; n = (Standard_Integer ) ((a-ra)/myAlpha + Sign(0.5, a-ra)) ;
#else #else
@ -149,6 +149,6 @@ return myDivisionNumber;
} }
void Aspect_CircularGrid::Init () { void Aspect_CircularGrid::Init () {
myAlpha = Standard_PI /Standard_Real(myDivisionNumber); myAlpha = M_PI / Standard_Real(myDivisionNumber);
myA1 = Cos(myAlpha); myB1=Sin(myAlpha); myA1 = Cos(myAlpha); myB1=Sin(myAlpha);
} }

View File

@ -252,7 +252,7 @@ void Aspect_MarkerStyle::SetPredefinedStyle() {
MySpoint = new TColStd_HArray1OfBoolean(1,MAX_O_POINT+1) ; MySpoint = new TColStd_HArray1OfBoolean(1,MAX_O_POINT+1) ;
{ Standard_Integer i; { Standard_Integer i;
Standard_Real da = 2.*Standard_PI/MAX_O_POINT; Standard_Real da = 2. * M_PI / MAX_O_POINT;
Standard_Real a = 0.; Standard_Real a = 0.;
for( i=1 ; i<= MAX_O_POINT+1 ; i++,a += da ) { for( i=1 ; i<= MAX_O_POINT+1 ; i++,a += da ) {
MyXpoint->SetValue(i,(float ) Cos(a)); MyXpoint->SetValue(i,(float ) Cos(a));
@ -290,7 +290,7 @@ void Aspect_MarkerStyle::SetPredefinedStyle() {
MyYpoint = new TShort_HArray1OfShortReal(1,MAX_O_POINT+6) ; MyYpoint = new TShort_HArray1OfShortReal(1,MAX_O_POINT+6) ;
MySpoint = new TColStd_HArray1OfBoolean(1,MAX_O_POINT+6) ; MySpoint = new TColStd_HArray1OfBoolean(1,MAX_O_POINT+6) ;
{ Standard_Integer i; { Standard_Integer i;
Standard_Real da = 2.*Standard_PI/MAX_O_POINT; Standard_Real da = 2. * M_PI / MAX_O_POINT;
Standard_Real a = 0.; Standard_Real a = 0.;
for( i=1 ; i<= MAX_O_POINT+1 ; i++,a += da ) { for( i=1 ; i<= MAX_O_POINT+1 ; i++,a += da ) {
MyXpoint->SetValue(i,(float ) Cos(a)); MyXpoint->SetValue(i,(float ) Cos(a));
@ -328,7 +328,7 @@ void Aspect_MarkerStyle::SetPredefinedStyle() {
MySpoint = new TColStd_HArray1OfBoolean(1,MAX_O_POINT+5) ; MySpoint = new TColStd_HArray1OfBoolean(1,MAX_O_POINT+5) ;
{ Standard_Integer i; { Standard_Integer i;
Standard_Real da = 2.*Standard_PI/MAX_O_POINT; Standard_Real da = 2. * M_PI / MAX_O_POINT;
Standard_Real a = 0.; Standard_Real a = 0.;
for( i=1 ; i<= MAX_O_POINT+1 ; i++,a += da ) { for( i=1 ; i<= MAX_O_POINT+1 ; i++,a += da ) {
MyXpoint->SetValue(i,(float ) Cos(a)); MyXpoint->SetValue(i,(float ) Cos(a));
@ -362,7 +362,7 @@ void Aspect_MarkerStyle::SetPredefinedStyle() {
MySpoint = new TColStd_HArray1OfBoolean(1,MAX_O_POINT+9) ; MySpoint = new TColStd_HArray1OfBoolean(1,MAX_O_POINT+9) ;
{ Standard_Integer i; { Standard_Integer i;
Standard_Real da = 2.*Standard_PI/MAX_O_POINT; Standard_Real da = 2. * M_PI / MAX_O_POINT;
Standard_Real a = 0.; Standard_Real a = 0.;
for( i=1 ; i<= MAX_O_POINT+1 ; i++,a += da ) { for( i=1 ; i<= MAX_O_POINT+1 ; i++,a += da ) {
MyXpoint->SetValue(i,(float ) Cos(a)); MyXpoint->SetValue(i,(float ) Cos(a));
@ -412,7 +412,7 @@ void Aspect_MarkerStyle::SetPredefinedStyle() {
MySpoint = new TColStd_HArray1OfBoolean(1,MAX_O_POINT+5) ; MySpoint = new TColStd_HArray1OfBoolean(1,MAX_O_POINT+5) ;
{ Standard_Integer i; { Standard_Integer i;
Standard_Real da = 2.*Standard_PI/MAX_O_POINT; Standard_Real da = 2. * M_PI / MAX_O_POINT;
Standard_Real a = 0.; Standard_Real a = 0.;
for( i=1 ; i<= MAX_O_POINT+1 ; i++,a += da ) { for( i=1 ; i<= MAX_O_POINT+1 ; i++,a += da ) {
MyXpoint->SetValue(i,(float ) Cos(a)); MyXpoint->SetValue(i,(float ) Cos(a));
@ -449,7 +449,7 @@ void Aspect_MarkerStyle::SetPredefinedStyle() {
MAX_BALL_LINE*(MAX_O_POINT+1)) ; MAX_BALL_LINE*(MAX_O_POINT+1)) ;
{ Standard_Integer i,j,n = 0; { Standard_Integer i,j,n = 0;
Standard_Real da = 2.*Standard_PI/MAX_O_POINT; Standard_Real da = 2. * M_PI / MAX_O_POINT;
Standard_Real dr = 1./MAX_BALL_LINE; Standard_Real dr = 1./MAX_BALL_LINE;
Standard_Real a,r = 1.; Standard_Real a,r = 1.;
@ -476,7 +476,7 @@ void Aspect_MarkerStyle::SetPredefinedStyle() {
(MAX_BALL_LINE/4)*(MAX_O_POINT+1)) ; (MAX_BALL_LINE/4)*(MAX_O_POINT+1)) ;
{ Standard_Integer i,j,n = 0; { Standard_Integer i,j,n = 0;
Standard_Real da = 2.*Standard_PI/MAX_O_POINT; Standard_Real da = 2. * M_PI / MAX_O_POINT;
Standard_Real dr = 1./MAX_BALL_LINE; Standard_Real dr = 1./MAX_BALL_LINE;
Standard_Real a,r = 1.; Standard_Real a,r = 1.;
@ -503,7 +503,7 @@ void Aspect_MarkerStyle::SetPredefinedStyle() {
(MAX_BALL_LINE/3)*(MAX_O_POINT+1)) ; (MAX_BALL_LINE/3)*(MAX_O_POINT+1)) ;
{ Standard_Integer i,j,n = 0; { Standard_Integer i,j,n = 0;
Standard_Real da = 2.*Standard_PI/MAX_O_POINT; Standard_Real da = 2. * M_PI / MAX_O_POINT;
Standard_Real dr = 1./MAX_BALL_LINE; Standard_Real dr = 1./MAX_BALL_LINE;
Standard_Real a,r = 1.; Standard_Real a,r = 1.;
@ -530,7 +530,7 @@ void Aspect_MarkerStyle::SetPredefinedStyle() {
(MAX_BALL_LINE)/2*(MAX_O_POINT+1)) ; (MAX_BALL_LINE)/2*(MAX_O_POINT+1)) ;
{ Standard_Integer i,j,n = 0; { Standard_Integer i,j,n = 0;
Standard_Real da = 2.*Standard_PI/MAX_O_POINT; Standard_Real da = 2. * M_PI / MAX_O_POINT;
Standard_Real dr = 1./MAX_BALL_LINE; Standard_Real dr = 1./MAX_BALL_LINE;
Standard_Real a,r = 1.; Standard_Real a,r = 1.;

View File

@ -126,8 +126,8 @@ void Aspect_RectangularGrid::Init () {
// b1 = Sin (myFirstAngle + RotationAngle() ); // b1 = Sin (myFirstAngle + RotationAngle() );
// c1 = XOrigin() * b1 - YOrigin() * a1; // c1 = XOrigin() * b1 - YOrigin() * a1;
// //
// a2 = Cos (mySecondAngle + RotationAngle() + Standard_PI/2.); // a2 = Cos (mySecondAngle + RotationAngle() + M_PI / 2.);
// b2 = Sin (mySecondAngle + RotationAngle() + Standard_PI/2.); // b2 = Sin (mySecondAngle + RotationAngle() + M_PI / 2.);
// c2 = XOrigin() * b2 - YOrigin() * a2; // c2 = XOrigin() * b2 - YOrigin() * a2;
#ifdef CSR577 #ifdef CSR577
@ -142,7 +142,7 @@ void Aspect_RectangularGrid::Init () {
} }
if ( angle2 != 0. ) { if ( angle2 != 0. ) {
angle2 += Standard_PI/2.; angle2 += M_PI / 2.;
a2 = -Sin (angle2); a2 = -Sin (angle2);
b2 = Cos (angle2); b2 = Cos (angle2);
c2 = XOrigin() * b2 - YOrigin() * a2; c2 = XOrigin() * b2 - YOrigin() * a2;
@ -154,8 +154,8 @@ void Aspect_RectangularGrid::Init () {
b1 = Cos (myFirstAngle + RotationAngle()); b1 = Cos (myFirstAngle + RotationAngle());
c1 = XOrigin() * b1 - YOrigin() * a1; c1 = XOrigin() * b1 - YOrigin() * a1;
a2 = -Sin (mySecondAngle + RotationAngle() + Standard_PI/2.); a2 = -Sin (mySecondAngle + RotationAngle() + M_PI / 2.);
b2 = Cos (mySecondAngle + RotationAngle() + Standard_PI/2.); b2 = Cos (mySecondAngle + RotationAngle() + M_PI / 2.);
c2 = XOrigin() * b2 - YOrigin() * a2; c2 = XOrigin() * b2 - YOrigin() * a2;
#endif #endif
//-zov //-zov
@ -163,7 +163,7 @@ void Aspect_RectangularGrid::Init () {
Standard_Boolean Aspect_RectangularGrid::CheckAngle(const Standard_Real alpha, Standard_Boolean Aspect_RectangularGrid::CheckAngle(const Standard_Real alpha,
const Standard_Real beta) const { const Standard_Real beta) const {
return (Abs( Sin(alpha) * Cos(beta+Standard_PI/2.) - Cos(alpha) * Sin(beta+Standard_PI/2.)) != 0) ; return (Abs( Sin(alpha) * Cos(beta + M_PI / 2.) - Cos(alpha) * Sin(beta + M_PI / 2.)) != 0) ;
} }

View File

@ -715,7 +715,7 @@ Standard_Real AngleIn(const TopoDS_Edge& aEIn,
Standard_Real ClockWiseAngle(const Standard_Real aAngleIn, Standard_Real ClockWiseAngle(const Standard_Real aAngleIn,
const Standard_Real aAngleOut) const Standard_Real aAngleOut)
{ {
const Standard_Real aTwoPi=Standard_PI+Standard_PI; const Standard_Real aTwoPi = M_PI + M_PI;
Standard_Real dA, A1, A2, AIn, AOut ; Standard_Real dA, A1, A2, AIn, AOut ;
AIn=aAngleIn; AIn=aAngleIn;
@ -728,7 +728,7 @@ Standard_Real ClockWiseAngle(const Standard_Real aAngleIn,
AOut=AOut-aTwoPi; AOut=AOut-aTwoPi;
} }
A1=AIn+Standard_PI; A1 = AIn + M_PI;
if (A1 >= aTwoPi) { if (A1 >= aTwoPi) {
A1=A1-aTwoPi; A1=A1-aTwoPi;
@ -815,7 +815,7 @@ Standard_Real Angle2D (const TopoDS_Vertex& aV,
Standard_Real Angle (const gp_Dir2d& aDir2D) Standard_Real Angle (const gp_Dir2d& aDir2D)
{ {
const Standard_Real anAngle = gp_Dir2d(1.,0.).Angle(aDir2D); const Standard_Real anAngle = gp_Dir2d(1.,0.).Angle(aDir2D);
return ((anAngle < 0.)? anAngle + Standard_PI + Standard_PI : anAngle); return ((anAngle < 0.)? anAngle + M_PI + M_PI : anAngle);
} }
//======================================================================= //=======================================================================
@ -974,7 +974,7 @@ Standard_Boolean RecomputeAngles(const BOP_ListOfEdgeInfo& aLEInfo,
bIgnore = (aD > theTol2D); bIgnore = (aD > theTol2D);
} }
if(!bIgnore && (theTol2D > PI)) { if(!bIgnore && (theTol2D > M_PI)) {
Standard_Real udist = fabs(aP2Dx.X() - thePb.X()); Standard_Real udist = fabs(aP2Dx.X() - thePb.X());
Standard_Real vdist = fabs(aP2Dx.Y() - thePb.Y()); Standard_Real vdist = fabs(aP2Dx.Y() - thePb.Y());
Standard_Real aTolU = 2. * UTolerance2D(theVb, theGAS); Standard_Real aTolU = 2. * UTolerance2D(theVb, theGAS);

View File

@ -3304,8 +3304,8 @@ void CorrectTolR3D(BOPTools_PaveFiller& aPF,
// //
aA=aDN[0].Angle(aDN[1]); aA=aDN[0].Angle(aDN[1]);
aA=fabs(aA); aA=fabs(aA);
if (aA>0.5*PI) { if (aA>0.5*M_PI) {
aA=PI-aA; aA=M_PI-aA;
} }
// //
if (aA<aAmin || aA>aAmax) { if (aA<aAmin || aA>aAmax) {

View File

@ -674,7 +674,7 @@ static
Standard_Real BOPTools_Tools2D::IntermediatePoint (const Standard_Real aFirst, Standard_Real BOPTools_Tools2D::IntermediatePoint (const Standard_Real aFirst,
const Standard_Real aLast) const Standard_Real aLast)
{ {
//define parameter division number as 10*e^(-PI) = 0.43213918 //define parameter division number as 10*e^(-M_PI) = 0.43213918
const Standard_Real PAR_T = 0.43213918; const Standard_Real PAR_T = 0.43213918;
Standard_Real aParm; Standard_Real aParm;
aParm=(1.-PAR_T)*aFirst + PAR_T*aLast; aParm=(1.-PAR_T)*aFirst + PAR_T*aLast;

View File

@ -1022,7 +1022,7 @@ static void GetApproxNormalToFaceOnEdgeEx(const TopoDS_Edge& aE,
{ {
Standard_Real d12, d1, anAlfa12, anAlfa1, aTwoPI; Standard_Real d12, d1, anAlfa12, anAlfa1, aTwoPI;
aTwoPI=Standard_PI+Standard_PI; aTwoPI = M_PI + M_PI;
gp_Vec aVx1(aPx, aPx1); gp_Vec aVx1(aPx, aPx1);
gp_Dir aDBx1 (aVx1); gp_Dir aDBx1 (aVx1);

View File

@ -1408,7 +1408,7 @@ void BRepAlgo_DSAccess::PntVtxOnCurve
if(iMother) igoodC = iMother; if(iMother) igoodC = iMother;
//#ifndef DEB //#ifndef DEB
TopOpeBRepDS_PointIterator PII = myHDS->CurvePoints(igoodC); TopOpeBRepDS_PointIterator PII = myHDS->CurvePoints(igoodC);
TopOpeBRepDS_PointIterator& PIt = PII; // skl : I change "PI" to "PIt" TopOpeBRepDS_PointIterator& PIt = PII; // skl : I change "M_PI" to "PIt"
//#else //#else
// TopOpeBRepDS_PointIterator& PIt = myHDS->CurvePoints(igoodC); // TopOpeBRepDS_PointIterator& PIt = myHDS->CurvePoints(igoodC);
//#endif //#endif

View File

@ -290,7 +290,7 @@ Standard_Boolean BRepBlend_RstRstConstRad::IsSolution(const math_Vector& Sol,
Angle = ACos(Cosa); Angle = ACos(Cosa);
if (Sina < 0.) { if (Sina < 0.) {
Angle = 2.*PI - Angle; Angle = 2.*M_PI - Angle;
} }
if (Angle > maxang) {maxang = Angle;} if (Angle > maxang) {maxang = Angle;}
@ -609,7 +609,7 @@ void BRepBlend_RstRstConstRad::Section(const Standard_Real Param,
Pfin = ElCLib::Parameter(C, ptrst2); Pfin = ElCLib::Parameter(C, ptrst2);
// Test of angles negative and almost null : Special Case // Test of angles negative and almost null : Special Case
if (Pfin > 1.5 * PI) { if (Pfin > 1.5 * M_PI) {
np.Reverse(); np.Reverse();
C.SetPosition(gp_Ax2(Center, np, ns)); C.SetPosition(gp_Ax2(Center, np, ns));
Pfin = ElCLib::Parameter(C, ptrst2); Pfin = ElCLib::Parameter(C, ptrst2);

View File

@ -361,7 +361,7 @@ Standard_Boolean BRepBlend_RstRstEvolRad::IsSolution(const math_Vector& Sol,
Angle = ACos(Cosa); Angle = ACos(Cosa);
if (Sina < 0.) { if (Sina < 0.) {
Angle = 2.*PI - Angle; Angle = 2.*M_PI - Angle;
} }
if (Angle > maxang) {maxang = Angle;} if (Angle > maxang) {maxang = Angle;}
@ -678,7 +678,7 @@ void BRepBlend_RstRstEvolRad::Section(const Standard_Real Param,
Pfin = ElCLib::Parameter(C, ptrst2); Pfin = ElCLib::Parameter(C, ptrst2);
// Test negative and quasi null angles: Special case // Test negative and quasi null angles: Special case
if (Pfin > 1.5 * PI) { if (Pfin > 1.5 * M_PI) {
np.Reverse(); np.Reverse();
C.SetPosition(gp_Ax2(Center, np, ns)); C.SetPosition(gp_Ax2(Center, np, ns));
Pfin = ElCLib::Parameter(C, ptrst2); Pfin = ElCLib::Parameter(C, ptrst2);

View File

@ -406,7 +406,7 @@ Standard_Boolean BRepBlend_SurfRstConstRad::IsSolution(const math_Vector& Sol,
Angle = ACos(Cosa); Angle = ACos(Cosa);
if (Sina <0.) { if (Sina <0.) {
Angle = 2.*PI - Angle; Angle = 2.*M_PI - Angle;
} }
if (Angle>maxang) {maxang = Angle;} if (Angle>maxang) {maxang = Angle;}
@ -663,7 +663,7 @@ void BRepBlend_SurfRstConstRad::Section(const Standard_Real Param,
Pfin = ElCLib::Parameter(C,ptrst); Pfin = ElCLib::Parameter(C,ptrst);
// Test negative and almost null angles : Special case // Test negative and almost null angles : Special case
if (Pfin>1.5*PI) { if (Pfin>1.5*M_PI) {
np.Reverse(); np.Reverse();
C.SetPosition(gp_Ax2(Center,np,ns)); C.SetPosition(gp_Ax2(Center,np,ns));
Pfin = ElCLib::Parameter(C,ptrst); Pfin = ElCLib::Parameter(C,ptrst);

View File

@ -463,7 +463,7 @@ const Standard_Real Tol)
Angle = ACos(Cosa); Angle = ACos(Cosa);
if (Sina <0.) { if (Sina <0.) {
Angle = 2.*PI - Angle; Angle = 2.*M_PI - Angle;
} }
if (Angle>maxang) {maxang = Angle;} if (Angle>maxang) {maxang = Angle;}
@ -708,7 +708,7 @@ gp_Circ& C)
Pfin = ElCLib::Parameter(C,ptrst); Pfin = ElCLib::Parameter(C,ptrst);
// Test negative and almost null angles : Single Case // Test negative and almost null angles : Single Case
if (Pfin>1.5*PI) { if (Pfin>1.5*M_PI) {
np.Reverse(); np.Reverse();
C.SetPosition(gp_Ax2(Center,np,ns)); C.SetPosition(gp_Ax2(Center,np,ns));
Pfin = ElCLib::Parameter(C,ptrst); Pfin = ElCLib::Parameter(C,ptrst);

View File

@ -196,7 +196,7 @@ static Standard_Boolean IsClosedShape(const TopoDS_Shape& theshape,
if (TotLength > 0.0) { if (TotLength > 0.0) {
gp_Pnt p1 = BRep_Tool::Pnt(TopoDS::Vertex(v1)); gp_Pnt p1 = BRep_Tool::Pnt(TopoDS::Vertex(v1));
gp_Pnt p2 = BRep_Tool::Pnt(TopoDS::Vertex(v2)); gp_Pnt p2 = BRep_Tool::Pnt(TopoDS::Vertex(v2));
return (p1.Distance(p2) < TotLength/(1.2 * PI)); return (p1.Distance(p2) < TotLength/(1.2 * M_PI));
} }
return Standard_False; return Standard_False;
} }
@ -983,7 +983,7 @@ void BRepBuilderAPI_Sewing::EvaluateAngulars(TopTools_SequenceOfShape& sequenceS
else if ((n.Magnitude()>gp::Resolution()) && (normRef(j).Magnitude()>gp::Resolution())) { else if ((n.Magnitude()>gp::Resolution()) && (normRef(j).Magnitude()>gp::Resolution())) {
nbComputedAngle++; nbComputedAngle++;
Standard_Real angular = n.Angle(normRef(j)); Standard_Real angular = n.Angle(normRef(j));
if (angular > PI/2.) angular = PI - angular; if (angular > M_PI/2.) angular = M_PI - angular;
cumulateAngular += angular; cumulateAngular += angular;
} }
} }

View File

@ -1549,7 +1549,7 @@ static TopAbs_Orientation GetOrientation(const TopTools_MapOfShape& mapE,
angle = DerRef.Angle( Der ); angle = DerRef.Angle( Der );
angle *= -1.; angle *= -1.;
if (angle < 0.) if (angle < 0.)
angle += 2.*PI; angle += 2.*M_PI;
if (F.Orientation() == TopAbs_FORWARD) { if (F.Orientation() == TopAbs_FORWARD) {
if (angle < MinAngle) { if (angle < MinAngle) {

View File

@ -511,11 +511,11 @@ void BRepFeat::FaceUntil(const TopoDS_Shape& Sbase,
} }
else if (styp == STANDARD_TYPE(Geom_CylindricalSurface)) { else if (styp == STANDARD_TYPE(Geom_CylindricalSurface)) {
str = new Geom_RectangularTrimmedSurface str = new Geom_RectangularTrimmedSurface
(s, 0., 2.*PI, bnd, -bnd, Standard_True, Standard_True); (s, 0., 2.*M_PI, bnd, -bnd, Standard_True, Standard_True);
} }
else if (styp == STANDARD_TYPE(Geom_ConicalSurface)) { else if (styp == STANDARD_TYPE(Geom_ConicalSurface)) {
str = new Geom_RectangularTrimmedSurface str = new Geom_RectangularTrimmedSurface
(s, 0., 2.*PI, bnd, -bnd, Standard_True, Standard_True); (s, 0., 2.*M_PI, bnd, -bnd, Standard_True, Standard_True);
} }
else { else {
FUntil.Nullify(); FUntil.Nullify();

View File

@ -199,7 +199,7 @@ void BRepFeat_MakeLinearForm::Init(const TopoDS_Shape& Sbase,
gp_Vec nulldir(0, 0, 0); gp_Vec nulldir(0, 0, 0);
if(!myDir1.IsEqual(nulldir, myTol, myTol)) { if(!myDir1.IsEqual(nulldir, myTol, myTol)) {
Standard_Real ang = myDir1.Angle(myDir); Standard_Real ang = myDir1.Angle(myDir);
if(ang != PI) { if(ang != M_PI) {
#ifdef DEB #ifdef DEB
if (trc) cout << " Directions must be opposite" << endl; if (trc) cout << " Directions must be opposite" << endl;
#endif #endif

View File

@ -229,7 +229,7 @@ void BRepFeat_MakeRevol::Perform(const Standard_Real Angle)
myGluedF.Clear(); myGluedF.Clear();
myPerfSelection = BRepFeat_NoSelection; myPerfSelection = BRepFeat_NoSelection;
PerfSelectionValid(); PerfSelectionValid();
Standard_Boolean RevolComp = (2*PI-Abs(Angle) <= Precision::Angular()); Standard_Boolean RevolComp = (2*M_PI-Abs(Angle) <= Precision::Angular());
LocOpe_Revol theRevol; LocOpe_Revol theRevol;
Standard_Real angledec = 0.; Standard_Real angledec = 0.;
TopExp_Explorer exp; TopExp_Explorer exp;
@ -238,7 +238,7 @@ void BRepFeat_MakeRevol::Perform(const Standard_Real Angle)
if (!mySkface.IsNull() || !mySlface.IsEmpty()) { if (!mySkface.IsNull() || !mySlface.IsEmpty()) {
for (exp.Init(mySbase,TopAbs_FACE); exp.More(); exp.Next()) { for (exp.Init(mySbase,TopAbs_FACE); exp.More(); exp.Next()) {
if (exp.Current().IsSame(mySkface)) { if (exp.Current().IsSame(mySkface)) {
angledec = PI/5; // pourquoi pas angledec = M_PI/5; // pourquoi pas
if (myFuse) angledec = -angledec; if (myFuse) angledec = -angledec;
break; break;
} }
@ -362,7 +362,7 @@ void BRepFeat_MakeRevol::Perform(const TopoDS_Shape& Until)
Standard_ConstructionError::Raise(); Standard_ConstructionError::Raise();
} }
if (!mySkface.IsNull() && Until.IsSame(mySkface)) { if (!mySkface.IsNull() && Until.IsSame(mySkface)) {
Angle = 2*PI; Angle = 2*M_PI;
TourComplet = Standard_True; TourComplet = Standard_True;
} }
myGluedF.Clear(); myGluedF.Clear();
@ -375,10 +375,10 @@ void BRepFeat_MakeRevol::Perform(const TopoDS_Shape& Until)
ShapeUntilValid(); ShapeUntilValid();
// Do systematically almost complete revolution // Do systematically almost complete revolution
// BRepSweep_Revol theRevol(myPbase,myAxis,2.*PI-10.*Precision::Angular()); // BRepSweep_Revol theRevol(myPbase,myAxis,2.*M_PI-10.*Precision::Angular());
LocOpe_Revol theRevol; LocOpe_Revol theRevol;
if(!TourComplet) { if(!TourComplet) {
Angle = 2.*PI- 3*PI/180.; Angle = 2.*M_PI- 3*M_PI/180.;
#ifdef DEB #ifdef DEB
if (trc) cout << " No complete Revolution" << endl; if (trc) cout << " No complete Revolution" << endl;
#endif #endif
@ -565,7 +565,7 @@ void BRepFeat_MakeRevol::Perform(const TopoDS_Shape& From,
} }
LocOpe_Revol theRevol; LocOpe_Revol theRevol;
theRevol.Perform(myPbase, myAxis, 2*PI); theRevol.Perform(myPbase, myAxis, 2*M_PI);
TopoDS_Shape VraiRevol = theRevol.Shape(); TopoDS_Shape VraiRevol = theRevol.Shape();
MajMap(myPbase,theRevol,myMap,myFShape,myLShape); MajMap(myPbase,theRevol,myMap,myFShape,myLShape);
@ -607,9 +607,9 @@ void BRepFeat_MakeRevol::Perform(const TopoDS_Shape& From,
} }
if (ASI2.IsDone() && ASI2.NbPoints(1) >=1) { if (ASI2.IsDone() && ASI2.NbPoints(1) >=1) {
Standard_Real pr1 = ASI2.Point(1,1).Parameter(); Standard_Real pr1 = ASI2.Point(1,1).Parameter();
pr1 = ElCLib::InPeriod(pr1,PrU-2*PI,PrU); pr1 = ElCLib::InPeriod(pr1,PrU-2*M_PI,PrU);
Standard_Real pr2 = ASI2.Point(1,ASI2.NbPoints(1)).Parameter(); Standard_Real pr2 = ASI2.Point(1,ASI2.NbPoints(1)).Parameter();
pr2 = ElCLib::InPeriod(pr2,PrU-2*PI,PrU); pr2 = ElCLib::InPeriod(pr2,PrU-2*M_PI,PrU);
OrF = OrU; OrF = OrU;
FFrom = ASI2.Point(1,1).Face(); FFrom = ASI2.Point(1,1).Face();
PrF = Max(pr1, pr2); PrF = Max(pr1, pr2);
@ -689,7 +689,7 @@ void BRepFeat_MakeRevol::PerformThruAll()
Standard_Boolean trc = BRepFeat_GettraceFEAT(); Standard_Boolean trc = BRepFeat_GettraceFEAT();
if (trc) cout << "BRepFeat_MakeRevol::PerformThruAll()" << endl; if (trc) cout << "BRepFeat_MakeRevol::PerformThruAll()" << endl;
#endif #endif
Perform(2.*PI); Perform(2.*M_PI);
} }
//======================================================================= //=======================================================================
@ -728,7 +728,7 @@ void BRepFeat_MakeRevol::PerformUntilAngle(const TopoDS_Shape& Until,
ShapeUntilValid(); ShapeUntilValid();
// Produce systematicallt an almost complete revolution // Produce systematicallt an almost complete revolution
// BRepSweep_Revol theRevol(myPbase,myAxis,2.*PI-10.*Precision::Angular()); // BRepSweep_Revol theRevol(myPbase,myAxis,2.*M_PI-10.*Precision::Angular());
LocOpe_Revol theRevol; LocOpe_Revol theRevol;
theRevol.Perform(myPbase, myAxis, Angle); theRevol.Perform(myPbase, myAxis, Angle);
TopoDS_Shape VraiRevol = theRevol.Shape(); TopoDS_Shape VraiRevol = theRevol.Shape();

View File

@ -221,13 +221,13 @@ void BRepFeat_MakeRevolutionForm::Init(const TopoDS_Shape& Sbase,
if(Rad <= height) Rad = height + 0.01*height; if(Rad <= height) Rad = height + 0.01*height;
myAngle1 = asin(H1/Rad) + PI/10.; myAngle1 = asin(H1/Rad) + M_PI/10.;
myAngle2 = asin(H2/Rad) + PI/10.; myAngle2 = asin(H2/Rad) + M_PI/10.;
if((myAngle1 - PI/2) > Precision::Confusion()) if((myAngle1 - M_PI/2) > Precision::Confusion())
myAngle1 = PI/2; myAngle1 = M_PI/2;
if((myAngle2 - PI/2) > Precision::Confusion()) if((myAngle2 - M_PI/2) > Precision::Confusion())
myAngle2 = PI/2; myAngle2 = M_PI/2;
mySkface.Nullify(); mySkface.Nullify();
myPbase.Nullify(); myPbase.Nullify();

View File

@ -1023,7 +1023,7 @@ TopoDS_Face BRepFeat_RibSlot::ChoiceOfFaces(TopTools_ListOfShape& faces,
gp_Ax1 Axe(pp, Pln->Position().Direction()); gp_Ax1 Axe(pp, Pln->Position().Direction());
for ( Standard_Integer i = 1; i <=8; i++) { for ( Standard_Integer i = 1; i <=8; i++) {
Handle(Geom_Curve) L = Handle(Geom_Curve) L =
Handle(Geom_Curve)::DownCast(l1->Rotated(Axe, i*PI/9.)); Handle(Geom_Curve)::DownCast(l1->Rotated(Axe, i*M_PI/9.));
scur.Append(L); scur.Append(L);
Counter++; Counter++;
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1601,7 +1601,7 @@ Standard_Integer CutEdge (const TopoDS_Edge& E,
//if (E.Orientation() == TopAbs_REVERSED) CT2d->Reverse(); //if (E.Orientation() == TopAbs_REVERSED) CT2d->Reverse();
if (CT2d->BasisCurve()->IsKind(STANDARD_TYPE(Geom2d_Circle)) && if (CT2d->BasisCurve()->IsKind(STANDARD_TYPE(Geom2d_Circle)) &&
( Abs(f-l) >= PI) ) { ( Abs(f-l) >= M_PI) ) {
return 0; return 0;
//--------------------------- //---------------------------
// Cut closed circle. // Cut closed circle.
@ -1844,7 +1844,7 @@ void MakeOffset (const TopoDS_Edge& E,
Adaptor3d_OffsetCurve Off(AHC,-anOffset); Adaptor3d_OffsetCurve Off(AHC,-anOffset);
Handle(Geom2d_Circle) CC = new Geom2d_Circle(Off.Circle()); 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; f -= 0.2*Delta; l += 0.2*Delta;
G2dOC = new Geom2d_TrimmedCurve(CC,f,l); 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; Standard_Boolean ToReverseResult = Standard_False;
gp_Vec d1u; gp_Vec d1u;
d1u = Surf->DN(0, (f1+l1)/2, 1, 0); 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; ToReverseResult = Standard_True;
/* /*
axe.Reverse(); axe.Reverse();
Angle = 2*PI - Angle; Angle = 2*M_PI - Angle;
Rev = new (Geom_SurfaceOfRevolution) (Prof1, axe); Rev = new (Geom_SurfaceOfRevolution) (Prof1, axe);
Surf = new (Geom_RectangularTrimmedSurface) Surf = new (Geom_RectangularTrimmedSurface)
(Rev, 0, Angle, f1, l1); (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); AS->D1(P2d.X(), P2d.Y(), P, D1U, D1V);
N2 = 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); Result.Orientation(TopAbs_REVERSED);
else Result.Orientation(TopAbs_FORWARD); else Result.Orientation(TopAbs_FORWARD);

View File

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

View File

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

View File

@ -318,7 +318,7 @@ void BRepGProp_Face::UKnots(TColStd_Array1OfReal& Knots) const
case GeomAbs_Cone: case GeomAbs_Cone:
case GeomAbs_Sphere: case GeomAbs_Sphere:
case GeomAbs_Torus: case GeomAbs_Torus:
Knots(1) = 0.0; Knots(2) = PI*2.0/3.0; Knots(3) = PI*4.0/3.0; Knots(4) = PI*6.0/3.0; Knots(1) = 0.0; Knots(2) = M_PI*2.0/3.0; Knots(3) = M_PI*4.0/3.0; Knots(4) = M_PI*6.0/3.0;
break; break;
case GeomAbs_BSplineSurface: case GeomAbs_BSplineSurface:
(*((Handle(Geom_BSplineSurface)*)&((mySurface.Surface()).Surface())))->UKnots(Knots); (*((Handle(Geom_BSplineSurface)*)&((mySurface.Surface()).Surface())))->UKnots(Knots);
@ -343,10 +343,10 @@ void BRepGProp_Face::VKnots(TColStd_Array1OfReal& Knots) const
Knots(1) = mySurface.FirstUParameter(); Knots(2) = mySurface.LastUParameter(); Knots(1) = mySurface.FirstUParameter(); Knots(2) = mySurface.LastUParameter();
break; break;
case GeomAbs_Sphere: case GeomAbs_Sphere:
Knots(1) = -PI/2.0; Knots(2) = 0.0; Knots(3) = +PI/2.0; Knots(1) = -M_PI/2.0; Knots(2) = 0.0; Knots(3) = +M_PI/2.0;
break; break;
case GeomAbs_Torus: case GeomAbs_Torus:
Knots(1) = 0.0; Knots(2) = PI*2.0/3.0; Knots(3) = PI*4.0/3.0; Knots(4) = PI*6.0/3.0; Knots(1) = 0.0; Knots(2) = M_PI*2.0/3.0; Knots(3) = M_PI*4.0/3.0; Knots(4) = M_PI*6.0/3.0;
break; break;
case GeomAbs_BSplineSurface: case GeomAbs_BSplineSurface:
(*((Handle(Geom_BSplineSurface)*)&((mySurface.Surface()).Surface())))->VKnots(Knots); (*((Handle(Geom_BSplineSurface)*)&((mySurface.Surface()).Surface())))->VKnots(Knots);
@ -450,7 +450,7 @@ void BRepGProp_Face::LKnots(TColStd_Array1OfReal& Knots) const
break; break;
case GeomAbs_Circle: case GeomAbs_Circle:
case GeomAbs_Ellipse: case GeomAbs_Ellipse:
Knots(1) = 0.0; Knots(2) = PI*2.0/3.0; Knots(3) = PI*4.0/3.0; Knots(2) = PI*6.0/3.0; Knots(1) = 0.0; Knots(2) = M_PI*2.0/3.0; Knots(3) = M_PI*4.0/3.0; Knots(2) = M_PI*6.0/3.0;
break; break;
case GeomAbs_Parabola: case GeomAbs_Parabola:
case GeomAbs_Hyperbola: case GeomAbs_Hyperbola:

View File

@ -1511,7 +1511,7 @@ static Standard_Boolean tgtfaces(const TopoDS_Edge& Ed,
Standard_Boolean rev1 = (F1.Orientation() == TopAbs_REVERSED); Standard_Boolean rev1 = (F1.Orientation() == TopAbs_REVERSED);
Standard_Boolean rev2 = (F2.Orientation() == TopAbs_REVERSED); Standard_Boolean rev2 = (F2.Orientation() == TopAbs_REVERSED);
Standard_Real f,l,eps, angmax = -PI; Standard_Real f,l,eps, angmax = -M_PI;
#ifndef DEB #ifndef DEB
Standard_Real ang =0.; Standard_Real ang =0.;
#else #else

View File

@ -48,7 +48,7 @@ static Standard_Integer debclass = 0;
#endif #endif
static const Standard_Real MIN_DIST = 2.E-5; //EPA: real mesh is created in the grid 10E5x10E5, so intersection should be cheched static const Standard_Real MIN_DIST = 2.E-5; //EPA: real mesh is created in the grid 10E5x10E5, so intersection should be cheched
// with double of discretization. // with double of discretization.
static const Standard_Real PARALL_COND = Sin(PI/3.0); static const Standard_Real PARALL_COND = Sin(M_PI/3.0);
static const Standard_Real RESOLUTION = 1.0E-16; //OCC319 static const Standard_Real RESOLUTION = 1.0E-16; //OCC319
@ -119,7 +119,7 @@ void BRepMesh_Classifier::AnalizeWire (const TColgp_SequenceOfPnt2d& theSeqPnt2
const Standard_Real a = A.Angle(B); const Standard_Real a = A.Angle(B);
const Standard_Real aa = Abs(a); const Standard_Real aa = Abs(a);
// Check if vectors are opposite // Check if vectors are opposite
if (aa > Precision::Angular() && (PI - aa) > Precision::Angular()) if (aa > Precision::Angular() && (M_PI - aa) > Precision::Angular())
{ {
theangle += a; theangle += a;
p1 = p2; p1 = p2;
@ -340,7 +340,7 @@ static Standard_Boolean checkWiresIntersection(const Standard_Integer
aLoopArea += triangle2Area(p2, p3); aLoopArea += triangle2Area(p2, p3);
aLoopArea += triangle2Area(p3, aStartPoint); // Last triangle area aLoopArea += triangle2Area(p3, aStartPoint); // Last triangle area
if( Abs(aLoopArea)/2 > PI*MIN_DIST ) if( Abs(aLoopArea)/2 > M_PI*MIN_DIST )
{ {
if ( findNextIntersection ) if ( findNextIntersection )
{ {

View File

@ -60,7 +60,7 @@ Handle(Geom_Surface) BRepOffset::Surface(const Handle(Geom_Surface)& Surface,
Result = new Geom_CylindricalSurface( Axis, Radius); Result = new Geom_CylindricalSurface( Axis, Radius);
} }
else if ( Radius <= -Tol ){ else if ( Radius <= -Tol ){
Axis.Rotate(gp_Ax1(Axis.Location(),Axis.Direction()),PI); Axis.Rotate(gp_Ax1(Axis.Location(),Axis.Direction()),M_PI);
Result = new Geom_CylindricalSurface( Axis, Abs(Radius)); Result = new Geom_CylindricalSurface( Axis, Abs(Radius));
Status = BRepOffset_Reversed; Status = BRepOffset_Reversed;
} }
@ -84,7 +84,7 @@ Handle(Geom_Surface) BRepOffset::Surface(const Handle(Geom_Surface)& Surface,
gp_Vec Z( Axis.Direction()); gp_Vec Z( Axis.Direction());
Z *= - Offset * Sin(Alpha); Z *= - Offset * Sin(Alpha);
Axis.Translate(Z); Axis.Translate(Z);
Axis.Rotate(gp_Ax1(Axis.Location(),Axis.Direction()),PI); Axis.Rotate(gp_Ax1(Axis.Location(),Axis.Direction()),M_PI);
Alpha = -Alpha; Alpha = -Alpha;
} }
Result = new Geom_ConicalSurface(Axis, Alpha, Radius); Result = new Geom_ConicalSurface(Axis, Alpha, Radius);
@ -102,7 +102,7 @@ Handle(Geom_Surface) BRepOffset::Surface(const Handle(Geom_Surface)& Surface,
Result = new Geom_SphericalSurface(Axis, Radius); Result = new Geom_SphericalSurface(Axis, Radius);
} }
else if ( Radius <= -Tol ) { else if ( Radius <= -Tol ) {
Axis.Rotate(gp_Ax1(Axis.Location(),Axis.Direction()),PI); Axis.Rotate(gp_Ax1(Axis.Location(),Axis.Direction()),M_PI);
Axis.ZReverse(); Axis.ZReverse();
Result = new Geom_SphericalSurface(Axis, -Radius); Result = new Geom_SphericalSurface(Axis, -Radius);
Status = BRepOffset_Reversed; Status = BRepOffset_Reversed;

View File

@ -1946,7 +1946,7 @@ void BRepOffset_MakeOffset::CorrectConicalFaces()
ElSLib::Parameters( theSphere, fPnt, Uf, Vf ); ElSLib::Parameters( theSphere, fPnt, Uf, Vf );
ElSLib::Parameters( theSphere, lPnt, Ul, Vl ); ElSLib::Parameters( theSphere, lPnt, Ul, Vl );
if (Abs(Ul) <= Precision::Confusion()) if (Abs(Ul) <= Precision::Confusion())
Ul = 2.*PI; Ul = 2.*M_PI;
Handle(Geom_Curve) aCurv = aSphSurf->VIso(Vf); Handle(Geom_Curve) aCurv = aSphSurf->VIso(Vf);
/* /*
if (!isFirstFace) if (!isFirstFace)
@ -2078,11 +2078,11 @@ void BRepOffset_MakeOffset::CorrectConicalFaces()
Standard_Real Vfirst, Vlast; Standard_Real Vfirst, Vlast;
if (p2d1.Y() > 0.) if (p2d1.Y() > 0.)
{ {
Vfirst = p2d1.Y(); Vlast = PI/2.; Vfirst = p2d1.Y(); Vlast = M_PI/2.;
} }
else else
{ {
Vfirst = -PI/2.; Vlast = p2d1.Y(); Vfirst = -M_PI/2.; Vlast = p2d1.Y();
} }
TopoDS_Face NewSphericalFace = BRepLib_MakeFace(aSphSurf, Ufirst, Ulast, Vfirst, Vlast, Precision::Confusion()); TopoDS_Face NewSphericalFace = BRepLib_MakeFace(aSphSurf, Ufirst, Ulast, Vfirst, Vlast, Precision::Confusion());
TopoDS_Edge OldEdge; TopoDS_Edge OldEdge;
@ -2154,12 +2154,12 @@ void BRepOffset_MakeOffset::CorrectConicalFaces()
apex = OffSurf->Value( Uapex, Vapex ); apex = OffSurf->Value( Uapex, Vapex );
//Making new degenerated edge //Making new degenerated edge
Handle(Geom2d_Line) theLine = GCE2d_MakeLine( gp_Pnt2d( 0., Vapex ), gp_Pnt2d( 2.*PI, Vapex ) ); Handle(Geom2d_Line) theLine = GCE2d_MakeLine( gp_Pnt2d( 0., Vapex ), gp_Pnt2d( 2.*M_PI, Vapex ) );
TopoDS_Edge NewEdge; TopoDS_Edge NewEdge;
BB.MakeEdge( NewEdge ); BB.MakeEdge( NewEdge );
NewEdge.Orientation(TopAbs_FORWARD); NewEdge.Orientation(TopAbs_FORWARD);
BB.UpdateEdge( NewEdge, theLine, Cone, Precision::Confusion() ); BB.UpdateEdge( NewEdge, theLine, Cone, Precision::Confusion() );
BB.Range( NewEdge, 0., 2.*PI ); BB.Range( NewEdge, 0., 2.*M_PI );
BB.SameParameter( NewEdge, Standard_True ); BB.SameParameter( NewEdge, Standard_True );
BB.SameRange( NewEdge, Standard_True ); BB.SameRange( NewEdge, Standard_True );
BB.Degenerated( NewEdge, Standard_True ); BB.Degenerated( NewEdge, Standard_True );
@ -2250,12 +2250,12 @@ void BRepOffset_MakeOffset::CorrectConicalFaces()
apex = OffSurf->Value( Uapex, Vapex ); apex = OffSurf->Value( Uapex, Vapex );
//Making new degenerated edge //Making new degenerated edge
Handle(Geom2d_Line) theLine = GCE2d_MakeLine( gp_Pnt2d( 0., Vapex ), gp_Pnt2d( 2.*PI, Vapex ) ); Handle(Geom2d_Line) theLine = GCE2d_MakeLine( gp_Pnt2d( 0., Vapex ), gp_Pnt2d( 2.*M_PI, Vapex ) );
TopoDS_Edge NewEdge; TopoDS_Edge NewEdge;
BB.MakeEdge( NewEdge ); BB.MakeEdge( NewEdge );
NewEdge.Orientation(TopAbs_FORWARD); NewEdge.Orientation(TopAbs_FORWARD);
BB.UpdateEdge( NewEdge, theLine, Cone, BRep_Tool::Tolerance( Circ ) ); BB.UpdateEdge( NewEdge, theLine, Cone, BRep_Tool::Tolerance( Circ ) );
BB.Range( NewEdge, 0., 2.*PI ); BB.Range( NewEdge, 0., 2.*M_PI );
BB.SameParameter( NewEdge, Standard_True ); BB.SameParameter( NewEdge, Standard_True );
BB.SameRange( NewEdge, Standard_True ); BB.SameRange( NewEdge, Standard_True );
BB.Degenerated( NewEdge, Standard_True ); BB.Degenerated( NewEdge, Standard_True );
@ -2358,9 +2358,9 @@ void BRepOffset_MakeOffset::CorrectConicalFaces()
ElSLib::Parameters( theSphere, OrPnt, Uor, Vor ); ElSLib::Parameters( theSphere, OrPnt, Uor, Vor );
TopoDS_Face NewFace; TopoDS_Face NewFace;
if (Vor > 0.) if (Vor > 0.)
NewFace = BRepLib_MakeFace( theSphere, 0., 2.*PI, Vor, PI/2. ); NewFace = BRepLib_MakeFace( theSphere, 0., 2.*M_PI, Vor, M_PI/2. );
else else
NewFace = BRepLib_MakeFace( theSphere, 0., 2.*PI, -PI/2., Vor ); NewFace = BRepLib_MakeFace( theSphere, 0., 2.*M_PI, -M_PI/2., Vor );
//Updating the bound of NewFace //Updating the bound of NewFace
TopoDS_Edge Bound; TopoDS_Edge Bound;
@ -2436,12 +2436,12 @@ void BRepOffset_MakeOffset::CorrectConicalFaces()
apex = OffSurf->Value( Uapex, Vapex ); apex = OffSurf->Value( Uapex, Vapex );
//Making new degenerated edge //Making new degenerated edge
Handle(Geom2d_Line) theLine = GCE2d_MakeLine( gp_Pnt2d( 0., Vapex ), gp_Pnt2d( 2.*PI, Vapex ) ); Handle(Geom2d_Line) theLine = GCE2d_MakeLine( gp_Pnt2d( 0., Vapex ), gp_Pnt2d( 2.*M_PI, Vapex ) );
TopoDS_Edge NewEdge; TopoDS_Edge NewEdge;
BB.MakeEdge( NewEdge ); BB.MakeEdge( NewEdge );
NewEdge.Orientation(TopAbs_FORWARD); NewEdge.Orientation(TopAbs_FORWARD);
BB.UpdateEdge( NewEdge, theLine, Cone, BRep_Tool::Tolerance( Circ ) ); BB.UpdateEdge( NewEdge, theLine, Cone, BRep_Tool::Tolerance( Circ ) );
BB.Range( NewEdge, 0., 2.*PI ); BB.Range( NewEdge, 0., 2.*M_PI );
BB.SameParameter( NewEdge, Standard_True ); BB.SameParameter( NewEdge, Standard_True );
BB.SameRange( NewEdge, Standard_True ); BB.SameRange( NewEdge, Standard_True );
BB.Degenerated( NewEdge, Standard_True ); BB.Degenerated( NewEdge, Standard_True );

View File

@ -203,7 +203,7 @@ static void ComputeCurve3d(TopoDS_Edge Edge,
if ( D.IsParallel(gp::DX2d(),Precision::Angular())) { // Iso V. if ( D.IsParallel(gp::DX2d(),Precision::Angular())) { // Iso V.
if ( STy == GeomAbs_Sphere) { if ( STy == GeomAbs_Sphere) {
gp_Pnt2d P = C.Line().Location(); gp_Pnt2d P = C.Line().Location();
if ( Abs( Abs(P.Y()) -PI/2. ) < Precision::PConfusion()) { if ( Abs( Abs(P.Y()) -M_PI/2. ) < Precision::PConfusion()) {
TheBuilder.Degenerated(Edge, Standard_True); TheBuilder.Degenerated(Edge, Standard_True);
} }
else { else {
@ -1391,18 +1391,18 @@ void BRepOffset_Offset::Init(const TopoDS_Vertex& Vertex,
// V` = +/- PI + 2 k` PI // V` = +/- PI + 2 k` PI
gp_Pnt2d P2d = PCurve->Value(f); gp_Pnt2d P2d = PCurve->Value(f);
Standard_Boolean IsToAdjust = Standard_False; Standard_Boolean IsToAdjust = Standard_False;
if ( P2d.Y() < -PI/2.) { if ( P2d.Y() < -M_PI/2.) {
IsToAdjust = Standard_True; IsToAdjust = Standard_True;
PCurve->Mirror(gp_Ax2d(gp_Pnt2d(0.,-PI/2.),gp::DX2d())); PCurve->Mirror(gp_Ax2d(gp_Pnt2d(0.,-M_PI/2.),gp::DX2d()));
} }
else if ( P2d.Y() > PI/2.) { else if ( P2d.Y() > M_PI/2.) {
IsToAdjust = Standard_True; IsToAdjust = Standard_True;
PCurve->Mirror(gp_Ax2d(gp_Pnt2d(0., PI/2.),gp::DX2d())); PCurve->Mirror(gp_Ax2d(gp_Pnt2d(0., M_PI/2.),gp::DX2d()));
} }
if ( IsToAdjust) { if ( IsToAdjust) {
// set the u firstpoint in [0,2*pi] // set the u firstpoint in [0,2*pi]
gp_Vec2d Tr( PI, 0.); gp_Vec2d Tr( M_PI, 0.);
if ( P2d.X() > PI) Tr.Reverse(); if ( P2d.X() > M_PI) Tr.Reverse();
PCurve->Translate(Tr); PCurve->Translate(Tr);
} }

View File

@ -994,7 +994,7 @@ static Standard_Boolean BSplineEdges(const TopoDS_Edge& E1,
if (Der1.Magnitude() <= gp::Resolution() || if (Der1.Magnitude() <= gp::Resolution() ||
Der2.Magnitude() <= gp::Resolution()) Der2.Magnitude() <= gp::Resolution())
angle = PI/2.; angle = M_PI/2.;
else else
angle = Der1.Angle(Der2); angle = Der1.Angle(Der2);
@ -1031,7 +1031,7 @@ static Standard_Real AngleWireEdge(const TopoDS_Wire& aWire,
if (V11.IsSame(CV) && V21.IsSame(CV)) if (V11.IsSame(CV) && V21.IsSame(CV))
{ {
BSplineEdges( FirstEdge, anEdge, 0, 0, Angle ); BSplineEdges( FirstEdge, anEdge, 0, 0, Angle );
Angle = PI - Angle; Angle = M_PI - Angle;
} }
else if (V11.IsSame(CV) && V22.IsSame(CV)) else if (V11.IsSame(CV) && V22.IsSame(CV))
BSplineEdges( FirstEdge, anEdge, 0, 1, Angle ); BSplineEdges( FirstEdge, anEdge, 0, 1, Angle );
@ -1040,7 +1040,7 @@ static Standard_Real AngleWireEdge(const TopoDS_Wire& aWire,
else else
{ {
BSplineEdges( FirstEdge, anEdge, 1, 1, Angle ); BSplineEdges( FirstEdge, anEdge, 1, 1, Angle );
Angle = PI - Angle; Angle = M_PI - Angle;
} }
return Angle; return Angle;
} }

View File

@ -804,18 +804,18 @@ void BRepOffsetAPI_DraftAngle::CorrectWires()
Pmid = bc2d.Value( (bc2d.FirstParameter()+bc2d.LastParameter())/2. ); Pmid = bc2d.Value( (bc2d.FirstParameter()+bc2d.LastParameter())/2. );
gp_Vec2d offset; gp_Vec2d offset;
Standard_Boolean translate = Standard_False; Standard_Boolean translate = Standard_False;
if (Pfirst.X()-2.*PI > Precision::Confusion() || if (Pfirst.X()-2.*M_PI > Precision::Confusion() ||
Plast.X()-2.*PI > Precision::Confusion() || Plast.X()-2.*M_PI > Precision::Confusion() ||
Pmid.X()-2.*PI > Precision::Confusion()) Pmid.X()-2.*M_PI > Precision::Confusion())
{ {
offset.SetCoord( -2.*PI, 0 ); offset.SetCoord( -2.*M_PI, 0 );
translate = Standard_True; translate = Standard_True;
} }
if (Pfirst.X() < -Precision::Confusion() || if (Pfirst.X() < -Precision::Confusion() ||
Plast.X() < -Precision::Confusion() || Plast.X() < -Precision::Confusion() ||
Pmid.X() < -Precision::Confusion()) Pmid.X() < -Precision::Confusion())
{ {
offset.SetCoord( 2.*PI, 0 ); offset.SetCoord( 2.*M_PI, 0 );
translate = Standard_True; translate = Standard_True;
} }
if (translate) if (translate)

View File

@ -31,7 +31,7 @@ BRepPrim_Cone::BRepPrim_Cone(const Standard_Real Angle,
Standard_DomainError::Raise("cone with null height"); Standard_DomainError::Raise("cone with null height");
if (myHalfAngle*Height < Precision::Confusion()) if (myHalfAngle*Height < Precision::Confusion())
Standard_DomainError::Raise("cone with null angle"); Standard_DomainError::Raise("cone with null angle");
if ((PI/2 - myHalfAngle)*Height < Precision::Confusion()) if ((M_PI/2 - myHalfAngle)*Height < Precision::Confusion())
Standard_DomainError::Raise("cone with angle > PI/2"); Standard_DomainError::Raise("cone with angle > PI/2");
// cut at top // cut at top
@ -50,7 +50,7 @@ BRepPrim_Cone::BRepPrim_Cone(const Standard_Real Angle) :
myHalfAngle(Angle), myHalfAngle(Angle),
myRadius(0.) myRadius(0.)
{ {
if ((Angle < 0) || (Angle > PI/2)) if ((Angle < 0) || (Angle > M_PI/2))
Standard_DomainError::Raise("cone with angle <0 or > PI/2"); Standard_DomainError::Raise("cone with angle <0 or > PI/2");
VMin(0.); VMin(0.);
SetMeridian(); SetMeridian();
@ -68,7 +68,7 @@ BRepPrim_Cone::BRepPrim_Cone(const Standard_Real Angle,
myHalfAngle(Angle), myHalfAngle(Angle),
myRadius(0.) myRadius(0.)
{ {
if ((Angle < 0) || (Angle > PI/2)) if ((Angle < 0) || (Angle > M_PI/2))
Standard_DomainError::Raise("cone with angle <0 or > PI/2"); Standard_DomainError::Raise("cone with angle <0 or > PI/2");
VMin(0.); VMin(0.);
SetMeridian(); SetMeridian();
@ -84,7 +84,7 @@ BRepPrim_Cone::BRepPrim_Cone(const Standard_Real Angle,
BRepPrim_Revolution( Axes, 0,RealLast()), BRepPrim_Revolution( Axes, 0,RealLast()),
myHalfAngle(Angle) myHalfAngle(Angle)
{ {
if ((Angle < 0) || (Angle > PI/2)) if ((Angle < 0) || (Angle > M_PI/2))
Standard_DomainError::Raise("cone with angle <0 or > PI/2"); Standard_DomainError::Raise("cone with angle <0 or > PI/2");
VMin(0.); VMin(0.);
SetMeridian(); SetMeridian();

View File

@ -16,8 +16,8 @@
// parameters on the meridian // parameters on the meridian
#define PMIN (-0.5*PI) #define PMIN (-0.5*M_PI)
#define PMAX (0.5*PI) #define PMAX (0.5*M_PI)
//======================================================================= //=======================================================================
//function : BRepPrim_Sphere //function : BRepPrim_Sphere
@ -82,7 +82,7 @@ void BRepPrim_Sphere::SetMeridian()
// Offset the parameters on the meridian // Offset the parameters on the meridian
// to trim the edge in 3pi/2, 5pi/2 // to trim the edge in 3pi/2, 5pi/2
SetMeridianOffset(2*PI); SetMeridianOffset(2*M_PI);
gp_Dir D = Axes().YDirection(); gp_Dir D = Axes().YDirection();
D.Reverse(); D.Reverse();

View File

@ -24,7 +24,7 @@
BRepPrim_Torus::BRepPrim_Torus(const gp_Ax2& Position, BRepPrim_Torus::BRepPrim_Torus(const gp_Ax2& Position,
const Standard_Real Major, const Standard_Real Major,
const Standard_Real Minor) : const Standard_Real Minor) :
BRepPrim_Revolution(Position,0,2*PI), BRepPrim_Revolution(Position,0,2*M_PI),
myMajor(Major), myMajor(Major),
myMinor(Minor) myMinor(Minor)
{ {
@ -38,7 +38,7 @@ BRepPrim_Torus::BRepPrim_Torus(const gp_Ax2& Position,
BRepPrim_Torus::BRepPrim_Torus(const Standard_Real Major, BRepPrim_Torus::BRepPrim_Torus(const Standard_Real Major,
const Standard_Real Minor) : const Standard_Real Minor) :
BRepPrim_Revolution(gp::XOY(),0,2*PI), BRepPrim_Revolution(gp::XOY(),0,2*M_PI),
myMajor(Major), myMajor(Major),
myMinor(Minor) myMinor(Minor)
{ {
@ -54,7 +54,7 @@ BRepPrim_Torus::BRepPrim_Torus(const gp_Pnt& Center,
const Standard_Real Major, const Standard_Real Major,
const Standard_Real Minor) : const Standard_Real Minor) :
BRepPrim_Revolution(gp_Ax2(Center,gp_Dir(0,0,1),gp_Dir(1,0,0)), BRepPrim_Revolution(gp_Ax2(Center,gp_Dir(0,0,1),gp_Dir(1,0,0)),
0,2*PI), 0,2*M_PI),
myMajor(Major), myMajor(Major),
myMinor(Minor) myMinor(Minor)
{ {

View File

@ -41,10 +41,10 @@ BRepSweep_Revol::BRepSweep_Revol
const gp_Ax1& Ax, const gp_Ax1& Ax,
const Standard_Boolean C): const Standard_Boolean C):
myRotation(S.Oriented(TopAbs_FORWARD), myRotation(S.Oriented(TopAbs_FORWARD),
NumShape(2*PI), NumShape(2*M_PI),
Location(Ax,2*PI), Location(Ax,2*M_PI),
Axe(Ax,2*PI), Axe(Ax,2*M_PI),
Angle(2*PI), Angle(2*M_PI),
C) C)
{ {
@ -125,7 +125,7 @@ TopoDS_Shape BRepSweep_Revol::LastShape(const TopoDS_Shape& aGenS)
Sweep_NumShape BRepSweep_Revol::NumShape(const Standard_Real D)const Sweep_NumShape BRepSweep_Revol::NumShape(const Standard_Real D)const
{ {
Sweep_NumShape N; Sweep_NumShape N;
if (Abs(Angle(D) - 2*PI)<=Precision::Angular()){ if (Abs(Angle(D) - 2*M_PI)<=Precision::Angular()){
N.Init(2,TopAbs_EDGE,Standard_True, N.Init(2,TopAbs_EDGE,Standard_True,
Standard_False,Standard_False); Standard_False,Standard_False);
} }
@ -172,8 +172,8 @@ gp_Ax1 BRepSweep_Revol::Axe(const gp_Ax1& Ax, const Standard_Real D)const
Standard_Real BRepSweep_Revol::Angle(const Standard_Real D)const Standard_Real BRepSweep_Revol::Angle(const Standard_Real D)const
{ {
Standard_Real d = Abs(D); Standard_Real d = Abs(D);
while(d>(2*PI + Precision::Angular())){ while(d>(2*M_PI + Precision::Angular())){
d = d - 2*PI; d = d - 2*M_PI;
} }
return d; return d;
} }

View File

@ -454,7 +454,7 @@ void BRepSweep_Rotation::SetGeneratingPCurve
Standard_Real U = BC.FirstParameter(); Standard_Real U = BC.FirstParameter();
point = BC.Value(U); point = BC.Value(U);
if (point.Distance(tor.Location()) < Precision::Confusion()) { if (point.Distance(tor.Location()) < Precision::Confusion()) {
v = PI; v = M_PI;
// modified by NIZHNY-EAP Wed Mar 1 17:49:29 2000 ___BEGIN___ // modified by NIZHNY-EAP Wed Mar 1 17:49:29 2000 ___BEGIN___
u = 0.; u = 0.;
} }
@ -463,15 +463,15 @@ void BRepSweep_Rotation::SetGeneratingPCurve
tor.MinorRadius(),point,u,v); tor.MinorRadius(),point,u,v);
} }
// u = 0.; // u = 0.;
v = ElCLib::InPeriod(v,0.,2*PI); v = ElCLib::InPeriod(v,0.,2*M_PI);
if((2*PI - v) <= Precision::PConfusion()) v -= 2*PI; if((2*M_PI - v) <= Precision::PConfusion()) v -= 2*M_PI;
if (aDirV.Index() == 2) { if (aDirV.Index() == 2) {
Standard_Real uLeft = u-myAng; Standard_Real uLeft = u-myAng;
ElCLib::AdjustPeriodic(-PI,PI,Precision::PConfusion(),uLeft,u); ElCLib::AdjustPeriodic(-M_PI,M_PI,Precision::PConfusion(),uLeft,u);
} }
else { else {
Standard_Real uRight = u+myAng; Standard_Real uRight = u+myAng;
ElCLib::AdjustPeriodic(-PI,PI,Precision::PConfusion(),u,uRight); ElCLib::AdjustPeriodic(-M_PI,M_PI,Precision::PConfusion(),u,uRight);
} }
// modified by NIZHNY-EAP Wed Mar 1 17:49:32 2000 ___END___ // modified by NIZHNY-EAP Wed Mar 1 17:49:32 2000 ___END___
pnt2d.SetCoord(u,v-U); pnt2d.SetCoord(u,v-U);
@ -575,7 +575,7 @@ void BRepSweep_Rotation::SetDirectingPCurve
BRepAdaptor_Curve BC(TopoDS::Edge(aGenE)); BRepAdaptor_Curve BC(TopoDS::Edge(aGenE));
p1 = BC.Value(BC.FirstParameter()); p1 = BC.Value(BC.FirstParameter());
if (p1.Distance(tor.Location()) < Precision::Confusion()){ if (p1.Distance(tor.Location()) < Precision::Confusion()){
v1 = PI; v1 = M_PI;
// modified by NIZHNY-EAP Thu Mar 2 09:43:26 2000 ___BEGIN___ // modified by NIZHNY-EAP Thu Mar 2 09:43:26 2000 ___BEGIN___
u1 = 0.; u1 = 0.;
// modified by NIZHNY-EAP Thu Mar 2 15:28:59 2000 ___END___ // modified by NIZHNY-EAP Thu Mar 2 15:28:59 2000 ___END___
@ -586,16 +586,16 @@ void BRepSweep_Rotation::SetDirectingPCurve
} }
p2 = BC.Value(BC.LastParameter()); p2 = BC.Value(BC.LastParameter());
if (p2.Distance(tor.Location()) < Precision::Confusion()){ if (p2.Distance(tor.Location()) < Precision::Confusion()){
v2 = PI; v2 = M_PI;
} }
else { else {
ElSLib::TorusParameters(tor.Position(),tor.MajorRadius(), ElSLib::TorusParameters(tor.Position(),tor.MajorRadius(),
tor.MinorRadius(),p2,u2,v2); tor.MinorRadius(),p2,u2,v2);
} }
ElCLib::AdjustPeriodic(0.,2*PI,Precision::PConfusion(),v1,v2); ElCLib::AdjustPeriodic(0.,2*M_PI,Precision::PConfusion(),v1,v2);
// modified by NIZHNY-EAP Thu Mar 2 15:29:04 2000 ___BEGIN___ // modified by NIZHNY-EAP Thu Mar 2 15:29:04 2000 ___BEGIN___
u2 = u1 + myAng; u2 = u1 + myAng;
ElCLib::AdjustPeriodic(-PI,PI,Precision::PConfusion(),u1,u2); ElCLib::AdjustPeriodic(-M_PI,M_PI,Precision::PConfusion(),u1,u2);
if (aGenV.Orientation()==TopAbs_FORWARD){ if (aGenV.Orientation()==TopAbs_FORWARD){
p22d.SetCoord(u1,v1); p22d.SetCoord(u1,v1);
} }
@ -747,7 +747,7 @@ Standard_Boolean BRepSweep_Rotation::GDDShapeIsToAdd
aGenS.ShapeType() == TopAbs_FACE && aGenS.ShapeType() == TopAbs_FACE &&
aDirS.Type() == TopAbs_EDGE && aDirS.Type() == TopAbs_EDGE &&
aSubDirS.Type() == TopAbs_VERTEX ){ aSubDirS.Type() == TopAbs_VERTEX ){
return ( Abs(myAng - 2 * PI) > Precision::Angular() ); return ( Abs(myAng - 2 * M_PI) > Precision::Angular() );
} }
else if ( aNewShape.ShapeType() == TopAbs_FACE && else if ( aNewShape.ShapeType() == TopAbs_FACE &&
aNewSubShape.ShapeType() == TopAbs_EDGE && aNewSubShape.ShapeType() == TopAbs_EDGE &&
@ -757,7 +757,7 @@ Standard_Boolean BRepSweep_Rotation::GDDShapeIsToAdd
TopLoc_Location Loc; TopLoc_Location Loc;
GeomAdaptor_Surface AS(BRep_Tool::Surface(TopoDS::Face(aNewShape),Loc)); GeomAdaptor_Surface AS(BRep_Tool::Surface(TopoDS::Face(aNewShape),Loc));
if (AS.GetType()==GeomAbs_Plane){ if (AS.GetType()==GeomAbs_Plane){
return ( Abs(myAng - 2 * PI) > Precision::Angular() ); return ( Abs(myAng - 2 * M_PI) > Precision::Angular() );
} }
else { else {
return Standard_True; return Standard_True;
@ -789,7 +789,7 @@ Standard_Boolean BRepSweep_Rotation::SeparatedWires
TopLoc_Location Loc; TopLoc_Location Loc;
GeomAdaptor_Surface AS(BRep_Tool::Surface(TopoDS::Face(aNewShape),Loc)); GeomAdaptor_Surface AS(BRep_Tool::Surface(TopoDS::Face(aNewShape),Loc));
if (AS.GetType()==GeomAbs_Plane){ if (AS.GetType()==GeomAbs_Plane){
return (Abs(myAng-2*PI) <= Precision::Angular()); return (Abs(myAng-2*M_PI) <= Precision::Angular());
} }
else{ else{
return Standard_False; return Standard_False;

View File

@ -105,7 +105,7 @@ static Standard_Integer transform(Draw_Interpretor& di,Standard_Integer n,const
if (n < 9) return 1; if (n < 9) return 1;
T.SetRotation(gp_Ax1(gp_Pnt(atof(a[n-7]),atof(a[n-6]),atof(a[n-5])), T.SetRotation(gp_Ax1(gp_Pnt(atof(a[n-7]),atof(a[n-6]),atof(a[n-5])),
gp_Vec(atof(a[n-4]),atof(a[n-3]),atof(a[n-2]))), gp_Vec(atof(a[n-4]),atof(a[n-3]),atof(a[n-2]))),
atof(a[n-1])* PI180); atof(a[n-1])* (M_PI / 180.0));
last = n-7; last = n-7;
} }
else if (!strcmp(a[0],"tmirror")) { else if (!strcmp(a[0],"tmirror")) {

View File

@ -103,11 +103,11 @@ static Standard_Integer chamfer(Draw_Interpretor& di,
if (!E.IsNull() && !F.IsNull() && (aMCh.Contour(E) == 0) ) { if (!E.IsNull() && !F.IsNull() && (aMCh.Contour(E) == 0) ) {
d1 = atof(a[i + 3]); d1 = atof(a[i + 3]);
angle = atof(a[i + 4]); angle = atof(a[i + 4]);
angle *= PI / 180.; angle *= M_PI / 180.;
if ( (d1 > Precision::Confusion()) if ( (d1 > Precision::Confusion())
&& (angle > Precision::Confusion()) && (angle > Precision::Confusion())
&& (PI / 2.- angle > Precision::Confusion()) ) && (M_PI / 2.- angle > Precision::Confusion()) )
aMCh.AddDA(d1, angle, E, F); aMCh.AddDA(d1, angle, E, F);
} }
i += 5; i += 5;

View File

@ -700,7 +700,7 @@ static Standard_Integer profile(Draw_Interpretor& di,
case 'r': case 'r':
i++; i++;
if (i >= n) goto badargs; if (i >= n) goto badargs;
angle = atof(a[i]) * PI180; angle = atof(a[i]) * (M_PI / 180.0);
if ((a[i-1][1] == 'R') || (a[i-1][1] == 'r')) { if ((a[i-1][1] == 'R') || (a[i-1][1] == 'r')) {
dx = Cos(angle); dx = Cos(angle);
dy = Sin(angle); dy = Sin(angle);
@ -736,7 +736,7 @@ static Standard_Integer profile(Draw_Interpretor& di,
if (i >= n) goto badargs; if (i >= n) goto badargs;
radius = atof(a[i-1]); radius = atof(a[i-1]);
if (Abs(radius) > Precision::Confusion()) { if (Abs(radius) > Precision::Confusion()) {
angle = atof(a[i]) * PI180; angle = atof(a[i]) * (M_PI / 180.0);
move = circle; move = circle;
} }
break; break;
@ -1288,7 +1288,7 @@ static Standard_Integer profile2d(Draw_Interpretor& di,
case 'r': case 'r':
i++; i++;
if (i >= n) goto badargs; if (i >= n) goto badargs;
angle = atof(a[i]) * PI180; angle = atof(a[i]) * (M_PI / 180.0);
if ((a[i-1][1] == 'R') || (a[i-1][1] == 'r')) { if ((a[i-1][1] == 'R') || (a[i-1][1] == 'r')) {
dx = Cos(angle); dx = Cos(angle);
dy = Sin(angle); dy = Sin(angle);
@ -1324,7 +1324,7 @@ static Standard_Integer profile2d(Draw_Interpretor& di,
if (i >= n) goto badargs; if (i >= n) goto badargs;
radius = atof(a[i-1]); radius = atof(a[i-1]);
if (Abs(radius) > Precision::Confusion()) { if (Abs(radius) > Precision::Confusion()) {
angle = atof(a[i]) * PI180; angle = atof(a[i]) * (M_PI / 180.0);
move = circle; move = circle;
} }
break; break;

View File

@ -58,7 +58,7 @@ static Standard_Integer DEP(Draw_Interpretor& theCommands,
TopoDS_Shape aLocalShape(DBRep::Get(a[8*ii+6],TopAbs_FACE)); TopoDS_Shape aLocalShape(DBRep::Get(a[8*ii+6],TopAbs_FACE));
F = TopoDS::Face(aLocalShape); F = TopoDS::Face(aLocalShape);
// F = TopoDS::Face(DBRep::Get(a[8*ii+6],TopAbs_FACE)); // F = TopoDS::Face(DBRep::Get(a[8*ii+6],TopAbs_FACE));
Angle = atof(a[8*ii+7])*PI/180.; Angle = atof(a[8*ii+7])*M_PI/180.;
Pax.SetCoord(atof(a[8*ii+8]),atof(a[8*ii+9]),atof(a[8*ii+10])); Pax.SetCoord(atof(a[8*ii+8]),atof(a[8*ii+9]),atof(a[8*ii+10]));
Dax.SetCoord(atof(a[8*ii+11]),atof(a[8*ii+12]),atof(a[8*ii+13])); Dax.SetCoord(atof(a[8*ii+11]),atof(a[8*ii+12]),atof(a[8*ii+13]));
drft.Add(F,Dirextract,Angle,gp_Pln(Pax,Dax)); drft.Add(F,Dirextract,Angle,gp_Pln(Pax,Dax));
@ -122,7 +122,7 @@ static Standard_Integer NDEP(Draw_Interpretor& theCommands,
//#else //#else
Flag = (Standard_Boolean ) atof(a[9*ii+7]); Flag = (Standard_Boolean ) atof(a[9*ii+7]);
//#endif //#endif
Angle = atof(a[9*ii+8])*PI/180.; Angle = atof(a[9*ii+8])*M_PI/180.;
Pax.SetCoord(atof(a[9*ii+9]),atof(a[9*ii+10]),atof(a[9*ii+11])); Pax.SetCoord(atof(a[9*ii+9]),atof(a[9*ii+10]),atof(a[9*ii+11]));
Dax.SetCoord(atof(a[9*ii+12]),atof(a[9*ii+13]),atof(a[9*ii+14])); Dax.SetCoord(atof(a[9*ii+12]),atof(a[9*ii+13]),atof(a[9*ii+14]));
drft.Add(F,Dirextract,Angle,gp_Pln(Pax,Dax), Flag); drft.Add(F,Dirextract,Angle,gp_Pln(Pax,Dax), Flag);

View File

@ -1107,7 +1107,7 @@ static Standard_Integer ROW(Draw_Interpretor& theCommands,
FFrom = DBRep::Get(a[4],TopAbs_SHAPE); FFrom = DBRep::Get(a[4],TopAbs_SHAPE);
if (FFrom.IsNull()) { if (FFrom.IsNull()) {
Angle = atof(a[4]); Angle = atof(a[4]);
Angle *=PI/180.; Angle *=M_PI/180.;
i = 5; i = 5;
} }
else { else {
@ -1268,7 +1268,7 @@ static Standard_Integer ROF(Draw_Interpretor& theCommands,
FFrom = DBRep::Get(a[4],TopAbs_SHAPE); FFrom = DBRep::Get(a[4],TopAbs_SHAPE);
if (FFrom.IsNull()) { if (FFrom.IsNull()) {
Angle = atof(a[4]); Angle = atof(a[4]);
Angle *=PI/180.; Angle *=M_PI/180.;
i = 5; i = 5;
} }
else { else {
@ -1589,7 +1589,7 @@ static Standard_Integer DEFIN(Draw_Interpretor& theCommands,
theCommands << "Invalid DPrism base"; theCommands << "Invalid DPrism base";
return 1; return 1;
} }
Standard_Real Angle = atof(a[4])*PI/360; Standard_Real Angle = atof(a[4])*M_PI/360;
dprdef = Standard_True; dprdef = Standard_True;
theDPrism.Init(Sbase,TopoDS::Face(Pbase),Skface,Angle,Fuse,Modify); theDPrism.Init(Sbase,TopoDS::Face(Pbase),Skface,Angle,Fuse,Modify);
} }
@ -1773,7 +1773,7 @@ static Standard_Integer PERF(Draw_Interpretor& theCommands,
thePrism.Perform(Val); thePrism.Perform(Val);
} }
else if (Kas == 2) { else if (Kas == 2) {
Val *=(PI/180.); Val *=(M_PI/180.);
theRevol.Perform(Val); theRevol.Perform(Val);
} }
else if (Kas == 4) { else if (Kas == 4) {
@ -1795,7 +1795,7 @@ static Standard_Integer PERF(Draw_Interpretor& theCommands,
thePrism.PerformUntilHeight(FUntil, Val); thePrism.PerformUntilHeight(FUntil, Val);
} }
else if (Kas == 2) { else if (Kas == 2) {
Val *=(PI/180.); Val *=(M_PI/180.);
theRevol.PerformUntilAngle(FUntil, Val); theRevol.PerformUntilAngle(FUntil, Val);
} }
else if (Kas == 4) { else if (Kas == 4) {

View File

@ -106,7 +106,7 @@ static Standard_Integer chfi2d(Draw_Interpretor& di, Standard_Integer n, const c
MF.AddChamfer(E1,E2,p1,p2); MF.AddChamfer(E1,E2,p1,p2);
} }
else { else {
MF.AddChamfer(E1,V,p1,p2*PI180); MF.AddChamfer(E1,V,p1,p2 * (M_PI / 180.0));
} }
} }

View File

@ -108,7 +108,7 @@ static Standard_Integer cylinder(Draw_Interpretor& , Standard_Integer n, const c
} }
else if (n == 5) { else if (n == 5) {
if (P.IsNull()) if (P.IsNull())
S = BRepPrimAPI_MakeCylinder(atof(a[2]),atof(a[3]),atof(a[4]) * PI180); S = BRepPrimAPI_MakeCylinder(atof(a[2]),atof(a[3]),atof(a[4]) * (M_PI / 180.0));
else else
S = BRepPrimAPI_MakeCylinder(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4])); S = BRepPrimAPI_MakeCylinder(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]));
} }
@ -116,7 +116,7 @@ static Standard_Integer cylinder(Draw_Interpretor& , Standard_Integer n, const c
if (P.IsNull()) if (P.IsNull())
return 1; return 1;
else else
S = BRepPrimAPI_MakeCylinder(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]),atof(a[5]) * PI180); S = BRepPrimAPI_MakeCylinder(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]),atof(a[5]) * (M_PI / 180.0));
} }
else else
return 1; return 1;
@ -142,12 +142,12 @@ static Standard_Integer cone(Draw_Interpretor& , Standard_Integer n, const char*
} }
else if (n == 6) { else if (n == 6) {
if (P.IsNull()) if (P.IsNull())
S = BRepPrimAPI_MakeCone(atof(a[2]),atof(a[3]),atof(a[4]),atof(a[5]) * PI180); S = BRepPrimAPI_MakeCone(atof(a[2]),atof(a[3]),atof(a[4]),atof(a[5]) * (M_PI / 180.0));
else else
S = BRepPrimAPI_MakeCone(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]),atof(a[5])); S = BRepPrimAPI_MakeCone(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]),atof(a[5]));
} }
else if (n == 7) { else if (n == 7) {
S = BRepPrimAPI_MakeCone(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]),atof(a[5]),atof(a[6]) * PI180); S = BRepPrimAPI_MakeCone(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]),atof(a[5]),atof(a[6]) * (M_PI / 180.0));
} }
else else
return 1; return 1;
@ -173,24 +173,24 @@ static Standard_Integer sphere(Draw_Interpretor& , Standard_Integer n, const cha
} }
else if (n == 4) { else if (n == 4) {
if (P.IsNull()) if (P.IsNull())
S = BRepPrimAPI_MakeSphere(atof(a[2]),atof(a[3]) * PI180); S = BRepPrimAPI_MakeSphere(atof(a[2]),atof(a[3]) * (M_PI / 180.0));
else else
S = BRepPrimAPI_MakeSphere(P->Pln().Position().Ax2(),atof(a[3])); S = BRepPrimAPI_MakeSphere(P->Pln().Position().Ax2(),atof(a[3]));
} }
else if (n == 5) { else if (n == 5) {
if (P.IsNull()) if (P.IsNull())
S = BRepPrimAPI_MakeSphere(atof(a[2]),atof(a[3]) * PI180,atof(a[4]) * PI180); S = BRepPrimAPI_MakeSphere(atof(a[2]),atof(a[3]) * (M_PI / 180.0),atof(a[4]) * (M_PI / 180.0));
else else
S = BRepPrimAPI_MakeSphere(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]) * PI180); S = BRepPrimAPI_MakeSphere(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]) * (M_PI / 180.0));
} }
else if (n == 6) { else if (n == 6) {
if (P.IsNull()) if (P.IsNull())
S = BRepPrimAPI_MakeSphere(atof(a[2]),atof(a[3]) * PI180,atof(a[4]) * PI180,atof(a[5]) * PI180); S = BRepPrimAPI_MakeSphere(atof(a[2]),atof(a[3]) * (M_PI / 180.0),atof(a[4]) * (M_PI / 180.0),atof(a[5]) * (M_PI / 180.0));
else else
S = BRepPrimAPI_MakeSphere(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]) * PI180,atof(a[5]) * PI180); S = BRepPrimAPI_MakeSphere(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]) * (M_PI / 180.0),atof(a[5]) * (M_PI / 180.0));
} }
else if (n == 7) { else if (n == 7) {
S = BRepPrimAPI_MakeSphere(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]) * PI180,atof(a[5]) * PI180,atof(a[6]) * PI180); S = BRepPrimAPI_MakeSphere(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]) * (M_PI / 180.0),atof(a[5]) * (M_PI / 180.0),atof(a[6]) * (M_PI / 180.0));
} }
else else
return 1; return 1;
@ -216,29 +216,29 @@ static Standard_Integer torus(Draw_Interpretor& , Standard_Integer n, const char
} }
else if (n == 5) { else if (n == 5) {
if (P.IsNull()) if (P.IsNull())
S = BRepPrimAPI_MakeTorus(atof(a[2]),atof(a[3]),atof(a[4]) * PI180); S = BRepPrimAPI_MakeTorus(atof(a[2]),atof(a[3]),atof(a[4]) * (M_PI / 180.0));
else else
S = BRepPrimAPI_MakeTorus(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4])); S = BRepPrimAPI_MakeTorus(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]));
} }
else if (n == 6) { else if (n == 6) {
if (P.IsNull()) if (P.IsNull())
S = BRepPrimAPI_MakeTorus(atof(a[2]),atof(a[3]), S = BRepPrimAPI_MakeTorus(atof(a[2]),atof(a[3]),
atof(a[4]) * PI180,atof(a[5]) * PI180); atof(a[4]) * (M_PI / 180.0),atof(a[5]) * (M_PI / 180.0));
else else
S = BRepPrimAPI_MakeTorus(P->Pln().Position().Ax2(), S = BRepPrimAPI_MakeTorus(P->Pln().Position().Ax2(),
atof(a[3]),atof(a[4]),atof(a[5]) * PI180); atof(a[3]),atof(a[4]),atof(a[5]) * (M_PI / 180.0));
} }
else if (n == 7) { else if (n == 7) {
if (P.IsNull()) if (P.IsNull())
S = BRepPrimAPI_MakeTorus(atof(a[2]),atof(a[3]), S = BRepPrimAPI_MakeTorus(atof(a[2]),atof(a[3]),
atof(a[4]) * PI180,atof(a[5]) * PI180,atof(a[6]) * PI180); atof(a[4]) * (M_PI / 180.0),atof(a[5]) * (M_PI / 180.0),atof(a[6]) * (M_PI / 180.0));
else else
S = BRepPrimAPI_MakeTorus(P->Pln().Position().Ax2(),atof(a[3]), S = BRepPrimAPI_MakeTorus(P->Pln().Position().Ax2(),atof(a[3]),
atof(a[4]),atof(a[5]) * PI180,atof(a[6]) * PI180); atof(a[4]),atof(a[5]) * (M_PI / 180.0),atof(a[6]) * (M_PI / 180.0));
} }
else if (n == 8) { else if (n == 8) {
S = BRepPrimAPI_MakeTorus(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]), S = BRepPrimAPI_MakeTorus(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]),
atof(a[5]) * PI180,atof(a[6]) * PI180,atof(a[7]) * PI180); atof(a[5]) * (M_PI / 180.0),atof(a[6]) * (M_PI / 180.0),atof(a[7]) * (M_PI / 180.0));
} }
else else
return 1; return 1;

View File

@ -456,7 +456,7 @@ static Standard_Integer encoderegularity (Draw_Interpretor& ,
BRepLib::EncodeRegularity(sh); BRepLib::EncodeRegularity(sh);
else { else {
Standard_Real Tol = atof(a[2]); Standard_Real Tol = atof(a[2]);
Tol *= PI/180.; Tol *= M_PI/180.;
BRepLib::EncodeRegularity(sh, Tol); BRepLib::EncodeRegularity(sh, Tol);
} }
return 0; return 0;

View File

@ -100,7 +100,7 @@ static Standard_Integer revol(Draw_Interpretor& ,
gp_Dir D(atof(a[6]),atof(a[7]),atof(a[8])); gp_Dir D(atof(a[6]),atof(a[7]),atof(a[8]));
gp_Ax1 A(P,D); gp_Ax1 A(P,D);
Standard_Real angle = atof(a[9]) * PI180; Standard_Real angle = atof(a[9]) * (M_PI / 180.0);
Standard_Boolean copy = n > 10; Standard_Boolean copy = n > 10;

View File

@ -382,24 +382,24 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRWire ::TransferEdge (const TopoDS_Edge&
//#30 rln 19.10.98 transformation of pcurves for IGES Surface of Revolution //#30 rln 19.10.98 transformation of pcurves for IGES Surface of Revolution
Curve2d->Mirror (gp_Ax2d (gp::Origin2d(), gp_Dir2d (1.,1.))); Curve2d->Mirror (gp_Ax2d (gp::Origin2d(), gp_Dir2d (1.,1.)));
Curve2d->Mirror (gp::OX2d()); Curve2d->Mirror (gp::OX2d());
Curve2d->Translate (gp_Vec2d (0, 2 * PI)); Curve2d->Translate (gp_Vec2d (0, 2 * M_PI));
} }
if(Surf->IsKind(STANDARD_TYPE(Geom_SurfaceOfRevolution))|| if(Surf->IsKind(STANDARD_TYPE(Geom_SurfaceOfRevolution))||
(Surf->IsKind(STANDARD_TYPE(Geom_ToroidalSurface)))){ (Surf->IsKind(STANDARD_TYPE(Geom_ToroidalSurface)))){
Curve2d->Mirror (gp_Ax2d (gp::Origin2d(), gp_Dir2d (1.,1.))); Curve2d->Mirror (gp_Ax2d (gp::Origin2d(), gp_Dir2d (1.,1.)));
Curve2d->Mirror (gp::OX2d()); Curve2d->Mirror (gp::OX2d());
Curve2d->Translate (gp_Vec2d (0, 2 * PI)); Curve2d->Translate (gp_Vec2d (0, 2 * M_PI));
} }
if (analyticMode&&(Surf->IsKind(STANDARD_TYPE(Geom_CylindricalSurface)) || if (analyticMode&&(Surf->IsKind(STANDARD_TYPE(Geom_CylindricalSurface)) ||
Surf->IsKind(STANDARD_TYPE(Geom_ConicalSurface)))) Surf->IsKind(STANDARD_TYPE(Geom_ConicalSurface))))
myLen = PI/180.; myLen = M_PI/180.;
if (analyticMode&&(Surf->IsKind(STANDARD_TYPE(Geom_SphericalSurface)) || if (analyticMode&&(Surf->IsKind(STANDARD_TYPE(Geom_SphericalSurface)) ||
Surf->IsKind(STANDARD_TYPE(Geom_ToroidalSurface)))) { Surf->IsKind(STANDARD_TYPE(Geom_ToroidalSurface)))) {
gp_Trsf2d trans; gp_Trsf2d trans;
trans.SetScale(gp_Pnt2d(0,0),180./PI); trans.SetScale(gp_Pnt2d(0,0),180./M_PI);
Curve2d->Transform(trans); Curve2d->Transform(trans);
First = Curve2d->TransformedParameter(First,trans); First = Curve2d->TransformedParameter(First,trans);
Last = Curve2d->TransformedParameter(Last, trans); Last = Curve2d->TransformedParameter(Last, trans);

View File

@ -442,7 +442,7 @@ void BRepTools_WireExplorer::Next()
Standard_Integer k = 1, kMin = 0, iDone = 0; Standard_Integer k = 1, kMin = 0, iDone = 0;
Standard_Boolean isDegenerated = Standard_True; Standard_Boolean isDegenerated = Standard_True;
Standard_Real dmin = RealLast(); Standard_Real dmin = RealLast();
Standard_Real dfMinAngle = 3.0*PI, dfCurAngle = 3.0*PI; Standard_Real dfMinAngle = 3.0*M_PI, dfCurAngle = 3.0*M_PI;
for(iDone = 0; iDone < 2; iDone++) for(iDone = 0; iDone < 2; iDone++)
{ {

View File

@ -358,19 +358,19 @@ BRepTopAdaptor_FClass2d::BRepTopAdaptor_FClass2d(const TopoDS_Face& aFace,const
|| surf->GetType()==GeomAbs_SurfaceOfRevolution) || surf->GetType()==GeomAbs_SurfaceOfRevolution)
{ {
Standard_Real uuu=PI+PI-(Umax-Umin); Standard_Real uuu=M_PI+M_PI-(Umax-Umin);
if(uuu<0) uuu=0; if(uuu<0) uuu=0;
U1 = 0.0; // modified by NIZHNY-OFV Thu May 31 14:24:10 2001 ---> //Umin-uuu*0.5; U1 = 0.0; // modified by NIZHNY-OFV Thu May 31 14:24:10 2001 ---> //Umin-uuu*0.5;
U2 = 2*PI; // modified by NIZHNY-OFV Thu May 31 14:24:35 2001 ---> //U1+PI+PI; U2 = 2*M_PI; // modified by NIZHNY-OFV Thu May 31 14:24:35 2001 ---> //U1+M_PI+M_PI;
} }
else { U1=U2=0.0; } else { U1=U2=0.0; }
if(surf->GetType()==GeomAbs_Torus) if(surf->GetType()==GeomAbs_Torus)
{ {
Standard_Real uuu=PI+PI-(Vmax-Vmin); Standard_Real uuu=M_PI+M_PI-(Vmax-Vmin);
if(uuu<0) uuu=0; if(uuu<0) uuu=0;
V1 = 0.0; // modified by NIZHNY-OFV Thu May 31 14:24:55 2001 ---> //Vmin-uuu*0.5; V1 = 0.0; // modified by NIZHNY-OFV Thu May 31 14:24:55 2001 ---> //Vmin-uuu*0.5;
V2 = 2*PI; // modified by NIZHNY-OFV Thu May 31 14:24:59 2001 ---> //V1+PI+PI; V2 = 2*M_PI; // modified by NIZHNY-OFV Thu May 31 14:24:59 2001 ---> //V1+M_PI+M_PI;
} }
else { V1=V2=0.0; } else { V1=V2=0.0; }
} }

View File

@ -236,7 +236,7 @@ static void KPartCurve3d(TopoDS_Edge Edge,
if ( D.IsParallel(gp::DX2d(),Precision::Angular())) { // Iso V. if ( D.IsParallel(gp::DX2d(),Precision::Angular())) { // Iso V.
if ( STy == GeomAbs_Sphere) { if ( STy == GeomAbs_Sphere) {
gp_Pnt2d P = C.Line().Location(); gp_Pnt2d P = C.Line().Location();
if ( Abs( Abs(P.Y()) -PI/2. ) < Precision::PConfusion()) { if ( Abs( Abs(P.Y()) -M_PI/2. ) < Precision::PConfusion()) {
TheBuilder.Degenerated(Edge, Standard_True); TheBuilder.Degenerated(Edge, Standard_True);
} }
else { else {

View File

@ -491,10 +491,10 @@ void Bisector_BisecAna::Perform(const Handle(Geom2d_Curve)& afirstcurve ,
bisectorcurve = new Geom2d_Circle(TheSol->Circle()); bisectorcurve = new Geom2d_Circle(TheSol->Circle());
if (!thesense) if (!thesense)
thebisector = new Geom2d_TrimmedCurve thebisector = new Geom2d_TrimmedCurve
(bisectorcurve,firstparameter-2.0*PI,firstparameter,thesense); (bisectorcurve,firstparameter-2.0*M_PI,firstparameter,thesense);
else else
thebisector = new Geom2d_TrimmedCurve thebisector = new Geom2d_TrimmedCurve
(bisectorcurve,firstparameter,firstparameter+2.0*PI,thesense); (bisectorcurve,firstparameter,firstparameter+2.0*M_PI,thesense);
} }
else if (type == GccInt_Hpr) { else if (type == GccInt_Hpr) {
bisectorcurve = new Geom2d_Hyperbola(TheSol->Hyperbola()); bisectorcurve = new Geom2d_Hyperbola(TheSol->Hyperbola());
@ -509,10 +509,10 @@ void Bisector_BisecAna::Perform(const Handle(Geom2d_Curve)& afirstcurve ,
bisectorcurve = new Geom2d_Ellipse(TheSol->Ellipse()); bisectorcurve = new Geom2d_Ellipse(TheSol->Ellipse());
if (!thesense) if (!thesense)
thebisector = new Geom2d_TrimmedCurve thebisector = new Geom2d_TrimmedCurve
(bisectorcurve,firstparameter-2.0*PI,firstparameter,thesense); (bisectorcurve,firstparameter-2.0*M_PI,firstparameter,thesense);
else else
thebisector = new Geom2d_TrimmedCurve thebisector = new Geom2d_TrimmedCurve
(bisectorcurve,firstparameter,firstparameter+2.0*PI,thesense); (bisectorcurve,firstparameter,firstparameter+2.0*M_PI,thesense);
} }
} }
} }
@ -862,13 +862,13 @@ void Bisector_BisecAna::Perform(const Handle(Geom2d_Curve)& afirstcurve ,
bisectorcurve = new Geom2d_Circle(TheSol->Circle()); bisectorcurve = new Geom2d_Circle(TheSol->Circle());
if (!thesense) if (!thesense)
thebisector = new Geom2d_TrimmedCurve(bisectorcurve, thebisector = new Geom2d_TrimmedCurve(bisectorcurve,
firstparameter-2.0*PI, firstparameter-2.0*M_PI,
firstparameter, firstparameter,
thesense); thesense);
else else
thebisector = new Geom2d_TrimmedCurve(bisectorcurve, thebisector = new Geom2d_TrimmedCurve(bisectorcurve,
firstparameter, firstparameter,
firstparameter+2.0*PI, firstparameter+2.0*M_PI,
thesense); thesense);
} }
else if (type == GccInt_Hpr) { else if (type == GccInt_Hpr) {
@ -886,13 +886,13 @@ void Bisector_BisecAna::Perform(const Handle(Geom2d_Curve)& afirstcurve ,
bisectorcurve = new Geom2d_Ellipse(TheSol->Ellipse()); bisectorcurve = new Geom2d_Ellipse(TheSol->Ellipse());
if (!thesense) if (!thesense)
thebisector = new Geom2d_TrimmedCurve(bisectorcurve, thebisector = new Geom2d_TrimmedCurve(bisectorcurve,
firstparameter-2.0*PI, firstparameter-2.0*M_PI,
firstparameter, firstparameter,
thesense); thesense);
else else
thebisector = new Geom2d_TrimmedCurve(bisectorcurve, thebisector = new Geom2d_TrimmedCurve(bisectorcurve,
firstparameter, firstparameter,
firstparameter+2.0*PI, firstparameter+2.0*M_PI,
thesense); thesense);
} }
} }
@ -1195,7 +1195,7 @@ void Bisector_BisecAna::SetTrim(const Handle(Geom2d_Curve)& )
thebisector->Value(UB2), UB2, Tolerance); thebisector->Value(UB2), UB2, Tolerance);
if (thebisector->BasisCurve()->IsPeriodic()) { if (thebisector->BasisCurve()->IsPeriodic()) {
DomainBisector.SetEquivalentParameters(0.0,2.*PI); DomainBisector.SetEquivalentParameters(0.0,2.*M_PI);
} }
FirstPointBisector = thebisector->Value(UB1); FirstPointBisector = thebisector->Value(UB1);

View File

@ -200,7 +200,7 @@ void Bisector_BisecCC::Perform(const Handle(Geom2d_Curve)& Cu1,
// - one of two curves is concave. // - one of two curves is concave.
// - the curves have a common point at the beginning and/or the end // - the curves have a common point at the beginning and/or the end
// - the angle of opening at the common point between two curves // - the angle of opening at the common point between two curves
// values PI. // values M_PI.
// the extension at the beginning is taken into account if the origin is found above. // the extension at the beginning is taken into account if the origin is found above.
// ie : the origin is not the in the polygon. // ie : the origin is not the in the polygon.
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------

View File

@ -41,7 +41,7 @@ void BlendFunc::GetShape (const BlendFunc_SectionShape SShape,
case BlendFunc_Rational: case BlendFunc_Rational:
{ {
Standard_Integer NbSpan = Standard_Integer NbSpan =
(Standard_Integer)(Ceiling(3.*Abs(MaxAng)/2./PI)); (Standard_Integer)(Ceiling(3.*Abs(MaxAng)/2./M_PI));
NbPoles = 2*NbSpan+1; NbPoles = 2*NbSpan+1;
NbKnots = NbSpan+1; NbKnots = NbSpan+1;
Degree = 2; Degree = 2;

View File

@ -237,7 +237,7 @@ Standard_Boolean BlendFunc_CSCircular::IsSolution(const math_Vector& Sol, const
Angle = ACos(Cosa); Angle = ACos(Cosa);
if (Sina <0.) { if (Sina <0.) {
Angle = 2.*PI - Angle; Angle = 2.*M_PI - Angle;
} }
if (Angle>maxang) {maxang = Angle;} if (Angle>maxang) {maxang = Angle;}
@ -686,7 +686,7 @@ Standard_Boolean BlendFunc_CSCircular::GetSection(const Standard_Real Param,
Sina = nplan.Dot(ns.Crossed(ns2)); Sina = nplan.Dot(ns.Crossed(ns2));
Angle = ACos(Cosa); Angle = ACos(Cosa);
if (Sina <0.) { if (Sina <0.) {
Angle = 2.*PI - Angle; Angle = 2.*M_PI - Angle;
} }
Dangle = -(dnw.Dot(ns2) + ns.Dot(dn2w))/Sina; Dangle = -(dnw.Dot(ns2) + ns.Dot(dn2w))/Sina;
ncrn = nplan.Crossed(ns); ncrn = nplan.Crossed(ns);

View File

@ -207,7 +207,7 @@ Standard_Boolean BlendFunc_CSConstRad::IsSolution(const math_Vector& Sol, const
Angle = ACos(Cosa); Angle = ACos(Cosa);
if (Sina <0.) { if (Sina <0.) {
Angle = 2.*PI - Angle; Angle = 2.*M_PI - Angle;
} }
if (Angle>maxang) {maxang = Angle;} if (Angle>maxang) {maxang = Angle;}
@ -649,7 +649,7 @@ Standard_Boolean BlendFunc_CSConstRad::GetSection(const Standard_Real Param,
Sina = nplan.Dot(ns.Crossed(ns2)); Sina = nplan.Dot(ns.Crossed(ns2));
Angle = ACos(Cosa); Angle = ACos(Cosa);
if (Sina <0.) { if (Sina <0.) {
Angle = 2.*PI - Angle; Angle = 2.*M_PI - Angle;
} }
Dangle = -(dnw.Dot(ns2) + ns.Dot(dn2w))/Sina; Dangle = -(dnw.Dot(ns2) + ns.Dot(dn2w))/Sina;
ncrn = nplan.Crossed(ns); ncrn = nplan.Crossed(ns);

View File

@ -902,11 +902,11 @@ Standard_Boolean BlendFunc_ConstRad::IsSolution(const math_Vector& Sol, const St
// Reframing on ]-pi/2, 3pi/2] // Reframing on ]-pi/2, 3pi/2]
if (Sina <0.) { if (Sina <0.) {
if (Cosa > 0.) Angle = -Angle; if (Cosa > 0.) Angle = -Angle;
else Angle = 2.*PI - Angle; else Angle = 2.*M_PI - Angle;
} }
// cout << "Angle : " <<Angle << endl; // cout << "Angle : " <<Angle << endl;
// if ((Angle < 0) || (Angle > PI)) { // if ((Angle < 0) || (Angle > M_PI)) {
// cout << "t = " << param << endl; // cout << "t = " << param << endl;
// } // }
@ -1176,7 +1176,7 @@ void BlendFunc_ConstRad::Section(const Standard_Real Param,
Pdeb = 0.; Pdeb = 0.;
Pfin = ElCLib::Parameter(C,pts2); Pfin = ElCLib::Parameter(C,pts2);
// Test negative and almost null angles : Singular Case // Test negative and almost null angles : Singular Case
if (Pfin>1.5*PI) { if (Pfin>1.5*M_PI) {
np.Reverse(); np.Reverse();
C.SetPosition(gp_Ax2(Center,np,ns1)); C.SetPosition(gp_Ax2(Center,np,ns1));
Pfin = ElCLib::Parameter(C,pts2); Pfin = ElCLib::Parameter(C,pts2);

View File

@ -971,7 +971,7 @@ Standard_Boolean BlendFunc_EvolRad::IsSolution(const math_Vector& Sol,
// Reframing on ]-pi/2, 3pi/2] // Reframing on ]-pi/2, 3pi/2]
if (Sina <0.) { if (Sina <0.) {
if (Cosa > 0.) Angle = -Angle; if (Cosa > 0.) Angle = -Angle;
else Angle = 2.*PI - Angle; else Angle = 2.*M_PI - Angle;
} }
if (Abs(Angle)>maxang) {maxang = Abs(Angle);} if (Abs(Angle)>maxang) {maxang = Abs(Angle);}
@ -1160,7 +1160,7 @@ void BlendFunc_EvolRad::Section(const Standard_Real Param,
Pdeb = 0.; Pdeb = 0.;
Pfin = ElCLib::Parameter(C,pts2); Pfin = ElCLib::Parameter(C,pts2);
// Test of negative and almost null angles : Single Case // Test of negative and almost null angles : Single Case
if (Pfin>1.5*PI) { if (Pfin>1.5*M_PI) {
np.Reverse(); np.Reverse();
C.SetPosition(gp_Ax2(Center,np,ns1)); C.SetPosition(gp_Ax2(Center,np,ns1));
Pfin = ElCLib::Parameter(C,pts2); Pfin = ElCLib::Parameter(C,pts2);

View File

@ -517,7 +517,7 @@ void BndLib::Add( const gp_Cylinder& S,const Standard_Real UMin,
void BndLib::Add( const gp_Cylinder& S,const Standard_Real VMin, void BndLib::Add( const gp_Cylinder& S,const Standard_Real VMin,
const Standard_Real VMax,const Standard_Real Tol, Bnd_Box& B) { const Standard_Real VMax,const Standard_Real Tol, Bnd_Box& B) {
BndLib::Add(S,0.,2.*PI,VMin,VMax,Tol,B); BndLib::Add(S,0.,2.*M_PI,VMin,VMax,Tol,B);
} }
void BndLib::Add(const gp_Cone& S,const Standard_Real UMin, void BndLib::Add(const gp_Cone& S,const Standard_Real UMin,
@ -594,7 +594,7 @@ void BndLib::Add(const gp_Cone& S,const Standard_Real UMin,
void BndLib::Add( const gp_Cone& S,const Standard_Real VMin, void BndLib::Add( const gp_Cone& S,const Standard_Real VMin,
const Standard_Real VMax,const Standard_Real Tol, Bnd_Box& B) { const Standard_Real VMax,const Standard_Real Tol, Bnd_Box& B) {
BndLib::Add(S,0.,2.*PI,VMin,VMax,Tol,B); BndLib::Add(S,0.,2.*M_PI,VMin,VMax,Tol,B);
} }
void BndLib::Add(const gp_Sphere& S,const Standard_Real UMin, void BndLib::Add(const gp_Sphere& S,const Standard_Real UMin,
@ -703,12 +703,12 @@ void BndLib::Add(const gp_Torus& S,const Standard_Real UMin,
Standard_Integer Fi1; Standard_Integer Fi1;
Standard_Integer Fi2; Standard_Integer Fi2;
if (VMax<VMin) { if (VMax<VMin) {
Fi1 = (Standard_Integer )( VMax/(PI/4.)); Fi1 = (Standard_Integer )( VMax/(M_PI/4.));
Fi2 = (Standard_Integer )( VMin/(PI/4.)); Fi2 = (Standard_Integer )( VMin/(M_PI/4.));
} }
else { else {
Fi1 = (Standard_Integer )( VMin/(PI/4.)); Fi1 = (Standard_Integer )( VMin/(M_PI/4.));
Fi2 = (Standard_Integer )( VMax/(PI/4.)); Fi2 = (Standard_Integer )( VMax/(M_PI/4.));
} }
Fi2++; Fi2++;

View File

@ -240,9 +240,9 @@ void BndLib_AddSurface::Add(const Adaptor3d_Surface& S,
case GeomAbs_Sphere: case GeomAbs_Sphere:
{ {
if (Abs(UMin) < Precision::Angular() && if (Abs(UMin) < Precision::Angular() &&
Abs(UMax - 2.*PI) < Precision::Angular() && Abs(UMax - 2.*M_PI) < Precision::Angular() &&
Abs(VMin + PI/2.) < Precision::Angular() && Abs(VMin + M_PI/2.) < Precision::Angular() &&
Abs(VMax - PI/2.) < Precision::Angular()) // a whole sphere Abs(VMax - M_PI/2.) < Precision::Angular()) // a whole sphere
BndLib::Add(S.Sphere(),Tol,B); BndLib::Add(S.Sphere(),Tol,B);
else else
BndLib::Add(S.Sphere(),UMin,UMax,VMin,VMax,Tol,B); BndLib::Add(S.Sphere(),UMin,UMax,VMin,VMax,Tol,B);

View File

@ -22,17 +22,17 @@ void Compute(const Standard_Real P1,
} }
Standard_Real Delta =Abs(Teta2-Teta1); Standard_Real Delta =Abs(Teta2-Teta1);
if (Delta > 2. * PI) { if (Delta > 2. * M_PI) {
Teta1 = 0.; Teta1 = 0.;
Teta2 = 2. * PI; Teta2 = 2. * M_PI;
} }
else { else {
if (Teta1 < 0.) { if (Teta1 < 0.) {
do { Teta1+=2.*PI;} while (Teta1< 0.); do { Teta1+=2.*M_PI;} while (Teta1< 0.);
} }
else if (Teta1> 2.*PI) { else if (Teta1> 2.*M_PI) {
do { Teta1-=2.*PI;} while (Teta1> 2.*PI); do { Teta1-=2.*M_PI;} while (Teta1> 2.*M_PI);
} }
Teta2 = Teta1 + Delta; Teta2 = Teta1 + Delta;
@ -46,7 +46,7 @@ void Compute(const Standard_Real P1,
B.Add(Point(O +Ra*Cn2*Xd +Rb*Sn2*Yd)); B.Add(Point(O +Ra*Cn2*Xd +Rb*Sn2*Yd));
Standard_Real Ram,Rbm; Standard_Real Ram,Rbm;
if (Delta > PI/8.) { if (Delta > M_PI/8.) {
// Main radiuses to take into account only 8 points (/cos(Pi/8.)) // Main radiuses to take into account only 8 points (/cos(Pi/8.))
Ram=Ra/0.92387953251128674; Ram=Ra/0.92387953251128674;
Rbm=Rb/0.92387953251128674; Rbm=Rb/0.92387953251128674;
@ -61,7 +61,7 @@ void Compute(const Standard_Real P1,
B.Add(Point(O +Ram*Cn2*Xd +Rbm*Sn2*Yd)); B.Add(Point(O +Ram*Cn2*Xd +Rbm*Sn2*Yd));
// cos or sin PI/4. // cos or sin M_PI/4.
#define PI4 0.70710678118654746 #define PI4 0.70710678118654746
// 8 points of the polygon // 8 points of the polygon
@ -74,8 +74,8 @@ void Compute(const Standard_Real P1,
#define addP6 B.Add(Point(O -Rbm*Yd)); #define addP6 B.Add(Point(O -Rbm*Yd));
#define addP7 B.Add(Point(O +Ram*PI4*Xd -Rbm*PI4*Yd)) #define addP7 B.Add(Point(O +Ram*PI4*Xd -Rbm*PI4*Yd))
Standard_Integer deb = (Standard_Integer )( Teta1/(PI/4.)); Standard_Integer deb = (Standard_Integer )( Teta1/(M_PI/4.));
Standard_Integer fin = (Standard_Integer )( Teta2/(PI/4.)); Standard_Integer fin = (Standard_Integer )( Teta2/(M_PI/4.));
deb++; deb++;
if (deb>fin) return; if (deb>fin) return;

View File

@ -38,7 +38,7 @@ static Handle(Image_Image) myImage;
#define TRANSFORMCOLOR(c) \ #define TRANSFORMCOLOR(c) \
{ if (TypeOfCgm == CgmCharEncoding) c = (((c+1) << 2) - 1); } { if (TypeOfCgm == CgmCharEncoding) c = (((c+1) << 2) - 1); }
#define DRAD (PI/180.) #define DRAD (M_PI/180.)
#define DEFPLOTTER "DIRECT_CGM" #define DEFPLOTTER "DIRECT_CGM"
//----------------------------------------------------------------- //-----------------------------------------------------------------
@ -541,7 +541,7 @@ Standard_Boolean CGM_Driver::PlotArc (const Standard_ShortReal Xpos,
{ {
Standard_ShortReal san = sAngle; Standard_ShortReal san = sAngle;
Standard_ShortReal fan = sAngle + oAngle; Standard_ShortReal fan = sAngle + oAngle;
if (oAngle >= 2*PI) { if (oAngle >= 2*M_PI) {
PlotPolyAttrib (myLineColorIndex, -1, Standard_True); PlotPolyAttrib (myLineColorIndex, -1, Standard_True);
if (aXradius == aYradius) { if (aXradius == aYradius) {
ptabreal[0] = (float)Xpos; ptabreal[1] = (float)Ypos; ptabreal[0] = (float)Xpos; ptabreal[1] = (float)Ypos;
@ -582,7 +582,7 @@ Standard_Boolean CGM_Driver::PlotPolyArc (const Standard_ShortReal Xpos,
{ {
Standard_ShortReal san = sAngle; Standard_ShortReal san = sAngle;
Standard_ShortReal fan = sAngle + oAngle; Standard_ShortReal fan = sAngle + oAngle;
if (oAngle >= 2.*PI) { if (oAngle >= 2.*M_PI) {
if (aXradius == aYradius) { if (aXradius == aYradius) {
ptabreal[0] = (float)Xpos; ptabreal[1] = (float)Ypos; ptabreal[0] = (float)Xpos; ptabreal[1] = (float)Ypos;
ptabreal[2] = (float)aXradius; ptabreal[2] = (float)aXradius;

View File

@ -632,11 +632,6 @@ struct flags {
#define LOG2 0.30103 #define LOG2 0.30103
#define PARABIT 0x40 #define PARABIT 0x40
#ifndef PI
#define PI 3.1415926535
#endif
/* All default values set within the control program */ /* All default values set within the control program */
/* with Character encoding defaults */ /* with Character encoding defaults */

View File

@ -230,8 +230,4 @@
#define LOG2 0.30103 #define LOG2 0.30103
#define PARABIT 0x40 #define PARABIT 0x40
#ifndef PI
#define PI 3.1415926535
#endif
#endif /* end of cgmpar.h */ #endif /* end of cgmpar.h */

View File

@ -239,8 +239,8 @@ void CSLib::Normal(const Standard_Integer MaxOrder,
{ //All lambda i exist { //All lambda i exist
Standard_Integer SP; Standard_Integer SP;
Standard_Real inf,sup; Standard_Real inf,sup;
inf=0.0-Standard_PI; inf = 0.0 - M_PI;
sup=0.0+Standard_PI; sup = 0.0 + M_PI;
Standard_Boolean FU,LU,FV,LV; Standard_Boolean FU,LU,FV,LV;
//Creation of the domain of definition depending on the position //Creation of the domain of definition depending on the position
@ -249,29 +249,41 @@ void CSLib::Normal(const Standard_Integer MaxOrder,
LU=(Abs(U-Umax) < Precision::PConfusion() ); LU=(Abs(U-Umax) < Precision::PConfusion() );
FV=(Abs(V-Vmin) < Precision::PConfusion() ); FV=(Abs(V-Vmin) < Precision::PConfusion() );
LV=(Abs(V-Vmax) < Precision::PConfusion() ); LV=(Abs(V-Vmax) < Precision::PConfusion() );
if(LU) if (LU)
{ {
inf=Standard_PI/2; inf = M_PI / 2;
sup=3*inf; sup = 3 * inf;
if(LV){inf=Standard_PI;} if (LV)
if(FV){sup=Standard_PI;} {
inf = M_PI;
}
if (FV)
{
sup = M_PI;
}
} }
else if(FU) else if (FU)
{ {
sup=Standard_PI/2; sup = M_PI / 2;
inf=-sup; inf = -sup;
if(LV){sup=0;} if (LV)
if(FV){inf=0;} {
sup = 0;
}
if (FV)
{
inf = 0;
}
} }
else if(LV) else if (LV)
{ {
inf=0.0-Standard_PI; inf = 0.0 - M_PI;
sup=0; sup = 0;
} }
else if(FV) else if (FV)
{ {
inf=0; inf = 0;
sup=Standard_PI; sup = M_PI;
} }
Standard_Boolean CS=0; Standard_Boolean CS=0;
Standard_Real Vprec=0,Vsuiv; Standard_Real Vprec=0,Vsuiv;

View File

@ -975,13 +975,13 @@ TopoDS_Edge ChFi2d_Builder::BuildFilletEdge(const TopoDS_Vertex& V,
inside = (PPU2<param3 && PPU2>param4) || (PPU2<param4 && PPU2>param3); inside = (PPU2<param3 && PPU2>param4) || (PPU2<param4 && PPU2>param3);
// case of arc of circle passing on the sewing // case of arc of circle passing on the sewing
if ( ( basisC2->DynamicType() == STANDARD_TYPE(Geom2d_Circle) ) && if ( ( basisC2->DynamicType() == STANDARD_TYPE(Geom2d_Circle) ) &&
( (2*PI<param3 && 2*PI>param4) || (2*PI<param4 && 2*PI>param3) ) ) { ( (2*M_PI<param3 && 2*M_PI>param4) || (2*M_PI<param4 && 2*M_PI>param3) ) ) {
// cas param3<param4 // cas param3<param4
inside = (param3<PPU2 && PPU2<2*PI) inside = (param3<PPU2 && PPU2<2*M_PI)
|| (0<=PPU2 && PPU2<param4-2*PI); || (0<=PPU2 && PPU2<param4-2*M_PI);
// cas param4<param3 // cas param4<param3
inside = inside || (param4<PPU2 && PPU2<2*PI) inside = inside || (param4<PPU2 && PPU2<2*M_PI)
|| (0<=PPU2 && PPU2<param3-2*PI); || (0<=PPU2 && PPU2<param3-2*M_PI);
} }
if ( inside && dist < dist1) { if ( inside && dist < dist1) {
numsol = nsol; numsol = nsol;
@ -1005,12 +1005,12 @@ TopoDS_Edge ChFi2d_Builder::BuildFilletEdge(const TopoDS_Vertex& V,
inside = (U2 < param1 && U2 >= param2) || (U2 <= param2 && U2 > param1); inside = (U2 < param1 && U2 >= param2) || (U2 <= param2 && U2 > param1);
///////////////////////////////////////////////////// /////////////////////////////////////////////////////
if ( (basisC1->DynamicType() == STANDARD_TYPE(Geom2d_Circle)) if ( (basisC1->DynamicType() == STANDARD_TYPE(Geom2d_Circle))
&& ( (2*PI<param1 && 2*PI>param2) || (2*PI<param2 && 2*PI>param1) ) ) { && ( (2*M_PI<param1 && 2*M_PI>param2) || (2*M_PI<param2 && 2*M_PI>param1) ) ) {
// arc of circle containing the circle origin // arc of circle containing the circle origin
// case param1<param2 // case param1<param2
inside = (param1<U2 && U2<2*PI) || (0<=U2 && U2<param2-2*PI); inside = (param1<U2 && U2<2*M_PI) || (0<=U2 && U2<param2-2*M_PI);
// case param2<param1 // case param2<param1
inside = inside || (param2<U2 && U2<2*PI) || (0<=U2 && U2<param1-2*PI); inside = inside || (param2<U2 && U2<2*M_PI) || (0<=U2 && U2<param1-2*M_PI);
} }
if (!inside) { if (!inside) {
status = ChFi2d_ComputationError; status = ChFi2d_ComputationError;
@ -1022,12 +1022,12 @@ TopoDS_Edge ChFi2d_Builder::BuildFilletEdge(const TopoDS_Vertex& V,
inside = (Vv2 < param3 && Vv2 >= param4) || (Vv2 <= param4 && Vv2 > param3); inside = (Vv2 < param3 && Vv2 >= param4) || (Vv2 <= param4 && Vv2 > param3);
///////////////////////////////////////////////////// /////////////////////////////////////////////////////
if ( (basisC2->DynamicType() == STANDARD_TYPE(Geom2d_Circle)) if ( (basisC2->DynamicType() == STANDARD_TYPE(Geom2d_Circle))
&& ( (2*PI<param3 && 2*PI>param4) || (2*PI<param4 && 2*PI>param3) ) ) { && ( (2*M_PI<param3 && 2*M_PI>param4) || (2*M_PI<param4 && 2*M_PI>param3) ) ) {
// arc of circle containing the circle origin // arc of circle containing the circle origin
// cas param3<param4 // cas param3<param4
inside = (param3<Vv2 && Vv2<2*PI) || (0<=Vv2 && Vv2<param4-2*PI); inside = (param3<Vv2 && Vv2<2*M_PI) || (0<=Vv2 && Vv2<param4-2*M_PI);
// cas param4<param3 // cas param4<param3
inside = inside || (param4<Vv2 && Vv2<2*PI) || (0<=Vv2 && Vv2<param3-2*PI); inside = inside || (param4<Vv2 && Vv2<2*M_PI) || (0<=Vv2 && Vv2<param3-2*M_PI);
} }
if (!inside) { if (!inside) {
status = ChFi2d_ComputationError; status = ChFi2d_ComputationError;
@ -1098,8 +1098,8 @@ TopoDS_Edge ChFi2d_Builder::BuildFilletEdge(const TopoDS_Vertex& V,
} // if (OE1 ... } // if (OE1 ...
Standard_Real cross = vec1*vec; Standard_Real cross = vec1*vec;
Standard_Boolean Sense = cross > 0.; Standard_Boolean Sense = cross > 0.;
if (U1 > Vv1 && U1 > 2.*PI) { if (U1 > Vv1 && U1 > 2.*M_PI) {
ElCLib::AdjustPeriodic(0.,2.*PI,Precision::Confusion(),U1,Vv1); ElCLib::AdjustPeriodic(0.,2.*M_PI,Precision::Confusion(),U1,Vv1);
} // if (U1 ... } // if (U1 ...
if (O1 == TopAbs_FORWARD && OE1 == TopAbs_FORWARD || if (O1 == TopAbs_FORWARD && OE1 == TopAbs_FORWARD ||
O1 == TopAbs_REVERSED && OE1 == TopAbs_REVERSED ) { O1 == TopAbs_REVERSED && OE1 == TopAbs_REVERSED ) {

View File

@ -98,7 +98,7 @@ Standard_Integer ChFi3d::ConcaveSide(const BRepAdaptor_Surface& S1,
dint1 = ns1.Crossed(tgE1); dint1 = ns1.Crossed(tgE1);
dint2 = ns2.Crossed(tgE2); dint2 = ns2.Crossed(tgE2);
Standard_Real ang = ns1.CrossMagnitude(ns2); Standard_Real ang = ns1.CrossMagnitude(ns2);
if(ang > 0.0001*PI){ if(ang > 0.0001*M_PI){
Standard_Real scal = ns2.Dot(dint1); Standard_Real scal = ns2.Dot(dint1);
if ( scal <= 0. ){ if ( scal <= 0. ){
ns2.Reverse(); ns2.Reverse();
@ -129,7 +129,7 @@ Standard_Integer ChFi3d::ConcaveSide(const BRepAdaptor_Surface& S1,
dint1 = ns1.Crossed(tgE1); dint1 = ns1.Crossed(tgE1);
dint2 = ns2.Crossed(tgE2); dint2 = ns2.Crossed(tgE2);
ang = ns1.CrossMagnitude(ns2); ang = ns1.CrossMagnitude(ns2);
if(ang > 0.0001*PI){ if(ang > 0.0001*M_PI){
Standard_Real scal = ns2.Dot(dint1); Standard_Real scal = ns2.Dot(dint1);
if ( scal <= 0. ){ if ( scal <= 0. ){
ns2.Reverse(); ns2.Reverse();

View File

@ -752,7 +752,7 @@ Handle(Geom_BezierCurve) ChFi3d_Spine(const gp_Pnt& pd,
const Standard_Real R) const Standard_Real R)
{ {
TColgp_Array1OfPnt pol(1,4); TColgp_Array1OfPnt pol(1,4);
const Standard_Real fac = 0.5 * tan((PI-vd.Angle(vf)) * 0.5); const Standard_Real fac = 0.5 * tan((M_PI-vd.Angle(vf)) * 0.5);
pol(1) = pd; pol(1) = pd;
vd.Multiply(fac*R); vd.Multiply(fac*R);
pol(2).SetCoord(pd.X()+vd.X(),pd.Y()+vd.Y(),pd.Z()+vd.Z()); pol(2).SetCoord(pd.X()+vd.X(),pd.Y()+vd.Y(),pd.Z()+vd.Z());
@ -3099,11 +3099,11 @@ Standard_Boolean ChFi3d_ComputeCurves(Handle(Adaptor3d_HSurface)& S1,
Ufin = -Ufin; Ufin = -Ufin;
} }
else{ else{
Udeb = 2*PI - Udeb; Udeb = 2*M_PI - Udeb;
Ufin = 2*PI - Ufin; Ufin = 2*M_PI - Ufin;
} }
} }
if(!c1line) ElCLib::AdjustPeriodic(0.,2*PI,Precision::Angular(),Udeb,Ufin); if(!c1line) ElCLib::AdjustPeriodic(0.,2*M_PI,Precision::Angular(),Udeb,Ufin);
Handle(GeomAdaptor_HCurve) HC = new GeomAdaptor_HCurve(); Handle(GeomAdaptor_HCurve) HC = new GeomAdaptor_HCurve();
HC->ChangeCurve().Load(C3d,Udeb,Ufin); HC->ChangeCurve().Load(C3d,Udeb,Ufin);
ChFi3d_ProjectPCurv(HC,S1,Pc1,tol3d,tolr1); ChFi3d_ProjectPCurv(HC,S1,Pc1,tol3d,tolr1);
@ -3629,7 +3629,7 @@ Handle(GeomAdaptor_HSurface) ChFi3d_BoundSurf(TopOpeBRepDS_DataStructure& DSt
//In the case of a torus or cone, it is not necessary that the bounds create a surface with period more than 2PI. //In the case of a torus or cone, it is not necessary that the bounds create a surface with period more than 2PI.
else if (styp == GeomAbs_Torus || else if (styp == GeomAbs_Torus ||
styp == GeomAbs_Cone) { styp == GeomAbs_Cone) {
Du = Min(PI-0.5*Du,0.1*Du); Du = Min(M_PI-0.5*Du,0.1*Du);
Dv = 0.; Dv = 0.;
S1.Load(DStr.Surface(Fd1->Surf()).Surface(), S1.Load(DStr.Surface(Fd1->Surf()).Surface(),
mu-Du,Mu+Du,mv,Mv); mu-Du,Mu+Du,mv,Mv);
@ -4126,7 +4126,7 @@ Standard_EXPORT
// //
caredeb = 0; caredeb = 0;
carefin = 0; carefin = 0;
Angle = PI*0.75; Angle = M_PI*0.75;
LocalWL = WL; LocalWL = WL;
LocalWF = WF; LocalWF = WF;
if (!ES.IsPeriodic() && !PDeb.IsEqual(BSpline->Pole(1), tol) ) { if (!ES.IsPeriodic() && !PDeb.IsEqual(BSpline->Pole(1), tol) ) {
@ -4748,7 +4748,7 @@ Standard_Boolean ChFi3d_IsSmooth( const Handle(Geom_Curve)& C )
LProp.CentreOfCurvature(P2); LProp.CentreOfCurvature(P2);
gp_Vec Vec(P1, P2); gp_Vec Vec(P1, P2);
Standard_Real Angle = PrevVec.Angle( Vec ); Standard_Real Angle = PrevVec.Angle( Vec );
if (Angle > PI/3.) if (Angle > M_PI/3.)
return Standard_False; return Standard_False;
Standard_Real Ratio = Vec.Magnitude() / PrevVec.Magnitude(); Standard_Real Ratio = Vec.Magnitude() / PrevVec.Magnitude();
if (Ratio < 1.) if (Ratio < 1.)

View File

@ -700,12 +700,12 @@ Standard_Boolean ChFi3d_Builder::PerformElement(const Handle(ChFiDS_Spine)& Spin
// there is no need of tolerance // there is no need of tolerance
// to make a decision (PRO9486) the regularity is enough. // to make a decision (PRO9486) the regularity is enough.
// However, the abcense of turn-back is checked (PRO9810) // However, the abcense of turn-back is checked (PRO9810)
OnAjoute = ((!rev && av1v2 < PI/2) OnAjoute = ((!rev && av1v2 < M_PI/2)
||(rev && av1v2 > PI/2)); ||(rev && av1v2 > M_PI/2));
// mate attention to the single case (cf CTS21610_1) // mate attention to the single case (cf CTS21610_1)
if (OnAjoute && (degeneOnEc || if (OnAjoute && (degeneOnEc ||
TangentOnVertex(LVEc, Ev,myEFMap, ta)) ) TangentOnVertex(LVEc, Ev,myEFMap, ta)) )
OnAjoute=((!rev && av1v2 < ta) || (rev && (PI - av1v2) < ta)); OnAjoute=((!rev && av1v2 < ta) || (rev && (M_PI - av1v2) < ta));
} }
if (OnAjoute) { if (OnAjoute) {
Fini = Standard_False; // If this can be useful (Cf PRO14713) Fini = Standard_False; // If this can be useful (Cf PRO14713)
@ -729,7 +729,7 @@ Standard_Boolean ChFi3d_Builder::PerformElement(const Handle(ChFiDS_Spine)& Spin
for (Jt.Initialize(myEFMap(Ev)), Nbface= 0 ;Jt.More();Jt.Next(), for (Jt.Initialize(myEFMap(Ev)), Nbface= 0 ;Jt.More();Jt.Next(),
Nbface++) {} Nbface++) {}
if (Nbface> 1) CurSt = ChFiDS_BreakPoint; if (Nbface> 1) CurSt = ChFiDS_BreakPoint;
Fini = ((!rev && av1v2 < ta) || (rev && (PI - av1v2) < ta)); Fini = ((!rev && av1v2 < ta) || (rev && (M_PI - av1v2) < ta));
} }
} }
} }
@ -772,11 +772,11 @@ Standard_Boolean ChFi3d_Builder::PerformElement(const Handle(ChFiDS_Spine)& Spin
Standard_Boolean rev = (Or1 != curor); Standard_Boolean rev = (Or1 != curor);
Standard_Boolean OnAjoute = Standard_False; Standard_Boolean OnAjoute = Standard_False;
if (FaceTangency(Ec,Ev,LVEv)) { if (FaceTangency(Ec,Ev,LVEv)) {
OnAjoute = ((!rev && av1v2 < PI/2) OnAjoute = ((!rev && av1v2 < M_PI/2)
||(rev && av1v2 > PI/2)); ||(rev && av1v2 > M_PI/2));
if (OnAjoute && (degeneOnEc || if (OnAjoute && (degeneOnEc ||
TangentOnVertex(FVEc, Ev,myEFMap, ta)) ) TangentOnVertex(FVEc, Ev,myEFMap, ta)) )
OnAjoute=((!rev && av1v2 < ta) || (rev && (PI-av1v2) < ta)); OnAjoute=((!rev && av1v2 < ta) || (rev && (M_PI-av1v2) < ta));
} }
if (OnAjoute) { if (OnAjoute) {
Ec = Ev; Ec = Ev;
@ -791,7 +791,7 @@ Standard_Boolean ChFi3d_Builder::PerformElement(const Handle(ChFiDS_Spine)& Spin
for(Jt.Initialize(myEFMap(Ev)),Nbface= 0 ;Jt.More();Jt.Next(), for(Jt.Initialize(myEFMap(Ev)),Nbface= 0 ;Jt.More();Jt.Next(),
Nbface++) {} Nbface++) {}
if (Nbface> 1) CurSt = ChFiDS_BreakPoint; if (Nbface> 1) CurSt = ChFiDS_BreakPoint;
Fini = ((!rev && av1v2 < ta) || (rev && (PI - av1v2) < ta)); Fini = ((!rev && av1v2 < ta) || (rev && (M_PI - av1v2) < ta));
} }
} }
} }

View File

@ -853,7 +853,7 @@ void ChFi3d_Builder::StartSol(const Handle(ChFiDS_Stripe)& Stripe,
// There are ponts on the border, and internal points are found // There are ponts on the border, and internal points are found
if (derive.Magnitude() > Precision::PConfusion()) { if (derive.Magnitude() > Precision::PConfusion()) {
derive.Normalized(); derive.Normalized();
derive.Rotate(PI/2); derive.Rotate(M_PI/2);
AS.Initialize(f1); AS.Initialize(f1);
ResU = AS.UResolution(TolE); ResU = AS.UResolution(TolE);
ResV = AS.VResolution(TolE); ResV = AS.VResolution(TolE);

View File

@ -2041,7 +2041,7 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index)
trouve=Standard_False; trouve=Standard_False;
ChFi3d_cherche_vertex ( Edge[0],Edge[1],Vcom,trouve); ChFi3d_cherche_vertex ( Edge[0],Edge[1],Vcom,trouve);
if (Vcom.IsSame(Vtx)) ang1=ChFi3d_AngleEdge(Vtx,Edge[0],Edge[1]); if (Vcom.IsSame(Vtx)) ang1=ChFi3d_AngleEdge(Vtx,Edge[0],Edge[1]);
if (Abs(ang1-PI)<0.01) { if (Abs(ang1-M_PI)<0.01) {
oneintersection1=Standard_True; oneintersection1=Standard_True;
facesau=Face[0]; facesau=Face[0];
edgesau=Edge[1]; edgesau=Edge[1];
@ -2054,7 +2054,7 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index)
trouve=Standard_False; trouve=Standard_False;
ChFi3d_cherche_vertex ( Edge[1],Edge[2],Vcom,trouve); ChFi3d_cherche_vertex ( Edge[1],Edge[2],Vcom,trouve);
if (Vcom.IsSame(Vtx)) ang1=ChFi3d_AngleEdge(Vtx,Edge[1],Edge[2]); if (Vcom.IsSame(Vtx)) ang1=ChFi3d_AngleEdge(Vtx,Edge[1],Edge[2]);
if (Abs(ang1-PI)<0.01) { if (Abs(ang1-M_PI)<0.01) {
oneintersection2=Standard_True; oneintersection2=Standard_True;
facesau=Face[1]; facesau=Face[1];
edgesau=Edge[1]; edgesau=Edge[1];
@ -2414,17 +2414,17 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index)
// deb=pfildeb.X(); // deb=pfildeb.X();
// xx1=pfil1.X(); // xx1=pfil1.X();
// xx2=pfil2.X(); // xx2=pfil2.X();
// moins2pi=Abs(deb)< Abs(Abs(deb)-2*PI); // moins2pi=Abs(deb)< Abs(Abs(deb)-2*M_PI);
// moins2pi1=Abs(xx1)< Abs(Abs(xx1)-2*PI); // moins2pi1=Abs(xx1)< Abs(Abs(xx1)-2*M_PI);
// moins2pi2=Abs(xx2)< Abs(Abs(xx2)-2*PI); // moins2pi2=Abs(xx2)< Abs(Abs(xx2)-2*M_PI);
// if (moins2pi1!=moins2pi2) { // if (moins2pi1!=moins2pi2) {
// if (moins2pi) { // if (moins2pi) {
// if (!moins2pi1) xx1=xx1-2*PI; // if (!moins2pi1) xx1=xx1-2*M_PI;
// if (!moins2pi2) xx2=xx2-2*PI; // if (!moins2pi2) xx2=xx2-2*M_PI;
// } // }
// else { // else {
// if (moins2pi1) xx1=xx1+2*PI; // if (moins2pi1) xx1=xx1+2*M_PI;
// if (moins2pi2) xx2=xx2+2*PI; // if (moins2pi2) xx2=xx2+2*M_PI;
// } // }
// } // }
// pfil1.SetX(xx1); // pfil1.SetX(xx1);
@ -2437,17 +2437,17 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index)
// deb=ufmin; // deb=ufmin;
// xx1=pfac1.X(); // xx1=pfac1.X();
// xx2=pfac2.X(); // xx2=pfac2.X();
// moins2pi=Abs(deb)< Abs(Abs(deb)-2*PI); // moins2pi=Abs(deb)< Abs(Abs(deb)-2*M_PI);
// moins2pi1=Abs(xx1)< Abs(Abs(xx1)-2*PI); // moins2pi1=Abs(xx1)< Abs(Abs(xx1)-2*M_PI);
// moins2pi2=Abs(xx2)< Abs(Abs(xx2)-2*PI); // moins2pi2=Abs(xx2)< Abs(Abs(xx2)-2*M_PI);
// if (moins2pi1!=moins2pi2) { // if (moins2pi1!=moins2pi2) {
// if (moins2pi) { // if (moins2pi) {
// if (!moins2pi1) xx1=xx1-2*PI; // if (!moins2pi1) xx1=xx1-2*M_PI;
// if (!moins2pi2) xx2=xx2-2*PI; // if (!moins2pi2) xx2=xx2-2*M_PI;
// } // }
// else { // else {
// if (moins2pi1) xx1=xx1+2*PI; // if (moins2pi1) xx1=xx1+2*M_PI;
// if (moins2pi2) xx2=xx2+2*PI; // if (moins2pi2) xx2=xx2+2*M_PI;
// } // }
// } // }
// pfac1.SetX(xx1); // pfac1.SetX(xx1);

View File

@ -491,15 +491,15 @@ static void CalculBatten (const Handle (GeomAdaptor_HSurface) ASurf,
Bat.SetFreeSliding (Standard_True); Bat.SetFreeSliding (Standard_True);
Standard_Real ang1,ang2; Standard_Real ang1,ang2;
ang1=dir1.Angle(dir3); ang1=dir1.Angle(dir3);
if (dir1.Angle(dir4) >0 ) ang2=PI-dir1.Angle(dir4); if (dir1.Angle(dir4) >0 ) ang2=M_PI-dir1.Angle(dir4);
else ang2=-PI-dir1.Angle(dir4); else ang2=-M_PI-dir1.Angle(dir4);
if (contraint1&&contraint2) if (contraint1&&contraint2)
anglebig=(Abs(ang1)>1.2)|| (Abs(ang2)>1.2 ); anglebig=(Abs(ang1)>1.2)|| (Abs(ang2)>1.2 );
else if (contraint1) else if (contraint1)
anglebig=Abs(ang1)>1.2; anglebig=Abs(ang1)>1.2;
else if (contraint2) else if (contraint2)
anglebig=Abs(ang2)>1.2; anglebig=Abs(ang2)>1.2;
if (isplane && (Abs(ang1)>PI/2 || Abs(ang2)>PI/2)) if (isplane && (Abs(ang1)>M_PI/2 || Abs(ang2)>M_PI/2))
isplane=Standard_False; isplane=Standard_False;
if (anglebig && !isplane) { if (anglebig && !isplane) {
CalculDroite(p2d1,xdir,ydir,pcurve); CalculDroite(p2d1,xdir,ydir,pcurve);
@ -994,7 +994,7 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex,
Standard_Boolean droit=Standard_False; Standard_Boolean droit=Standard_False;
if (bordlibre) {nedge=(nedge-2)/2 +2; if (bordlibre) {nedge=(nedge-2)/2 +2;
Standard_Real angedg=Abs(ChFi3d_AngleEdge(V1,edgelibre1,edgelibre2)); Standard_Real angedg=Abs(ChFi3d_AngleEdge(V1,edgelibre1,edgelibre2));
droit=Abs(angedg-PI)<0.01; droit=Abs(angedg-M_PI)<0.01;
} }
else nedge=nedge/2; else nedge=nedge/2;
Standard_Integer size=nedge*2; Standard_Integer size=nedge*2;
@ -1248,7 +1248,7 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex,
if (ind!=ic) { if (ind!=ic) {
TopoDS_Edge ecur=TopoDS::Edge(Evive.Value(ind)); TopoDS_Edge ecur=TopoDS::Edge(Evive.Value(ind));
Standard_Real ang=Abs(ChFi3d_AngleEdge(V1,ecur,ereg)); Standard_Real ang=Abs(ChFi3d_AngleEdge(V1,ecur,ereg));
if (ang<0.01 || Abs(ang-PI) <0.01) { if (ang<0.01 || Abs(ang-M_PI) <0.01) {
regul.SetValue(ic,Standard_False); regul.SetValue(ic,Standard_False);
tangentregul.SetValue(ic,Standard_True); tangentregul.SetValue(ic,Standard_True);
trouve=Standard_True; trouve=Standard_True;
@ -1290,7 +1290,7 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex,
if ( !E1.IsSame(edgelibre1) && !E1.IsSame(edgelibre2) && if ( !E1.IsSame(edgelibre1) && !E1.IsSame(edgelibre2) &&
!E2.IsSame(edgelibre1) && !E2.IsSame(edgelibre2)){ !E2.IsSame(edgelibre1) && !E2.IsSame(edgelibre2)){
Standard_Real ang=Abs(ChFi3d_AngleEdge(V1 ,E1,E2)); Standard_Real ang=Abs(ChFi3d_AngleEdge(V1 ,E1,E2));
deuxconges=(ang<0.01 || Abs(ang-PI)<0.01); deuxconges=(ang<0.01 || Abs(ang-M_PI)<0.01);
} }
} }
} }
@ -1339,7 +1339,7 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex,
Indices(nedge,ic,icplus,icmoins); Indices(nedge,ic,icplus,icmoins);
TopoDS_Edge Arc=TopoDS::Edge(Evive.Value(ic)); TopoDS_Edge Arc=TopoDS::Edge(Evive.Value(ic));
ChFiDS_CommonPoint cp1, cp2; ChFiDS_CommonPoint cp1, cp2;
Standard_Real angedg=PI; Standard_Real angedg=M_PI;
TopoDS_Vertex Vcom; TopoDS_Vertex Vcom;
if (!sharp.Value(icplus)) { if (!sharp.Value(icplus)) {
isfirst=(sens.Value(icplus)==1); isfirst=(sens.Value(icplus)==1);
@ -1349,7 +1349,7 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex,
if (cp1.IsOnArc()){ if (cp1.IsOnArc()){
ChFi3d_cherche_vertex(Arc,cp1.Arc(),Vcom,trouve); ChFi3d_cherche_vertex(Arc,cp1.Arc(),Vcom,trouve);
if (trouve) angedg=Abs(ChFi3d_AngleEdge(Vcom,Arc,cp1.Arc())); if (trouve) angedg=Abs(ChFi3d_AngleEdge(Vcom,Arc,cp1.Arc()));
if (!cp1.Arc().IsSame(Arc) && Abs(angedg-PI)<0.01){ if (!cp1.Arc().IsSame(Arc) && Abs(angedg-M_PI)<0.01){
Evive.SetValue(ic,cp1.Arc()); Evive.SetValue(ic,cp1.Arc());
ChFi3d_edge_common_faces(myEFMap(cp1.Arc()),F1,F2); ChFi3d_edge_common_faces(myEFMap(cp1.Arc()),F1,F2);
if (!Fvive.Value(ic,icplus).IsSame(F1) && !Fvive.Value(ic,icplus).IsSame(F2)) { if (!Fvive.Value(ic,icplus).IsSame(F1) && !Fvive.Value(ic,icplus).IsSame(F2)) {
@ -1378,10 +1378,10 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex,
cp2 = CD.Value(icmoins)->SetOfSurfData()->Value(Index.Value(icmoins))-> cp2 = CD.Value(icmoins)->SetOfSurfData()->Value(Index.Value(icmoins))->
ChangeVertex (isfirst,jf.Value(icmoins)); ChangeVertex (isfirst,jf.Value(icmoins));
if (cp2.IsOnArc()) { if (cp2.IsOnArc()) {
angedg=PI; angedg=M_PI;
ChFi3d_cherche_vertex(Arc,cp2.Arc(),Vcom,trouve); ChFi3d_cherche_vertex(Arc,cp2.Arc(),Vcom,trouve);
if (trouve) angedg=Abs(ChFi3d_AngleEdge(Vcom,Arc,cp2.Arc())); if (trouve) angedg=Abs(ChFi3d_AngleEdge(Vcom,Arc,cp2.Arc()));
if (!cp2.Arc().IsSame(Arc)&&Abs(angedg-PI)<0.01) { if (!cp2.Arc().IsSame(Arc)&&Abs(angedg-M_PI)<0.01) {
Evive.SetValue(ic,cp2.Arc()); Evive.SetValue(ic,cp2.Arc());
ChFi3d_edge_common_faces(myEFMap(cp2.Arc()),F1,F2); ChFi3d_edge_common_faces(myEFMap(cp2.Arc()),F1,F2);
if (!Fvive.Value(ic,icmoins).IsSame(F1) && !Fvive.Value(ic,icmoins).IsSame(F2)) { if (!Fvive.Value(ic,icmoins).IsSame(F1) && !Fvive.Value(ic,icmoins).IsSame(F2)) {
@ -1459,7 +1459,7 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex,
Standard_Integer iface; Standard_Integer iface;
// if two edges are tangent the intersection is not attempted (cts60046) // if two edges are tangent the intersection is not attempted (cts60046)
angedg=Abs(ChFi3d_AngleEdge(V1,TopoDS::Edge(Evive.Value(ic)),TopoDS::Edge(Evive.Value(icplus)))); angedg=Abs(ChFi3d_AngleEdge(V1,TopoDS::Edge(Evive.Value(ic)),TopoDS::Edge(Evive.Value(icplus))));
if (Abs(angedg-PI)>0.01) if (Abs(angedg-M_PI)>0.01)
ok = ChFi3d_SearchFD(DStr,CD.Value(ic),CD.Value(icplus),sens.Value(ic),sens.Value(icplus), ok = ChFi3d_SearchFD(DStr,CD.Value(ic),CD.Value(icplus),sens.Value(ic),sens.Value(icplus),
i1,i2,pa1,pa2, i1,i2,pa1,pa2,
Index.Value(ic),Index.Value(icplus), Index.Value(ic),Index.Value(icplus),
@ -2230,20 +2230,20 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex,
if (couture) { if (couture) {
Standard_Boolean PI1=Standard_False, PI2=Standard_False; Standard_Boolean PI1=Standard_False, PI2=Standard_False;
Standard_Real xx; Standard_Real xx;
PI1=0<=p2d1.X() && p2d1.X() <=PI; PI1=0<=p2d1.X() && p2d1.X() <=M_PI;
PI2=0<=p2d2.X() && p2d2.X() <=PI; PI2=0<=p2d2.X() && p2d2.X() <=M_PI;
if (Evive.Value(ic).IsSame(edgecouture)){ if (Evive.Value(ic).IsSame(edgecouture)){
xx=p2d1.X(); xx=p2d1.X();
if (PI2&&!PI1) xx=xx-2*PI; if (PI2&&!PI1) xx=xx-2*M_PI;
if (!PI2&&PI1) xx=xx+2*PI; if (!PI2&&PI1) xx=xx+2*M_PI;
p2d1.SetX(xx); p2d1.SetX(xx);
} }
if (Evive.Value(icplus).IsSame(edgecouture)){ if (Evive.Value(icplus).IsSame(edgecouture)){
xx=p2d2.X(); xx=p2d2.X();
if (PI2&&!PI1) xx=xx+2*PI; if (PI2&&!PI1) xx=xx+2*M_PI;
if (!PI2&&PI1) xx=xx-2*PI; if (!PI2&&PI1) xx=xx-2*M_PI;
p2d2.SetX(xx); p2d2.SetX(xx);
} }
} }

View File

@ -363,7 +363,7 @@ void ChFi3d_Builder::Trunc(const Handle(ChFiDS_SurfData)& SD,
Standard_Real Ang = dsp.Angle(ded); Standard_Real Ang = dsp.Angle(ded);
Standard_Real dis1 = psp.Distance(ped); Standard_Real dis1 = psp.Distance(ped);
Standard_Real dis2 = p1.Distance(p2); Standard_Real dis2 = p1.Distance(p2);
if(Ang > PI/18.) tron = Standard_True; if(Ang > M_PI/18.) tron = Standard_True;
if(dis1 >= 0.1*dis2) tron = Standard_True; if(dis1 >= 0.1*dis2) tron = Standard_True;
Standard_Integer ivois; Standard_Integer ivois;
if(!tron && YaUnVoisin(Spine,iedge,ivois,isfirst)) { if(!tron && YaUnVoisin(Spine,iedge,ivois,isfirst)) {

View File

@ -746,9 +746,9 @@ void ChFi3d_ChBuilder::SimulKPart(const Handle(ChFiDS_SurfData)& SD ) const
gp_Cone Co = AS.Cone(); gp_Cone Co = AS.Cone();
Standard_Real rad = Co.RefRadius(), sang = Co.SemiAngle(); Standard_Real rad = Co.RefRadius(), sang = Co.SemiAngle();
//#ifndef DEB //#ifndef DEB
Standard_Integer n = (Standard_Integer) (36.*ang/PI + 1); Standard_Integer n = (Standard_Integer) (36.*ang/M_PI + 1);
//#else //#else
// Standard_Integer n = 36.*ang/PI + 1; // Standard_Integer n = 36.*ang/M_PI + 1;
//#endif //#endif
if(n<2) n = 2; if(n<2) n = 2;
sec = new ChFiDS_SecHArray1(1, n); sec = new ChFiDS_SecHArray1(1, n);
@ -2133,7 +2133,7 @@ void ChFi3d_ChBuilder::SetRegul()
gp_Pnt p; gp_Pnt p;
gp_Vec n1,n2,du,dv; gp_Vec n1,n2,du,dv;
BRep_Builder B; BRep_Builder B;
Standard_Real Seuil = PI/360.; Standard_Real Seuil = M_PI/360.;
Standard_Real Seuil2 = Seuil * Seuil; Standard_Real Seuil2 = Seuil * Seuil;
for (it.Initialize(myRegul); it.More(); it.Next()){ for (it.Initialize(myRegul); it.More(); it.Next()){
const ChFiDS_Regul& reg = it.Value(); const ChFiDS_Regul& reg = it.Value();

View File

@ -542,9 +542,9 @@ void ChFi3d_FilBuilder::SimulKPart(const Handle(ChFiDS_SurfData)& SD) const
gp_Torus To = AS.Torus(); gp_Torus To = AS.Torus();
Standard_Real majr = To.MajorRadius(), minr = To.MinorRadius(); Standard_Real majr = To.MajorRadius(), minr = To.MinorRadius();
//#ifndef DEB //#ifndef DEB
Standard_Integer n = (Standard_Integer) (36.*ang/PI + 1); Standard_Integer n = (Standard_Integer) (36.*ang/M_PI + 1);
//#else //#else
// Standard_Integer n = 36.*ang/PI + 1; // Standard_Integer n = 36.*ang/M_PI + 1;
//#endif //#endif
if(n<2) n = 2; if(n<2) n = 2;
sec = new ChFiDS_SecHArray1(1, n); sec = new ChFiDS_SecHArray1(1, n);
@ -565,9 +565,9 @@ void ChFi3d_FilBuilder::SimulKPart(const Handle(ChFiDS_SurfData)& SD) const
gp_Sphere Sp = AS.Sphere(); gp_Sphere Sp = AS.Sphere();
Standard_Real rad = Sp.Radius(); Standard_Real rad = Sp.Radius();
//#ifndef DEB //#ifndef DEB
Standard_Integer n = (Standard_Integer) (36.*ang/PI + 1); Standard_Integer n = (Standard_Integer) (36.*ang/M_PI + 1);
//#else //#else
// Standard_Integer n = 36.*ang/PI + 1; // Standard_Integer n = 36.*ang/M_PI + 1;
//#endif //#endif
if(n<2) n = 2; if(n<2) n = 2;
sec = new ChFiDS_SecHArray1(1, n); sec = new ChFiDS_SecHArray1(1, n);

View File

@ -220,7 +220,7 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const Standard_Integer Index)
if (Sens2==-1) dir2.Reverse(); if (Sens2==-1) dir2.Reverse();
Standard_Real ang1; Standard_Real ang1;
ang1=Abs(dir1.Angle(dir2)); ang1=Abs(dir1.Angle(dir2));
if (ang1<PI/180.) { if (ang1<M_PI/180.) {
PerformMoreThreeCorner(Index,2); PerformMoreThreeCorner(Index,2);
done=1; done=1;
return; return;

Some files were not shown because too many files have changed in this diff Show More