if (! Xdirection.IsEqual( ToFirstAttach, Precision::Angular() ) &&
! Xdirection.IsOpposite( ToFirstAttach, Precision::Angular() ) &&
(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 ) );
if(lpar > fpar)
return ((para >= fpar) && (para <= lpar));
else { // fpar > lpar
- Standard_Real delta = 2*PI-fpar;
+ Standard_Real delta = 2*M_PI-fpar;
Standard_Real lp, par, fp;
lp = lpar + delta;
par = para + delta;
- while(lp > 2*PI) lp-=2*PI;
- while(par > 2*PI) par-=2*PI;
+ while(lp > 2*M_PI) lp-=2*M_PI;
+ while(par > 2*M_PI) par-=2*M_PI;
fp = 0.;
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;
return Standard_False;
}
{
Standard_Real dist;
Standard_Real parApex = ElCLib::Parameter ( elips, Apex );
- if(parApex == 0.0 || parApex == PI)
+ if(parApex == 0.0 || parApex == M_PI)
{//Major case
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
- dist = (par < PI) ? ( PI - par) : ( par - PI );
+ dist = (par < M_PI) ? ( M_PI - par) : ( par - M_PI );
}
else
{// 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;
else
{
- if(par > parApex + PI) // 3/2*PI < par < 2*PI
- dist = 2*PI - par + parApex;
+ if(par > parApex + M_PI) // 3/2*M_PI < par < 2*M_PI
+ dist = 2*M_PI - par + parApex;
else
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;
else
{
- if(par > parApex) // 3/2*PI < par < 2*PI
+ if(par > parApex) // 3/2*M_PI < par < 2*M_PI
dist = par - parApex;
else
- dist = par + PI/2; // 0 < par < PI/2
+ dist = par + M_PI/2; // 0 < par < M_PI/2
}
}
}
aCurve = aSurf->VIso(midV);
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;
}
else {
#endif
- if (myVal <= Precision::Angular() || Abs( PI-myVal ) <= Precision::Angular())
+ if (myVal <= Precision::Angular() || Abs( M_PI-myVal ) <= Precision::Angular())
DsgPrs_AnglePresentation::Add(aPresentation,
myDrawer,
myVal,
Standard_Boolean In1(Standard_False);
Standard_Boolean In2(Standard_False);
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 par11 = ElCLib::Parameter(l1->Lin(), ptat11);
Standard_Real par12 = ElCLib::Parameter(l1->Lin(), ptat12);
gp_Lin gpl2 = l2->Lin();
theaxis = gp_Lin(myCenter,myFDir^mySDir);
- if (myVal > PI) {
+ if (myVal > M_PI) {
theaxis.Reverse();
}
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 {
curpos.SetXYZ(.5*(myFAttach.XYZ()+mySAttach.XYZ()));
gp_Vec transl(curpos, myCenter);
Standard_Real udeb = uc1;
Standard_Real ufin = uc2;
if (uco > ufin) {
- if (Abs(myVal)<PI) {
+ if (Abs(myVal)<M_PI) {
// 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;
}
}
Standard_Real FirstParAngleCirc, LastParAngleCirc, FirstParAttachCirc, LastParAttachCirc;
gp_Pnt EndOfArrow1, EndOfArrow2, ProjAttachPoint2;
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);
Standard_Boolean isPlane = (myFirstSurfType == AIS_KOS_Plane)? Standard_True : Standard_False;
Handle( Select3D_SensitiveCurve ) SensCurve;
// 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 );
SensCurve = new Select3D_SensitiveCurve( own, curve );
gp_Lin l2(cu2.Line());
// 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()) ||
- (Abs((l1.Angle(l2) - PI)) < Precision::Angular()) )
+ (Abs((l1.Angle(l2) - M_PI)) < Precision::Angular()) )
*/
{
Standard_Real ufin = uc2;
if (uco > ufin) {
- if (Abs(myVal)<PI) {
+ if (Abs(myVal)<M_PI) {
// test if uco is in the opposing sector
- if (uco > udeb+PI && uco < ufin+PI){
- udeb = udeb + PI;
- ufin = ufin + PI;
+ if (uco > udeb+M_PI && uco < ufin+M_PI){
+ udeb = udeb + M_PI;
+ ufin = ufin + M_PI;
uc1 = udeb;
uc2 = ufin;
}
}
}
if (uco > ufin) {
- if ((uco-uc2) < (uc1-uco+(2*PI))) ufin = uco;
- else udeb = uco - 2*PI;
+ if ((uco-uc2) < (uc1-uco+(2*M_PI))) ufin = uco;
+ else udeb = uco - 2*M_PI;
}
p1 = ElCLib::Value(udeb,cer);
p2 = ElCLib::Value(ufin,cer);
Standard_Real ufin = uc2;
if (uco > ufin) {
- if (Abs(myVal)<PI) {
+ if (Abs(myVal)<M_PI) {
// test if uco is in the opposing sector
- if (uco > udeb+PI && uco < ufin+PI){
- udeb = udeb + PI;
- ufin = ufin + PI;
+ if (uco > udeb+M_PI && uco < ufin+M_PI){
+ udeb = udeb + M_PI;
+ ufin = ufin + M_PI;
uc1 = udeb;
uc2 = ufin;
}
}
if (uco > ufin) {
- if ((uco-uc2) < (uc1-uco+(2*PI))) {
+ if ((uco-uc2) < (uc1-uco+(2*M_PI))) {
ufin = uco;
}
else {
- udeb = uco - 2*PI;
+ udeb = uco - 2*M_PI;
}
}
aCurve = aSurf->VIso(midV);
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;
}
else {
aPnt = Apex;
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
Standard_Real AttParam = ElCLib::Parameter(aCircle2, AttachmentPnt);
Standard_Real OppParam = ElCLib::Parameter(aCircle2, OppositePnt);
- while ( AttParam >= 2*Standard_PI ) AttParam -= 2*Standard_PI;
- while ( OppParam >= 2*Standard_PI ) OppParam -= 2*Standard_PI;
+ while ( AttParam >= 2 * M_PI ) AttParam -= 2 * M_PI;
+ while ( OppParam >= 2 * M_PI ) OppParam -= 2 * M_PI;
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
param = ElCLib::Parameter(aCircle2, tmpPnt);
if(IsArrowOut) {
- angle = OppParam - AttParam + Standard_PI/6; //An angle between AttParam and OppParam + 30 degrees
- param = AttParam - Standard_PI/12; //out parts of dimension line are 15 degrees
+ angle = OppParam - AttParam + M_PI / 6; //An angle between AttParam and OppParam + 30 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
aPnt = ElCLib::Value(param + angle/11 * i, aCircle2);
aPnt.Coord(X, Y, Z);
else {
angle = OppParam - 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
aPnt = ElCLib::Value(param + angle/11 * i, aCircle2);
aPnt.Coord(X, Y, Z);
AIS_InteractiveObject(PrsMgr_TOP_AllView),
myComponent(aComponent),
myUStart(0.),
-myUEnd(2*PI),
+myUEnd(2*M_PI),
myCircleIsArc(Standard_False)
{
}
aSelection->Add(seg);
gp_Ax1 RotateAxis(myCenter, myDir);
- gp_Pnt FPnt = myCenter.Rotated(RotateAxis, PI/2);
- gp_Pnt SPnt = myCenter.Rotated(RotateAxis, -PI/2);
+ gp_Pnt FPnt = myCenter.Rotated(RotateAxis, M_PI/2);
+ gp_Pnt SPnt = myCenter.Rotated(RotateAxis, -M_PI/2);
seg = new Select3D_SensitiveSegment(own,
FPnt,
SPnt);
Handle(SelectMgr_EntityOwner) own = new SelectMgr_EntityOwner(this,7);
gp_Pnt theCenter = myCircle.Location();
- while (lpara > 2*PI) {
- fpara -= 2*PI;
- lpara -= 2*PI;
+ while (lpara > 2*M_PI) {
+ fpara -= 2*M_PI;
+ lpara -= 2*M_PI;
}
Standard_Real parat = ElCLib::Parameter(myCircle,myPosition);
Standard_Boolean otherside(Standard_False);
gp_Pnt attpoint = myPosition;
if (!AIS::InDomain(fpara,lpara,parat)) {
- Standard_Real otherpar = parat + PI;
- if (otherpar > 2*PI) otherpar -= 2*PI;
+ Standard_Real otherpar = parat + M_PI;
+ if (otherpar > 2*M_PI) otherpar -= 2*M_PI;
if (AIS::InDomain(fpara,lpara,otherpar)) {
parat = otherpar;
otherside = Standard_True;
myFirstPar = parfirst;
myLastPar = parend;
if ( parfirst > parend) {
- parfirst -= 2*PI;
+ parfirst -= 2*M_PI;
}
if (myAutomaticPosition) {
Standard_Real pcurpos = (parfirst + parend)/2.;
parfirst = ElCLib::Parameter(myCircle, ptfirst);
parend = ElCLib::Parameter(myCircle, ptend);
if ( parfirst > parend) {
- parfirst -= 2*PI;
+ parfirst -= 2*M_PI;
}
Standard_Real parcurPos = (parfirst + parend) * 0.5;
curPos = ElCLib::Value(parcurPos, myCircle);
default:
break;
}
- while (myFirstPar > 2*PI) myFirstPar -= 2*PI;
- while (myLastPar > 2*PI) myLastPar -= 2*PI;
- while (myFirstPar < 0.0) myFirstPar += 2*PI;
- while (myLastPar < 0.0) myLastPar += 2*PI;
+ while (myFirstPar > 2*M_PI) myFirstPar -= 2*M_PI;
+ while (myLastPar > 2*M_PI) myLastPar -= 2*M_PI;
+ while (myFirstPar < 0.0) myFirstPar += 2*M_PI;
+ while (myLastPar < 0.0) myLastPar += 2*M_PI;
}
//=======================================================================
Handle(Geom_Circle) aCircle = Handle(Geom_Circle)::DownCast(aCurve.Curve().Curve());
Standard_Real FirstPar = ElCLib::Parameter(aCircle->Circ(), myAttachPoint1),
LastPar = ElCLib::Parameter(aCircle->Circ(), myPoint1);
- if (LastPar < FirstPar ) LastPar+=PI*2;
+ if (LastPar < FirstPar ) LastPar+=M_PI*2;
//add sensetive arc
Handle(Select3D_SensitiveCircle) circ =
new Select3D_SensitiveCircle( own, aCircle, FirstPar, LastPar);
Handle(Geom_Circle) aCircle = Handle(Geom_Circle)::DownCast(aCurve.Curve().Curve());
Standard_Real FirstPar = ElCLib::Parameter(aCircle->Circ(), myAttachPoint2),
LastPar = ElCLib::Parameter(aCircle->Circ(), myPoint2);
- if (LastPar < FirstPar ) LastPar+=PI*2;
+ if (LastPar < FirstPar ) LastPar+=M_PI*2;
//add sensetive arc
Handle(Select3D_SensitiveCircle) circ =
new Select3D_SensitiveCircle( own,aCircle, FirstPar, LastPar);
Handle(Geom_Circle) aCircle = Handle(Geom_Circle)::DownCast(aCurve.Curve().Curve());
Standard_Real FirstPar = ElCLib::Parameter(aCircle->Circ(), myAttachPoint3),
LastPar = ElCLib::Parameter(aCircle->Circ(), myPoint3);
- if (LastPar < FirstPar ) LastPar+=PI*2;
+ if (LastPar < FirstPar ) LastPar+=M_PI*2;
Handle(Select3D_SensitiveCircle) circ =
new Select3D_SensitiveCircle( own, aCircle, FirstPar, LastPar);
aSelection->Add( circ );
Handle(Geom_Circle) aCircle = Handle(Geom_Circle)::DownCast(aCurve.Curve().Curve());
Standard_Real FirstPar = ElCLib::Parameter(aCircle->Circ(), myAttachPoint4),
LastPar = ElCLib::Parameter(aCircle->Circ(), myPoint4);
- if (LastPar < FirstPar ) LastPar+=PI*2;
+ if (LastPar < FirstPar ) LastPar+=M_PI*2;
//add sensetive arc
Handle(Select3D_SensitiveCircle) circ =
new Select3D_SensitiveCircle( own,aCircle, FirstPar, LastPar);
if (PrPnt12.Distance(PrCenter) >Precision::Confusion())
{
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)
- anAngle = 2*Standard_PI - anAngle;
+ anAngle = 2 * M_PI - anAngle;
par1 = anAngle;
}
if (PrPnt22.Distance(PrCenter) >Precision::Confusion())
{
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)
- anAngle = 2*Standard_PI - anAngle;
+ anAngle = 2 * M_PI - anAngle;
par2 = anAngle;
}
else {
if (!samePoint) {
DirAttach.SetXYZ(SecondAttach.XYZ() - FirstAttach.XYZ());
- DirAttach.Rotate(Plane->Pln().Axis(),PI/2.);
+ DirAttach.Rotate(Plane->Pln().Axis(),M_PI/2.);
}
}
}
else {
Standard_Real aPar = ElCLib::Parameter(FirstCirc, myFirstPoint);
- if (IntegerPart(0.5*LastPar1/PI) != 0 && aPar < FirstPar1 )
- aPar +=2*PI*IntegerPart(0.5*LastPar1/PI);
+ if (IntegerPart(0.5*LastPar1/M_PI) != 0 && aPar < FirstPar1 )
+ aPar +=2*M_PI*IntegerPart(0.5*LastPar1/M_PI);
Standard_Real aRadius = FirstCirc.Radius();
if (Abs(myFirstPoint.Distance(myFirstCenter) - aRadius) >= Precision::Confusion())
aPar = ElCLib::Parameter(SecondCirc, mySecondPoint);
- if (IntegerPart(0.5*LastPar2/PI) != 0 && aPar < FirstPar2 )
- aPar +=2*PI*IntegerPart(0.5*LastPar2/PI);
+ if (IntegerPart(0.5*LastPar2/M_PI) != 0 && aPar < FirstPar2 )
+ aPar +=2*M_PI*IntegerPart(0.5*LastPar2/M_PI);
aRadius = SecondCirc.Radius();
if (Abs(mySecondPoint.Distance(mySecondCenter) - aRadius) >= Precision::Confusion())
if (fpar >= 0.) {
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;
return Standard_False;
}
dirac.Normalize();
gp_Vec norac = dirac.Crossed(gp_Vec(norm));
gp_Ax1 ax(myPosition, norm);
- norac.Rotate(ax, PI/8);
+ norac.Rotate(ax, M_PI/8);
norac*=(myArrowSize/2);
gp_Pnt P1 = myPosition.Translated(norac);
gp_Vec transvec = vec*myArrowSize;
curpos = myPntAttach.Translated(transvec);
gp_Ax1 RotAx( myPntAttach, NormPln);
- curpos.Rotate(RotAx, PI/10);
+ curpos.Rotate(RotAx, M_PI/10);
}
return curpos;
Standard_Real& plast)
{
// readjust parametres on the circle
- if (plast > 2*PI ) {
- Standard_Real nbtours = Floor(plast / (2*PI));
- plast -= nbtours*2*PI;
- pfirst -= nbtours*2*PI;
+ if (plast > 2*M_PI ) {
+ Standard_Real nbtours = Floor(plast / (2*M_PI));
+ plast -= nbtours*2*M_PI;
+ pfirst -= nbtours*2*M_PI;
}
if (myAutomaticPosition) {
Standard_Real circparam = (pfirst + plast)/2.;
if ( !InDomain(pfirst,plast,circparam)) {
- Standard_Real otherpar = circparam + PI;
- if (otherpar > 2*PI) otherpar -= 2*PI;
+ Standard_Real otherpar = circparam + M_PI;
+ if (otherpar > 2*M_PI) otherpar -= 2*M_PI;
circparam = otherpar;
}
Standard_Real circparam = ElCLib::Parameter(gcirc, pos);
if ( !InDomain(pfirst,plast,circparam)) {
- Standard_Real otherpar = circparam + PI;
- if (otherpar > 2*PI) otherpar -= 2*PI;
+ Standard_Real otherpar = circparam + M_PI;
+ if (otherpar > 2*M_PI) otherpar -= 2*M_PI;
circparam = otherpar;
}
static Standard_Real Modulo2PI(const Standard_Real ANGLE)
{
- if ( ANGLE < 0 ) return Modulo2PI(ANGLE + 2*PI);
- else if ( ANGLE >= 2*PI ) return Modulo2PI(ANGLE - 2*PI);
+ if ( ANGLE < 0 ) return Modulo2PI(ANGLE + 2*M_PI);
+ else if ( ANGLE >= 2*M_PI ) return Modulo2PI(ANGLE - 2*M_PI);
return ANGLE;
}
{
Standard_Real diff = Abs(angle1-angle2);
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;
}
// jfa 15/10/2000 end
Standard_Real deltap = pSAttachM - pFAttach;
if ( deltap < 0 )
{
- deltap += 2*Standard_PI;
- pSAttachM += 2*Standard_PI;
+ deltap += 2 * M_PI;
+ pSAttachM += 2 * M_PI;
}
pSAttachM -= pFAttach;
- Standard_Real pmiddleout = pSAttachM/2.0 + Standard_PI;
+ Standard_Real pmiddleout = pSAttachM/2.0 + M_PI;
Standard_Real pcurpos1 = pcurpos;
// define where curpos lays
if ( pcurpos1 < pFAttach )
{
- pcurpos1 = pcurpos1 + 2*Standard_PI - pFAttach;
+ pcurpos1 = pcurpos1 + 2 * M_PI - pFAttach;
if ( pcurpos1 > pSAttachM ) // out
{
if ( pcurpos1 > pmiddleout ) pcurpos = pFAttach;
Standard_Real deltap = pSAttachM - pFAttach;
if ( deltap < 0 )
{
- deltap += 2*Standard_PI;
- pSAttachM += 2*Standard_PI;
+ deltap += 2 * M_PI;
+ pSAttachM += 2 * M_PI;
}
pSAttachM -= pFAttach;
- Standard_Real pmiddleout = pSAttachM/2.0 + Standard_PI;
+ Standard_Real pmiddleout = pSAttachM/2.0 + M_PI;
Standard_Real pcurpos1 = pcurpos;
// define where curpos lays
if ( pcurpos1 < pFAttach )
{
- pcurpos1 = pcurpos1 + 2*Standard_PI - pFAttach;
+ pcurpos1 = pcurpos1 + 2 * M_PI - pFAttach;
if ( pcurpos1 > pSAttachM ) // out
{
if ( pcurpos1 > pmiddleout ) pcurpos = pFAttach;
myCenter = thecirc->Location();
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
if ( circ1complete && circ2complete )
const Standard_Boolean isstatic)
{
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 pSA = ElCLib::Parameter(thecirc->Circ(),lastp);
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 pFAttach = pcurpos - rad;
Standard_Real pSAttach = pcurpos + rad;
Standard_Real pSPnt = ElCLib::Parameter(cirNotAuto, pntlast);
Standard_Real deltap = Modulo2PI(pSPnt - pFPnt)/2.0;
- Standard_Real rad = Standard_PI/5;
+ Standard_Real rad = M_PI / 5;
if ( deltap < rad )
{
myFAttach = pntfirst;
myCenter = theEll->Location();
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
if ( circ1complete && circ2complete )
const Standard_Boolean isstatic)
{
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();
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);
GeomAPI_ProjectPointOnCurve aProj (curpos, theEll);
Standard_Real pcurpos = aProj.LowerDistanceParameter();
Standard_Real pSPnt = ElCLib::Parameter(anEll, pntlast);
Standard_Real deltap = Modulo2PI(pSPnt - pFPnt)/2.0;
- Standard_Real rad = Standard_PI/5;
+ Standard_Real rad = M_PI / 5;
if ( deltap < rad )
{
myFAttach = pntfirst;
Standard_Real AIS_InteractiveContext::DeviationAngle() const
{
- return PI/180.0e0 ;
+ return M_PI/180.0e0 ;
// return myDefaultDrawer->DeviationAngle();
}
// gp_Dir D =Tr->Component()->XDirection();
// gp_Pnt O = Tr->Component()->Location();
// 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);
// TopLoc_Location L,IncLoc(T);
{
// cout<<" Angle:"<< anAngle <<endl;
if(anIObj.IsNull()) return ;
-// Standard_Real anAngleRad = PI*anAngle/180; test rob...
+// Standard_Real anAngleRad = M_PI*anAngle/180; test rob...
if(!anIObj->HasInteractiveContext())
anIObj->SetContext(this);
else {
if (!samePoint) {
DirAttach = gce_MakeDir(FirstAttach,SecondAttach);
- DirAttach.Rotate(Plane->Pln().Axis(),PI/2.);
+ DirAttach.Rotate(Plane->Pln().Axis(),M_PI/2.);
}
}
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 pFPnt;
Standard_Real deltap = pSAttachM - pFAttach;
if ( deltap < 0 )
{
- deltap += 2*Standard_PI;
- pSAttachM += 2*Standard_PI;
+ deltap += 2 * M_PI;
+ pSAttachM += 2 * M_PI;
}
pSAttachM -= pFAttach;
- Standard_Real pmiddleout = pSAttachM/2.0 + Standard_PI;
+ Standard_Real pmiddleout = pSAttachM/2.0 + M_PI;
Standard_Real pcurpos1 = pcurpos;
// define where curpos lays
if ( pcurpos1 < pFAttach )
{
- pcurpos1 = pcurpos1 + 2*Standard_PI - pFAttach;
+ pcurpos1 = pcurpos1 + 2 * M_PI - pFAttach;
if ( pcurpos1 > pSAttachM ) // out
{
segm = Min(rad,deltap*0.75);
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 pFPnt;
Standard_Real deltap = pSAttachM - pFAttach;
if ( deltap < 0 )
{
- deltap += 2*Standard_PI;
- pSAttachM += 2*Standard_PI;
+ deltap += 2 * M_PI;
+ pSAttachM += 2 * M_PI;
}
pSAttachM -= pFAttach;
- Standard_Real pmiddleout = pSAttachM/2.0 + Standard_PI;
+ Standard_Real pmiddleout = pSAttachM / 2.0 + M_PI;
Standard_Real pcurpos1 = pcurpos;
// define where curpos lays
if ( pcurpos1 < pFAttach )
{
- pcurpos1 = pcurpos1 + 2*Standard_PI - pFAttach;
+ pcurpos1 = pcurpos1 + 2 * M_PI - pFAttach;
if ( pcurpos1 > pSAttachM ) // out
{
segm = Min(rad,deltap*0.75);
myCenter = myCircle.Location();
myCircle.SetRadius(myVal);
- while (myFirstPar > 2*PI) myFirstPar -= 2*PI;
- while (myFirstPar < 0.0 ) myFirstPar += 2*PI;
- while (myLastPar > 2*PI) myLastPar -= 2*PI;
- while (myLastPar < 0.0 ) myLastPar += 2*PI;
+ while (myFirstPar > 2*M_PI) myFirstPar -= 2*M_PI;
+ while (myFirstPar < 0.0 ) myFirstPar += 2*M_PI;
+ while (myLastPar > 2*M_PI) myLastPar -= 2*M_PI;
+ while (myLastPar < 0.0 ) myLastPar += 2*M_PI;
myPlane = new Geom_Plane(gp_Pln(gp_Ax3(myCircle.Position())));
myFirstLine = gce_MakeLin( myCenter, ElCLib::Value( myFirstPar, myCircle ) );
myLastLine = gce_MakeLin( myCenter, ElCLib::Value( myLastPar, myCircle ) );
Standard_Real PosPar = ElCLib::Parameter( myCircle, myPosition );
if (!AIS::InDomain(myFirstPar, myLastPar, PosPar))
{ // not in domain
- Standard_Real otherpar = PosPar + PI;
- if (otherpar > 2*PI) otherpar -= 2*PI;
+ Standard_Real otherpar = PosPar + M_PI;
+ if (otherpar > 2*M_PI) otherpar -= 2*M_PI;
if (AIS::InDomain(myFirstPar, myLastPar, otherpar)){
PosPar = otherpar;// parameter on circle
myEndOfArrow = ElCLib::Value( PosPar, myCircle );
}
else {
Standard_Real Teta1 = Abs( PosPar - myFirstPar ), Teta2 = Abs( PosPar - myLastPar );
- if (Teta1 > PI)
- Teta1 = 2.0*PI - Teta1;
- if (Teta2 > PI)
- Teta2 = 2.0*PI - Teta2;
+ if (Teta1 > M_PI)
+ Teta1 = 2.0*M_PI - Teta1;
+ if (Teta2 > M_PI)
+ Teta2 = 2.0*M_PI - Teta2;
if (Teta1 < Teta2)
{
if(myFirstLine.Contains(myPosition,Precision::Confusion()))
ElCLib::D1(par_inter,ellipse->Elips(),P2,aVector2);
}
// 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;
if ( D.IsParallel(gp::DX2d(),Precision::Angular())) { // Iso V.
if ( STy == GeomAbs_Sphere) {
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;
gp_Sphere Sph = mySurface->Sphere();
gp_Ax3 Axis = Sph.Position();
Standard_Real Adaptor3d_SurfaceOfRevolution::LastUParameter() const
{
- return 2*PI;
+ return 2*M_PI;
}
//=======================================================================
const GeomAbs_Shape ) const
{
T(T.Lower() ) = 0.;
- T(T.Lower()+1) = 2*PI;
+ T(T.Lower()+1) = 2*M_PI;
}
Standard_Real Eps = Precision::PConfusion();
#endif
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");
Handle(Adaptor3d_HSurfaceOfRevolution) HR =
Standard_Real Adaptor3d_SurfaceOfRevolution::UPeriod() const
{
- return 2*PI;
+ return 2*M_PI;
}
//=======================================================================
}
else {
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);
}
}
else {
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;
V = sin(SAngle) * ( Ploc.X() * cos(U) + Ploc.Y() * sin(U) - Radius)
Vt2d=TabV2d.Value(jp2d);
Vt2d.Normalize();
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();
myTabConstraints->SetValue(jndex++,Vt2d.X());
myTabConstraints->SetValue(jndex++,Vt2d.Y());
Vt2d=TabV2d.Value(jp2d);
Vt2d.Normalize();
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();
myTabConstraints->SetValue(jndex++,Vt2d.X());
myTabConstraints->SetValue(jndex++,Vt2d.Y());
v2 = X(2)-TranslationV;
ComputeParametersOnImplicitSurface(MyISurf,P,u1,v1);
if(MyISurf.TypeQuadric() != GeomAbs_Plane) {
- while(u1-tu1>PI) u1-=PI+PI;
- while(tu1-u1>PI) u1+=PI+PI;
+ while(u1-tu1>M_PI) u1-=M_PI+M_PI;
+ while(tu1-u1>M_PI) u1+=M_PI+M_PI;
}
MyParOnS1.SetCoord(tu1,tv1);
MyParOnS2.SetCoord(tu2,tv2);
v1 = X(2)-TranslationV;
ComputeParametersOnImplicitSurface(MyISurf,P,u2,v2);
if(MyISurf.TypeQuadric() != GeomAbs_Plane) {
- while(u2-tu2>PI) u2-=PI+PI;
- while(tu2-u2>PI) u2+=PI+PI;
+ while(u2-tu2>M_PI) u2-=M_PI+M_PI;
+ while(tu2-u2>M_PI) u2+=M_PI+M_PI;
}
MyParOnS1.SetCoord(tu1,tv1);
MyParOnS2.SetCoord(tu2,tu2);
Standard_Real cosinus = (X-xo)/d;
Standard_Real a = ACos(cosinus);
Standard_Real ra = RotationAngle();
- if ( Y < yo ) a = 2*Standard_PI - a;
+ if ( Y < yo ) a = 2 * M_PI - a;
#ifdef OCC192_193
n = (Standard_Integer ) ((a-ra)/myAlpha + Sign(0.5, a-ra)) ;
#else
}
void Aspect_CircularGrid::Init () {
- myAlpha = Standard_PI /Standard_Real(myDivisionNumber);
+ myAlpha = M_PI / Standard_Real(myDivisionNumber);
myA1 = Cos(myAlpha); myB1=Sin(myAlpha);
}
MySpoint = new TColStd_HArray1OfBoolean(1,MAX_O_POINT+1) ;
{ 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.;
for( i=1 ; i<= MAX_O_POINT+1 ; i++,a += da ) {
MyXpoint->SetValue(i,(float ) Cos(a));
MyYpoint = new TShort_HArray1OfShortReal(1,MAX_O_POINT+6) ;
MySpoint = new TColStd_HArray1OfBoolean(1,MAX_O_POINT+6) ;
{ 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.;
for( i=1 ; i<= MAX_O_POINT+1 ; i++,a += da ) {
MyXpoint->SetValue(i,(float ) Cos(a));
MySpoint = new TColStd_HArray1OfBoolean(1,MAX_O_POINT+5) ;
{ 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.;
for( i=1 ; i<= MAX_O_POINT+1 ; i++,a += da ) {
MyXpoint->SetValue(i,(float ) Cos(a));
MySpoint = new TColStd_HArray1OfBoolean(1,MAX_O_POINT+9) ;
{ 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.;
for( i=1 ; i<= MAX_O_POINT+1 ; i++,a += da ) {
MyXpoint->SetValue(i,(float ) Cos(a));
MySpoint = new TColStd_HArray1OfBoolean(1,MAX_O_POINT+5) ;
{ 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.;
for( i=1 ; i<= MAX_O_POINT+1 ; i++,a += da ) {
MyXpoint->SetValue(i,(float ) Cos(a));
MAX_BALL_LINE*(MAX_O_POINT+1)) ;
{ 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 a,r = 1.;
(MAX_BALL_LINE/4)*(MAX_O_POINT+1)) ;
{ 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 a,r = 1.;
(MAX_BALL_LINE/3)*(MAX_O_POINT+1)) ;
{ 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 a,r = 1.;
(MAX_BALL_LINE)/2*(MAX_O_POINT+1)) ;
{ 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 a,r = 1.;
// b1 = Sin (myFirstAngle + RotationAngle() );
// c1 = XOrigin() * b1 - YOrigin() * a1;
//
-// a2 = Cos (mySecondAngle + RotationAngle() + Standard_PI/2.);
-// b2 = Sin (mySecondAngle + RotationAngle() + Standard_PI/2.);
+// a2 = Cos (mySecondAngle + RotationAngle() + M_PI / 2.);
+// b2 = Sin (mySecondAngle + RotationAngle() + M_PI / 2.);
// c2 = XOrigin() * b2 - YOrigin() * a2;
#ifdef CSR577
}
if ( angle2 != 0. ) {
- angle2 += Standard_PI/2.;
+ angle2 += M_PI / 2.;
a2 = -Sin (angle2);
b2 = Cos (angle2);
c2 = XOrigin() * b2 - YOrigin() * a2;
b1 = Cos (myFirstAngle + RotationAngle());
c1 = XOrigin() * b1 - YOrigin() * a1;
- a2 = -Sin (mySecondAngle + RotationAngle() + Standard_PI/2.);
- b2 = Cos (mySecondAngle + RotationAngle() + Standard_PI/2.);
+ a2 = -Sin (mySecondAngle + RotationAngle() + M_PI / 2.);
+ b2 = Cos (mySecondAngle + RotationAngle() + M_PI / 2.);
c2 = XOrigin() * b2 - YOrigin() * a2;
#endif
//-zov
Standard_Boolean Aspect_RectangularGrid::CheckAngle(const Standard_Real alpha,
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) ;
}
Standard_Real ClockWiseAngle(const Standard_Real aAngleIn,
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 ;
AIn=aAngleIn;
AOut=AOut-aTwoPi;
}
- A1=AIn+Standard_PI;
+ A1 = AIn + M_PI;
if (A1 >= aTwoPi) {
A1=A1-aTwoPi;
Standard_Real Angle (const gp_Dir2d& 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);
}
//=======================================================================
bIgnore = (aD > theTol2D);
}
- if(!bIgnore && (theTol2D > PI)) {
+ if(!bIgnore && (theTol2D > M_PI)) {
Standard_Real udist = fabs(aP2Dx.X() - thePb.X());
Standard_Real vdist = fabs(aP2Dx.Y() - thePb.Y());
Standard_Real aTolU = 2. * UTolerance2D(theVb, theGAS);
//
aA=aDN[0].Angle(aDN[1]);
aA=fabs(aA);
- if (aA>0.5*PI) {
- aA=PI-aA;
+ if (aA>0.5*M_PI) {
+ aA=M_PI-aA;
}
//
if (aA<aAmin || aA>aAmax) {
Standard_Real BOPTools_Tools2D::IntermediatePoint (const Standard_Real aFirst,
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;
Standard_Real aParm;
aParm=(1.-PAR_T)*aFirst + PAR_T*aLast;
{
Standard_Real d12, d1, anAlfa12, anAlfa1, aTwoPI;
- aTwoPI=Standard_PI+Standard_PI;
+ aTwoPI = M_PI + M_PI;
gp_Vec aVx1(aPx, aPx1);
gp_Dir aDBx1 (aVx1);
if(iMother) igoodC = iMother;
//#ifndef DEB
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
// TopOpeBRepDS_PointIterator& PIt = myHDS->CurvePoints(igoodC);
//#endif
Angle = ACos(Cosa);
if (Sina < 0.) {
- Angle = 2.*PI - Angle;
+ Angle = 2.*M_PI - Angle;
}
if (Angle > maxang) {maxang = Angle;}
Pfin = ElCLib::Parameter(C, ptrst2);
// Test of angles negative and almost null : Special Case
- if (Pfin > 1.5 * PI) {
+ if (Pfin > 1.5 * M_PI) {
np.Reverse();
C.SetPosition(gp_Ax2(Center, np, ns));
Pfin = ElCLib::Parameter(C, ptrst2);
Angle = ACos(Cosa);
if (Sina < 0.) {
- Angle = 2.*PI - Angle;
+ Angle = 2.*M_PI - Angle;
}
if (Angle > maxang) {maxang = Angle;}
Pfin = ElCLib::Parameter(C, ptrst2);
// Test negative and quasi null angles: Special case
- if (Pfin > 1.5 * PI) {
+ if (Pfin > 1.5 * M_PI) {
np.Reverse();
C.SetPosition(gp_Ax2(Center, np, ns));
Pfin = ElCLib::Parameter(C, ptrst2);
Angle = ACos(Cosa);
if (Sina <0.) {
- Angle = 2.*PI - Angle;
+ Angle = 2.*M_PI - Angle;
}
if (Angle>maxang) {maxang = Angle;}
Pfin = ElCLib::Parameter(C,ptrst);
// Test negative and almost null angles : Special case
- if (Pfin>1.5*PI) {
+ if (Pfin>1.5*M_PI) {
np.Reverse();
C.SetPosition(gp_Ax2(Center,np,ns));
Pfin = ElCLib::Parameter(C,ptrst);
Angle = ACos(Cosa);
if (Sina <0.) {
- Angle = 2.*PI - Angle;
+ Angle = 2.*M_PI - Angle;
}
if (Angle>maxang) {maxang = Angle;}
Pfin = ElCLib::Parameter(C,ptrst);
// Test negative and almost null angles : Single Case
- if (Pfin>1.5*PI) {
+ if (Pfin>1.5*M_PI) {
np.Reverse();
C.SetPosition(gp_Ax2(Center,np,ns));
Pfin = ElCLib::Parameter(C,ptrst);
if (TotLength > 0.0) {
gp_Pnt p1 = BRep_Tool::Pnt(TopoDS::Vertex(v1));
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;
}
else if ((n.Magnitude()>gp::Resolution()) && (normRef(j).Magnitude()>gp::Resolution())) {
nbComputedAngle++;
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;
}
}
angle = DerRef.Angle( Der );
angle *= -1.;
if (angle < 0.)
- angle += 2.*PI;
+ angle += 2.*M_PI;
if (F.Orientation() == TopAbs_FORWARD) {
if (angle < MinAngle) {
}
else if (styp == STANDARD_TYPE(Geom_CylindricalSurface)) {
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)) {
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 {
FUntil.Nullify();
gp_Vec nulldir(0, 0, 0);
if(!myDir1.IsEqual(nulldir, myTol, myTol)) {
Standard_Real ang = myDir1.Angle(myDir);
- if(ang != PI) {
+ if(ang != M_PI) {
#ifdef DEB
if (trc) cout << " Directions must be opposite" << endl;
#endif
myGluedF.Clear();
myPerfSelection = BRepFeat_NoSelection;
PerfSelectionValid();
- Standard_Boolean RevolComp = (2*PI-Abs(Angle) <= Precision::Angular());
+ Standard_Boolean RevolComp = (2*M_PI-Abs(Angle) <= Precision::Angular());
LocOpe_Revol theRevol;
Standard_Real angledec = 0.;
TopExp_Explorer exp;
if (!mySkface.IsNull() || !mySlface.IsEmpty()) {
for (exp.Init(mySbase,TopAbs_FACE); exp.More(); exp.Next()) {
if (exp.Current().IsSame(mySkface)) {
- angledec = PI/5; // pourquoi pas
+ angledec = M_PI/5; // pourquoi pas
if (myFuse) angledec = -angledec;
break;
}
Standard_ConstructionError::Raise();
}
if (!mySkface.IsNull() && Until.IsSame(mySkface)) {
- Angle = 2*PI;
+ Angle = 2*M_PI;
TourComplet = Standard_True;
}
myGluedF.Clear();
ShapeUntilValid();
// 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;
if(!TourComplet) {
- Angle = 2.*PI- 3*PI/180.;
+ Angle = 2.*M_PI- 3*M_PI/180.;
#ifdef DEB
if (trc) cout << " No complete Revolution" << endl;
#endif
}
LocOpe_Revol theRevol;
- theRevol.Perform(myPbase, myAxis, 2*PI);
+ theRevol.Perform(myPbase, myAxis, 2*M_PI);
TopoDS_Shape VraiRevol = theRevol.Shape();
MajMap(myPbase,theRevol,myMap,myFShape,myLShape);
}
if (ASI2.IsDone() && ASI2.NbPoints(1) >=1) {
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();
- pr2 = ElCLib::InPeriod(pr2,PrU-2*PI,PrU);
+ pr2 = ElCLib::InPeriod(pr2,PrU-2*M_PI,PrU);
OrF = OrU;
FFrom = ASI2.Point(1,1).Face();
PrF = Max(pr1, pr2);
Standard_Boolean trc = BRepFeat_GettraceFEAT();
if (trc) cout << "BRepFeat_MakeRevol::PerformThruAll()" << endl;
#endif
- Perform(2.*PI);
+ Perform(2.*M_PI);
}
//=======================================================================
ShapeUntilValid();
// 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;
theRevol.Perform(myPbase, myAxis, Angle);
TopoDS_Shape VraiRevol = theRevol.Shape();
if(Rad <= height) Rad = height + 0.01*height;
- myAngle1 = asin(H1/Rad) + PI/10.;
- myAngle2 = asin(H2/Rad) + PI/10.;
+ myAngle1 = asin(H1/Rad) + M_PI/10.;
+ myAngle2 = asin(H2/Rad) + M_PI/10.;
- if((myAngle1 - PI/2) > Precision::Confusion())
- myAngle1 = PI/2;
- if((myAngle2 - PI/2) > Precision::Confusion())
- myAngle2 = PI/2;
+ if((myAngle1 - M_PI/2) > Precision::Confusion())
+ myAngle1 = M_PI/2;
+ if((myAngle2 - M_PI/2) > Precision::Confusion())
+ myAngle2 = M_PI/2;
mySkface.Nullify();
myPbase.Nullify();
gp_Ax1 Axe(pp, Pln->Position().Direction());
for ( Standard_Integer i = 1; i <=8; i++) {
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);
Counter++;
}
Ve *= -1;
}
angle = Ve.Angle(Dir);
- if (angle > PI) angle = 2*PI - angle;
- forward = (angle <= PI/2);
+ if (angle > M_PI) angle = 2*M_PI - angle;
+ forward = (angle <= M_PI/2);
// Reconstruction
MakeWire( Edges, rangdeb, forward, W);
gp_Ax1 Norm(Pos2,norm2);
Standard_Real ang = axe1.AngleWithRef(axe2,norm2);
if (!WithRotation) {
- if (ang>PI/2) ang = ang - PI;
- if (ang<-PI/2) ang = ang + PI;
+ if (ang>M_PI/2) ang = ang - M_PI;
+ if (ang<-M_PI/2) ang = ang + M_PI;
}
ang *= sign;
Pnew = Pnew.Rotated (Norm,ang);
// recherche du vertex correspondant a la projection conique
Standard_Real angmin, angV, eta = Precision::Angular();
TopoDS_Vertex Vopti;
- angmin = PI/2;
+ angmin = M_PI/2;
distmini = Precision::Infinite();
gp_Dir dir0(gp_Vec(Pnew,P.Location()));
for (Standard_Integer ii=1;ii<=SeqV.Length();ii++) {
gp_Dir dir1(gp_Vec(Pnew,P1));
angV = dir1.Angle(dir0);
}
- if (angV>PI/2) angV = PI - angV;
+ if (angV>M_PI/2) angV = M_PI - angV;
if (angmin>angV+eta) {
distmini = dist;
angmin = angV;
norm = vec1 ^ vec2;
gp_Ax1 Norm(P.Location(),norm);
Standard_Real ang = vec1.AngleWithRef(vec2,norm);
- if (ang > PI/2.0)
- ang = PI - ang;
- if (ang < -PI/2.0)
- ang = -PI - ang;
- if (Abs(ang-PI/2.0)<Precision::Angular()) {
+ if (ang > M_PI/2.0)
+ ang = M_PI - ang;
+ if (ang < -M_PI/2.0)
+ ang = -M_PI - ang;
+ if (Abs(ang-M_PI/2.0)<Precision::Angular()) {
// cas d'ambiguite
gp_Vec Vtrans(P0.Location(),P.Location()),Vsign;
Standard_Real alpha,beta,sign=1;
};
gp_Vec VDebFin0(P1o,P2o), VDebFin(P1,P2);
Standard_Real AStraight = VDebFin0.Angle(VDebFin);
- parcours = (AStraight < PI/2.0? Standard_True: Standard_False);
+ parcours = (AStraight < M_PI/2.0? Standard_True: Standard_False);
}
// reconstruction of the wire
gp_Dir BN(M.Column(2));
Standard_Real ang = myDir.Angle(BN);
- if (ang > PI/2) D.Reverse();
+ if (ang > M_PI/2) D.Reverse();
Handle(Geom_Line) L = new (Geom_Line) (P, D);
Handle(Geom_Curve) TC = new (Geom_TrimmedCurve) (L, 0, Length);
V = V1.Crossed(V2);
if (F.Orientation() == TopAbs_REVERSED) V.Reverse();
if (V.Magnitude() > 1.e-10) {
- out = myDir.Angle(V) > PI/2;
+ out = myDir.Angle(V) > M_PI/2;
}
if (out == IsInternal) {
myShell.Reverse();
}
// 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;
}
gp_Trsf trsf;
if (Side(myProfile,BRepFill_Confusion()) > 3) { // side right
- trsf.SetRotation(gp::OZ(),PI);
+ trsf.SetRotation(gp::OZ(),M_PI);
}
TopLoc_Location DumLoc (trsf);
TopoDS_Shape aLocalShape = myProfile.Moved(DumLoc);
gp_Trsf trsf;
if (Side(myProfile,BRepFill_Confusion()) > 3) { // side right
- trsf.SetRotation(gp::OZ(),PI);
+ trsf.SetRotation(gp::OZ(),M_PI);
}
TopLoc_Location DumLoc (trsf);
TopoDS_Shape aLocalShape = myProfile.Moved(DumLoc);
// Position of the sewing on the edge of the spine
// so that the bissectrices didn't cross the sewings.
gp_Trsf dummy;
- dummy.SetRotation(AxeRev, 1.5*PI);
+ dummy.SetRotation(AxeRev, 1.5*M_PI);
TopLoc_Location DummyLoc(dummy);
GenProf.Move(DummyLoc);
#else
Standard_Boolean IsLast ;
#endif
- Standard_Real MinAngle = PI;
+ Standard_Real MinAngle = M_PI;
for (MapIt.Initialize( WireMap ); MapIt.More(); MapIt.Next())
{
}
if (GAS1.GetType() == GeomAbs_Sphere) {
if (myIsoU1)
- ElCLib::AdjustPeriodic(-PI/2.,PI/2.,
+ ElCLib::AdjustPeriodic(-M_PI/2.,M_PI/2.,
Precision::PConfusion(),
Umin, Umax);
else
- ElCLib::AdjustPeriodic(-PI/2.,PI/2.,
+ ElCLib::AdjustPeriodic(-M_PI/2.,M_PI/2.,
Precision::PConfusion(),
Vmin, Vmax);
}
}
if (GAS2.GetType() == GeomAbs_Sphere) {
if (myIsoU2)
- ElCLib::AdjustPeriodic(-PI/2.,PI/2.,
+ ElCLib::AdjustPeriodic(-M_PI/2.,M_PI/2.,
Precision::PConfusion(),
Umin, Umax);
else
- ElCLib::AdjustPeriodic(-PI/2.,PI/2.,
+ ElCLib::AdjustPeriodic(-M_PI/2.,M_PI/2.,
Precision::PConfusion(),
Vmin, Vmax);
}
Standard_Real Ang = Axis.Angle(D12d);
if ( !TheU.Circle().IsDirect()) Ang = -Ang;
UU = ElCLib::InPeriod( Ang, TheU.FirstParameter(),
- TheU.FirstParameter() + 2*PI);
+ TheU.FirstParameter() + 2*M_PI);
Dist = TheU.Circle().Radius();
}
else {
//if (E.Orientation() == TopAbs_REVERSED) CT2d->Reverse();
if (CT2d->BasisCurve()->IsKind(STANDARD_TYPE(Geom2d_Circle)) &&
- ( Abs(f-l) >= PI) ) {
+ ( Abs(f-l) >= M_PI) ) {
return 0;
//---------------------------
// Cut closed circle.
Adaptor3d_OffsetCurve Off(AHC,-anOffset);
Handle(Geom2d_Circle) CC = new Geom2d_Circle(Off.Circle());
- Standard_Real Delta = 2*PI - l + f;
+ Standard_Real Delta = 2*M_PI - l + f;
f -= 0.2*Delta; l += 0.2*Delta;
G2dOC = new Geom2d_TrimmedCurve(CC,f,l);
Standard_Boolean ToReverseResult = Standard_False;
gp_Vec d1u;
d1u = Surf->DN(0, (f1+l1)/2, 1, 0);
- if (d1u.Angle(TangentOnPart1) > PI/2) { //Invert everything
+ if (d1u.Angle(TangentOnPart1) > M_PI/2) { //Invert everything
ToReverseResult = Standard_True;
/*
axe.Reverse();
- Angle = 2*PI - Angle;
+ Angle = 2*M_PI - Angle;
Rev = new (Geom_SurfaceOfRevolution) (Prof1, axe);
Surf = new (Geom_RectangularTrimmedSurface)
(Rev, 0, Angle, f1, l1);
AS->D1(P2d.X(), P2d.Y(), P, D1U, D1V);
N2 = D1U^D1V;
- if ( (F1.Orientation() == TopAbs_REVERSED) ^ (N1.Angle(N2)>PI/2) )
+ if ( (F1.Orientation() == TopAbs_REVERSED) ^ (N1.Angle(N2)>M_PI/2) )
Result.Orientation(TopAbs_REVERSED);
else Result.Orientation(TopAbs_FORWARD);
continue;
Standard_Real Angle = aPln.Axis().Angle( bis.Axis() );
- if (Angle > PI/2)
- Angle = PI - Angle;
+ if (Angle > M_PI/2)
+ Angle = M_PI - Angle;
if (Angle < MinAngle)
{
TColgp_Array1OfPnt Origins( 0, NumberOfEdges*2-1 );
TColgp_Array1OfDir Normals( 0, NumberOfEdges*2-1 );
TColStd_Array1OfBoolean IsSingular( 0, NumberOfEdges*2-1 );
- Standard_Real MinAngle = PI/2;
+ Standard_Real MinAngle = M_PI/2;
Standard_Integer MinInd;
for (ind = 0; ind < NumberOfEdges*2; ind++)
{
Origins(ind) = Axe.Location();
Normals(ind) = Axe.Direction();
Standard_Real Angle = bis.Angle( Axe );
- if (Angle > PI/2)
- Angle = PI - Angle;
+ if (Angle > M_PI/2)
+ Angle = M_PI - Angle;
if (Angle < MinAngle)
{
MinAngle = Angle;
}
gp_Ax2 TheAxe( Origins(MinInd), Normals(MinInd) );
- Standard_Real MaxAngleWithPln = PI/16;
+ Standard_Real MaxAngleWithPln = M_PI/16;
TColStd_SequenceOfInteger iseq;
TColgp_SequenceOfPnt Pseq;
for (ind = 0; ind < NumberOfEdges*2; ind++)
if (!IsSingular(ind))
{
Standard_Real Angle = Normals(ind).Angle( TheAxe.Direction() );
- if (Angle > PI/2)
- Angle = PI - Angle;
+ if (Angle > M_PI/2)
+ Angle = M_PI - Angle;
if (Angle <= MaxAngleWithPln)
{
iseq.Append(ind);
gp_Pnt P = GAS.Value(0., V);
if ( gp_Vec(Axis.Location(), P).Dot(Axis.XDirection()) < 0.)
- return PI;
+ return M_PI;
else
return 0.;
}
case GeomAbs_Cone: {
//----------------------------------------------------------
// if myFace1 is not at the same side of the apex as the point
- // of parameter 0 0 on the cone => phase = PI.
+ // of parameter 0 0 on the cone => phase = M_PI.
//----------------------------------------------------------
Axis = GAS.Cone().Position();
Phase = EvalPhase(Edge,Face,GAS,Axis);
case GeomAbs_SurfaceOfRevolution: {
//----------------------------------------------------------
// if myFace1 is not at the same side of the apex as the point
- // of parameter 0 0 on the cone => phase = PI.
+ // of parameter 0 0 on the cone => phase = M_PI.
//----------------------------------------------------------
Handle(Geom_SurfaceOfRevolution) GSRev =
Handle(Geom_SurfaceOfRevolution)::DownCast(GS);
Standard_Real U = Axis.XDirection().
AngleWithRef(D1,Axis.XDirection()^Axis.YDirection());
U += Phase;
- if ( U < 0.) U += 2*PI;
+ if ( U < 0.) U += 2*M_PI;
P = gp_Pnt(Bis->FirstParameter(), U, 0.);
Seq.Append(P);
case GeomAbs_Cone:
case GeomAbs_Sphere:
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;
case GeomAbs_BSplineSurface:
(*((Handle(Geom_BSplineSurface)*)&((mySurface.Surface()).Surface())))->UKnots(Knots);
Knots(1) = mySurface.FirstUParameter(); Knots(2) = mySurface.LastUParameter();
break;
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;
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;
case GeomAbs_BSplineSurface:
(*((Handle(Geom_BSplineSurface)*)&((mySurface.Surface()).Surface())))->VKnots(Knots);
break;
case GeomAbs_Circle:
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;
case GeomAbs_Parabola:
case GeomAbs_Hyperbola:
Standard_Boolean rev1 = (F1.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
Standard_Real ang =0.;
#else
#endif
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.
-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
const Standard_Real a = A.Angle(B);
const Standard_Real aa = Abs(a);
// Check if vectors are opposite
- if (aa > Precision::Angular() && (PI - aa) > Precision::Angular())
+ if (aa > Precision::Angular() && (M_PI - aa) > Precision::Angular())
{
theangle += a;
p1 = p2;
aLoopArea += triangle2Area(p2, p3);
aLoopArea += triangle2Area(p3, aStartPoint); // Last triangle area
- if( Abs(aLoopArea)/2 > PI*MIN_DIST )
+ if( Abs(aLoopArea)/2 > M_PI*MIN_DIST )
{
if ( findNextIntersection )
{
Result = new Geom_CylindricalSurface( Axis, Radius);
}
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));
Status = BRepOffset_Reversed;
}
gp_Vec Z( Axis.Direction());
Z *= - Offset * Sin(Alpha);
Axis.Translate(Z);
- Axis.Rotate(gp_Ax1(Axis.Location(),Axis.Direction()),PI);
+ Axis.Rotate(gp_Ax1(Axis.Location(),Axis.Direction()),M_PI);
Alpha = -Alpha;
}
Result = new Geom_ConicalSurface(Axis, Alpha, Radius);
Result = new Geom_SphericalSurface(Axis, Radius);
}
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();
Result = new Geom_SphericalSurface(Axis, -Radius);
Status = BRepOffset_Reversed;
ElSLib::Parameters( theSphere, fPnt, Uf, Vf );
ElSLib::Parameters( theSphere, lPnt, Ul, Vl );
if (Abs(Ul) <= Precision::Confusion())
- Ul = 2.*PI;
+ Ul = 2.*M_PI;
Handle(Geom_Curve) aCurv = aSphSurf->VIso(Vf);
/*
if (!isFirstFace)
Standard_Real Vfirst, Vlast;
if (p2d1.Y() > 0.)
{
- Vfirst = p2d1.Y(); Vlast = PI/2.;
+ Vfirst = p2d1.Y(); Vlast = M_PI/2.;
}
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_Edge OldEdge;
apex = OffSurf->Value( Uapex, Vapex );
//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;
BB.MakeEdge( NewEdge );
NewEdge.Orientation(TopAbs_FORWARD);
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.SameRange( NewEdge, Standard_True );
BB.Degenerated( NewEdge, Standard_True );
apex = OffSurf->Value( Uapex, Vapex );
//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;
BB.MakeEdge( NewEdge );
NewEdge.Orientation(TopAbs_FORWARD);
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.SameRange( NewEdge, Standard_True );
BB.Degenerated( NewEdge, Standard_True );
ElSLib::Parameters( theSphere, OrPnt, Uor, Vor );
TopoDS_Face NewFace;
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
- 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
TopoDS_Edge Bound;
apex = OffSurf->Value( Uapex, Vapex );
//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;
BB.MakeEdge( NewEdge );
NewEdge.Orientation(TopAbs_FORWARD);
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.SameRange( NewEdge, Standard_True );
BB.Degenerated( NewEdge, Standard_True );
if ( D.IsParallel(gp::DX2d(),Precision::Angular())) { // Iso V.
if ( STy == GeomAbs_Sphere) {
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);
}
else {
// V` = +/- PI + 2 k` PI
gp_Pnt2d P2d = PCurve->Value(f);
Standard_Boolean IsToAdjust = Standard_False;
- if ( P2d.Y() < -PI/2.) {
+ if ( P2d.Y() < -M_PI/2.) {
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;
- 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) {
// set the u firstpoint in [0,2*pi]
- gp_Vec2d Tr( PI, 0.);
- if ( P2d.X() > PI) Tr.Reverse();
+ gp_Vec2d Tr( M_PI, 0.);
+ if ( P2d.X() > M_PI) Tr.Reverse();
PCurve->Translate(Tr);
}
if (Der1.Magnitude() <= gp::Resolution() ||
Der2.Magnitude() <= gp::Resolution())
- angle = PI/2.;
+ angle = M_PI/2.;
else
angle = Der1.Angle(Der2);
if (V11.IsSame(CV) && V21.IsSame(CV))
{
BSplineEdges( FirstEdge, anEdge, 0, 0, Angle );
- Angle = PI - Angle;
+ Angle = M_PI - Angle;
}
else if (V11.IsSame(CV) && V22.IsSame(CV))
BSplineEdges( FirstEdge, anEdge, 0, 1, Angle );
else
{
BSplineEdges( FirstEdge, anEdge, 1, 1, Angle );
- Angle = PI - Angle;
+ Angle = M_PI - Angle;
}
return Angle;
}
Pmid = bc2d.Value( (bc2d.FirstParameter()+bc2d.LastParameter())/2. );
gp_Vec2d offset;
Standard_Boolean translate = Standard_False;
- if (Pfirst.X()-2.*PI > Precision::Confusion() ||
- Plast.X()-2.*PI > Precision::Confusion() ||
- Pmid.X()-2.*PI > Precision::Confusion())
+ if (Pfirst.X()-2.*M_PI > Precision::Confusion() ||
+ Plast.X()-2.*M_PI > Precision::Confusion() ||
+ Pmid.X()-2.*M_PI > Precision::Confusion())
{
- offset.SetCoord( -2.*PI, 0 );
+ offset.SetCoord( -2.*M_PI, 0 );
translate = Standard_True;
}
if (Pfirst.X() < -Precision::Confusion() ||
Plast.X() < -Precision::Confusion() ||
Pmid.X() < -Precision::Confusion())
{
- offset.SetCoord( 2.*PI, 0 );
+ offset.SetCoord( 2.*M_PI, 0 );
translate = Standard_True;
}
if (translate)
Standard_DomainError::Raise("cone with null height");
if (myHalfAngle*Height < Precision::Confusion())
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");
// cut at top
myHalfAngle(Angle),
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");
VMin(0.);
SetMeridian();
myHalfAngle(Angle),
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");
VMin(0.);
SetMeridian();
BRepPrim_Revolution( Axes, 0,RealLast()),
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");
VMin(0.);
SetMeridian();
// parameters on the meridian
-#define PMIN (-0.5*PI)
-#define PMAX (0.5*PI)
+#define PMIN (-0.5*M_PI)
+#define PMAX (0.5*M_PI)
//=======================================================================
//function : BRepPrim_Sphere
// Offset the parameters on the meridian
// to trim the edge in 3pi/2, 5pi/2
- SetMeridianOffset(2*PI);
+ SetMeridianOffset(2*M_PI);
gp_Dir D = Axes().YDirection();
D.Reverse();
BRepPrim_Torus::BRepPrim_Torus(const gp_Ax2& Position,
const Standard_Real Major,
const Standard_Real Minor) :
- BRepPrim_Revolution(Position,0,2*PI),
+ BRepPrim_Revolution(Position,0,2*M_PI),
myMajor(Major),
myMinor(Minor)
{
BRepPrim_Torus::BRepPrim_Torus(const Standard_Real Major,
const Standard_Real Minor) :
- BRepPrim_Revolution(gp::XOY(),0,2*PI),
+ BRepPrim_Revolution(gp::XOY(),0,2*M_PI),
myMajor(Major),
myMinor(Minor)
{
const Standard_Real Major,
const Standard_Real Minor) :
BRepPrim_Revolution(gp_Ax2(Center,gp_Dir(0,0,1),gp_Dir(1,0,0)),
- 0,2*PI),
+ 0,2*M_PI),
myMajor(Major),
myMinor(Minor)
{
const gp_Ax1& Ax,
const Standard_Boolean C):
myRotation(S.Oriented(TopAbs_FORWARD),
- NumShape(2*PI),
- Location(Ax,2*PI),
- Axe(Ax,2*PI),
- Angle(2*PI),
+ NumShape(2*M_PI),
+ Location(Ax,2*M_PI),
+ Axe(Ax,2*M_PI),
+ Angle(2*M_PI),
C)
{
Sweep_NumShape BRepSweep_Revol::NumShape(const Standard_Real D)const
{
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,
Standard_False,Standard_False);
}
Standard_Real BRepSweep_Revol::Angle(const Standard_Real D)const
{
Standard_Real d = Abs(D);
- while(d>(2*PI + Precision::Angular())){
- d = d - 2*PI;
+ while(d>(2*M_PI + Precision::Angular())){
+ d = d - 2*M_PI;
}
return d;
}
Standard_Real U = BC.FirstParameter();
point = BC.Value(U);
if (point.Distance(tor.Location()) < Precision::Confusion()) {
- v = PI;
+ v = M_PI;
// modified by NIZHNY-EAP Wed Mar 1 17:49:29 2000 ___BEGIN___
u = 0.;
}
tor.MinorRadius(),point,u,v);
}
// u = 0.;
- v = ElCLib::InPeriod(v,0.,2*PI);
- if((2*PI - v) <= Precision::PConfusion()) v -= 2*PI;
+ v = ElCLib::InPeriod(v,0.,2*M_PI);
+ if((2*M_PI - v) <= Precision::PConfusion()) v -= 2*M_PI;
if (aDirV.Index() == 2) {
Standard_Real uLeft = u-myAng;
- ElCLib::AdjustPeriodic(-PI,PI,Precision::PConfusion(),uLeft,u);
+ ElCLib::AdjustPeriodic(-M_PI,M_PI,Precision::PConfusion(),uLeft,u);
}
else {
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___
pnt2d.SetCoord(u,v-U);
BRepAdaptor_Curve BC(TopoDS::Edge(aGenE));
p1 = BC.Value(BC.FirstParameter());
if (p1.Distance(tor.Location()) < Precision::Confusion()){
- v1 = PI;
+ v1 = M_PI;
// modified by NIZHNY-EAP Thu Mar 2 09:43:26 2000 ___BEGIN___
u1 = 0.;
// modified by NIZHNY-EAP Thu Mar 2 15:28:59 2000 ___END___
}
p2 = BC.Value(BC.LastParameter());
if (p2.Distance(tor.Location()) < Precision::Confusion()){
- v2 = PI;
+ v2 = M_PI;
}
else {
ElSLib::TorusParameters(tor.Position(),tor.MajorRadius(),
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___
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){
p22d.SetCoord(u1,v1);
}
aGenS.ShapeType() == TopAbs_FACE &&
aDirS.Type() == TopAbs_EDGE &&
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 &&
aNewSubShape.ShapeType() == TopAbs_EDGE &&
TopLoc_Location Loc;
GeomAdaptor_Surface AS(BRep_Tool::Surface(TopoDS::Face(aNewShape),Loc));
if (AS.GetType()==GeomAbs_Plane){
- return ( Abs(myAng - 2 * PI) > Precision::Angular() );
+ return ( Abs(myAng - 2 * M_PI) > Precision::Angular() );
}
else {
return Standard_True;
TopLoc_Location Loc;
GeomAdaptor_Surface AS(BRep_Tool::Surface(TopoDS::Face(aNewShape),Loc));
if (AS.GetType()==GeomAbs_Plane){
- return (Abs(myAng-2*PI) <= Precision::Angular());
+ return (Abs(myAng-2*M_PI) <= Precision::Angular());
}
else{
return Standard_False;
if (n < 9) return 1;
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]))),
- atof(a[n-1])* PI180);
+ atof(a[n-1])* (M_PI / 180.0));
last = n-7;
}
else if (!strcmp(a[0],"tmirror")) {
if (!E.IsNull() && !F.IsNull() && (aMCh.Contour(E) == 0) ) {
d1 = atof(a[i + 3]);
angle = atof(a[i + 4]);
- angle *= PI / 180.;
+ angle *= M_PI / 180.;
if ( (d1 > Precision::Confusion())
&& (angle > Precision::Confusion())
- && (PI / 2.- angle > Precision::Confusion()) )
+ && (M_PI / 2.- angle > Precision::Confusion()) )
aMCh.AddDA(d1, angle, E, F);
}
i += 5;
case 'r':
i++;
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')) {
dx = Cos(angle);
dy = Sin(angle);
if (i >= n) goto badargs;
radius = atof(a[i-1]);
if (Abs(radius) > Precision::Confusion()) {
- angle = atof(a[i]) * PI180;
+ angle = atof(a[i]) * (M_PI / 180.0);
move = circle;
}
break;
case 'r':
i++;
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')) {
dx = Cos(angle);
dy = Sin(angle);
if (i >= n) goto badargs;
radius = atof(a[i-1]);
if (Abs(radius) > Precision::Confusion()) {
- angle = atof(a[i]) * PI180;
+ angle = atof(a[i]) * (M_PI / 180.0);
move = circle;
}
break;
TopoDS_Shape aLocalShape(DBRep::Get(a[8*ii+6],TopAbs_FACE));
F = TopoDS::Face(aLocalShape);
// 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]));
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));
//#else
Flag = (Standard_Boolean ) atof(a[9*ii+7]);
//#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]));
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);
FFrom = DBRep::Get(a[4],TopAbs_SHAPE);
if (FFrom.IsNull()) {
Angle = atof(a[4]);
- Angle *=PI/180.;
+ Angle *=M_PI/180.;
i = 5;
}
else {
FFrom = DBRep::Get(a[4],TopAbs_SHAPE);
if (FFrom.IsNull()) {
Angle = atof(a[4]);
- Angle *=PI/180.;
+ Angle *=M_PI/180.;
i = 5;
}
else {
theCommands << "Invalid DPrism base";
return 1;
}
- Standard_Real Angle = atof(a[4])*PI/360;
+ Standard_Real Angle = atof(a[4])*M_PI/360;
dprdef = Standard_True;
theDPrism.Init(Sbase,TopoDS::Face(Pbase),Skface,Angle,Fuse,Modify);
}
thePrism.Perform(Val);
}
else if (Kas == 2) {
- Val *=(PI/180.);
+ Val *=(M_PI/180.);
theRevol.Perform(Val);
}
else if (Kas == 4) {
thePrism.PerformUntilHeight(FUntil, Val);
}
else if (Kas == 2) {
- Val *=(PI/180.);
+ Val *=(M_PI/180.);
theRevol.PerformUntilAngle(FUntil, Val);
}
else if (Kas == 4) {
MF.AddChamfer(E1,E2,p1,p2);
}
else {
- MF.AddChamfer(E1,V,p1,p2*PI180);
+ MF.AddChamfer(E1,V,p1,p2 * (M_PI / 180.0));
}
}
}
else if (n == 5) {
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
S = BRepPrimAPI_MakeCylinder(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]));
}
if (P.IsNull())
return 1;
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
return 1;
}
else if (n == 6) {
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
S = BRepPrimAPI_MakeCone(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]),atof(a[5]));
}
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
return 1;
}
else if (n == 4) {
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
S = BRepPrimAPI_MakeSphere(P->Pln().Position().Ax2(),atof(a[3]));
}
else if (n == 5) {
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
- 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) {
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
- 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) {
- 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
return 1;
}
else if (n == 5) {
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
S = BRepPrimAPI_MakeTorus(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]));
}
else if (n == 6) {
if (P.IsNull())
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
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) {
if (P.IsNull())
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
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) {
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
return 1;
BRepLib::EncodeRegularity(sh);
else {
Standard_Real Tol = atof(a[2]);
- Tol *= PI/180.;
+ Tol *= M_PI/180.;
BRepLib::EncodeRegularity(sh, Tol);
}
return 0;
gp_Dir D(atof(a[6]),atof(a[7]),atof(a[8]));
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;
//#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::OX2d());
- Curve2d->Translate (gp_Vec2d (0, 2 * PI));
+ Curve2d->Translate (gp_Vec2d (0, 2 * M_PI));
}
if(Surf->IsKind(STANDARD_TYPE(Geom_SurfaceOfRevolution))||
(Surf->IsKind(STANDARD_TYPE(Geom_ToroidalSurface)))){
Curve2d->Mirror (gp_Ax2d (gp::Origin2d(), gp_Dir2d (1.,1.)));
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)) ||
Surf->IsKind(STANDARD_TYPE(Geom_ConicalSurface))))
- myLen = PI/180.;
+ myLen = M_PI/180.;
if (analyticMode&&(Surf->IsKind(STANDARD_TYPE(Geom_SphericalSurface)) ||
Surf->IsKind(STANDARD_TYPE(Geom_ToroidalSurface)))) {
gp_Trsf2d trans;
- trans.SetScale(gp_Pnt2d(0,0),180./PI);
+ trans.SetScale(gp_Pnt2d(0,0),180./M_PI);
Curve2d->Transform(trans);
First = Curve2d->TransformedParameter(First,trans);
Last = Curve2d->TransformedParameter(Last, trans);
Standard_Integer k = 1, kMin = 0, iDone = 0;
Standard_Boolean isDegenerated = Standard_True;
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++)
{
|| 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;
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; }
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;
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; }
}
if ( D.IsParallel(gp::DX2d(),Precision::Angular())) { // Iso V.
if ( STy == GeomAbs_Sphere) {
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);
}
else {
bisectorcurve = new Geom2d_Circle(TheSol->Circle());
if (!thesense)
thebisector = new Geom2d_TrimmedCurve
- (bisectorcurve,firstparameter-2.0*PI,firstparameter,thesense);
+ (bisectorcurve,firstparameter-2.0*M_PI,firstparameter,thesense);
else
thebisector = new Geom2d_TrimmedCurve
- (bisectorcurve,firstparameter,firstparameter+2.0*PI,thesense);
+ (bisectorcurve,firstparameter,firstparameter+2.0*M_PI,thesense);
}
else if (type == GccInt_Hpr) {
bisectorcurve = new Geom2d_Hyperbola(TheSol->Hyperbola());
bisectorcurve = new Geom2d_Ellipse(TheSol->Ellipse());
if (!thesense)
thebisector = new Geom2d_TrimmedCurve
- (bisectorcurve,firstparameter-2.0*PI,firstparameter,thesense);
+ (bisectorcurve,firstparameter-2.0*M_PI,firstparameter,thesense);
else
thebisector = new Geom2d_TrimmedCurve
- (bisectorcurve,firstparameter,firstparameter+2.0*PI,thesense);
+ (bisectorcurve,firstparameter,firstparameter+2.0*M_PI,thesense);
}
}
}
bisectorcurve = new Geom2d_Circle(TheSol->Circle());
if (!thesense)
thebisector = new Geom2d_TrimmedCurve(bisectorcurve,
- firstparameter-2.0*PI,
+ firstparameter-2.0*M_PI,
firstparameter,
thesense);
else
thebisector = new Geom2d_TrimmedCurve(bisectorcurve,
firstparameter,
- firstparameter+2.0*PI,
+ firstparameter+2.0*M_PI,
thesense);
}
else if (type == GccInt_Hpr) {
bisectorcurve = new Geom2d_Ellipse(TheSol->Ellipse());
if (!thesense)
thebisector = new Geom2d_TrimmedCurve(bisectorcurve,
- firstparameter-2.0*PI,
+ firstparameter-2.0*M_PI,
firstparameter,
thesense);
else
thebisector = new Geom2d_TrimmedCurve(bisectorcurve,
firstparameter,
- firstparameter+2.0*PI,
+ firstparameter+2.0*M_PI,
thesense);
}
}
thebisector->Value(UB2), UB2, Tolerance);
if (thebisector->BasisCurve()->IsPeriodic()) {
- DomainBisector.SetEquivalentParameters(0.0,2.*PI);
+ DomainBisector.SetEquivalentParameters(0.0,2.*M_PI);
}
FirstPointBisector = thebisector->Value(UB1);
// - one of two curves is concave.
// - the curves have a common point at the beginning and/or the end
// - 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.
// ie : the origin is not the in the polygon.
//-----------------------------------------------------------------------------
case BlendFunc_Rational:
{
Standard_Integer NbSpan =
- (Standard_Integer)(Ceiling(3.*Abs(MaxAng)/2./PI));
+ (Standard_Integer)(Ceiling(3.*Abs(MaxAng)/2./M_PI));
NbPoles = 2*NbSpan+1;
NbKnots = NbSpan+1;
Degree = 2;
Angle = ACos(Cosa);
if (Sina <0.) {
- Angle = 2.*PI - Angle;
+ Angle = 2.*M_PI - Angle;
}
if (Angle>maxang) {maxang = Angle;}
Sina = nplan.Dot(ns.Crossed(ns2));
Angle = ACos(Cosa);
if (Sina <0.) {
- Angle = 2.*PI - Angle;
+ Angle = 2.*M_PI - Angle;
}
Dangle = -(dnw.Dot(ns2) + ns.Dot(dn2w))/Sina;
ncrn = nplan.Crossed(ns);
Angle = ACos(Cosa);
if (Sina <0.) {
- Angle = 2.*PI - Angle;
+ Angle = 2.*M_PI - Angle;
}
if (Angle>maxang) {maxang = Angle;}
Sina = nplan.Dot(ns.Crossed(ns2));
Angle = ACos(Cosa);
if (Sina <0.) {
- Angle = 2.*PI - Angle;
+ Angle = 2.*M_PI - Angle;
}
Dangle = -(dnw.Dot(ns2) + ns.Dot(dn2w))/Sina;
ncrn = nplan.Crossed(ns);
// Reframing on ]-pi/2, 3pi/2]
if (Sina <0.) {
if (Cosa > 0.) Angle = -Angle;
- else Angle = 2.*PI - Angle;
+ else Angle = 2.*M_PI - Angle;
}
// cout << "Angle : " <<Angle << endl;
-// if ((Angle < 0) || (Angle > PI)) {
+// if ((Angle < 0) || (Angle > M_PI)) {
// cout << "t = " << param << endl;
// }
Pdeb = 0.;
Pfin = ElCLib::Parameter(C,pts2);
// Test negative and almost null angles : Singular Case
- if (Pfin>1.5*PI) {
+ if (Pfin>1.5*M_PI) {
np.Reverse();
C.SetPosition(gp_Ax2(Center,np,ns1));
Pfin = ElCLib::Parameter(C,pts2);
// Reframing on ]-pi/2, 3pi/2]
if (Sina <0.) {
if (Cosa > 0.) Angle = -Angle;
- else Angle = 2.*PI - Angle;
+ else Angle = 2.*M_PI - Angle;
}
if (Abs(Angle)>maxang) {maxang = Abs(Angle);}
Pdeb = 0.;
Pfin = ElCLib::Parameter(C,pts2);
// Test of negative and almost null angles : Single Case
- if (Pfin>1.5*PI) {
+ if (Pfin>1.5*M_PI) {
np.Reverse();
C.SetPosition(gp_Ax2(Center,np,ns1));
Pfin = ElCLib::Parameter(C,pts2);
void BndLib::Add( const gp_Cylinder& S,const Standard_Real VMin,
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 VMin,
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,
Standard_Integer Fi1;
Standard_Integer Fi2;
if (VMax<VMin) {
- Fi1 = (Standard_Integer )( VMax/(PI/4.));
- Fi2 = (Standard_Integer )( VMin/(PI/4.));
+ Fi1 = (Standard_Integer )( VMax/(M_PI/4.));
+ Fi2 = (Standard_Integer )( VMin/(M_PI/4.));
}
else {
- Fi1 = (Standard_Integer )( VMin/(PI/4.));
- Fi2 = (Standard_Integer )( VMax/(PI/4.));
+ Fi1 = (Standard_Integer )( VMin/(M_PI/4.));
+ Fi2 = (Standard_Integer )( VMax/(M_PI/4.));
}
Fi2++;
case GeomAbs_Sphere:
{
if (Abs(UMin) < Precision::Angular() &&
- Abs(UMax - 2.*PI) < Precision::Angular() &&
- Abs(VMin + PI/2.) < Precision::Angular() &&
- Abs(VMax - PI/2.) < Precision::Angular()) // a whole sphere
+ Abs(UMax - 2.*M_PI) < Precision::Angular() &&
+ Abs(VMin + M_PI/2.) < Precision::Angular() &&
+ Abs(VMax - M_PI/2.) < Precision::Angular()) // a whole sphere
BndLib::Add(S.Sphere(),Tol,B);
else
BndLib::Add(S.Sphere(),UMin,UMax,VMin,VMax,Tol,B);
}
Standard_Real Delta =Abs(Teta2-Teta1);
- if (Delta > 2. * PI) {
+ if (Delta > 2. * M_PI) {
Teta1 = 0.;
- Teta2 = 2. * PI;
+ Teta2 = 2. * M_PI;
}
else {
if (Teta1 < 0.) {
- do { Teta1+=2.*PI;} while (Teta1< 0.);
+ do { Teta1+=2.*M_PI;} while (Teta1< 0.);
}
- else if (Teta1> 2.*PI) {
- do { Teta1-=2.*PI;} while (Teta1> 2.*PI);
+ else if (Teta1> 2.*M_PI) {
+ do { Teta1-=2.*M_PI;} while (Teta1> 2.*M_PI);
}
Teta2 = Teta1 + Delta;
B.Add(Point(O +Ra*Cn2*Xd +Rb*Sn2*Yd));
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.))
Ram=Ra/0.92387953251128674;
Rbm=Rb/0.92387953251128674;
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
// 8 points of the polygon
#define addP6 B.Add(Point(O -Rbm*Yd));
#define addP7 B.Add(Point(O +Ram*PI4*Xd -Rbm*PI4*Yd))
- Standard_Integer deb = (Standard_Integer )( Teta1/(PI/4.));
- Standard_Integer fin = (Standard_Integer )( Teta2/(PI/4.));
+ Standard_Integer deb = (Standard_Integer )( Teta1/(M_PI/4.));
+ Standard_Integer fin = (Standard_Integer )( Teta2/(M_PI/4.));
deb++;
if (deb>fin) return;
#define TRANSFORMCOLOR(c) \
{ if (TypeOfCgm == CgmCharEncoding) c = (((c+1) << 2) - 1); }
-#define DRAD (PI/180.)
+#define DRAD (M_PI/180.)
#define DEFPLOTTER "DIRECT_CGM"
//-----------------------------------------------------------------
{
Standard_ShortReal san = sAngle;
Standard_ShortReal fan = sAngle + oAngle;
- if (oAngle >= 2*PI) {
+ if (oAngle >= 2*M_PI) {
PlotPolyAttrib (myLineColorIndex, -1, Standard_True);
if (aXradius == aYradius) {
ptabreal[0] = (float)Xpos; ptabreal[1] = (float)Ypos;
{
Standard_ShortReal san = sAngle;
Standard_ShortReal fan = sAngle + oAngle;
- if (oAngle >= 2.*PI) {
+ if (oAngle >= 2.*M_PI) {
if (aXradius == aYradius) {
ptabreal[0] = (float)Xpos; ptabreal[1] = (float)Ypos;
ptabreal[2] = (float)aXradius;
#define LOG2 0.30103
#define PARABIT 0x40
-#ifndef PI
-#define PI 3.1415926535
-#endif
-
-
/* All default values set within the control program */
/* with Character encoding defaults */
#define LOG2 0.30103
#define PARABIT 0x40
-#ifndef PI
-#define PI 3.1415926535
-#endif
-
#endif /* end of cgmpar.h */
{ //All lambda i exist
Standard_Integer SP;
Standard_Real inf,sup;
- inf=0.0-Standard_PI;
- sup=0.0+Standard_PI;
+ inf = 0.0 - M_PI;
+ sup = 0.0 + M_PI;
Standard_Boolean FU,LU,FV,LV;
//Creation of the domain of definition depending on the position
LU=(Abs(U-Umax) < Precision::PConfusion() );
FV=(Abs(V-Vmin) < Precision::PConfusion() );
LV=(Abs(V-Vmax) < Precision::PConfusion() );
- if(LU)
+ if (LU)
{
- inf=Standard_PI/2;
- sup=3*inf;
- if(LV){inf=Standard_PI;}
- if(FV){sup=Standard_PI;}
+ inf = M_PI / 2;
+ sup = 3 * inf;
+ if (LV)
+ {
+ inf = M_PI;
+ }
+ if (FV)
+ {
+ sup = M_PI;
+ }
}
- else if(FU)
+ else if (FU)
{
- sup=Standard_PI/2;
- inf=-sup;
- if(LV){sup=0;}
- if(FV){inf=0;}
+ sup = M_PI / 2;
+ inf = -sup;
+ if (LV)
+ {
+ sup = 0;
+ }
+ if (FV)
+ {
+ inf = 0;
+ }
}
- else if(LV)
+ else if (LV)
{
- inf=0.0-Standard_PI;
- sup=0;
+ inf = 0.0 - M_PI;
+ sup = 0;
}
- else if(FV)
+ else if (FV)
{
- inf=0;
- sup=Standard_PI;
+ inf = 0;
+ sup = M_PI;
}
Standard_Boolean CS=0;
Standard_Real Vprec=0,Vsuiv;
inside = (PPU2<param3 && PPU2>param4) || (PPU2<param4 && PPU2>param3);
// case of arc of circle passing on the sewing
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
- inside = (param3<PPU2 && PPU2<2*PI)
- || (0<=PPU2 && PPU2<param4-2*PI);
+ inside = (param3<PPU2 && PPU2<2*M_PI)
+ || (0<=PPU2 && PPU2<param4-2*M_PI);
// cas param4<param3
- inside = inside || (param4<PPU2 && PPU2<2*PI)
- || (0<=PPU2 && PPU2<param3-2*PI);
+ inside = inside || (param4<PPU2 && PPU2<2*M_PI)
+ || (0<=PPU2 && PPU2<param3-2*M_PI);
}
if ( inside && dist < dist1) {
numsol = nsol;
inside = (U2 < param1 && U2 >= param2) || (U2 <= param2 && U2 > param1);
/////////////////////////////////////////////////////
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
// 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
- 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) {
status = ChFi2d_ComputationError;
inside = (Vv2 < param3 && Vv2 >= param4) || (Vv2 <= param4 && Vv2 > param3);
/////////////////////////////////////////////////////
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
// 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
- 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) {
status = ChFi2d_ComputationError;
} // if (OE1 ...
Standard_Real cross = vec1*vec;
Standard_Boolean Sense = cross > 0.;
- if (U1 > Vv1 && U1 > 2.*PI) {
- ElCLib::AdjustPeriodic(0.,2.*PI,Precision::Confusion(),U1,Vv1);
+ if (U1 > Vv1 && U1 > 2.*M_PI) {
+ ElCLib::AdjustPeriodic(0.,2.*M_PI,Precision::Confusion(),U1,Vv1);
} // if (U1 ...
if (O1 == TopAbs_FORWARD && OE1 == TopAbs_FORWARD ||
O1 == TopAbs_REVERSED && OE1 == TopAbs_REVERSED ) {
dint1 = ns1.Crossed(tgE1);
dint2 = ns2.Crossed(tgE2);
Standard_Real ang = ns1.CrossMagnitude(ns2);
- if(ang > 0.0001*PI){
+ if(ang > 0.0001*M_PI){
Standard_Real scal = ns2.Dot(dint1);
if ( scal <= 0. ){
ns2.Reverse();
dint1 = ns1.Crossed(tgE1);
dint2 = ns2.Crossed(tgE2);
ang = ns1.CrossMagnitude(ns2);
- if(ang > 0.0001*PI){
+ if(ang > 0.0001*M_PI){
Standard_Real scal = ns2.Dot(dint1);
if ( scal <= 0. ){
ns2.Reverse();
const Standard_Real R)
{
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;
vd.Multiply(fac*R);
pol(2).SetCoord(pd.X()+vd.X(),pd.Y()+vd.Y(),pd.Z()+vd.Z());
Ufin = -Ufin;
}
else{
- Udeb = 2*PI - Udeb;
- Ufin = 2*PI - Ufin;
+ Udeb = 2*M_PI - Udeb;
+ 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();
HC->ChangeCurve().Load(C3d,Udeb,Ufin);
ChFi3d_ProjectPCurv(HC,S1,Pc1,tol3d,tolr1);
//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 ||
styp == GeomAbs_Cone) {
- Du = Min(PI-0.5*Du,0.1*Du);
+ Du = Min(M_PI-0.5*Du,0.1*Du);
Dv = 0.;
S1.Load(DStr.Surface(Fd1->Surf()).Surface(),
mu-Du,Mu+Du,mv,Mv);
//
caredeb = 0;
carefin = 0;
- Angle = PI*0.75;
+ Angle = M_PI*0.75;
LocalWL = WL;
LocalWF = WF;
if (!ES.IsPeriodic() && !PDeb.IsEqual(BSpline->Pole(1), tol) ) {
LProp.CentreOfCurvature(P2);
gp_Vec Vec(P1, P2);
Standard_Real Angle = PrevVec.Angle( Vec );
- if (Angle > PI/3.)
+ if (Angle > M_PI/3.)
return Standard_False;
Standard_Real Ratio = Vec.Magnitude() / PrevVec.Magnitude();
if (Ratio < 1.)
// there is no need of tolerance
// to make a decision (PRO9486) the regularity is enough.
// However, the abcense of turn-back is checked (PRO9810)
- OnAjoute = ((!rev && av1v2 < PI/2)
- ||(rev && av1v2 > PI/2));
+ OnAjoute = ((!rev && av1v2 < M_PI/2)
+ ||(rev && av1v2 > M_PI/2));
// mate attention to the single case (cf CTS21610_1)
if (OnAjoute && (degeneOnEc ||
TangentOnVertex(LVEc, Ev,myEFMap, ta)) )
- OnAjoute=((!rev && av1v2 < ta) || (rev && (PI - av1v2) < ta));
+ OnAjoute=((!rev && av1v2 < ta) || (rev && (M_PI - av1v2) < ta));
}
if (OnAjoute) {
Fini = Standard_False; // If this can be useful (Cf PRO14713)
for (Jt.Initialize(myEFMap(Ev)), Nbface= 0 ;Jt.More();Jt.Next(),
Nbface++) {}
if (Nbface> 1) CurSt = ChFiDS_BreakPoint;
- Fini = ((!rev && av1v2 < ta) || (rev && (PI - av1v2) < ta));
+ Fini = ((!rev && av1v2 < ta) || (rev && (M_PI - av1v2) < ta));
}
}
}
Standard_Boolean rev = (Or1 != curor);
Standard_Boolean OnAjoute = Standard_False;
if (FaceTangency(Ec,Ev,LVEv)) {
- OnAjoute = ((!rev && av1v2 < PI/2)
- ||(rev && av1v2 > PI/2));
+ OnAjoute = ((!rev && av1v2 < M_PI/2)
+ ||(rev && av1v2 > M_PI/2));
if (OnAjoute && (degeneOnEc ||
TangentOnVertex(FVEc, Ev,myEFMap, ta)) )
- OnAjoute=((!rev && av1v2 < ta) || (rev && (PI-av1v2) < ta));
+ OnAjoute=((!rev && av1v2 < ta) || (rev && (M_PI-av1v2) < ta));
}
if (OnAjoute) {
Ec = Ev;
for(Jt.Initialize(myEFMap(Ev)),Nbface= 0 ;Jt.More();Jt.Next(),
Nbface++) {}
if (Nbface> 1) CurSt = ChFiDS_BreakPoint;
- Fini = ((!rev && av1v2 < ta) || (rev && (PI - av1v2) < ta));
+ Fini = ((!rev && av1v2 < ta) || (rev && (M_PI - av1v2) < ta));
}
}
}
// There are ponts on the border, and internal points are found
if (derive.Magnitude() > Precision::PConfusion()) {
derive.Normalized();
- derive.Rotate(PI/2);
+ derive.Rotate(M_PI/2);
AS.Initialize(f1);
ResU = AS.UResolution(TolE);
ResV = AS.VResolution(TolE);
trouve=Standard_False;
ChFi3d_cherche_vertex ( Edge[0],Edge[1],Vcom,trouve);
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;
facesau=Face[0];
edgesau=Edge[1];
trouve=Standard_False;
ChFi3d_cherche_vertex ( Edge[1],Edge[2],Vcom,trouve);
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;
facesau=Face[1];
edgesau=Edge[1];
// deb=pfildeb.X();
// xx1=pfil1.X();
// xx2=pfil2.X();
-// moins2pi=Abs(deb)< Abs(Abs(deb)-2*PI);
-// moins2pi1=Abs(xx1)< Abs(Abs(xx1)-2*PI);
-// moins2pi2=Abs(xx2)< Abs(Abs(xx2)-2*PI);
+// moins2pi=Abs(deb)< Abs(Abs(deb)-2*M_PI);
+// moins2pi1=Abs(xx1)< Abs(Abs(xx1)-2*M_PI);
+// moins2pi2=Abs(xx2)< Abs(Abs(xx2)-2*M_PI);
// if (moins2pi1!=moins2pi2) {
// if (moins2pi) {
-// if (!moins2pi1) xx1=xx1-2*PI;
-// if (!moins2pi2) xx2=xx2-2*PI;
+// if (!moins2pi1) xx1=xx1-2*M_PI;
+// if (!moins2pi2) xx2=xx2-2*M_PI;
// }
// else {
-// if (moins2pi1) xx1=xx1+2*PI;
-// if (moins2pi2) xx2=xx2+2*PI;
+// if (moins2pi1) xx1=xx1+2*M_PI;
+// if (moins2pi2) xx2=xx2+2*M_PI;
// }
// }
// pfil1.SetX(xx1);
// deb=ufmin;
// xx1=pfac1.X();
// xx2=pfac2.X();
-// moins2pi=Abs(deb)< Abs(Abs(deb)-2*PI);
-// moins2pi1=Abs(xx1)< Abs(Abs(xx1)-2*PI);
-// moins2pi2=Abs(xx2)< Abs(Abs(xx2)-2*PI);
+// moins2pi=Abs(deb)< Abs(Abs(deb)-2*M_PI);
+// moins2pi1=Abs(xx1)< Abs(Abs(xx1)-2*M_PI);
+// moins2pi2=Abs(xx2)< Abs(Abs(xx2)-2*M_PI);
// if (moins2pi1!=moins2pi2) {
// if (moins2pi) {
-// if (!moins2pi1) xx1=xx1-2*PI;
-// if (!moins2pi2) xx2=xx2-2*PI;
+// if (!moins2pi1) xx1=xx1-2*M_PI;
+// if (!moins2pi2) xx2=xx2-2*M_PI;
// }
// else {
-// if (moins2pi1) xx1=xx1+2*PI;
-// if (moins2pi2) xx2=xx2+2*PI;
+// if (moins2pi1) xx1=xx1+2*M_PI;
+// if (moins2pi2) xx2=xx2+2*M_PI;
// }
// }
// pfac1.SetX(xx1);
Bat.SetFreeSliding (Standard_True);
Standard_Real ang1,ang2;
ang1=dir1.Angle(dir3);
- if (dir1.Angle(dir4) >0 ) ang2=PI-dir1.Angle(dir4);
- else ang2=-PI-dir1.Angle(dir4);
+ if (dir1.Angle(dir4) >0 ) ang2=M_PI-dir1.Angle(dir4);
+ else ang2=-M_PI-dir1.Angle(dir4);
if (contraint1&&contraint2)
anglebig=(Abs(ang1)>1.2)|| (Abs(ang2)>1.2 );
else if (contraint1)
anglebig=Abs(ang1)>1.2;
else if (contraint2)
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;
if (anglebig && !isplane) {
CalculDroite(p2d1,xdir,ydir,pcurve);
Standard_Boolean droit=Standard_False;
if (bordlibre) {nedge=(nedge-2)/2 +2;
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;
Standard_Integer size=nedge*2;
if (ind!=ic) {
TopoDS_Edge ecur=TopoDS::Edge(Evive.Value(ind));
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);
tangentregul.SetValue(ic,Standard_True);
trouve=Standard_True;
if ( !E1.IsSame(edgelibre1) && !E1.IsSame(edgelibre2) &&
!E2.IsSame(edgelibre1) && !E2.IsSame(edgelibre2)){
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);
}
}
}
Indices(nedge,ic,icplus,icmoins);
TopoDS_Edge Arc=TopoDS::Edge(Evive.Value(ic));
ChFiDS_CommonPoint cp1, cp2;
- Standard_Real angedg=PI;
+ Standard_Real angedg=M_PI;
TopoDS_Vertex Vcom;
if (!sharp.Value(icplus)) {
isfirst=(sens.Value(icplus)==1);
if (cp1.IsOnArc()){
ChFi3d_cherche_vertex(Arc,cp1.Arc(),Vcom,trouve);
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());
ChFi3d_edge_common_faces(myEFMap(cp1.Arc()),F1,F2);
if (!Fvive.Value(ic,icplus).IsSame(F1) && !Fvive.Value(ic,icplus).IsSame(F2)) {
cp2 = CD.Value(icmoins)->SetOfSurfData()->Value(Index.Value(icmoins))->
ChangeVertex (isfirst,jf.Value(icmoins));
if (cp2.IsOnArc()) {
- angedg=PI;
+ angedg=M_PI;
ChFi3d_cherche_vertex(Arc,cp2.Arc(),Vcom,trouve);
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());
ChFi3d_edge_common_faces(myEFMap(cp2.Arc()),F1,F2);
if (!Fvive.Value(ic,icmoins).IsSame(F1) && !Fvive.Value(ic,icmoins).IsSame(F2)) {
Standard_Integer iface;
// 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))));
- 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),
i1,i2,pa1,pa2,
Index.Value(ic),Index.Value(icplus),
if (couture) {
Standard_Boolean PI1=Standard_False, PI2=Standard_False;
Standard_Real xx;
- PI1=0<=p2d1.X() && p2d1.X() <=PI;
- PI2=0<=p2d2.X() && p2d2.X() <=PI;
+ PI1=0<=p2d1.X() && p2d1.X() <=M_PI;
+ PI2=0<=p2d2.X() && p2d2.X() <=M_PI;
if (Evive.Value(ic).IsSame(edgecouture)){
xx=p2d1.X();
- if (PI2&&!PI1) xx=xx-2*PI;
- if (!PI2&&PI1) xx=xx+2*PI;
+ if (PI2&&!PI1) xx=xx-2*M_PI;
+ if (!PI2&&PI1) xx=xx+2*M_PI;
p2d1.SetX(xx);
}
if (Evive.Value(icplus).IsSame(edgecouture)){
xx=p2d2.X();
- if (PI2&&!PI1) xx=xx+2*PI;
- if (!PI2&&PI1) xx=xx-2*PI;
+ if (PI2&&!PI1) xx=xx+2*M_PI;
+ if (!PI2&&PI1) xx=xx-2*M_PI;
p2d2.SetX(xx);
}
}
Standard_Real Ang = dsp.Angle(ded);
Standard_Real dis1 = psp.Distance(ped);
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;
Standard_Integer ivois;
if(!tron && YaUnVoisin(Spine,iedge,ivois,isfirst)) {
gp_Cone Co = AS.Cone();
Standard_Real rad = Co.RefRadius(), sang = Co.SemiAngle();
//#ifndef DEB
- Standard_Integer n = (Standard_Integer) (36.*ang/PI + 1);
+ Standard_Integer n = (Standard_Integer) (36.*ang/M_PI + 1);
//#else
-// Standard_Integer n = 36.*ang/PI + 1;
+// Standard_Integer n = 36.*ang/M_PI + 1;
//#endif
if(n<2) n = 2;
sec = new ChFiDS_SecHArray1(1, n);
gp_Pnt p;
gp_Vec n1,n2,du,dv;
BRep_Builder B;
- Standard_Real Seuil = PI/360.;
+ Standard_Real Seuil = M_PI/360.;
Standard_Real Seuil2 = Seuil * Seuil;
for (it.Initialize(myRegul); it.More(); it.Next()){
const ChFiDS_Regul& reg = it.Value();
gp_Torus To = AS.Torus();
Standard_Real majr = To.MajorRadius(), minr = To.MinorRadius();
//#ifndef DEB
- Standard_Integer n = (Standard_Integer) (36.*ang/PI + 1);
+ Standard_Integer n = (Standard_Integer) (36.*ang/M_PI + 1);
//#else
-// Standard_Integer n = 36.*ang/PI + 1;
+// Standard_Integer n = 36.*ang/M_PI + 1;
//#endif
if(n<2) n = 2;
sec = new ChFiDS_SecHArray1(1, n);
gp_Sphere Sp = AS.Sphere();
Standard_Real rad = Sp.Radius();
//#ifndef DEB
- Standard_Integer n = (Standard_Integer) (36.*ang/PI + 1);
+ Standard_Integer n = (Standard_Integer) (36.*ang/M_PI + 1);
//#else
-// Standard_Integer n = 36.*ang/PI + 1;
+// Standard_Integer n = 36.*ang/M_PI + 1;
//#endif
if(n<2) n = 2;
sec = new ChFiDS_SecHArray1(1, n);
if (Sens2==-1) dir2.Reverse();
Standard_Real ang1;
ang1=Abs(dir1.Angle(dir2));
- if (ang1<PI/180.) {
+ if (ang1<M_PI/180.) {
PerformMoreThreeCorner(Index,2);
done=1;
return;
#endif
return Standard_False;
}
- SemiAngl = PI / 2. - Angle;
+ SemiAngl = M_PI / 2. - Angle;
}
else {
ChamfRad = Spine.Radius() + Dis;
- SemiAngl = Angle - PI / 2.;
+ SemiAngl = Angle - M_PI / 2.;
}
if (ouvert) {
if (ouvert) {
SemiAngl = Abs(angCon) + Angle;
- if ( (PI / 2. - SemiAngl) < Precision::Confusion() ) {
+ if ( (M_PI / 2. - SemiAngl) < Precision::Confusion() ) {
cout <<"wrong choice of angle for the chamfer"<<endl;
return Standard_False;
}
Or.Z()+Rad*Dx.Z());
ElSLib::Parameters(Con,Pt ,u,v);
Standard_Real tol = Precision::PConfusion();
- if(u >= 2*PI - tol && u <= 2*PI) u = 0.;
+ if(u >= 2*M_PI - tol && u <= 2*M_PI) u = 0.;
if(u >= fu - tol && u < fu) u = fu;
if(u <= lu + tol && u > lu) u = lu;
- if(u < fu || u > lu) u = ElCLib::InPeriod(u,fu,fu + 2*PI);
+ if(u < fu || u > lu) u = ElCLib::InPeriod(u,fu,fu + 2*M_PI);
ElSLib::D1(u,v,Con,Pt,deru,derv);
gp_Pnt2d p2dCon(u,v);
gp_Dir2d d2dCon;
Or.Z()+Rad*Dx.Z());
ElSLib::Parameters(Con,Pt ,u,v);
Standard_Real tol = Precision::PConfusion();
- if (u >= 2*PI - tol && u <= 2*PI) u = 0.;
+ if (u >= 2*M_PI - tol && u <= 2*M_PI) u = 0.;
if (u >= fu - tol && u < fu) u = fu;
if (u <= lu + tol && u > lu) u = lu;
- if (u < fu || u > lu) u = ElCLib::InPeriod(u,fu,fu + 2*PI);
+ if (u < fu || u > lu) u = ElCLib::InPeriod(u,fu,fu + 2*M_PI);
ElSLib::D1(u,v,Con,Pt,deru,derv);
gp_Pnt2d p2dCon(u,v);
gp_Dir2d d2dCon;
ElSLib::Parameters(Cyl, Pt ,u, v);
Standard_Real tol = Precision::PConfusion();
Standard_Boolean careaboutsens = 0;
- if(Abs(lu - fu - 2 * PI) < tol) careaboutsens = 1;
+ if(Abs(lu - fu - 2 * M_PI) < tol) careaboutsens = 1;
if(u >= fu - tol && u < fu) u = fu;
if(u <= lu + tol && u > lu) u = lu;
- if(u < fu || u > lu) u = ChFiKPart_InPeriod(u, fu, fu + 2 * PI, tol);
+ if(u < fu || u > lu) u = ChFiKPart_InPeriod(u, fu, fu + 2 * M_PI, tol);
ElSLib::D1(u, v, Cyl, Pt, deru, derv);
gp_Dir norcyl = deru.Crossed(derv);
Or.Z()+Rad*Dx.Z());
ElSLib::Parameters(Con,Pt ,u,v);
Standard_Real tol = Precision::PConfusion();
- if(u >= 2*PI - tol && u <= 2*PI) u = 0.;
+ if(u >= 2*M_PI - tol && u <= 2*M_PI) u = 0.;
if(u >= fu - tol && u < fu) u = fu;
if(u <= lu + tol && u > lu) u = lu;
- if(u < fu || u > lu) u = ElCLib::InPeriod(u,fu,fu + 2*PI);
+ if(u < fu || u > lu) u = ElCLib::InPeriod(u,fu,fu + 2*M_PI);
ElSLib::D1(u,v,Con,Pt,deru,derv);
gp_Pnt2d p2dCon(u,v);
gp_Dir2d d2dCon;
ElSLib::Parameters(Cyl,Pt ,u,v);
Standard_Real tol = Precision::PConfusion();
Standard_Boolean careaboutsens = 0;
- if(Abs(lu - fu - 2*PI) < tol) careaboutsens = 1;
+ if(Abs(lu - fu - 2*M_PI) < tol) careaboutsens = 1;
if(u >= fu - tol && u < fu) u = fu;
if(u <= lu + tol && u > lu) u = lu;
- if(u < fu || u > lu) u = ChFiKPart_InPeriod(u,fu,fu + 2*PI,tol);
+ if(u < fu || u > lu) u = ChFiKPart_InPeriod(u,fu,fu + 2*M_PI,tol);
ElSLib::D1(u,v,Cyl,Pt,deru,derv);
gp_Dir norcyl = deru.Crossed(derv);
else{
ElSLib::TorusParameters(FilAx3,Rad,Radius,P,u,v);
ElSLib::TorusD1(u,v,FilAx3,Rad,Radius,PP,deru,derv);
- if(!plandab && Ang < PI/2 && dedans) v = v + 2*PI;
+ if(!plandab && Ang < M_PI/2 && dedans) v = v + 2*M_PI;
}
gp_Pnt2d p2dFil(0.,v);
gp_Dir norFil(deru.Crossed(derv));
else{
ElSLib::TorusParameters(FilAx3,Rad,Radius,P,u,v);
ElSLib::TorusD1(u,v,FilAx3,Rad,Radius,PP,deru,derv);
- if(plandab && Ang < PI/2 && dedans) v = v + 2*PI;
+ if(plandab && Ang < M_PI/2 && dedans) v = v + 2*M_PI;
}
norFil = deru.Crossed(derv);
p2dFil.SetCoord(0.,v);
ElSLib::Parameters(Con,P,u,v);
Standard_Real tol = Precision::PConfusion();
Standard_Boolean careaboutsens = 0;
- if(Abs(lu - fu - 2*PI) < tol) careaboutsens = 1;
+ if(Abs(lu - fu - 2*M_PI) < tol) careaboutsens = 1;
if(u >= fu - tol && u < fu) u = fu;
if(u <= lu + tol && u > lu) u = lu;
- if(u < fu || u > lu) u = ElCLib::InPeriod(u,fu,fu + 2*PI);
+ if(u < fu || u > lu) u = ElCLib::InPeriod(u,fu,fu + 2*M_PI);
ElSLib::D1(u,v,Con,PP,deru,derv);
gp_Dir norCon = deru.Crossed(derv);
gp_Dir2d d2dCon = gp::DX2d();
ElSLib::Parameters(Cyl,OrFillet,UOnCyl,VOnCyl);
Standard_Real tesp = Precision::Confusion();
if(UOnCyl < fu - tesp || UOnCyl > lu + tesp)
- UOnCyl = ElCLib::InPeriod(UOnCyl,fu,fu+2*PI);
+ UOnCyl = ElCLib::InPeriod(UOnCyl,fu,fu+2*M_PI);
ElSLib::Parameters(Pln,OrFillet,UOnPln,VOnPln);
gp_Vec XDir,OtherDir;
gp_Lin C3d(POnPln,DirFillet);
Standard_Real UOnFillet,V;
ElSLib::CylinderParameters(AxFil,Radius,POnPln,UOnFillet,V);
- if(UOnFillet > PI) UOnFillet = 0.;
+ if(UOnFillet > M_PI) UOnFillet = 0.;
gp_Lin2d LOnFillet(gp_Pnt2d(UOnFillet,V),gp::DY2d());
Handle(Geom_Line) L3d = new Geom_Line (C3d);
Handle(Geom2d_Line) LFac = new Geom2d_Line(Lin2dPln);
gp_Pnt POnCyl = ElSLib::Value(UOnCyl,VOnCyl,Cyl);
C3d = gp_Lin(POnCyl,DirFillet);
ElSLib::CylinderParameters(AxFil,Radius,POnCyl,UOnFillet,V);
- if(UOnFillet > PI) UOnFillet = 0.;
+ if(UOnFillet > M_PI) UOnFillet = 0.;
LOnFillet = gp_Lin2d(gp_Pnt2d(UOnFillet,V),gp::DY2d());
L3d = new Geom_Line (C3d);
LFac = new Geom2d_Line(Lin2dCyl);
Standard_Real acote = 1e-7;
ElCLib::D1(First,Spine,PtSp,DSp);
ElSLib::Parameters(Cyl,PtSp,u,v);
- if ((Abs(u)<acote) || (Abs(u-(2*PI))<acote)){
+ if ((Abs(u)<acote) || (Abs(u-(2*M_PI))<acote)){
ElCLib::D1(First+0.2,Spine,PtSp2,DSp2);
Standard_Real u2,v2;
ElSLib::Parameters(Cyl,PtSp2,u2,v2);
- if (Abs(u2-u)>PI){
- u = (2*PI)-u;
+ if (Abs(u2-u)>M_PI){
+ u = (2*M_PI)-u;
PtSp = ElSLib::Value(u,v,Cyl);
Standard_Real PR;
PR = ElCLib::Parameter(Spine,PtSp);
cPln.Z()+Rad*Dx.Z());
u = 0.;
if ((dedans && plandab) || (!dedans && !plandab)){
- if (c1sphere) { v = - PI / 2; }
- else { v = 3 * PI / 2; }
+ if (c1sphere) { v = - M_PI / 2; }
+ else { v = 3 * M_PI / 2; }
}
- else { v = PI / 2; }
+ else { v = M_PI / 2; }
gp_Dir norFil;
if(c1sphere){
ElSLib::SphereD1(u,v,FilAx3,cylrad,PP,deru,derv);
Or.Z()+cylrad*Dx.Z());
u = 0.;
if (dedans) {
- if (plandab && !c1sphere) { v = 2 * PI; }
+ if (plandab && !c1sphere) { v = 2 * M_PI; }
else { v = 0. ; }
}
- else { v = PI; }
+ else { v = M_PI; }
p2dFil.SetCoord(u,v);
if(c1sphere){
ElSLib::SphereD1(u,v,FilAx3,cylrad,PP,deru,derv);
ElSLib::Parameters(Cyl,P,u,v);
Standard_Real tol = Precision::PConfusion();
Standard_Boolean careaboutsens = 0;
- if(Abs(lu - fu - 2*PI) < tol) careaboutsens = 1;
+ if(Abs(lu - fu - 2*M_PI) < tol) careaboutsens = 1;
if(u >= fu - tol && u < fu) u = fu;
if(u <= lu + tol && u > lu) u = lu;
- if(u < fu || u > lu) u = ChFiKPart_InPeriod(u,fu,fu + 2*PI,tol);
+ if(u < fu || u > lu) u = ChFiKPart_InPeriod(u,fu,fu + 2*M_PI,tol);
ElSLib::D1(u,v,Cyl,PP,deru,derv);
gp_Dir norcyl = deru.Crossed(derv);
gp_Dir2d d2dCyl = gp::DX2d();
//------------------------------------------------------------
gp_Pnt pp;
gp_Vec du,dv;
- ElSLib::TorusD1(0.,PI/2,ppos,r,r,pp,du,dv);
+ ElSLib::TorusD1(0.,M_PI/2,ppos,r,r,pp,du,dv);
gp_Dir drot(du.Crossed(dv));
Standard_Boolean reversecur = ( drot.Dot(dplnat) <= 0. );
Standard_Boolean reversefil = ( drot.Dot(dfpl) <= 0. );
ppos.YDirection().Dot(pl.Position().YDirection()));
gp_Ax22d circ2dax(p2dcirc,dx2d,dy2d);
Handle(Geom2d_Circle) GC2d = new Geom2d_Circle(circ2dax,r);
- gp_Pnt2d p2dlin(0.,PI/2);
+ gp_Pnt2d p2dlin(0.,M_PI/2);
Handle(Geom2d_Line) GL2d = new Geom2d_Line(p2dlin,gp::DX2d());
TopAbs_Orientation trans = TopAbs_REVERSED;
if (reversecur) trans = TopAbs_FORWARD;
//--------------
Handle(Geom_Curve) bid;
Handle(Geom2d_Curve) bid2d;
- p2dlin.SetCoord(0.,PI);
+ p2dlin.SetCoord(0.,M_PI);
Handle(Geom2d_Line) GL2dcoin = new Geom2d_Line(p2dlin,gp::DX2d());
Data->ChangeInterferenceOnS2().
SetInterference(ChFiKPart_IndexCurveInDS(bid,DStr),trans,bid2d,GL2dcoin);
//et les points
//-------------
Data->ChangeVertexFirstOnS1().SetPoint(pp);
- ElSLib::TorusD0(alpha,PI/2,ppos,r,r,pp);
+ ElSLib::TorusD0(alpha,M_PI/2,ppos,r,r,pp);
Data->ChangeVertexLastOnS1().SetPoint(pp);
Data->ChangeInterferenceOnS1().SetFirstParameter(0.);
Data->ChangeInterferenceOnS1().SetLastParameter(alpha);
Handle(Geom_Curve) C;
Handle(Geom2d_Curve) C2d;
- gp_Pnt2d p2dFil(0.,-PI/2.);
+ gp_Pnt2d p2dFil(0.,-M_PI/2.);
gp_Lin2d lin2dFil(p2dFil,gp::DX2d());
Handle(Geom2d_Curve) C2dFil = new Geom2d_Line(lin2dFil);
toreverse = ( ddz.Dot(dnat1) <= 0. );
{
myType = Contap_DraftStd;
myDir = Direction;
- myCosAng = Cos(PI/2.+Angle);
+ myCosAng = Cos(M_PI/2.+Angle);
}
inline void Contap_ArcFunction::Set(const gp_Pnt& Eye,
{
myType = Contap_DraftPrs;
myEye = Eye;
- myCosAng = Cos(PI/2.+Angle);
+ myCosAng = Cos(M_PI/2.+Angle);
}
inline void Contap_ArcFunction::Set(const gp_Dir& Direction)
Standard_Real Coefcos = D.Dot(C.Position().XDirection());
Standard_Real Coefsin = D.Dot(C.Position().YDirection());
- Standard_Real Coefcst = cos(PI*0.5 + Angle);
+ Standard_Real Coefcst = cos(M_PI*0.5 + Angle);
Standard_Real norm1 = Coefcos*Coefcos + Coefsin*Coefsin;
Standard_Real norm2 = sqrt(norm1);
Standard_Real Coefcos = D.Dot(C.Position().XDirection());
Standard_Real Coefsin = D.Dot(C.Position().YDirection());
- Standard_Real Coefcst1 = cos(PI*0.5 + Angle);
+ Standard_Real Coefcst1 = cos(M_PI*0.5 + Angle);
Standard_Real norm1 = Coefcos*Coefcos + Coefsin*Coefsin;
Standard_Real norm2 = Sqrt(norm1);
}
}
if(myHS1IsUPeriodic) {
- lmf = PI+PI; //-- myHS1->UPeriod();
+ lmf = M_PI+M_PI; //-- myHS1->UPeriod();
f = myHS1->FirstUParameter();
l = myHS1->LastUParameter();
while(u1 < f) { u1+=lmf; }
while(u1 > l) { u1-=lmf; }
}
if(myHS1IsVPeriodic) {
- lmf = PI+PI; //-- myHS1->VPeriod();
+ lmf = M_PI+M_PI; //-- myHS1->VPeriod();
f = myHS1->FirstVParameter();
l = myHS1->LastVParameter();
while(v1 < f) { v1+=lmf; }
Standard_Boolean novtx = Standard_True;
if(nbvtx) novtx=Standard_False;
for(Standard_Integer i=1;i<nbvtx || novtx;i++) {
- Standard_Real firstp=0,lastp=PI+PI;
+ Standard_Real firstp=0,lastp=M_PI+M_PI;
if(novtx == Standard_False) {
firstp = L.Vertex(i).ParameterOnLine();
lastp = L.Vertex(i+1).ParameterOnLine();
}
if(nbvtx) {
Standard_Real firstp = L.Vertex(nbvtx).ParameterOnLine();
- Standard_Real lastp = L.Vertex(1).ParameterOnLine() + PI+PI;
+ Standard_Real lastp = L.Vertex(1).ParameterOnLine() + M_PI+M_PI;
if(Abs(firstp-lastp)>0.0000000001) {
Standard_Real pmid = (firstp+lastp)*0.5;
gp_Pnt Pmid = ElCLib::Value(pmid,L.Circle());
Contap_ThePoint pvtx = L.Vertex(nbvtx);
Line.Add(pvtx);
- pvtx = L.Vertex(1); pvtx.SetParameter(pvtx.ParameterOnLine()+PI+PI);
+ pvtx = L.Vertex(1); pvtx.SetParameter(pvtx.ParameterOnLine()+M_PI+M_PI);
Line.Add(pvtx);
Line.SetTransitionOnS(L.TransitionOnS());
slin.Append(Line);
myType = Contap_DraftStd; // Contour vu
myDir = Direction;
myAng = Angle;
- myCosAng = Cos(PI/2.+Angle);
+ myCosAng = Cos(M_PI/2.+Angle);
}
inline void Contap_SurfFunction::Set(const gp_Pnt& Eye,
myType = Contap_DraftPrs; // Contour vu "conique"...
myEye = Eye;
myAng = Angle;
- myCosAng = Cos(PI/2.+Angle);
+ myCosAng = Cos(M_PI/2.+Angle);
}
inline void Contap_SurfFunction::Set(const Standard_Real Tolerance)
isperiodic = Standard_False;
Convert_ConicToBSplineCurve::
BuildCosAndSin(Parameterisation,
- 0, 2*PI,
+ 0, 2*M_PI,
CosNumeratorPtr,
SinNumeratorPtr,
weights,
Standard_Real delta = ULast - UFirst ;
Standard_Real Eps = Precision::PConfusion();
- if ( (delta > (2*PI + Eps)) || (delta <= 0.0e0) ) {
+ if ( (delta > (2*M_PI + Eps)) || (delta <= 0.0e0) ) {
Standard_DomainError::Raise( "Convert_CircleToBSplineCurve");
}
// Number of spans : maximum opening = 150 degrees ( = PI / 1.2 rds)
Standard_Integer
- nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / PI) + 1;
+ nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / M_PI) + 1;
Standard_Real AlfaU = deltaU / ( nbUSpans * 2);
Standard_Real x[TheNbVPoles];
{
Standard_Real deltaU = U2 - U1;
Standard_DomainError_Raise_if( (Abs(V2-V1) <= Abs(Epsilon(V1))) ||
- (deltaU > 2*PI) ||
+ (deltaU > 2*M_PI) ||
(deltaU < 0. ),
"Convert_ConeToBSplineSurface");
// Number of spans : maximum opening = 150 degrees ( = PI / 1.2 rds)
Standard_Integer
- nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / PI) + 1;
+ nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / M_PI) + 1;
Standard_Real AlfaU = deltaU / ( nbUSpans * 2);
nbUPoles = 2 * nbUSpans + 1;
Standard_Real R = C.RefRadius();
Standard_Real A = C.SemiAngle();
- ComputePoles( R, A, 0., 2.*PI, V1, V2, poles);
+ ComputePoles( R, A, 0., 2.*M_PI, V1, V2, poles);
nbUPoles = 6;
nbUKnots = 4;
nbVKnots = 2;
for ( i = 1; i <= nbUKnots; i++) {
- uknots(i) = ( i-1) * 2. * PI /3.;
+ uknots(i) = ( i-1) * 2. * M_PI /3.;
umults(i) = 2;
}
vknots(1) = V1; vmults(1) = 2;
switch (Parameterisation) {
case Convert_TgtThetaOver2:
num_spans =
- (Standard_Integer)IntegerPart( 1.2 * delta / PI) + 1;
+ (Standard_Integer)IntegerPart( 1.2 * delta / M_PI) + 1;
tgt_theta_flag = 1 ;
break ;
case Convert_TgtThetaOver2_1:
num_spans = 1 ;
- if (delta > 0.9999 * PI) {
+ if (delta > 0.9999 * M_PI) {
Standard_ConstructionError::Raise() ;
}
tgt_theta_flag = 1 ;
break ;
case Convert_TgtThetaOver2_2:
num_spans = 2 ;
- if (delta > 1.9999 * PI) {
+ if (delta > 1.9999 * M_PI) {
Standard_ConstructionError::Raise() ;
}
tgt_theta_flag = 1 ;
alpha_2 = alpha * 0.5e0 ;
p_param = - 1.0e0 / (alpha_2 * alpha_2) ;
- if (alpha_2 < PI * 0.5e0) {
+ if (alpha_2 < M_PI * 0.5e0) {
tan_alpha_2 = Tan(alpha_2) ;
value1 = 3.0e0 * (tan_alpha_2 - alpha_2) ;
value1 = alpha_2 / value1 ;
if (Parameterisation == Convert_TgtThetaOver2) {
BuildCosAndSin(Convert_TgtThetaOver2_3,
0.0e0,
- 2 * PI,
+ 2 * M_PI,
temp_cos_ptr,
temp_sin_ptr,
temp_denominator_ptr,
else if (Parameterisation == Convert_RationalC1)
{
first_param = 0.0e0 ;
- last_param = PI ;
+ last_param = M_PI ;
BuildCosAndSin(Convert_RationalC1,
first_param,
last_param,
DenominatorPtr =
new TColStd_HArray1OfReal(1,num_periodic_poles) ;
- half_pi = PI * 0.5e0 ;
+ half_pi = M_PI * 0.5e0 ;
index = 1 ;
for (jj = 1 ; jj <= 2 ; jj++) {
flat_knots(index) = - half_pi ;
}
}
for (jj = 1 ; jj <= 2 ; jj++) {
- flat_knots(index) = 2 * PI + half_pi ;
+ flat_knots(index) = 2 * M_PI + half_pi ;
index += 1 ;
}
KnotsPtr =
inverse = 1.0e0 ;
for (ii = parameters.Lower() ; ii <= parameters.Upper() ; ii++) {
param = parameters(ii) ;
- if (param > PI) {
+ if (param > M_PI) {
inverse = -1.0e0 ;
- param -= PI ;
+ param -= M_PI ;
}
BSplCLib::D0(param,
0,
// Number of spans : maximum opening = 150 degrees ( = PI / 1.2 rds)
Standard_Integer
- nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / PI) + 1;
+ nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / M_PI) + 1;
Standard_Real AlfaU = deltaU / ( nbUSpans * 2);
Standard_Real UStart = U1;
{
Standard_Real deltaU = U2 - U1;
Standard_DomainError_Raise_if( (Abs(V2-V1) <= Abs(Epsilon(V1))) ||
- (deltaU > 2*PI) ||
+ (deltaU > 2*M_PI) ||
(deltaU < 0. ),
"Convert_CylinderToBSplineSurface");
// Number of spans : maximum opening = 150 degrees ( = PI / 1.2 rds)
Standard_Integer
- nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / PI) + 1;
+ nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / M_PI) + 1;
Standard_Real AlfaU = deltaU / ( nbUSpans * 2);
nbUPoles = 2 * nbUSpans + 1;
Standard_Real R = Cyl.Radius();
- ComputePoles( R, 0., 2.*PI, V1, V2, poles);
+ ComputePoles( R, 0., 2.*M_PI, V1, V2, poles);
nbUPoles = 6;
nbUKnots = 4;
nbVKnots = 2;
for ( i = 1; i <= nbUKnots; i++) {
- uknots(i) = ( i-1) * 2. * PI /3.;
+ uknots(i) = ( i-1) * 2. * M_PI /3.;
umults(i) = 2;
}
vknots(1) = V1; vmults(1) = 2;
isperiodic = Standard_False;
Convert_ConicToBSplineCurve::
BuildCosAndSin(Parameterisation,
- 0, 2*PI,
+ 0, 2*M_PI,
CosNumeratorPtr,
SinNumeratorPtr,
weights,
Standard_Real Tol = Precision::PConfusion();
Standard_Real delta = ULast - UFirst;
#endif
- Standard_DomainError_Raise_if( (delta > (2*PI+Tol)) || (delta <= 0.0e0),
+ Standard_DomainError_Raise_if( (delta > (2*M_PI+Tol)) || (delta <= 0.0e0),
"Convert_EllipseToBSplineCurve");
Standard_Integer ii;
Standard_Real R, r, value;
BSplCLib::D0(ptest,TPoles,BSplCLib::NoWeights(),valP);
Standard_Real theta = ATan2(valP.Y(),valP.X());
if (theta < 0.) {
- theta +=2.*PI;
+ theta +=2.*M_PI;
}
if (Abs(theta - Angfin) < Ptol) {
return ptest;
trim_max,
middle,
Angle,
- PI2 = 2*PI ;
+ PI2 = 2*M_PI ;
Standard_Integer ii, degree = num_poles -1 ;
locUFirst = UFirst ;
// parametre 1/2 of Bezier was exactly a point of the bissectrice
// of the required angular sector.
//
- Angle = middle - PI ;
+ Angle = middle - M_PI ;
//
// Circle of radius 1. See Euclid
//
}
- t_min = 1.0e0 - (Delta * 1.3e0 / PI) ;
+ t_min = 1.0e0 - (Delta * 1.3e0 / M_PI) ;
t_min *= 0.5e0 ;
t_min = Max(t_min,0.0e0) ;
- t_max = 1.0e0 + (Delta * 1.3e0 / PI) ;
+ t_max = 1.0e0 + (Delta * 1.3e0 / M_PI) ;
t_max *= 0.5e0 ;
t_max = Min(t_max,1.0e0) ;
trim_max = Locate(Delta,
// Number of spans : maximum opening = 150 degrees ( = PI / 1.2 rds)
Standard_Integer
- nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / PI) + 1;
+ nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / M_PI) + 1;
Standard_Integer
- nbVSpans = (Standard_Integer)IntegerPart( 1.2 * deltaV / PI) + 1;
+ nbVSpans = (Standard_Integer)IntegerPart( 1.2 * deltaV / M_PI) + 1;
Standard_Real AlfaU = deltaU / ( nbUSpans * 2);
Standard_Real AlfaV = deltaV / ( nbVSpans * 2);
{
Standard_Real deltaU = U2 - U1;
Standard_Real deltaV = V2 - V1;
- Standard_DomainError_Raise_if( (deltaU>2*PI) || (deltaU<0.) ||
- (V1 < -PI/2.0) || (V2 > PI/2),
+ Standard_DomainError_Raise_if( (deltaU>2*M_PI) || (deltaU<0.) ||
+ (V1 < -M_PI/2.0) || (V2 > M_PI/2),
"Convert_SphereToBSplineSurface");
isuperiodic = Standard_False;
// Number of spans : maximum opening = 150 degrees ( = PI / 1.2 rds)
Standard_Integer
- nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / PI) + 1;
+ nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / M_PI) + 1;
Standard_Integer
- nbVSpans = (Standard_Integer)IntegerPart( 1.2 * deltaV / PI) + 1;
+ nbVSpans = (Standard_Integer)IntegerPart( 1.2 * deltaV / M_PI) + 1;
Standard_Real AlfaU = deltaU / ( nbUSpans * 2);
Standard_Real AlfaV = deltaV / ( nbVSpans * 2);
#ifndef No_Exception
Standard_Real delta = Param2 - Param1;
#endif
- Standard_DomainError_Raise_if( (delta>2*PI) || (delta<0.),
+ Standard_DomainError_Raise_if( (delta>2*M_PI) || (delta<0.),
"Convert_SphereToBSplineSurface");
Standard_Integer i, j;
Standard_Real W1, W2, CosU, CosV;
if ( isuperiodic) {
- ComputePoles(R, 0., 2.*PI, Param1, Param2, poles);
+ ComputePoles(R, 0., 2.*M_PI, Param1, Param2, poles);
nbUPoles = 6;
nbUKnots = 4;
deltaV = Param2 - Param1;
Standard_Integer
- nbVSpans = (Standard_Integer)IntegerPart( 1.2 * deltaV / PI) + 1;
+ nbVSpans = (Standard_Integer)IntegerPart( 1.2 * deltaV / M_PI) + 1;
Standard_Real AlfaV = deltaV / ( nbVSpans * 2);
nbVPoles = 2 * nbVSpans + 1;
nbVKnots = nbVSpans + 1;
for ( i = 1; i <= nbUKnots; i++) {
- uknots(i) = ( i-1) * 2. * PI /3.;
+ uknots(i) = ( i-1) * 2. * M_PI /3.;
umults(i) = 2;
}
for ( i = 1; i <= nbVKnots; i++) {
CosV = Cos(AlfaV);
}
else {
- ComputePoles(R, Param1, Param2, -PI/2., PI/2., poles);
+ ComputePoles(R, Param1, Param2, -M_PI/2., M_PI/2., poles);
nbVPoles = 5;
nbVKnots = 3;
deltaU = Param2 - Param1;
Standard_Integer
- nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / PI) + 1;
+ nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / M_PI) + 1;
Standard_Real AlfaU = deltaU / ( nbUSpans * 2);
nbUPoles = 2 * nbUSpans + 1;
nbUKnots = nbUSpans + 1;
- vknots(1) = -PI/2.; vmults(1) = 3;
+ vknots(1) = -M_PI/2.; vmults(1) = 3;
vknots(2) = 0.; vmults(2) = 2;
- vknots(3) = PI/2.; vmults(3) = 3;
+ vknots(3) = M_PI/2.; vmults(3) = 3;
for ( i = 1; i <= nbUKnots; i++) {
uknots(i) = Param1 + (i-1) * 2 * AlfaU;
umults(i) = 2;
Standard_Real R = Sph.Radius();
- ComputePoles( R, 0., 2.*PI, -PI/2., PI/2., poles);
+ ComputePoles( R, 0., 2.*M_PI, -M_PI/2., M_PI/2., poles);
uknots( 1) = 0.;
- uknots( 2) = 2. * PI / 3.;
- uknots( 3) = 4. * PI / 3.;
- uknots( 4) = 2. * PI;
- vknots( 1) = -PI/2.;
+ uknots( 2) = 2. * M_PI / 3.;
+ uknots( 3) = 4. * M_PI / 3.;
+ uknots( 4) = 2. * M_PI;
+ vknots( 1) = -M_PI/2.;
vknots( 2) = 0.;
- vknots( 3) = PI/2.;
+ vknots( 3) = M_PI/2.;
for ( i = 1; i <= 4; i++) {
umults( i) = 2;
}
// Number of spans : maximum opening = 150 degrees ( = PI / 1.2 rds)
Standard_Integer
- nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / PI) + 1;
+ nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / M_PI) + 1;
Standard_Integer
- nbVSpans = (Standard_Integer)IntegerPart( 1.2 * deltaV / PI) + 1;
+ nbVSpans = (Standard_Integer)IntegerPart( 1.2 * deltaV / M_PI) + 1;
Standard_Real AlfaU = deltaU / ( nbUSpans * 2);
Standard_Real AlfaV = deltaV / ( nbVSpans * 2);
{
Standard_Real deltaU = U2 - U1;
Standard_Real deltaV = V2 - V1;
- Standard_DomainError_Raise_if( (deltaU>2*PI) || (deltaU<0.) ||
- (deltaV>2*PI) || (deltaV<0.),
+ Standard_DomainError_Raise_if( (deltaU>2*M_PI) || (deltaU<0.) ||
+ (deltaV>2*M_PI) || (deltaV<0.),
"Convert_TorusToBSplineSurface");
isuperiodic = Standard_False;
// Number of spans : maximum opening = 150 degrees ( = PI / 1.2 rds)
Standard_Integer
- nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / PI) + 1;
+ nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / M_PI) + 1;
Standard_Integer
- nbVSpans = (Standard_Integer)IntegerPart( 1.2 * deltaV / PI) + 1;
+ nbVSpans = (Standard_Integer)IntegerPart( 1.2 * deltaV / M_PI) + 1;
Standard_Real AlfaU = deltaU / ( nbUSpans * 2);
Standard_Real AlfaV = deltaV / ( nbVSpans * 2);
#ifndef No_Exception
Standard_Real delta = Param2 - Param1;
#endif
- Standard_DomainError_Raise_if( (delta>2*PI) || (delta<0.),
+ Standard_DomainError_Raise_if( (delta>2*M_PI) || (delta<0.),
"Convert_TorusToBSplineSurface");
Standard_Integer i, j;
Standard_Real W1, W2, CosU, CosV;
if ( isuperiodic) {
- ComputePoles(R, r, 0, 2.*PI, Param1, Param2, poles);
+ ComputePoles(R, r, 0, 2.*M_PI, Param1, Param2, poles);
nbUPoles = 6;
nbUKnots = 4;
deltaV = Param2 - Param1;
Standard_Integer
- nbVSpans = (Standard_Integer)IntegerPart( 1.2 * deltaV / PI) + 1;
+ nbVSpans = (Standard_Integer)IntegerPart( 1.2 * deltaV / M_PI) + 1;
Standard_Real AlfaV = deltaV / ( nbVSpans * 2);
nbVPoles = 2 * nbVSpans + 1;
nbVKnots = nbVSpans + 1;
for ( i = 1; i <= nbUKnots; i++) {
- uknots(i) = ( i-1) * 2. * PI /3.;
+ uknots(i) = ( i-1) * 2. * M_PI /3.;
umults(i) = 2;
}
for ( i = 1; i <= nbVKnots; i++) {
CosV = Cos(AlfaV);
}
else {
- ComputePoles(R, r, Param1, Param2, 0., 2.*PI, poles);
+ ComputePoles(R, r, Param1, Param2, 0., 2.*M_PI, poles);
nbVPoles = 6;
nbVKnots = 4;
deltaU = Param2 - Param1;
Standard_Integer
- nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / PI) + 1;
+ nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / M_PI) + 1;
Standard_Real AlfaU = deltaU / ( nbUSpans * 2);
nbUPoles = 2 * nbUSpans + 1;
nbUKnots = nbUSpans + 1;
for ( i = 1; i <= nbVKnots; i++) {
- vknots(i) = ( i-1) * 2. * PI /3.;
+ vknots(i) = ( i-1) * 2. * M_PI /3.;
vmults(i) = 2;
}
for ( i = 1; i <= nbUKnots; i++) {
Standard_Real R = T.MajorRadius();
Standard_Real r = T.MinorRadius();
- ComputePoles( R, r, 0., 2.*PI, 0., 2.*PI, poles);
+ ComputePoles( R, r, 0., 2.*M_PI, 0., 2.*M_PI, poles);
uknots( 1) = vknots( 1) = 0.;
- uknots( 2) = vknots( 2) = 2. * PI / 3.;
- uknots( 3) = vknots( 3) = 4. * PI / 3.;
- uknots( 4) = vknots( 4) = 2. * PI;
+ uknots( 2) = vknots( 2) = 2. * M_PI / 3.;
+ uknots( 3) = vknots( 3) = 4. * M_PI / 3.;
+ uknots( 4) = vknots( 4) = 2. * M_PI;
for ( i = 1; i <= 4; i++) {
umults( i) = vmults( i) = 2;
}
static Standard_Integer discret = 30;
static Standard_Boolean disptriangles = Standard_False;
static Standard_Boolean disppolygons = Standard_False;
-static Standard_Real anglHLR = 35 * PI / 180;
-static Standard_Real HAngMin = 1 * PI / 180;
-static Standard_Real HAngMax = 35 * PI / 180;
+static Standard_Real anglHLR = 35 * M_PI / 180;
+static Standard_Real HAngMin = 1 * M_PI / 180;
+static Standard_Real HAngMax = 35 * M_PI / 180;
static Standard_Boolean withHLR = Standard_False;
static Standard_Boolean withRg1 = Standard_True;
static Standard_Boolean withRgN = Standard_False;
di << "\n";
if (withHLR) {
di << "Angle of discretization : ";
- di << anglHLR * 180 / PI << " degrees" << "\n";
+ di << anglHLR * 180 / M_PI << " degrees" << "\n";
}
}
else di << " wireframe";
}
else if (!strcasecmp(a[1],"ang" )) {
di << "Angle de discretisation : ";
- di << anglHLR * 180 / PI << " degres" << "\n";
+ di << anglHLR * 180 / M_PI << " degres" << "\n";
}
else return 1;
}
nFirst = 3;
if (n == 3) {
Standard_Real ang = atof(a[2]);
- anglHLR = ang * PI / 180;
+ anglHLR = ang * M_PI / 180;
if (anglHLR < HAngMin) anglHLR = HAngMin;
if (anglHLR > HAngMax) anglHLR = HAngMax;
}
di << "Angle of discretization : ";
- di << anglHLR * 180 / PI << " degrees" << "\n";
+ di << anglHLR * 180 / M_PI << " degrees" << "\n";
}
if (n >= nFirst + 1) {
}
else if (!strcasecmp(a[1],"ang" )) {
Standard_Real ang = atof(a[2]);
- localAng = ang * PI / 180;
+ localAng = ang * M_PI / 180;
}
else return 1;
S->DisplayHLR(localHLR, localRg1, localRgN, localHid,
TDataStd_RealEnum t = CTR->GetValue()->GetDimension();
TDataStd::Print(t,anOS);
Standard_Real val = CTR->GetValue()->Get();
- if (t == TDataStd_ANGULAR) val = (180.*val)/PI;
+ if (t == TDataStd_ANGULAR) val = (180.*val)/M_PI;
anOS << " ";
anOS << val;
}
// Standard_Real ang = atof(arg[9]);
// T.SetRotation(gp_Ax1(gp_Pnt(x,y,z),
// gp_Vec(dx,dy,dz)),
-// ang * PI180);
+// ang * (M_PI / 180.0));
// }
// Loc = T;
// }
if (!D.IsNull()) {
if (!A->GetValue().IsNull()) {
Standard_Real val = A->GetValue()->Get();
- if (A->GetValue()->GetDimension() == TDataStd_ANGULAR) val = (180.*val)/PI;
+ if (A->GetValue()->GetDimension() == TDataStd_ANGULAR) val = (180.*val)/M_PI;
D->SetValue(val);
}
// unverified constraints are red (default is white)
// Filling array
for(Standard_Integer j = realarray->Lower(); j<= realarray->Upper(); j++) {
- realarray->SetValue(j, Standard_PI*j);
+ realarray->SetValue(j, M_PI * j);
}
// Getting length of array
Standard_Real anAngle = 0.;
anAngle = atof(a[4]);
- Standard_Real aK = 2*PI/360;
+ Standard_Real aK = 2*M_PI/360;
anAngle = anAngle * aK;
DNaming::GetReal(aFun,PTRANSF_ANG)->Set(anAngle);
if(theNb > 4 ) {
Standard_Real angle = atof(theArg[4]);
- Standard_Real aK = 2*PI/360;
+ Standard_Real aK = 2*M_PI/360;
angle = angle * aK;
DNaming::GetReal(aFun,REVOL_ANGLE)->Set(angle);
if( theNb == 6) {
gp_Pnt2d PF,PL;
BRep_Tool::UVPoints(E,F,PF,PL);
gp_Pnt2d NewPF = C->Value(Fp);
- gp_Vec2d vectra(2.*PI,0.);
+ gp_Vec2d vectra(2.*M_PI,0.);
if (NewPF.Translated(vectra).SquareDistance(PF)
< NewPF.SquareDistance(PF)) {
}
}
}
- NewS = new Geom_RectangularTrimmedSurface(NewS,0.,2.*PI,vmin,vmax);
+ NewS = new Geom_RectangularTrimmedSurface(NewS,0.,2.*M_PI,vmin,vmax);
}
}
}
vmin = vmin - deltav;
vmax = vmax + deltav;
NewS =
- new Geom_RectangularTrimmedSurface(NewS,0.,2.*PI,vmin,vmax);
+ new Geom_RectangularTrimmedSurface(NewS,0.,2.*M_PI,vmin,vmax);
}
}
vmin = -300;
}
- NewS = new Geom_RectangularTrimmedSurface(NewS,0.,1.9*PI,vmin,vmax);
+ NewS = new Geom_RectangularTrimmedSurface(NewS,0.,1.9*M_PI,vmin,vmax);
Finf.ChangeGeometry() = NewS;
}
itf.Next();
GeomAPI_ProjectPointOnSurf projector( Pnt, S1, Precision::Confusion() );
Standard_Real U, V;
projector.LowerDistanceParameters( U, V );
- if (Abs(U) <= Precision::Confusion() || Abs(U-2.*PI) <= Precision::Confusion())
+ if (Abs(U) <= Precision::Confusion() || Abs(U-2.*M_PI) <= Precision::Confusion())
Candidates.Append( aCurve );
else
{
Pnt = aCurve->Value( aCurve->LastParameter() );
projector.Init( Pnt, S1, Precision::Confusion() );
projector.LowerDistanceParameters( U, V );
- if (Abs(U) <= Precision::Confusion() || Abs(U-2.*PI) <= Precision::Confusion())
+ if (Abs(U) <= Precision::Confusion() || Abs(U-2.*M_PI) <= Precision::Confusion())
{
aCurve->Reverse();
Candidates.Append( aCurve );
}
else if (ctyp == STANDARD_TYPE(Geom_Circle)) {
param = ElCLib::Parameter(Handle(Geom_Circle)::DownCast(cbase)->Circ(),P);
- if (Abs(2.*PI-param) <=Epsilon(2.*PI)) {
+ if (Abs(2.*M_PI-param) <=Epsilon(2.*M_PI)) {
param = 0.;
}
}
else if (ctyp == STANDARD_TYPE(Geom_Ellipse)) {
param = ElCLib::Parameter(Handle(Geom_Ellipse)::DownCast(cbase)->Elips(),P);
- if (Abs(2.*PI-param) <=Epsilon(2.*PI)) {
+ if (Abs(2.*M_PI-param) <=Epsilon(2.*M_PI)) {
param = 0.;
}
}
theta = -theta0 -phi;
}
// modified by NIZHNY-EAP Tue Nov 16 15:51:38 1999 ___BEGIN___
- while (Abs(theta)>PI) {
- theta = theta + PI*(theta<0 ? 1 : -1);
+ while (Abs(theta)>M_PI) {
+ theta = theta + M_PI*(theta<0 ? 1 : -1);
}
// modified by NIZHNY-EAP Tue Nov 16 15:53:32 1999 ___END___
Axe = li.Position();
// gp_Circ2d C;
C.SetRadius(ISize);
C.SetLocation(pt);
- Draw(C, 0, 2*PI, Standard_False);
+ Draw(C, 0, 2*M_PI, Standard_False);
break;
#ifndef DEB
default:
// if the circus is too small, a "plus" is drawn to mark the point
Standard_Boolean b = (R * Zoom()) > 2;
if(b)
- Draw(C, 0, 2*PI);
+ Draw(C, 0, 2*M_PI);
else
DrawMarker(pt, Draw_Plus);
}
const Standard_Boolean ModifyWithZoom)
{
Standard_Real A2 = A3;
- while (A2 < A1) A2 += 2*PI;
+ while (A2 < A1) A2 += 2*M_PI;
Standard_Real angle = DEFLECTION / (C.Radius() * Zoom());
Standard_Integer n = (Standard_Integer )( (A2 - A1) / angle);
const Standard_Boolean ModifyWithZoom)
{
Standard_Real A2 = A3;
- while (A2 < A1) A2 += 2*PI;
+ while (A2 < A1) A2 += 2*M_PI;
Standard_Real angle = DEFLECTION / (C.Radius() * Zoom());
Standard_Integer n = (Standard_Integer )( (A2 - A1) / angle);
extern Standard_Boolean Draw_BlackBackGround;
-#define DEFROTATE (5 * PI/ 180.)
+#define DEFROTATE (5 * M_PI/ 180.)
#define DEFMAGNIFY 1.1
#define DEFPANNING 0.1
#define DEFFOCAL 1.1
theAxes2d->Protected(Standard_True);
n = "pi";
- Draw::Set(n,PI);
+ Draw::Set(n,M_PI);
Draw::Get(n)->Protected(Standard_True);
n = "pinf";
}
else if (!strcmp("-Y+X",typ))
{
- Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,0,1)),PI/2);
+ Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,0,1)),M_PI/2);
}
else if (!strcmp("-X-Y",typ))
{
- Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,0,1)),PI);
+ Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,0,1)),M_PI);
}
else if (!strcmp("+Y-X",typ))
{
- Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,0,1)),-PI/2);
+ Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,0,1)),-M_PI/2);
}
else if (!strcmp("+Y+X",typ))
{
- Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,0,1)),-PI/2);
- T.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),PI);
+ Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,0,1)),-M_PI/2);
+ T.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),M_PI);
Matrix.Multiply(T);
}
else if (!strcmp("-X+Y",typ))
{
- Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),PI);
+ Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),M_PI);
}
else if (!strcmp("-Y-X",typ))
{
- Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,0,1)),-PI/2);
- T.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),PI);
+ Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,0,1)),-M_PI/2);
+ T.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),M_PI);
Matrix.Multiply(T);
}
else if (!strcmp("+X-Y",typ))
{
- Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),PI);
+ Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),M_PI);
}
else if (!strcmp("+X+Z",typ))
{
- Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),-PI/2);
+ Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),-M_PI/2);
}
else if (!strcmp("-Z+X",typ))
{
- Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),-PI/2);
- T.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),-PI/2);
+ Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),-M_PI/2);
+ T.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),-M_PI/2);
Matrix.Multiply(T);
}
else if (!strcmp("-X-Z",typ))
{
- Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),-PI/2);
- T.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),-PI);
+ Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),-M_PI/2);
+ T.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),-M_PI);
Matrix.Multiply(T);
}
else if (!strcmp("+Z-X",typ))
{
- Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),-PI/2);
- T.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),PI/2);
+ Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),-M_PI/2);
+ T.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),M_PI/2);
Matrix.Multiply(T);
}
else if (!strcmp("+Z+X",typ))
{
- Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),PI/2);
- T.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),PI/2);
+ Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),M_PI/2);
+ T.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),M_PI/2);
Matrix.Multiply(T);
}
else if (!strcmp("-X+Z",typ))
{
- Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),PI/2);
- T.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),PI);
+ Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),M_PI/2);
+ T.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),M_PI);
Matrix.Multiply(T);
}
else if (!strcmp("-Z-X",typ))
{
- Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),PI/2);
- T.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),-PI/2);
+ Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),M_PI/2);
+ T.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),-M_PI/2);
Matrix.Multiply(T);
}
else if (!strcmp("+X-Z",typ))
{
- Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),PI/2);
+ Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),M_PI/2);
}
else if (!strcmp("+Y+Z",typ))
{
- Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),-PI/2);
- T.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),-PI/2);
+ Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),-M_PI/2);
+ T.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),-M_PI/2);
Matrix.Multiply(T);
}
else if (!strcmp("-Z+Y",typ))
{
- Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),-PI/2);
+ Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),-M_PI/2);
}
else if (!strcmp("-Y-Z",typ))
{
- Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),-PI/2);
- T.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),PI/2);
+ Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),-M_PI/2);
+ T.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),M_PI/2);
Matrix.Multiply(T);
}
else if (!strcmp("+Z-Y",typ))
{
- Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),-PI/2);
- T.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),PI);
+ Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),-M_PI/2);
+ T.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),M_PI);
Matrix.Multiply(T);
}
else if (!strcmp("+Z+Y",typ))
{
- Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),PI/2);
+ Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),M_PI/2);
}
else if (!strcmp("-Y+Z",typ))
{
- Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),PI/2);
- T.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),-PI/2);
+ Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),M_PI/2);
+ T.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),-M_PI/2);
Matrix.Multiply(T);
}
else if (!strcmp("-Z-Y",typ))
{
- Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),PI/2);
- T.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),PI);
+ Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),M_PI/2);
+ T.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),M_PI);
Matrix.Multiply(T);
}
else if (!strcmp("+Y-Z",typ))
{
- Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),PI/2);
- T.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),PI/2);
+ Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),M_PI/2);
+ T.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),M_PI/2);
Matrix.Multiply(T);
}
else if (!strcmp("AXON",typ))
{
- Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),-PI/4);
- T.SetRotation(gp_Ax1(Pvise,gp_Dir(0,0,1)),-PI/4);
+ Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),-M_PI/4);
+ T.SetRotation(gp_Ax1(Pvise,gp_Dir(0,0,1)),-M_PI/4);
Matrix.Multiply(T);
}
else if (!strcmp("PERS",typ))
{
FlagPers =1;
- Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),-PI/4);
- T.SetRotation(gp_Ax1(Pvise,gp_Dir(0,0,1)),-PI/4);
+ Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),-M_PI/4);
+ T.SetRotation(gp_Ax1(Pvise,gp_Dir(0,0,1)),-M_PI/4);
Matrix.Multiply(T);
}
else {
}
else if (curve->IsKind(STANDARD_TYPE(Geom_Circle))) {
parameter = (f+l)/2.;
- if (f > l) parameter = parameter + PI;
+ if (f > l) parameter = parameter + M_PI;
position = ElCLib::Value(parameter,Handle(Geom_Circle)::DownCast(curve)->Circ());
}
}
}
if (!parallel && !clockwise) {
p1 = angle;
- p2 = PI;
+ p2 = M_PI;
}
if (parallel && clockwise) {
- p1 = PI;
- p2 = PI+angle;
+ p1 = M_PI;
+ p2 = M_PI+angle;
}
if (!parallel && clockwise) {
- p1 = PI+angle;
- p2 = 2*PI;
+ p1 = M_PI+angle;
+ p2 = 2*M_PI;
}
// affichage
dis.Draw(circle,p1,p2);
TopExp::Vertices(TopoDS::Edge(myCircle),vf,vl);
const gp_Pnt first = BRep_Tool::Pnt(vf);
Standard_Real parfirst = ElCLib::Parameter(circle,first);
- Standard_Real parlast = (parfirst + PI);
+ Standard_Real parlast = (parfirst + M_PI);
gp_Pnt last = ElCLib::Value(parlast,circle);
//
dis.Draw (first,last);
void DrawFairCurve_Batten::SetAngle(const Standard_Integer Side, const Standard_Real Angle)
{
if (Side == 1) {
- ((FairCurve_Batten*)MyBatten)->SetAngle1(Angle*PI/180);
+ ((FairCurve_Batten*)MyBatten)->SetAngle1(Angle*M_PI/180);
if ( ((FairCurve_Batten*)MyBatten)->GetConstraintOrder1() == 0 )
{
((FairCurve_Batten*)MyBatten)->SetConstraintOrder1(1);
}
}
else {
- ((FairCurve_Batten*)MyBatten)->SetAngle2(Angle*PI/180);
+ ((FairCurve_Batten*)MyBatten)->SetAngle2(Angle*M_PI/180);
if ( ((FairCurve_Batten*)MyBatten)->GetConstraintOrder2() == 0 )
{
((FairCurve_Batten*)MyBatten)->SetConstraintOrder2(1);
else if (!strcmp(a[0],"rotate")) {
if (last < 8) return 1;
- Standard_Real ang = atof(a[last]) * PI180;
+ Standard_Real ang = atof(a[last]) * (M_PI / 180.0);
last --;
gp_Dir D(atof(a[last-2]),atof(a[last-1]),atof(a[last]));
last -= 3;
else if (!strcmp(a[0],"2drotate")) {
if (last < 4) return 1;
- Standard_Real ang = atof(a[last]) * PI180;
+ Standard_Real ang = atof(a[last]) * (M_PI / 180.0);
last --;
gp_Pnt2d P(atof(a[last-1]),atof(a[last]));
last -= 2;
Standard_Real & FirstParAttachCirc,
Standard_Real & LastParAttachCirc )
{
- if (Value > Precision::Angular() && Abs( PI-Value ) > Precision::Angular())
+ if (Value > Precision::Angular() && Abs( M_PI-Value ) > Precision::Angular())
{
// Computing presentation of angle's arc
gp_Ax2 ax( CenterPoint, axisdir, dir1 );
}
else if (Sign1 == -1 && Sign2 == 1)
{
- Par1 += PI;
- Par2 += PI;
+ Par1 += M_PI;
+ Par2 += M_PI;
FirstParAngleCirc = Par1;
LastParAngleCirc = Par2;
}
Intersection.NearestPoints( ProjAttachPoint2, ProjAttachPoint2 );
Standard_Real U2 = ElCLib::Parameter( AttachCirc, ProjAttachPoint2 );
- if (U2 <= PI)
+ if (U2 <= M_PI)
{
FirstParAttachCirc = 0;
LastParAttachCirc = U2;
else
{
FirstParAttachCirc = U2;
- LastParAttachCirc = 2*PI;
+ LastParAttachCirc = 2*M_PI;
}
}
}
gp_Dir dir1(gp_Vec(Center, FirstPoint));
gp_Dir dir2(gp_Vec(Center, SecondPoint));
Standard_Real Angle = dir1.Angle(dir2);
- if(Angle <= Precision::Angular() || ( PI - Angle ) <= Precision::Angular() ||
+ if(Angle <= Precision::Angular() || ( M_PI - Angle ) <= Precision::Angular() ||
Value <= Precision::Confusion()) SpecCase = Standard_True;
else SpecCase = Standard_False;
if ( !SpecCase )
gp_Dir direction(PosVec) ;
Standard_Real angle = dir1.Angle(direction) ;
if (( dir1 ^ direction) * NormalDir < 0.0e0) angle = -angle ;
- if(Sign1 == -1) angle += PI;
+ if(Sign1 == -1) angle += M_PI;
EndOfArrow = ElCLib::Value(angle, FilletCirc); //***
}
{
Standard_Real dist;
Standard_Real parApex = ElCLib::Parameter ( elips, Apex );
- if(parApex == 0.0 || parApex == PI)
+ if(parApex == 0.0 || parApex == M_PI)
{//Major case
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
- dist = (par < PI) ? ( PI - par) : ( par - PI );
+ dist = (par < M_PI) ? ( M_PI - par) : ( par - M_PI );
}
else
{// Minor case
- if(parApex == PI / 2) //pos Apex
+ if(parApex == M_PI / 2) //pos Apex
{
- if(par <= parApex + PI && par > parApex )
+ if(par <= parApex + M_PI && par > parApex )
dist = par - parApex;
else
{
- if(par > parApex + PI)
- dist = 2*PI - par + parApex;
+ if(par > parApex + M_PI)
+ dist = 2*M_PI - par + parApex;
else
- dist = parApex - par; // 0 < par < PI/2
+ dist = parApex - par; // 0 < par < M_PI/2
}
}
else //neg Apex == 3/2 PI
{
- if(par <= parApex && par >= PI/2)
+ if(par <= parApex && par >= M_PI/2)
dist = parApex - par;
else
{
if(par > parApex)
dist = par - parApex;
else
- dist = par + PI/2; // 0 < par < PI/2
+ dist = par + M_PI/2; // 0 < par < PI/2
}
}
}
aPnt = Apex;
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
Standard_Real OppParam = ElCLib::Parameter(aCircle2, OppositePnt);
gp_Dir aDir, aDir2;
- while ( AttParam >= 2*Standard_PI ) AttParam -= 2*Standard_PI;
- while ( OppParam >= 2*Standard_PI ) OppParam -= 2*Standard_PI;
+ while ( AttParam >= 2 * M_PI ) AttParam -= 2 * M_PI;
+ while ( OppParam >= 2 * M_PI ) OppParam -= 2 * M_PI;
//-------------------------- Compute angle ------------------------
if( txt.Length() == 0 ) {
param = AttParam;
if(IsArrowOut) {
- aDir = gp_Dir( ( gp_Vec( ElCLib::Value( AttParam - Standard_PI/12, aCircle2 ), AttachmentPnt) ) );
- aDir2 = gp_Dir( ( gp_Vec( ElCLib::Value( OppParam + Standard_PI/12, aCircle2 ), OppositePnt) ) );
+ aDir = gp_Dir( ( gp_Vec( ElCLib::Value( AttParam - M_PI / 12, aCircle2 ), AttachmentPnt) ) );
+ aDir2 = gp_Dir( ( gp_Vec( ElCLib::Value( OppParam + M_PI / 12, aCircle2 ), OppositePnt) ) );
}
else {
- aDir = gp_Dir( ( gp_Vec( ElCLib::Value( AttParam + Standard_PI/12, aCircle2 ), AttachmentPnt ) ) );
- aDir2 = gp_Dir( ( gp_Vec( ElCLib::Value( OppParam - Standard_PI/12, aCircle2 ), OppositePnt ) ) );
+ aDir = gp_Dir( ( gp_Vec( ElCLib::Value( AttParam + M_PI / 12, aCircle2 ), AttachmentPnt ) ) );
+ aDir2 = gp_Dir( ( gp_Vec( ElCLib::Value( OppParam - M_PI / 12, aCircle2 ), OppositePnt ) ) );
}
- 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
( ElCLib::Value(param + angle/11 * i, aCircle2) ).Coord(X, Y, Z);
V(i+1).SetCoord(X, Y, Z);
tmpPnt = tmpPnt.Translated(gp_Vec(0, 0, -1)*2);
Prs3d_Text::Draw(aPresentation,aLengthAspect->TextAspect(), txt, tmpPnt); //add the TCollection_ExtendedString
- angle = 2*Standard_PI - param ;
+ angle = 2 * M_PI - param ;
if( param > OppParam ) {
- while ( angle > 2*Standard_PI ) angle -= 2*Standard_PI;
+ while ( angle > 2 * M_PI ) angle -= 2 * M_PI;
for( i = 11; i >= 0; i-- ) { //calculating of arc
( ElCLib::Value(-angle/11 * i, aCircle2) ).Coord(X, Y, Z);
V(i+1).SetCoord(X, Y, Z);
if ( AboveInBelowCone( VmaxCircle, VminCircle, myCircle ) == 0 ) return;
Graphic3d_Array1OfVertex V3(1,2);
gp_Pnt P11 = ElCLib::Value( 0., VmaxCircle );
- gp_Pnt P12 = ElCLib::Value( Standard_PI, VmaxCircle );
+ gp_Pnt P12 = ElCLib::Value( M_PI, VmaxCircle );
AttachmentPnt.Coord(X, Y, Z);
V3(1).SetCoord(X, Y, Z);
Standard_Real ufin = uc2;
if (uco > ufin) {
- if (Abs(theval)<PI) {
+ if (Abs(theval)<M_PI) {
// test if uco is in the opposite sector
- if (uco > udeb+PI && uco < ufin+PI){
- udeb = udeb + PI;
- ufin = ufin + PI;
+ if (uco > udeb+M_PI && uco < ufin+M_PI){
+ udeb = udeb + M_PI;
+ ufin = ufin + M_PI;
uc1 = udeb;
uc2 = ufin;
}
}
if (uco > ufin) {
- if ((uco-uc2) < (uc1-uco+(2*PI))) {
+ if ((uco-uc2) < (uc1-uco+(2*M_PI))) {
ufin = uco;
}
else {
- udeb = uco - 2*PI;
+ udeb = uco - 2*M_PI;
}
}
Standard_Real alpha = Abs(ufin-udeb);
- Standard_Integer nbp = Max (4 , Standard_Integer (50. * alpha / PI));
+ Standard_Integer nbp = Max (4 , Standard_Integer (50. * alpha / M_PI));
Graphic3d_Array1OfVertex V(1,nbp);
Standard_Real dteta = alpha/(nbp-1);
gp_Pnt ptcur;
Graphic3d_Array1OfVertex Vrap(1,2);
// Creating the angle's arc or line if null angle
- if (theval > Precision::Angular() && Abs( PI-theval ) > Precision::Angular())
+ if (theval > Precision::Angular() && Abs( M_PI-theval ) > Precision::Angular())
{
Standard_Real Alpha = Abs( LastParAngleCirc - FirstParAngleCirc );
- Standard_Integer NodeNumber = Max (4 , Standard_Integer (50. * Alpha / PI));
+ Standard_Integer NodeNumber = Max (4 , Standard_Integer (50. * Alpha / M_PI));
Graphic3d_Array1OfVertex ApproxArc( 0, NodeNumber-1 );
Standard_Real delta = Alpha / (Standard_Real)( NodeNumber - 1 );
gp_Pnt CurPnt;
{
// Creating the arc from AttachmentPoint2 to its projection
Standard_Real Alpha = Abs( LastParAttachCirc - FirstParAttachCirc );
- Standard_Integer NodeNumber = Max (4 , Standard_Integer (50. * Alpha / PI));
+ Standard_Integer NodeNumber = Max (4 , Standard_Integer (50. * Alpha / M_PI));
Graphic3d_Array1OfVertex ApproxArc( 0, NodeNumber-1 );
Standard_Real delta = Alpha / (Standard_Real)( NodeNumber - 1 );
gp_Pnt CurPnt;
Norm = dir1.Crossed(dir2B);
}
- if (Abs(theval) > PI) Norm.Reverse();
+ if (Abs(theval) > M_PI) Norm.Reverse();
gp_Ax2 ax(CenterPoint,Norm,dir1);
gp_Circ cer(ax,CenterPoint.Distance(OffsetPoint));
Standard_Real ufin = uc2;
if (uco > ufin) {
- if (Abs(theval)<PI) {
+ if (Abs(theval)<M_PI) {
// test if uco is in the opposite sector
- if (uco > udeb+PI && uco < ufin+PI){
- udeb = udeb + PI;
- ufin = ufin + PI;
+ if (uco > udeb+M_PI && uco < ufin+M_PI){
+ udeb = udeb + M_PI;
+ ufin = ufin + M_PI;
uc1 = udeb;
uc2 = ufin;
}
}
if (uco > ufin) {
- if ((uco-uc2) < (uc1-uco+(2*PI))) {
+ if ((uco-uc2) < (uc1-uco+(2*M_PI))) {
ufin = uco;
}
else {
- udeb = uco - 2*PI;
+ udeb = uco - 2*M_PI;
}
}
Standard_Real alpha = Abs(ufin-udeb);
- Standard_Integer nbp = Max (4 , Standard_Integer (50. * alpha / PI));
+ Standard_Integer nbp = Max (4 , Standard_Integer (50. * alpha / M_PI));
Graphic3d_Array1OfVertex V(1,nbp);
Standard_Real dteta = alpha/(nbp-1);
gp_Pnt ptcur;
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
gp_Dir Norm = dir1.Crossed(dir2);
- if (Abs(theval) > PI) Norm.Reverse();
+ if (Abs(theval) > M_PI) Norm.Reverse();
gp_Ax2 ax(CenterPoint,Norm,dir1);
gp_Circ cer(ax,CenterPoint.Distance(OffsetPoint));
Standard_Real ufin = uc2;
if (uco > ufin) {
- if (Abs(theval)<PI) {
+ if (Abs(theval)<M_PI) {
// test if uco is in the opposite sector
- if (uco > udeb+PI && uco < ufin+PI){
- udeb = udeb + PI;
- ufin = ufin + PI;
+ if (uco > udeb+M_PI && uco < ufin+M_PI){
+ udeb = udeb + M_PI;
+ ufin = ufin + M_PI;
uc1 = udeb;
uc2 = ufin;
}
}
if (uco > ufin) {
- if ((uco-uc2) < (uc1-uco+(2*PI))) {
+ if ((uco-uc2) < (uc1-uco+(2*M_PI))) {
ufin = uco;
}
else {
- udeb = uco - 2*PI;
+ udeb = uco - 2*M_PI;
}
}
Standard_Real alpha = Abs(ufin-udeb);
- Standard_Integer nbp = Max (4 , Standard_Integer (50. * alpha / PI));
+ Standard_Integer nbp = Max (4 , Standard_Integer (50. * alpha / M_PI));
Graphic3d_Array1OfVertex V(1,nbp);
Standard_Real dteta = alpha/(nbp-1);
gp_Pnt ptcur;
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
gp_Dir Norm = dir1.Crossed(dir2);
- if (Abs(theval) > PI) Norm.Reverse();
+ if (Abs(theval) > M_PI) Norm.Reverse();
gp_Ax2 ax(CenterPoint,Norm,dir1);
gp_Circ cer(ax,CenterPoint.Distance(OffsetPoint));
Standard_Real ufin = uc2;
if (uco > ufin) {
- if (Abs(theval)<PI) {
+ if (Abs(theval)<M_PI) {
// test if uco is in the opposite sector
- if (uco > udeb+PI && uco < ufin+PI){
- udeb = udeb + PI;
- ufin = ufin + PI;
+ if (uco > udeb+M_PI && uco < ufin+M_PI){
+ udeb = udeb + M_PI;
+ ufin = ufin + M_PI;
uc1 = udeb;
uc2 = ufin;
}
}
if (uco > ufin) {
- if ((uco-uc2) < (uc1-uco+(2*PI))) {
+ if ((uco-uc2) < (uc1-uco+(2*M_PI))) {
ufin = uco;
}
else {
- udeb = uco - 2*PI;
+ udeb = uco - 2*M_PI;
}
}
Standard_Real alpha = Abs(ufin-udeb);
- Standard_Integer nbp = Max (4 , Standard_Integer (50. * alpha / PI));
+ Standard_Integer nbp = Max (4 , Standard_Integer (50. * alpha / M_PI));
Graphic3d_Array1OfVertex V(1,nbp);
Standard_Real dteta = alpha/(nbp-1);
gp_Pnt ptcur;
gp_Ax2 ax(CenterPoint,theAxe.Direction(),dir1);
gp_Circ cer(ax,CenterPoint.Distance(AttachmentPoint1));
- Standard_Integer nbp = Max (4 , Standard_Integer (50. * theval / PI));
+ Standard_Integer nbp = Max (4 , Standard_Integer (50. * theval / M_PI));
Graphic3d_Array1OfVertex V(1,nbp);
Standard_Real dteta = theval/(nbp-1);
gp_Pnt ptcur;
//Creation et discretisation du plus gros cercle
gp_Circ Circ(gp_Ax2(aCenter,aNorm), aRadius);
Standard_Integer nbp = 50;
- Standard_Real dteta = (2 * PI)/nbp;
+ Standard_Real dteta = (2 * M_PI)/nbp;
Graphic3d_Array1OfVertex V(1,nbp+1);
gp_Pnt ptcur;
Standard_Real ucur = 0;
if(lpar > fpar)
return ((para >= fpar) && (para <= lpar));
else { // fpar > lpar
- Standard_Real delta = 2*PI-fpar;
+ Standard_Real delta = 2*M_PI-fpar;
Standard_Real lp, par, fp;
lp = lpar + delta;
par = para + delta;
- while(lp > 2*PI) lp-=2*PI;
- while(par > 2*PI) par-=2*PI;
+ while(lp > 2*M_PI) lp-=2*M_PI;
+ while(par > 2*M_PI) par-=2*M_PI;
fp = 0.;
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;
return Standard_False;
}
{
Standard_Real fpara = uFirst;
Standard_Real lpara = uLast;
- while (lpara > 2*PI) {
- fpara -= 2*PI;
- lpara -= 2*PI;
+ while (lpara > 2*M_PI) {
+ fpara -= 2*M_PI;
+ lpara -= 2*M_PI;
}
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
gp_Pnt SecondPoint = ElCLib::Value(uLast, aCircle);
if ( !DsgPrs_InDomain(fpara,lpara,parEndOfArrow)) {
- Standard_Real otherpar = parEndOfArrow + PI;// not in domain
- if (otherpar > 2*PI) otherpar -= 2*PI;
+ Standard_Real otherpar = parEndOfArrow + M_PI;// not in domain
+ if (otherpar > 2*M_PI) otherpar -= 2*M_PI;
if (DsgPrs_InDomain(fpara,lpara,otherpar)) {
parEndOfArrow = otherpar; // parameter on circle
EndOfArrow = ElCLib::Value(parEndOfArrow, aCircle);
parFirst = uLast;
else
parFirst = uFirst;
- Standard_Integer NodeNumber = Max (4 , Standard_Integer (50. * Alpha / PI));
+ Standard_Integer NodeNumber = Max (4 , Standard_Integer (50. * Alpha / M_PI));
Graphic3d_Array1OfVertex ApproxArc( 0, NodeNumber-1 );
Standard_Real delta = Alpha / ( NodeNumber - 1 );
gp_Pnt CurPnt;
parFirst = uLast;
else
parFirst = uFirst;
- Standard_Integer NodeNumber = Max (4 , Standard_Integer (50. * Alpha / PI));
+ Standard_Integer NodeNumber = Max (4 , Standard_Integer (50. * Alpha / M_PI));
Graphic3d_Array1OfVertex ApproxArc( 0, NodeNumber-1 );
Standard_Real delta = Alpha / ( NodeNumber - 1 );
gp_Pnt CurPnt;
aPar12 = ElCLib::Parameter(aCirc1, aPoint2);
}
else {
- aPar11 = PI;
- aPar12 = PI;
+ aPar11 = M_PI;
+ aPar12 = M_PI;
}
if (aCirc2.Radius() > Precision::Confusion()){
aPar21 = ElCLib::Parameter(aCirc2, aPoint3 );
aPar22 = ElCLib::Parameter(aCirc2, aPoint4);
}
else {
- aPar21 = PI;
- aPar22 = PI;
+ aPar21 = M_PI;
+ aPar22 = M_PI;
}
Graphic3d_Array1OfVertex V(1,2);
Standard_Integer aNodeNb;
Standard_Real aDelta, aCurPar;
- if(aPar12 < aPar11 ) aPar12 +=2*PI;
+ if(aPar12 < aPar11 ) aPar12 +=2*M_PI;
if (Abs(aPar12 - aPar11) > Precision::Confusion()) {
- aNodeNb = Standard_Integer(Max(Abs(aPar12 - aPar11)*50./PI + 0.5, 4.));
+ aNodeNb = Standard_Integer(Max(Abs(aPar12 - aPar11)*50./M_PI + 0.5, 4.));
Graphic3d_Array1OfVertex ApproxArc1( 1, aNodeNb+1);
aDelta = (aPar12 - aPar11)/aNodeNb;
aCurPar= aPar11;
Prs3d_Root::CurrentGroup( aPresentation )->Polyline( ApproxArc1 );
}
- if (aPar22 < aPar21) aPar22 += 2*PI;
+ if (aPar22 < aPar21) aPar22 += 2*M_PI;
if ( Abs(aPar22 - aPar21) > Precision::Confusion()){
- aNodeNb = Standard_Integer(Max(Abs(aPar22 - aPar21)*50./PI + 0.5, 4.));
+ aNodeNb = Standard_Integer(Max(Abs(aPar22 - aPar21)*50./M_PI + 0.5, 4.));
Graphic3d_Array1OfVertex ApproxArc2( 1, aNodeNb+1);
aDelta = (aPar22 - aPar21)/aNodeNb;
aCurPar= aPar21;
if( !SpecCase )
{
Standard_Real Alpha = Abs(LastParCirc - FirstParCirc);
- Standard_Integer NodeNumber = Max (4 , Standard_Integer (50. * Alpha / PI));
+ Standard_Integer NodeNumber = Max (4 , Standard_Integer (50. * Alpha / M_PI));
Graphic3d_Array1OfVertex ApproxArc( 0, NodeNumber-1 );
Standard_Real delta = Alpha / ( NodeNumber - 1 );
gp_Pnt CurPnt;
dirac.Normalize();
gp_Vec norac = dirac.Crossed(gp_Vec(aNormPln));
gp_Ax1 ax(aPntEnd, aNormPln);
- norac.Rotate(ax, PI/8);
+ norac.Rotate(ax, M_PI/8);
// vecteur normal au seg. de raccord
norac*=(symbsize/2);
gp_Pnt P1 = aPntEnd.Translated(norac);
Standard_Real pFAttach = ElCLib::Parameter(CC, aFAttach);
Standard_Real pSAttach = ElCLib::Parameter(CC, aSAttach);
Standard_Real alpha = pSAttach - pFAttach;
- if ( alpha < 0 ) alpha += 2*Standard_PI;
- Standard_Integer nb = (Standard_Integer )( 50. * alpha / PI);
+ if ( alpha < 0 ) alpha += 2 * M_PI;
+ Standard_Integer nb = (Standard_Integer )( 50. * alpha / M_PI);
Standard_Integer nbp = Max (4 , nb);
Graphic3d_Array1OfVertex V(1,nbp);
Standard_Real dteta = alpha/(nbp-1);
Standard_Real pFAttach = ElCLib::Parameter(CC, aFAttach);
Standard_Real pSAttach = ElCLib::Parameter(CC, aSAttach);
Standard_Real alpha = pSAttach - pFAttach;
- if ( alpha < 0 ) alpha += 2*Standard_PI;
- Standard_Integer nb = (Standard_Integer )( 50. * alpha / PI);
+ if ( alpha < 0 ) alpha += 2 * M_PI;
+ Standard_Integer nb = (Standard_Integer )( 50. * alpha / M_PI);
Standard_Integer nbp = Max (4 , nb);
Graphic3d_Array1OfVertex V(1,nbp);
Standard_Real dteta = alpha/(nbp-1);
Standard_Real pFAttach = ElCLib::Parameter(anEllipse, aFAttach);
Standard_Real pSAttach = ElCLib::Parameter(anEllipse, aSAttach);
Standard_Real alpha = pSAttach - pFAttach;
- if ( alpha < 0 ) alpha += 2*Standard_PI;
- Standard_Integer nb = (Standard_Integer)(50.0*alpha/PI);
+ if ( alpha < 0 ) alpha += 2 * M_PI;
+ Standard_Integer nb = (Standard_Integer)(50.0*alpha/M_PI);
Standard_Integer nbp = Max (4 , nb);
Graphic3d_Array1OfVertex V(1,nbp);
Standard_Real dteta = alpha/(nbp-1);
Alpha = Abs( deltaU );
if (Alpha > Precision::Angular() && Alpha<Precision::Infinite())
{
- NodeNumber = Max( 4 , Standard_Integer (50. * Alpha / PI) );
+ NodeNumber = Max( 4 , Standard_Integer (50. * Alpha / M_PI) );
Graphic3d_Array1OfVertex ApproxCurve( 1, NodeNumber );
delta = deltaU / (Standard_Real)( NodeNumber - 1 );
gp_Pnt CurPnt;
Alpha = Abs( deltaV );
if (Alpha > Precision::Angular() && Alpha<Precision::Infinite())
{
- NodeNumber = Max( 4 , Standard_Integer (50. * Alpha / PI) );
+ NodeNumber = Max( 4 , Standard_Integer (50. * Alpha / M_PI) );
Graphic3d_Array1OfVertex ApproxCurve( 1, NodeNumber );
delta = deltaV / (Standard_Real)( NodeNumber - 1 );
gp_Pnt CurPnt;
// center of the symmetry - circle around the MidPoint
Prs3d_Root::NewGroup(aPresentation);
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
- Standard_Real alpha = 2*Standard_PI;
+ Standard_Real alpha = 2 * M_PI;
Standard_Integer nbp = 100;
Graphic3d_Array1OfVertex VC(1,nbp);
Standard_Real dteta = alpha/(nbp-1);
// center of the symmetry - circle around the MidPoint
Prs3d_Root::NewGroup(aPresentation);
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
- Standard_Real alpha = 2*Standard_PI;
+ Standard_Real alpha = 2 * M_PI;
Standard_Integer nbp = 100;
Graphic3d_Array1OfVertex VC(1,nbp);
Standard_Real dteta = alpha/(nbp-1);
// center of the symmetry - circle around the MidPoint
Prs3d_Root::NewGroup(aPresentation);
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
- Standard_Real alpha = 2*Standard_PI;
+ Standard_Real alpha = 2 * M_PI;
Standard_Integer nbp = 100;
Graphic3d_Array1OfVertex VC(1,nbp);
Standard_Real dteta = alpha/(nbp-1);
Standard_Real pf = ElCLib::Parameter(aCircle,Point1);
Standard_Real pl = ElCLib::Parameter(aCircle,Point2);
Standard_Real alpha = pl - pf;
- if ( alpha < 0 ) alpha += 2*Standard_PI;
- Standard_Integer nb = (Standard_Integer)(50.0*alpha/PI);
+ if ( alpha < 0 ) alpha += 2 * M_PI;
+ Standard_Integer nb = (Standard_Integer)(50.0*alpha/M_PI);
Standard_Integer nbp = Max(4,nb);
Graphic3d_Array1OfVertex VC1(1,nbp);
Standard_Real dteta = alpha/(nbp-1);
// center of the symmetry - circle around the MidPoint
Prs3d_Root::NewGroup(aPresentation);
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
- Standard_Real alpha = 2*Standard_PI;
+ Standard_Real alpha = 2 * M_PI;
Standard_Integer nbp = 100;
Graphic3d_Array1OfVertex VC(1,nbp);
Standard_Real dteta = alpha/(nbp-1);
Standard_Real pf = ElCLib::Parameter(aCircle,Point1);
Standard_Real pl = ElCLib::Parameter(aCircle,Point2);
Standard_Real alpha = pl - pf;
- if ( alpha < 0 ) alpha += 2*Standard_PI;
- Standard_Integer nb = (Standard_Integer)(50.0*alpha/PI);
+ if ( alpha < 0 ) alpha += 2 * M_PI;
+ Standard_Integer nb = (Standard_Integer)(50.0*alpha/M_PI);
Standard_Integer nbp = Max(4,nb);
Graphic3d_Array1OfVertex VC1(1,nbp);
Standard_Real dteta = alpha/(nbp-1);
if (fpar >= 0.) {
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;
return Standard_False;
}
{
Standard_Real fpara = firstparam;
Standard_Real lpara = lastparam;
- while (lpara > 2*PI) {
- fpara -= 2*PI;
- lpara -= 2*PI;
+ while (lpara > 2*M_PI) {
+ fpara -= 2*M_PI;
+ lpara -= 2*M_PI;
}
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
gp_Pnt attpoint = AttachmentPoint;
Standard_Boolean otherside = Standard_False;
if ( !DsgPrs_InDomain(fpara,lpara,parat)) {
- Standard_Real otherpar = parat + PI;
- if (otherpar > 2*PI) otherpar -= 2*PI;
+ Standard_Real otherpar = parat + M_PI;
+ if (otherpar > 2*M_PI) otherpar -= 2*M_PI;
if (DsgPrs_InDomain(fpara,lpara,otherpar)) {
parat = otherpar;
otherside = Standard_True;
Prs3d_Root::CurrentGroup(prs)->SetPrimitivesAspect(drawer->LineAspect()->Aspect());
Prs3d_Root::CurrentGroup(prs)->Polyline(line);
- Prs3d_Arrow::Draw(prs, pt2, dir, PI/180.*10., leng*0.3);
+ Prs3d_Arrow::Draw(prs, pt2, dir, M_PI/180.*10., leng*0.3);
}
alpha = fabs(ParamP1 - ParamPAttach1);
if(ParamP1 < ParamPAttach1){
- if(alpha > PI){
- alpha = (2*PI) - alpha;
+ if(alpha > M_PI){
+ alpha = (2*M_PI) - alpha;
nbp = (Standard_Integer ) IntegerPart(alpha/(alpha*.02));
Dalpha = alpha/(nbp - 1);
}
}
}
else{
- if(alpha > PI){
- alpha = (2*PI) - alpha;
+ if(alpha > M_PI){
+ alpha = (2*M_PI) - alpha;
nbp = (Standard_Integer ) IntegerPart(alpha/(alpha*.02));
Dalpha = -alpha/(nbp - 1);
}
alpha = fabs(ParamP2 - ParamPAttach2);
if (alpha <= Precision::Confusion()) alpha = 1.e-5;
if(ParamP2 < ParamPAttach2){
- if(alpha > PI){
- alpha = (2*PI) - alpha;
+ if(alpha > M_PI){
+ alpha = (2*M_PI) - alpha;
nbp = (Standard_Integer ) IntegerPart(alpha/(alpha*.02));
Dalpha = alpha/(nbp - 1);
}
}
}
else{
- if(alpha > PI){
- alpha = (2*PI) - alpha;
+ if(alpha > M_PI){
+ alpha = (2*M_PI) - alpha;
nbp = (Standard_Integer ) IntegerPart(alpha/(alpha*.02));
Dalpha = -alpha/(nbp - 1);
}
G->SetPrimitivesAspect(aLineAspect->Aspect());
G->Polyline(A);
- Prs3d_Arrow::Draw(aPresentation,gp_Pnt(x,y,z),aDir,PI/180.*10.,aVal/10.);
+ Prs3d_Arrow::Draw(aPresentation,gp_Pnt(x,y,z),aDir,M_PI/180.*10.,aVal/10.);
Prs3d_Root::CurrentGroup(aPresentation)->Text(aText,A(2),1./81.);
}
G->SetPrimitivesAspect(aLineAspect->Aspect());
G->Polyline(A);
G->SetPrimitivesAspect( anArrowAspect->Aspect() );
- Prs3d_Arrow::Draw(aPresentation,gp_Pnt(x,y,z),aDir,PI/180.*10.,aVal/10.);
+ Prs3d_Arrow::Draw(aPresentation,gp_Pnt(x,y,z),aDir,M_PI/180.*10.,aVal/10.);
G->SetPrimitivesAspect(aTextAspect->Aspect());
Prs3d_Root::CurrentGroup(aPresentation)->Text(aText,A(2),1./81.);
#endif
#include <ElCLib.ixx>
#include <gp.hxx>
-static Standard_Real PIPI = PI + PI;
+static Standard_Real PIPI = M_PI + M_PI;
//=======================================================================
//function : InPeriod
#include <gp_XYZ.hxx>
#include <gp_Trsf.hxx>
-static Standard_Real PIPI = PI + PI;
+static Standard_Real PIPI = M_PI + M_PI;
gp_Pnt ElSLib::PlaneValue (const Standard_Real U,
const Standard_Real V,
{
gp_XYZ Xdir = Pos.XDirection().XYZ();
gp_XYZ Ydir = Pos.YDirection().XYZ();
- Standard_Real Um = U + Nu * M_PI_2; // PI * 0.5
+ Standard_Real Um = U + Nu * M_PI_2; // M_PI * 0.5
Xdir.Multiply(cos(Um));
Ydir.Multiply(sin(Um));
Xdir.Add(Ydir);
if (AD1 < 0) AD1 = - AD1;
Standard_Real AD2 = D2;
if (AD2 < 0) AD2 = - AD2;
- if (AD2 < AD1) U += PI;
+ if (AD2 < AD1) U += M_PI;
}
if (U < -1.e-16) U += PIPI;
else if (U < 0) U = 0;
PS.Parameter(U, V);
if((myStype == GeomAbs_Sphere) || (myStype == GeomAbs_Cylinder)) {
- U = ElCLib::InPeriod(U, myuinf, myuinf+2.*PI);
+ U = ElCLib::InPeriod(U, myuinf, myuinf+2.*M_PI);
}
if ((myuinf-U) <= mytolS && (U-myusup) <= mytolS &&
Standard_Real PIpPI, aEps;
//
aEps=RealEpsilon();
- PIpPI=Standard_PI+Standard_PI;
+ PIpPI = M_PI + M_PI;
for(Standard_Integer i=0 ; i<NbRoots; i++) {
if(Abs(u - Roots[i])<=aEps) {
return Standard_True ;
Standard_Integer j, SvNbRoots;
Standard_Real aTwoPI, aMaxCoef, aPrecision;
//
- aTwoPI=PI+PI;
+ aTwoPI=M_PI+M_PI;
NbRoots=MTFR.NbSolutions();
for(i=0;i<NbRoots;++i) {
Roots[i]=MTFR.Value(i+1);
A4 = 0.;
}
//
- ExtremaExtElC_TrigonometricRoots Sol(A1,A2,A3,A4,A5,0.,PI+PI);
+ ExtremaExtElC_TrigonometricRoots Sol(A1,A2,A3,A4,A5,0.,M_PI+M_PI);
if (!Sol.IsDone()) {
return;
}
if(fabs(A4) <= aEps) A4 = 0.;
//modified by NIZNHY-PKV Thu Feb 03 14:51:08 2011t
//
- ExtremaExtElC_TrigonometricRoots Sol(A1,A2,A3,A4,A5,0.,PI+PI);
+ ExtremaExtElC_TrigonometricRoots Sol(A1,A2,A3,A4,A5,0.,M_PI+M_PI);
if (!Sol.IsDone()) { return; }
// Storage of solutions ...
#endif
if (Abs(Dy) <= RealEpsilon()) {
- teta[0] = PI/2.0;
+ teta[0] = M_PI/2.0;
}
else teta[0] = ATan(-Dx/Dy);
- teta[1] = teta[0]+ PI;
- if (teta[0] < 0.0) teta[0] = teta[0] + 2.0*PI;
+ teta[1] = teta[0]+ M_PI;
+ if (teta[0] < 0.0) teta[0] = teta[0] + 2.0*M_PI;
P2 = ElCLib::Value(teta[0], C2);
U1 = (gp_Vec2d(O1, P2)).Dot(D);
#endif
if (Abs(Dy) <= RealEpsilon()) {
- teta[0] = PI/2.0;
+ teta[0] = M_PI/2.0;
}
else teta[0] = ATan(-Dx*r2/(Dy*r1));
- teta[1] = teta[0] + PI;
- if (teta[0] < 0.0) teta[0] += 2.0*PI;
+ teta[1] = teta[0] + M_PI;
+ if (teta[0] < 0.0) teta[0] += 2.0*M_PI;
P2 = ElCLib::Value(teta[0], C2);
U1 = (gp_Vec2d(O1, P2)).Dot(D);
P1 = ElCLib::Value(U1, C1);
Standard_Integer i, j;
Extrema_ExtPElC2d ExtElip(C1.Location(), C2,
- Precision::Confusion(), 0.0, 2.0*PI);
+ Precision::Confusion(), 0.0, 2.0*M_PI);
if (ExtElip.IsDone()) {
for (i = 1; i <= ExtElip.NbExt(); i++) {
Extrema_ExtPElC2d ExtCirc(ExtElip.Point(i).Value(), C1,
- Precision::Confusion(), 0.0, 2.0*PI);
+ Precision::Confusion(), 0.0, 2.0*M_PI);
if (ExtCirc.IsDone()) {
for (j = 1; j <= ExtCirc.NbExt(); j++) {
mySqDist[myNbExt] = ExtCirc.SquareDistance(j);
if (ExtHyp.IsDone()) {
for (i = 1; i <= ExtHyp.NbExt(); i++) {
Extrema_ExtPElC2d ExtCirc(ExtHyp.Point(i).Value(), C1,
- Precision::Confusion(), 0.0, 2.0*PI);
+ Precision::Confusion(), 0.0, 2.0*M_PI);
if (ExtCirc.IsDone()) {
for (j = 1; j <= ExtCirc.NbExt(); j++) {
mySqDist[myNbExt] = ExtCirc.SquareDistance(j);
if (ExtParab.IsDone()) {
for (i = 1; i <= ExtParab.NbExt(); i++) {
Extrema_ExtPElC2d ExtCirc(ExtParab.Point(i).Value(),
- C1, Precision::Confusion(), 0.0, 2.0*PI);
+ C1, Precision::Confusion(), 0.0, 2.0*M_PI);
if (ExtCirc.IsDone()) {
for (j = 1; j <= ExtCirc.NbExt(); j++) {
mySqDist[myNbExt] = ExtCirc.SquareDistance(j);
Method:
Pass 3 stages:
1- Projection of point P in the plane of the circle,
- 2- Calculation of u solutions in [0.,2.*PI]:
+ 2- Calculation of u solutions in [0.,2.*M_PI]:
Let Pp, the projected point and
O, the center of the circle;
2 cases:
IsDone() renvoie Standard_False.
- otherwise, 2 points are solutions for the complete circle:
. Us1 = angle(OPp,OX) corresponds to the minimum,
- . let Us2 = ( Us1 + PI if Us1 < PI,
- ( Us1 - PI otherwise;
+ . let Us2 = ( Us1 + M_PI if Us1 < M_PI,
+ ( Us1 - M_PI otherwise;
Us2 corresponds to the maximum.
3- Calculate the extrema in [Uinf,Usup].
-----------------------------------------------------------------------------*/
gp_Vec OPp (O,Pp);
if (OPp.Magnitude() < Tol) { return; }
Standard_Real Usol[2];
- Usol[0] = C.XAxis().Direction().AngleWithRef(OPp,Axe); // -PI<U1<PI
- Usol[1] = Usol[0] + PI;
+ Usol[0] = C.XAxis().Direction().AngleWithRef(OPp,Axe); // -M_PI<U1<M_PI
+ Usol[1] = Usol[0] + M_PI;
Standard_Real myuinf = Uinf;
//modified by NIZNHY-PKV Fri Apr 20 15:03:28 2001 f
TolU= Tol/aR;
}
//modified by NIZNHY-PKV Fri Apr 20 15:03:32 2001 t
- ElCLib::AdjustPeriodic(Uinf, Uinf+2*PI, TolU, myuinf, Usol[0]);
- ElCLib::AdjustPeriodic(Uinf, Uinf+2*PI, TolU, myuinf, Usol[1]);
- if (((Usol[0]-2*PI-Uinf) < TolU) && ((Usol[0]-2*PI-Uinf) > -TolU)) Usol[0] = Uinf;
- if (((Usol[1]-2*PI-Uinf) < TolU) && ((Usol[1]-2*PI-Uinf) > -TolU)) Usol[1] = Uinf;
+ ElCLib::AdjustPeriodic(Uinf, Uinf+2*M_PI, TolU, myuinf, Usol[0]);
+ ElCLib::AdjustPeriodic(Uinf, Uinf+2*M_PI, TolU, myuinf, Usol[1]);
+ if (((Usol[0]-2*M_PI-Uinf) < TolU) && ((Usol[0]-2*M_PI-Uinf) > -TolU)) Usol[0] = Uinf;
+ if (((Usol[1]-2*M_PI-Uinf) < TolU) && ((Usol[1]-2*M_PI-Uinf) > -TolU)) Usol[1] = Uinf;
// 3- Calculate extrema in [Umin,Umax] ...
radius = C.Radius();
P1 = OC.Translated(radius*V);
U1 = ElCLib::Parameter(C, P1);
- U2 = U1 + PI;
+ U2 = U1 + M_PI;
P2 = OC.Translated(-radius*V);
Standard_Real myuinf = Uinf;
- ElCLib::AdjustPeriodic(Uinf, Uinf+2*PI, Precision::PConfusion(), myuinf, U1);
- ElCLib::AdjustPeriodic(Uinf, Uinf+2*PI, Precision::PConfusion(), myuinf, U2);
- if (((U1-2*PI-Uinf) < Tol) && ((U1-2*PI-Uinf) > -Tol)) U1 = Uinf;
- if (((U2-2*PI-Uinf) < Tol) && ((U2-2*PI-Uinf) > -Tol)) U2 = Uinf;
+ ElCLib::AdjustPeriodic(Uinf, Uinf+2*M_PI, Precision::PConfusion(), myuinf, U1);
+ ElCLib::AdjustPeriodic(Uinf, Uinf+2*M_PI, Precision::PConfusion(), myuinf, U2);
+ if (((U1-2*M_PI-Uinf) < Tol) && ((U1-2*M_PI-Uinf) > -Tol)) U1 = Uinf;
+ if (((U2-2*M_PI-Uinf) < Tol) && ((U2-2*M_PI-Uinf) > -Tol)) U2 = Uinf;
if (((Uinf-U1) < Tol) && ((U1-Usup) < Tol)) {
Extrema_POnCurv2d MyPOnCurve(U1, P1);
There are infinite solutions; IsDone() = Standard_False.
2- distance(Pp,O) > Tol:
let V = OP.OZ,
- U1 = angle(OX,OPp) with 0 < U1 < 2.*PI
- U2 = U1 + PI with 0 < U2 < 2.*PI;
+ U1 = angle(OX,OPp) with 0 < U1 < 2.*M_PI
+ U2 = U1 + M_PI with 0 < U2 < 2.*M_PI;
then (U1,V) corresponds to the min distance.
and (U2,V) corresponds to the max distance.
-----------------------------------------------------------------------------*/
gp_Vec OPp (O,Pp);
if (OPp.Magnitude() < Tol) { return; }
gp_Vec myZ = Pos.XDirection()^Pos.YDirection();
- Standard_Real U1 = gp_Vec(Pos.XDirection()).AngleWithRef(OPp,myZ); //-PI<U1<PI
- Standard_Real U2 = U1 + PI;
- if (U1 < 0.) { U1 += 2. * PI; }
+ Standard_Real U1 = gp_Vec(Pos.XDirection()).AngleWithRef(OPp,myZ); //-M_PI<U1<M_PI
+ Standard_Real U2 = U1 + M_PI;
+ if (U1 < 0.) { U1 += 2. * M_PI; }
gp_Pnt Ps;
Ps = ElSLib::Value(U1,V,S);
Let Vm = value of v for point M,
Vp = value of v for point P,
U1 = angle(OX,OPp) if Vp > Vm )
- -angle(OX,OPp) otherwise ) with 0. < U1 < 2*PI,
- U2 = U1 + PI with 0. < U2 < 2*PI;
+ -angle(OX,OPp) otherwise ) with 0. < U1 < 2*M_PI,
+ U2 = U1 + M_PI with 0. < U2 < 2*M_PI;
We are in plane PpOZ.
Let A the angle of the cone,
- B = angle(MP,MO) with 0. < B < PI,
+ B = angle(MP,MO) with 0. < B < M_PI,
L = longueur(MP),
V1 = (L * cos(B-A)) + Vm,
V2 = (L * cos(B+A)) + Vm;
if (OPp.SquareMagnitude() < Tol * Tol) return;
Standard_Real B, U1, V1, U2, V2;
Standard_Boolean Same = DirZ.Dot(MP) >= 0.0;
- U1 = gp_Vec(Pos.XDirection()).AngleWithRef(OPp,myZ); //-PI<U1<PI
+ U1 = gp_Vec(Pos.XDirection()).AngleWithRef(OPp,myZ); //-M_PI<U1<M_PI
B = MP.Angle(DirZ);
- if (!Same) { U1 += PI; }
- U2 = U1 + PI;
- if (U1 < 0.) { U1 += 2. * PI; }
- if (U2 > 2.*PI) { U2 -= 2. * PI; }
+ if (!Same) { U1 += M_PI; }
+ U2 = U1 + M_PI;
+ if (U1 < 0.) { U1 += 2. * M_PI; }
+ if (U2 > 2.*M_PI) { U2 -= 2. * M_PI; }
B = MP.Angle(DirZ);
A = Abs(A);
Standard_Real L = sqrt(L2);
if (!Same) {
- B = PI-B;
+ B = M_PI-B;
V1 = -L*cos(B-A);
V2 = -L*cos(B+A);
}
Let Pp be the projection of point P in the plane XOY of the sphere;
2 cases are considered:
1- distance(Pp,O) < Tol:
- 2 solutions are: (0,-PI/2.) and (0.,PI/2.)
+ 2 solutions are: (0,-M_PI/2.) and (0.,M_PI/2.)
2- distance(Pp,O) > Tol:
- Let U1 = angle(OX,OPp) with 0. < U1 < 2.*PI,
- U2 = U1 + PI avec 0. < U2 < 2*PI,
- V1 = angle(OPp,OP) with -PI/2. < V1 < PI/2. ,
+ Let U1 = angle(OX,OPp) with 0. < U1 < 2.*M_PI,
+ U2 = U1 + M_PI avec 0. < U2 < 2*M_PI,
+ V1 = angle(OPp,OP) with -M_PI/2. < V1 < M_PI/2. ,
then (U1, V1) corresponds to the min distance
and (U2,-V1) corresponds to the max distance.
-----------------------------------------------------------------------------*/
if (OPp.SquareMagnitude() < Tol * Tol) {
U1 = 0.;
U2 = 0.;
- if (Zp < 0.) { V = -PI / 2.; }
- else { V = PI / 2.; }
+ if (Zp < 0.) { V = -M_PI / 2.; }
+ else { V = M_PI / 2.; }
}
else {
gp_Vec myZ = Pos.XDirection()^Pos.YDirection();
U1 = gp_Vec(Pos.XDirection()).AngleWithRef(OPp,myZ);
- U2 = U1 + PI;
- if (U1 < 0.) { U1 += 2. * PI; }
+ U2 = U1 + M_PI;
+ if (U1 < 0.) { U1 += 2. * M_PI; }
V = OP.Angle(OPp);
if (Zp < 0.) { V = -V; }
}
There is an infinite number of solutions; IsDone() = Standard_False.
2- distance(Pp,O) > Tol:
One is located in plane PpOZ;
- Let V1 = angle(OX,OPp) with 0. < V1 < 2.*PI,
- V2 = V1 + PI with 0. < V2 < 2.*PI,
+ Let V1 = angle(OX,OPp) with 0. < V1 < 2.*M_PI,
+ V2 = V1 + M_PI with 0. < V2 < 2.*M_PI,
O1 and O2 centers of circles (O1 on coord. posit.)
U1 = angle(OPp,O1P),
U2 = angle(OPp,PO2);
gp_Vec myZ = Pos.XDirection()^Pos.YDirection();
Standard_Real U1 = gp_Vec(Pos.XDirection()).AngleWithRef(OPp,myZ);
- Standard_Real U2 = U1 + PI;
- if (U1 < 0.) { U1 += 2. * PI; }
+ Standard_Real U2 = U1 + M_PI;
+ if (U1 < 0.) { U1 += 2. * M_PI; }
Standard_Real R = sqrt(R2);
gp_Vec OO1 = OPp.Divided(R).Multiplied(S.MajorRadius());
gp_Vec OO2 = OO1.Multiplied(-1.);
Standard_Real V1 = OO1.AngleWithRef(gp_Vec(O1,P),OO1.Crossed(OZ));
Standard_Real V2 = OO2.AngleWithRef(gp_Vec(P,O2),OO2.Crossed(OZ));
- if (V1 < 0.) { V1 += 2. * PI; }
- if (V2 < 0.) { V2 += 2. * PI; }
+ if (V1 < 0.) { V1 += 2. * M_PI; }
+ if (V2 < 0.) { V2 += 2. * M_PI; }
gp_Pnt Ps;
Ps = ElSLib::Value(U1,V1,S);
mySqDist[0] = Ps.SquareDistance(P);
myPoint[0] = Extrema_POnSurf(U1,V1,Ps);
- Ps = ElSLib::Value(U1,V1+PI,S);
+ Ps = ElSLib::Value(U1,V1+M_PI,S);
mySqDist[1] = Ps.SquareDistance(P);
- myPoint[1] = Extrema_POnSurf(U1,V1+PI,Ps);
+ myPoint[1] = Extrema_POnSurf(U1,V1+M_PI,Ps);
Ps = ElSLib::Value(U2,V2,S);
mySqDist[2] = Ps.SquareDistance(P);
myPoint[2] = Extrema_POnSurf(U2,V2,Ps);
- Ps = ElSLib::Value(U2,V2+PI,S);
+ Ps = ElSLib::Value(U2,V2+M_PI,S);
mySqDist[3] = Ps.SquareDistance(P);
- myPoint[3] = Extrema_POnSurf(U2,V2+PI,Ps);
+ myPoint[3] = Extrema_POnSurf(U2,V2+M_PI,Ps);
myNbExt = 4;
myDone = Standard_True;
if (myC->IsPeriodic())
{
Standard_Real U2 = U;
- ElCLib::AdjustPeriodic(myuinf, myuinf + 2.*PI, Precision::PConfusion(), U, U2);
+ ElCLib::AdjustPeriodic(myuinf, myuinf + 2.*M_PI, Precision::PConfusion(), U, U2);
}
//////////////////////////////////////////////////
gp_Pnt E = POC.Value();
E.Perform(P, C->Line(), Tol, -Precision::Infinite(),Precision::Infinite());
return;
case GeomAbs_Circle:
- E.Perform(P, C->Circle(), Tol, 0.0, 2.0 * PI);
+ E.Perform(P, C->Circle(), Tol, 0.0, 2.0 * M_PI);
return;
case GeomAbs_Ellipse:
- E.Perform(P, C->Ellipse(), Tol, 0.0, 2.0 * PI);
+ E.Perform(P, C->Ellipse(), Tol, 0.0, 2.0 * M_PI);
return;
case GeomAbs_Parabola:
E.Perform(P, C->Parabola(), Tol, -Precision::Infinite(),Precision::Infinite());
E.Perform(P, C->Line(), Tol, -Precision::Infinite(),Precision::Infinite());
return;
case GeomAbs_Circle:
- E.Perform(P, C->Circle(), Tol, 0.0, 2.0 * PI);
+ E.Perform(P, C->Circle(), Tol, 0.0, 2.0 * M_PI);
return;
case GeomAbs_Ellipse:
- E.Perform(P, C->Ellipse(), Tol, 0.0, 2.0 * PI);
+ E.Perform(P, C->Ellipse(), Tol, 0.0, 2.0 * M_PI);
return;
case GeomAbs_Parabola:
E.Perform(P, C->Parabola(), Tol, -Precision::Infinite(),Precision::Infinite());
else {
Ppp = Pp.Translated(Z.Multiplied(-OPpz));
if (O.IsEqual(Ppp,Precision::Confusion()))
- U = PI/2;
+ U = M_PI/2;
else {
U = gp_Vec(O,Ppp).AngleWithRef(gp_Vec(O,Pp),Dir);
}
}
- gp_Vec OPpp (O,Ppp), OPq (O, myS->Value(PI/2,0));
- if (U != PI/2) {
+ gp_Vec OPpp (O,Ppp), OPq (O, myS->Value(M_PI/2,0));
+ if (U != M_PI/2) {
if (Abs(OPq.Magnitude()) <= gp::Resolution())
- OPq = gp_Vec(O, myS->Value(PI/2,anACurve->LastParameter()/10));
+ OPq = gp_Vec(O, myS->Value(M_PI/2,anACurve->LastParameter()/10));
if (OPpp.AngleWithRef(OPq,Dir) < 0)
- U += PI;
+ U += M_PI;
}
gp_Trsf T;
if((anACurve->GetType() == GeomAbs_Circle) ||
(anACurve->GetType() == GeomAbs_Ellipse)) {
- newV = ElCLib::InPeriod(V, myvinf, myvinf + 2. * PI);
+ newV = ElCLib::InPeriod(V, myvinf, myvinf + 2. * M_PI);
if (newV > myvsup) {
newV = myvsup;
if((anACurve->GetType() == GeomAbs_Circle) ||
(anACurve->GetType() == GeomAbs_Ellipse)) {
- newV = ElCLib::InPeriod(V, myvsup - 2. * PI, myvsup);
+ newV = ElCLib::InPeriod(V, myvsup - 2. * M_PI, myvsup);
if(newV < myvinf)
newV = myvinf;
}
}
}
- T.SetRotation(Ax, PI);
+ T.SetRotation(Ax, M_PI);
P1.Transform(T);
PerformExtPElC(anExt, P1, anACurve, mytolv);
if (anExt.IsDone()) {
myDone = Standard_True;
- U += PI;
+ U += M_PI;
for (i=1; i<=anExt.NbExt(); i++) {
Extrema_POnCurv POC=anExt.Point(i);
if((anACurve->GetType() == GeomAbs_Circle) ||
(anACurve->GetType() == GeomAbs_Ellipse)) {
- newV = ElCLib::InPeriod(V, myvinf, myvinf + 2. * PI);
+ newV = ElCLib::InPeriod(V, myvinf, myvinf + 2. * M_PI);
if (newV > myvsup) {
newV = myvsup;
if((anACurve->GetType() == GeomAbs_Circle) ||
(anACurve->GetType() == GeomAbs_Ellipse)) {
- newV = ElCLib::InPeriod(V, myvsup - 2. * PI, myvsup);
+ newV = ElCLib::InPeriod(V, myvsup - 2. * M_PI, myvsup);
if(newV < myvinf)
newV = myvinf;
1- distance(Pp,O) < Tol:
Il existe 0 ou une infinite de solutions; IsDone() = Standard_False;
2- distance(Pp,O) > Tol:
- Soit U1 = angle(OX,OPp) avec 0. < U1 < 2.*PI,
- U2 = U1 + PI avec 0. < U2 < 2.*PI,
+ Soit U1 = angle(OX,OPp) avec 0. < U1 < 2.*M_PI,
+ U2 = U1 + M_PI avec 0. < U2 < 2.*M_PI,
M1 le meridien S(U1),
M2 le meridien S(U2);
On recherche les distances minimales entre P et M1 et les distances
if (OPp.Magnitude() < Tol) { return; }
Standard_Real U1 = gp_Vec(Pos.XDirection()).AngleWithRef(OPp,OZ);
- Standard_Real U2 = U1 + PI;
- if (U1 < 0.) { U1 += 2. * PI; }
+ Standard_Real U2 = U1 + M_PI;
+ if (U1 < 0.) { U1 += 2. * M_PI; }
Curve M1 = Tool::Meridian(S, U1);
Curve M2 = Tool::Meridian(S, U2);
TheExtPC ExtPM1 (P,M1,NbV,TolV,Tol);
switch(type2) {
case GeomAbs_Circle: {
Extrema_ExtElC2d Xtrem(Tool1::Circle(C1), Tool2::Circle(*((Curve2*)myC)));
- Results(Xtrem, U11, U12, U21, U22, 2*PI, 2*PI);
+ Results(Xtrem, U11, U12, U21, U22, 2*M_PI, 2*M_PI);
}
break;
case GeomAbs_Ellipse: {
Extrema_ExtElC2d Xtrem(Tool1::Circle(C1), Tool2::Ellipse(*((Curve2*)myC)));
- Results(Xtrem, U11, U12, U21, U22, 2*PI, 2*PI );
+ Results(Xtrem, U11, U12, U21, U22, 2*M_PI, 2*M_PI );
}
break;
case GeomAbs_Parabola: {
Extrema_ExtElC2d Xtrem(Tool1::Circle(C1), Tool2::Parabola(*((Curve2*)myC)));
- Results(Xtrem, U11, U12, U21, U22, 2*PI, 0.);
+ Results(Xtrem, U11, U12, U21, U22, 2*M_PI, 0.);
}
break;
case GeomAbs_Hyperbola: {
Extrema_ExtElC2d Xtrem(Tool1::Circle(C1), Tool2::Hyperbola(*((Curve2*)myC)));
- Results(Xtrem, U11, U12, U21, U22, 2*PI, 0. );
+ Results(Xtrem, U11, U12, U21, U22, 2*M_PI, 0. );
}
break;
case GeomAbs_BezierCurve:
NbU, NbV, mytolc1, mytolc2);
Standard_Real Period2 = 0.;
if (Tool2::IsPeriodic(*((Curve2*)myC))) Period2 = Tool2::Period(*((Curve2*)myC));
- Results(Xtrem, C1, U11, U12, U21, U22, 2*PI,Period2);
+ Results(Xtrem, C1, U11, U12, U21, U22, 2*M_PI,Period2);
}
break;
case GeomAbs_Line: {
inverse = Standard_True;
Extrema_ExtElC2d Xtrem(Tool2::Line(*((Curve2*)myC)), Tool1::Circle(C1), Tol);
- Results(Xtrem, U11, U12, U21, U22, 2*PI, 0.);
+ Results(Xtrem, U11, U12, U21, U22, 2*M_PI, 0.);
}
break;
}; // switch(type2)
case GeomAbs_Circle: {
inverse = Standard_True;
Extrema_ExtElC2d Xtrem(Tool2::Circle(*((Curve2*)myC)), Tool1::Ellipse(C1));
- Results(Xtrem, U11, U12, U21, U22, 2*PI, 2*PI);
+ Results(Xtrem, U11, U12, U21, U22, 2*M_PI, 2*M_PI);
}
break;
case GeomAbs_Ellipse: {
//Extrema_ExtElC2d Xtrem(Tool1::Ellipse(C1), Tool2::Ellipse(*((Curve2*)myC)));
Extrema_ECC2d Xtrem(C1, *((Curve2*)myC),
NbU, NbV, mytolc1, mytolc2);
- Results(Xtrem, C1, U11, U12, U21, U22,2*PI, 2*PI);
+ Results(Xtrem, C1, U11, U12, U21, U22,2*M_PI, 2*M_PI);
}
break;
case GeomAbs_Parabola: {
//Extrema_ExtElC2d Xtrem(Tool1::Ellipse(C1), Tool2::Parabola(*((Curve2*)myC)));
Extrema_ECC2d Xtrem(C1, *((Curve2*)myC),
NbU, NbV, mytolc1, mytolc2);
- Results(Xtrem, C1, U11, U12, U21, U22, 2*PI, 0.);
+ Results(Xtrem, C1, U11, U12, U21, U22, 2*M_PI, 0.);
}
break;
case GeomAbs_Hyperbola: {
//Extrema_ExtElC2d Xtrem(Tool1::Ellipse(C1), Tool2::Hyperbola(*((Curve2*)myC)));
Extrema_ECC2d Xtrem(C1, *((Curve2*)myC),
NbU, NbV, mytolc1, mytolc2);
- Results(Xtrem, C1, U11, U12, U21, U22, 2*PI, 0.);
+ Results(Xtrem, C1, U11, U12, U21, U22, 2*M_PI, 0.);
}
break;
case GeomAbs_BezierCurve:
NbU, NbV, mytolc1, mytolc2);
Standard_Real Period2 = 0.;
if (Tool2::IsPeriodic(*((Curve2*)myC))) Period2 = Tool2::Period(*((Curve2*)myC));
- Results(Xtrem, C1, U11, U12, U21, U22, 2*PI,Period2);
+ Results(Xtrem, C1, U11, U12, U21, U22, 2*M_PI,Period2);
}
break;
case GeomAbs_Line: {
inverse = Standard_True;
Extrema_ExtElC2d Xtrem(Tool2::Line(*((Curve2*)myC)), Tool1::Ellipse(C1));
- Results(Xtrem, U11, U12, U21, U22, 2*PI, 0.);
+ Results(Xtrem, U11, U12, U21, U22, 2*M_PI, 0.);
}
break;
}; // switch(type2)
case GeomAbs_Circle: {
inverse = Standard_True;
Extrema_ExtElC2d Xtrem(Tool2::Circle(*((Curve2*)myC)), Tool1::Parabola(C1));
- Results(Xtrem, U11, U12, U21, U22, 0., 2*PI);
+ Results(Xtrem, U11, U12, U21, U22, 0., 2*M_PI);
}
break;
case GeomAbs_Ellipse: {
//Extrema_ExtElC2d Xtrem(Tool2::Ellipse(*((Curve2*)myC)), Tool1::Parabola(C1));
Extrema_ECC2d Xtrem(C1, *((Curve2*)myC),
NbU, NbV, mytolc1, mytolc2);
- Results(Xtrem, C1, U11, U12, U21, U22, 0., 2*PI);
+ Results(Xtrem, C1, U11, U12, U21, U22, 0., 2*M_PI);
}
break;
case GeomAbs_Parabola: {
case GeomAbs_Circle: {
inverse = Standard_True;
Extrema_ExtElC2d Xtrem(Tool2::Circle(*((Curve2*)myC)), Tool1::Hyperbola(C1));
- Results(Xtrem, U11, U12, U21, U22, 0., 2*PI);
+ Results(Xtrem, U11, U12, U21, U22, 0., 2*M_PI);
}
break;
case GeomAbs_Ellipse: {
//Extrema_ExtElC2d Xtrem(Tool2::Ellipse(*((Curve2*)myC)), Tool1::Hyperbola(C1));
Extrema_ECC2d Xtrem(C1, *((Curve2*)myC),
NbU, NbV, mytolc1, mytolc2);
- Results(Xtrem, C1, U11, U12, U21, U22, 0., 2*PI );
+ Results(Xtrem, C1, U11, U12, U21, U22, 0., 2*M_PI );
}
break;
case GeomAbs_Parabola: {
switch(type2) {
case GeomAbs_Circle: {
Extrema_ExtElC2d Xtrem(Tool1::Line(C1), Tool2::Circle(*((Curve2*)myC)), Tol);
- Results(Xtrem, U11, U12, U21, U22, 0., 2*PI);
+ Results(Xtrem, U11, U12, U21, U22, 0., 2*M_PI);
}
break;
case GeomAbs_Ellipse: {
Extrema_ExtElC2d Xtrem(Tool1::Line(C1), Tool2::Ellipse(*((Curve2*)myC)));
- Results(Xtrem, U11, U12, U21, U22, 0., 2*PI);
+ Results(Xtrem, U11, U12, U21, U22, 0., 2*M_PI);
}
break;
case GeomAbs_Parabola: {
{
Standard_Boolean Ok=Standard_True, End=Standard_False;
Standard_Real AngleMax = 0.7; // parameter ruling the function of increment ( 40 degrees )
- Standard_Real AngleMin = 2*PI/100; // parameter ruling the function of increment
+ Standard_Real AngleMin = 2*M_PI/100; // parameter ruling the function of increment
// full passage should not cost more than 100 steps.
Standard_Real DAngle1, DAngle2, Ratio, Fraction, Toler;
Standard_Real OldDist, NewDist;
// case of angle without constraints
if ( (NewConstraintOrder1 == 0) && (NewConstraintOrder2 == 0)) return Dist;
- if (NewConstraintOrder1 == 0) a1 = Abs( Abs(NewAngle2)<PI ? Angle2/2 : PI/2);
+ if (NewConstraintOrder1 == 0) a1 = Abs( Abs(NewAngle2)<M_PI ? Angle2/2 : M_PI/2);
else a1 = Abs(Angle1);
- if (NewConstraintOrder2 == 0) a2 = Abs( Abs(NewAngle1)<PI ? Angle1/2 : PI/2);
+ if (NewConstraintOrder2 == 0) a2 = Abs( Abs(NewAngle1)<M_PI ? Angle1/2 : M_PI/2);
else a2 = Abs(Angle2);
// case of angle of the same sign
else {
Standard_Real Ratio = a1 / ( a1 + a2 );
Standard_Real AngleMilieu = pow(1-Ratio,2) * a1 + pow(Ratio,2) * a2;
- if (AngleMilieu > PI/2) AngleMilieu = PI/2;
+ if (AngleMilieu > M_PI/2) AngleMilieu = M_PI/2;
return Ratio * Compute(Dist, a1, AngleMilieu )
+ (1-Ratio) * Compute(Dist, a2, AngleMilieu );
// ==================================================================
{
if (Angle < Precision::Angular() ) { return Dist; } // length of segment P1P2
- if (Angle < PI/2) { return Angle*Dist / sin(Angle); } // length of circle P1P2 respecting ANGLE
- if (Angle > PI) { return Sqrt(Angle*PI) * Dist;}
+ if (Angle < M_PI/2) { return Angle*Dist / sin(Angle); } // length of circle P1P2 respecting ANGLE
+ if (Angle > M_PI) { return Sqrt(Angle*M_PI) * Dist;}
else { return Angle * Dist; } // linear interpolation
}
{
Standard_Boolean Ok=Standard_True, End=Standard_False;
Standard_Real AngleMax = 0.7; // parameter regulating the function of increment ( 40 degrees )
- Standard_Real AngleMin = 2*PI/100; // parameter regulating the function of increment
+ Standard_Real AngleMin = 2*M_PI/100; // parameter regulating the function of increment
// full passage should not contain more than 100 steps.
Standard_Real DAngle1, DAngle2, DRho1, DRho2, Ratio, Fraction, Toler;
Standard_Real OldDist, NewDist;
/ pow (Knots->Value(Knots->Lower()+1)-Knots->Value(Knots->Lower()), 2);
Standard_Real CPrim = OldDerive.Magnitude();
ADelta(kk) = ( OldSeconde.Rotated(DAngle1) - OldSeconde
- + DeltaCurvature1*CPrim*OldDerive.Rotated(PI/2+DAngle1) ).XY();
+ + DeltaCurvature1*CPrim*OldDerive.Rotated(M_PI/2+DAngle1) ).XY();
kk += 1;
}
}
/ pow (Knots->Value(Knots->Upper())-Knots->Value(Knots->Upper()-1), 2);
Standard_Real CPrim = OldDerive.Magnitude();
ADelta(kk) = ( OldSeconde.Rotated(DAngle2) - OldSeconde
- + DeltaCurvature2*CPrim*OldDerive.Rotated(PI/2+DAngle2) ).XY();
+ + DeltaCurvature2*CPrim*OldDerive.Rotated(M_PI/2+DAngle2) ).XY();
kk += 1;
}
}
const Standard_Real Radius)
{
if (Radius < 0.) { TheError = gce_NegativeRadius; }
- else if (Ang <= gp::Resolution() || Ang >= PI/2. - gp::Resolution()) {
+ else if (Ang <= gp::Resolution() || Ang >= M_PI/2. - gp::Resolution()) {
TheError = gce_BadAngle;
}
else {
gp_Pnt P5 = ext1.Point(1).Value();
gp_Pnt P6 = ext2.Point(1).Value();
Standard_Real D = P6.Distance(P5)/cos((Cone.Value())->SemiAngle());
- TheCone=new Geom_RectangularTrimmedSurface(Cone.Value(),0.,2.*PI,0.,D,Standard_True,Standard_True);
+ TheCone=new Geom_RectangularTrimmedSurface(Cone.Value(),0.,2.*M_PI,0.,D,Standard_True,Standard_True);
}
}
TheError = Cone.Status();
if (TheError == gce_Done) {
Standard_Real D = (P2.Distance(P1))/cos((Cone.Value())->SemiAngle());
- TheCone=new Geom_RectangularTrimmedSurface(Cone.Value(),0.,2.*PI,0.,D,Standard_True,Standard_True);
+ TheCone=new Geom_RectangularTrimmedSurface(Cone.Value(),0.,2.*M_PI,0.,D,Standard_True,Standard_True);
}
}
GC_MakeCylindricalSurface Cyl(P1,P2,P3);
TheError = Cyl.Status();
if (TheError == gce_Done) {
- TheCyl = new Geom_RectangularTrimmedSurface(Cyl.Value(),0.,2.*PI,0.,
+ TheCyl = new Geom_RectangularTrimmedSurface(Cyl.Value(),0.,2.*M_PI,0.,
P2.Distance(P1),Standard_True,Standard_True);
}
}
GC_MakeCylindricalSurface Cyl(Circ);
TheError = Cyl.Status();
if (TheError == gce_Done) {
- TheCyl = new Geom_RectangularTrimmedSurface(Cyl.Value(),0.,2.*PI,0.,
+ TheCyl = new Geom_RectangularTrimmedSurface(Cyl.Value(),0.,2.*M_PI,0.,
Height,Standard_True,Standard_True);
}
}
GC_MakeCylindricalSurface Cyl(A1,Radius);
TheError = Cyl.Status();
if (TheError == gce_Done) {
- TheCyl = new Geom_RectangularTrimmedSurface(Cyl.Value(),0.,2.*PI,0.,
+ TheCyl = new Geom_RectangularTrimmedSurface(Cyl.Value(),0.,2.*M_PI,0.,
Height,Standard_True,Standard_True);
}
}
GProp_CelGProps::GProp_CelGProps (const gp_Circ& C, const gp_Pnt& CLocation)
{
SetLocation(CLocation);
- Perform(C,0.,2.*PI);
+ Perform(C,0.,2.*M_PI);
}
GProp_CelGProps::GProp_CelGProps (const gp_Circ& C,
{
gp_Circ2d Circ(Sol->Circle());
IntRes2d_Domain D1(ElCLib::Value(0.,Circ), 0.,Tol1,
- ElCLib::Value(2.*PI,Circ),2.*PI,Tol2);
- D1.SetEquivalentParameters(0.,2.*PI);
+ ElCLib::Value(2.*M_PI,Circ),2.*M_PI,Tol2);
+ D1.SetEquivalentParameters(0.,2.*M_PI);
Intp.Perform(Circ,D1,Cu2,D2,Tol1,Tol2);
}
break;
{
gp_Elips2d Elips(Sol->Ellipse());
IntRes2d_Domain D1(ElCLib::Value(0.,Elips), 0.,Tol1,
- ElCLib::Value(2.*PI,Elips),2.*PI,Tol2);
- D1.SetEquivalentParameters(0.,2.*PI);
+ ElCLib::Value(2.*M_PI,Elips),2.*M_PI,Tol2);
+ D1.SetEquivalentParameters(0.,2.*M_PI);
Intp.Perform(Elips,D1,Cu2,D2,Tol1,Tol2);
}
break;
{
gp_Circ2d Circ(Sol->Circle());
IntRes2d_Domain D1(ElCLib::Value(0.,Circ), 0.,Tol1,
- ElCLib::Value(2.*PI,Circ),2.*PI,Tol2);
- D1.SetEquivalentParameters(0.,2.*PI);
+ ElCLib::Value(2.*M_PI,Circ),2.*M_PI,Tol2);
+ D1.SetEquivalentParameters(0.,2.*M_PI);
Intp.Perform(Circ,D1,C2,D2,Tol1,Tol2);
}
break;
{
gp_Elips2d Elips(Sol->Ellipse());
IntRes2d_Domain D1(ElCLib::Value(0.,Elips), 0.,Tol1,
- ElCLib::Value(2.*PI,Elips),2.*PI,Tol2);
- D1.SetEquivalentParameters(0.,2.*PI);
+ ElCLib::Value(2.*M_PI,Elips),2.*M_PI,Tol2);
+ D1.SetEquivalentParameters(0.,2.*M_PI);
Intp.Perform(Elips,D1,C2,D2,Tol1,Tol2);
}
break;
for (Standard_Integer jcote1 = 1 ; jcote1 <= nbrcote1 ; jcote1++) {
gp_Circ2d Circ(C1.XAxis(),R1+cote1(jcote1));
IntRes2d_Domain D1(ElCLib::Value(0.,Circ), 0.,Tol,
- ElCLib::Value(2.*PI,Circ),2.*PI,Tol);
- D1.SetEquivalentParameters(0.,2.*PI);
+ ElCLib::Value(2.*M_PI,Circ),2.*M_PI,Tol);
+ D1.SetEquivalentParameters(0.,2.*M_PI);
for (Standard_Integer jcote2 = 1 ; jcote2 <= nbrcote2 ; jcote2++) {
Handle(TheHParGenCurve) HCu2 = new TheHParGenCurve(Cu2);
TheParGenCurve C2(HCu2,cote2(jcote2));
}
gp_Circ2d Circ(gp_Ax2d(Point2,gp_Dir2d(1.,0.)),Radius);
IntRes2d_Domain D1(ElCLib::Value(0.,Circ), 0.,Tol,
- ElCLib::Value(PI+PI,Circ),PI+PI,Tol);
- D1.SetEquivalentParameters(0.,PI+PI);
+ ElCLib::Value(M_PI+M_PI,Circ),M_PI+M_PI,Tol);
+ D1.SetEquivalentParameters(0.,M_PI+M_PI);
TheIntConicCurve Intp;
for (Standard_Integer jcote1 = 1 ; jcote1 <= nbrcote1 ; jcote1++) {
Handle(TheHParGenCurve) HCu1 = new TheHParGenCurve(Cu1);
cote1(2) = -Radius;
}
IntRes2d_Domain D1(ElCLib::Value(0.,OnCirc), 0.,Tol,
- ElCLib::Value(2.*PI,OnCirc),2.*PI,Tol);
- D1.SetEquivalentParameters(0.,2.*PI);
+ ElCLib::Value(2.*M_PI,OnCirc),2.*M_PI,Tol);
+ D1.SetEquivalentParameters(0.,2.*M_PI);
TheIntConicCurve Intp;
for (Standard_Integer jcote1 = 1 ; jcote1 <= nbrcote1 ; jcote1++) {
Handle(TheHParGenCurve) HCu1 = new TheHParGenCurve(Cu1);
for (Standard_Integer jcote1 = 1 ; jcote1 <= nbrcote1 ; jcote1++) {
gp_Circ2d Circ(C1.XAxis(),R1 + cote1(jcote1));
IntRes2d_Domain D1(ElCLib::Value(0.,Circ), 0.,Tol,
- ElCLib::Value(2.*PI,Circ),2.*PI,Tol);
- D1.SetEquivalentParameters(0.,2.*PI);
+ ElCLib::Value(2.*M_PI,Circ),2.*M_PI,Tol);
+ D1.SetEquivalentParameters(0.,2.*M_PI);
firstparam = Max(TheTool::FirstParameter(OnCurv),thefirst);
lastparam = Min(TheTool::LastParameter(OnCurv),thelast);
IntRes2d_Domain D2(TheTool::Value(OnCurv,firstparam),firstparam,Tol,
// gp_Dir2d Dir(-y1dir,x1dir);
gp_Circ2d Circ(gp_Ax2d(Point1,gp_Dir2d(1.,0.)),Radius);
IntRes2d_Domain D1(ElCLib::Value(0.,Circ), 0.,Tol,
- ElCLib::Value(2.*PI,Circ),2*PI,Tol);
- D1.SetEquivalentParameters(0.,2.*PI);
+ ElCLib::Value(2.*M_PI,Circ),2*M_PI,Tol);
+ D1.SetEquivalentParameters(0.,2.*M_PI);
firstparam = Max(TheTool::FirstParameter(OnCurv),thefirst);
lastparam = Min(TheTool::LastParameter(OnCurv),thelast);
IntRes2d_Domain D2(TheTool::Value(OnCurv,firstparam),firstparam,Tol,
Ufirst(1) = Param1;
Ufirst(2) = Param2;
Ufirst(3) = Param3;
- tol(1) = 2.e-15*PI;
+ tol(1) = 2.e-15*M_PI;
tol(2) = TheCurveTool::EpsX(Cu2,Abs(Tolerance));
tol(3) = 1.e-15;
tol(4) = Tol/10.;
Ufirst(1) = Param1;
Ufirst(2) = Param2;
Ufirst(3) = Param3;
- tol(1) = 2.e-15*PI;
+ tol(1) = 2.e-15*M_PI;
tol(2) = TheCurveTool::EpsX(Cu2,Abs(Tolerance));
- tol(3) = 2.e-15*PI;
+ tol(3) = 2.e-15*M_PI;
tol(4) = Tol/10.;
gp_Pnt2d point1 = ElCLib::Value(Param1,C1);
gp_Pnt2d point2 = TheCurveTool::Value(Cu2,Param2);
Ufirst(3) = Param3;
tol(1) = 1.e-15;
tol(2) = TheCurveTool::EpsX(Cu2,Abs(Tolerance));
- tol(3) = 2.e-15*PI;
+ tol(3) = 2.e-15*M_PI;
tol(4) = Tol/10.;
gp_Pnt2d point1 = ElCLib::Value(Param1,L1);
gp_Pnt2d point2 = TheCurveTool::Value(Cu2,Param2);
Ufirst(3) = Param3;
tol(1) = TheCurveTool::EpsX(Cu1,Abs(Tolerance));
tol(2) = TheCurveTool::EpsX(Cu2,Abs(Tolerance));
- tol(3) = 2.e-15*PI;
+ tol(3) = 2.e-15*M_PI;
tol(4) = Tol/10.;
gp_Pnt2d point1 = TheCurveTool::Value(Cu1,Param1);
gp_Pnt2d point2 = TheCurveTool::Value(Cu2,Param2);
Ufirst(1) = Param1;
Ufirst(2) = Param2;
tol(1) = TheCurveTool::EpsX(Cu1,Abs(Tolerance));
- tol(2) = 2.e-15*PI;
+ tol(2) = 2.e-15*M_PI;
tol(3) = Tol/10.;
gp_Pnt2d point1 = TheCurveTool::Value(Cu1,Param1);
gp_Pnt2d point3 = ElCLib::Value(Param2,OnCirc);
Ufirst(1) = Param1;
Ufirst(2) = Param2;
Ufirst(3) = ParamOn;
- tol(1) = 2.e-15*PI;
+ tol(1) = 2.e-15*M_PI;
tol(2) = TheCurveTool::EpsX(Cu2,Abs(Tolerance));
tol(3) = TheCurveTool::EpsX(OnCurv,Abs(Tolerance));
tol(4) = Tol/10.;;
Umin(1) = 0.;
Umin(2) = TheCurveTool::FirstParameter(Cu2);
Umin(3) = TheCurveTool::FirstParameter(Cu3);
- Umax(1) = 2*PI;
+ Umax(1) = 2*M_PI;
Umax(2) = TheCurveTool::LastParameter(Cu2);
Umax(3) = TheCurveTool::LastParameter(Cu3);
Ufirst(1) = Param1;
Ufirst(2) = Param2;
Ufirst(3) = Param3;
- tol(1) = 2.e-15*PI;
+ tol(1) = 2.e-15*M_PI;
tol(2) = TheCurveTool::EpsX(Cu2,Abs(Tolerance));
tol(3) = TheCurveTool::EpsX(Cu3,Abs(Tolerance));
math_FunctionSetRoot Root(Func,Ufirst,tol,Umin,Umax);
Umin(1) = 0.;
Umin(2) = 0.;
Umin(3) = TheCurveTool::FirstParameter(Cu3);
- Umax(1) = 2*PI;
- Umax(2) = 2*PI;
+ Umax(1) = 2*M_PI;
+ Umax(2) = 2*M_PI;
Umax(3) = TheCurveTool::LastParameter(Cu3);
Ufirst(1) = Param1;
Ufirst(2) = Param2;
Ufirst(3) = Param3;
- tol(1) = 2.e-15*PI;
- tol(2) = 2.e-15*PI;
+ tol(1) = 2.e-15*M_PI;
+ tol(2) = 2.e-15*M_PI;
tol(3) = TheCurveTool::EpsX(Cu3,Abs(Tolerance));
math_FunctionSetRoot Root(Func,Ufirst,tol,Umin,Umax);
if (Root.IsDone()) {
Umin(1) = 0.;
Umin(2) = TheCurveTool::FirstParameter(Cu1);
Umin(3) = TheCurveTool::FirstParameter(Cu2);
- Umax(1) = 2*PI;
+ Umax(1) = 2*M_PI;
Umax(2) = TheCurveTool::LastParameter(Cu1);
Umax(3) = TheCurveTool::LastParameter(Cu2);
- Ufirst(1) = PI;
+ Ufirst(1) = M_PI;
Ufirst(2) = Param1;
Ufirst(3) = Param2;
- tol(1) = 2.e-15*PI;
+ tol(1) = 2.e-15*M_PI;
tol(2) = TheCurveTool::EpsX(Cu1,Abs(Tolerance));
tol(3) = TheCurveTool::EpsX(Cu2,Abs(Tolerance));
math_FunctionSetRoot Root(Func,Ufirst,tol,Umin,Umax);
Umin(1) = 0.;
Umin(2) = 0.;
Umin(3) = TheCurveTool::FirstParameter(Cu1);
- Umax(1) = 2*PI;
- Umax(2) = 2*PI;
+ Umax(1) = 2*M_PI;
+ Umax(2) = 2*M_PI;
Umax(3) = TheCurveTool::LastParameter(Cu1);
- Ufirst(1) = PI;
- Ufirst(2) = PI;
+ Ufirst(1) = M_PI;
+ Ufirst(2) = M_PI;
Ufirst(3) = Param1;
- tol(1) = 2.e-15*PI;
- tol(2) = 2.e-15*PI;
+ tol(1) = 2.e-15*M_PI;
+ tol(2) = 2.e-15*M_PI;
tol(3) = TheCurveTool::EpsX(Cu1,Abs(Tolerance));
math_FunctionSetRoot Root(Func,Ufirst,tol,Umin,Umax);
if (Root.IsDone()) {
Umin(1) = 0.;
Umax(2) = RealLast();
Umax(3) = TheCurveTool::LastParameter(Cu2);
- Umax(1) = 2*PI;
+ Umax(1) = 2*M_PI;
Ufirst(2) = Param1;
Ufirst(3) = Param2;
- Ufirst(1) = PI;
+ Ufirst(1) = M_PI;
tol(1) = 2.e-15;
tol(2) = 1.e-15;
tol(3) = TheCurveTool::EpsX(Cu2,Abs(Tolerance));
Umin(1) = 0.;
Umin(2) = RealFirst();
Umin(3) = TheCurveTool::FirstParameter(Cu3);
- Umax(1) = 2*PI;
+ Umax(1) = 2*M_PI;
Umax(2) = RealLast();
Umax(3) = TheCurveTool::LastParameter(Cu3);
Ufirst(1) = Param1;
Ufirst(2) = Param2;
Ufirst(3) = Param3;
- tol(1) = 2.e-15*PI;
+ tol(1) = 2.e-15*M_PI;
tol(2) = 1.e-15;
tol(3) = TheCurveTool::EpsX(Cu3,Abs(Tolerance));
math_FunctionSetRoot Root(Func,Ufirst,tol,Umin,Umax);
Umin(1) = 0.;
Umin(3) = TheCurveTool::FirstParameter(Cu2);
Umin(2) = 0.;
- Umax(1) = 2*PI;
+ Umax(1) = 2*M_PI;
Umax(3) = TheCurveTool::LastParameter(Cu2);
- Umax(2) = 2*PI;
+ Umax(2) = 2*M_PI;
Ufirst(1) = Param1;
- Ufirst(2) = PI;
+ Ufirst(2) = M_PI;
Ufirst(3) = Param2;
- tol(1) = 2.e-15*PI;
- tol(2) = 2.e-15*PI;
+ tol(1) = 2.e-15*M_PI;
+ tol(2) = 2.e-15*M_PI;
tol(3) = TheCurveTool::EpsX(Cu2,Abs(Tolerance));
math_FunctionSetRoot Root(Func,Ufirst,tol,Umin,Umax);
if (Root.IsDone()) {
Standard_Real B = Dir.Y();
gp_Dir2d TheDirection(Dir);
if (Abs(Angle) > Abs(TolAng)) {
- if (Abs(Abs(Angle)-PI) <= Abs(TolAng)) {
+ if (Abs(Abs(Angle)-M_PI) <= Abs(TolAng)) {
Paral2 = Standard_True;
TheDirection = Dir.Reversed();
}
- else if (Abs(Angle-PI/2) <= Abs(TolAng)) { TheDirection=gp_Dir2d(-B,A); }
- else if (Abs(Angle+PI/2) <= Abs(TolAng)) { TheDirection=gp_Dir2d(B,-A); }
+ else if (Abs(Angle-M_PI/2) <= Abs(TolAng)) { TheDirection=gp_Dir2d(-B,A); }
+ else if (Abs(Angle+M_PI/2) <= Abs(TolAng)) { TheDirection=gp_Dir2d(B,-A); }
else {
TheDirection=gp_Dir2d(A*Cos(Angle)-B*Sin(Angle),
A*Sin(Angle)+B*Cos(Angle));
Standard_Real Geom_Circle::ReversedParameter( const Standard_Real U) const
{
- return ( 2. * PI - U);
+ return ( 2. * M_PI - U);
}
//=======================================================================
//purpose :
//=======================================================================
-Standard_Real Geom_Circle::LastParameter () const { return 2.0 * PI; }
+Standard_Real Geom_Circle::LastParameter () const { return 2.0 * M_PI; }
//=======================================================================
radius(R), semiAngle (Ang)
{
- if (R < 0.0 || Abs(Ang) <= gp::Resolution() || Abs(Ang) >= PI/2.0 - gp::Resolution())
+ if (R < 0.0 || Abs(Ang) <= gp::Resolution() || Abs(Ang) >= M_PI/2.0 - gp::Resolution())
Standard_ConstructionError::Raise();
pos = A3;
Standard_Real Geom_ConicalSurface::UReversedParameter( const Standard_Real U) const
{
- return ( 2.*PI - U);
+ return ( 2.*M_PI - U);
}
void Geom_ConicalSurface::SetSemiAngle (const Standard_Real Ang) {
- if (Abs(Ang) <= gp::Resolution() || Abs(Ang) >= PI/2.0 - gp::Resolution()) {
+ if (Abs(Ang) <= gp::Resolution() || Abs(Ang) >= M_PI/2.0 - gp::Resolution()) {
Standard_ConstructionError::Raise();
}
semiAngle = Ang;
void Geom_ConicalSurface::Bounds (Standard_Real& U1, Standard_Real& U2,
Standard_Real& V1, Standard_Real& V2) const {
- U1 = 0.0; U2 = 2.0 * PI;
+ U1 = 0.0; U2 = 2.0 * M_PI;
V1 = -Precision::Infinite(); V2 = Precision::Infinite();
}
Standard_Real Geom_CylindricalSurface::UReversedParameter( const Standard_Real U) const
{
- return (2.*PI - U);
+ return (2.*M_PI - U);
}
//=======================================================================
void Geom_CylindricalSurface::Bounds (Standard_Real& U1, Standard_Real& U2,
Standard_Real& V1, Standard_Real& V2) const {
- U1 = 0.0; U2 = 2.0 * PI;
+ U1 = 0.0; U2 = 2.0 * M_PI;
V1 = - Precision::Infinite(); V2 = Precision::Infinite();
}
//purpose :
//=======================================================================
-Standard_Real Geom_Ellipse::LastParameter () const { return 2.0 * PI; }
+Standard_Real Geom_Ellipse::LastParameter () const { return 2.0 * M_PI; }
//=======================================================================
//function : MajorRadius
Standard_Real Geom_Ellipse::ReversedParameter( const Standard_Real U) const
{
- return ( 2. * PI - U);
+ return ( 2. * M_PI - U);
}
Result = new Geom_CylindricalSurface( Axis, Radius);
}
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->UReverse();
}
Result = new Geom_SphericalSurface(Axis, Radius);
}
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();
Result = new Geom_SphericalSurface(Axis, -Radius);
Result->UReverse();
Standard_Real Geom_SphericalSurface::UReversedParameter( const Standard_Real U) const
{
- return (2.*PI - U);
+ return (2.*M_PI - U);
}
//=======================================================================
//=======================================================================
Standard_Real Geom_SphericalSurface::Area () const
-{return 4.0 * PI * radius * radius;}
+{return 4.0 * M_PI * radius * radius;}
//=======================================================================
//function : Radius
Standard_Real& V1, Standard_Real& V2) const {
U1 = 0.0;
- U2 = PI * 2.0;
- V1 = -PI / 2.0;
- V2 = PI / 2.0;
+ U2 = M_PI * 2.0;
+ V1 = -M_PI / 2.0;
+ V2 = M_PI / 2.0;
}
Handle(Curve) Geom_SphericalSurface::UIso (const Standard_Real U) const
{
Handle(Geom_Circle) GC = new Geom_Circle(ElSLib::SphereUIso(pos,radius,U));
- Handle(Geom_TrimmedCurve) iso = new Geom_TrimmedCurve(GC,-PI/2.,PI/2);
+ Handle(Geom_TrimmedCurve) iso = new Geom_TrimmedCurve(GC,-M_PI/2.,M_PI/2);
return iso;
}
Standard_Real Geom_SphericalSurface::Volume () const {
- return (4.0 * PI * radius * radius * radius)/3.0;
+ return (4.0 * M_PI * radius * radius * radius)/3.0;
}
Standard_Real Geom_SurfaceOfRevolution::UReversedParameter (const Standard_Real U) const {
- return ( 2.*PI - U);
+ return ( 2.*M_PI - U);
}
Standard_Real& V2 ) const {
U1 = 0.0;
- U2 = 2.0 * PI;
+ U2 = 2.0 * M_PI;
V1 = basisCurve->FirstParameter();
V2 = basisCurve->LastParameter();
}
Standard_Real Geom_ToroidalSurface::UReversedParameter( const Standard_Real U) const {
- return (2.*PI - U);
+ return (2.*M_PI - U);
}
Standard_Real Geom_ToroidalSurface::VReversedParameter( const Standard_Real V) const {
- return (2.*PI - V);
+ return (2.*M_PI - V);
}
//=======================================================================
Standard_Real Geom_ToroidalSurface::Area () const {
- return 4.0 * PI * PI * minorRadius * majorRadius;
+ return 4.0 * M_PI * M_PI * minorRadius * majorRadius;
}
U1 = 0.0;
V1 = 0.0;
- U2 = 2*PI;
- V2 = 2*PI;
+ U2 = 2*M_PI;
+ V2 = 2*M_PI;
}
Standard_Real Geom_ToroidalSurface::Volume () const {
- return (PI * minorRadius * minorRadius) * (2.0 * PI * majorRadius);
+ return (M_PI * minorRadius * minorRadius) * (2.0 * M_PI * majorRadius);
}
Standard_Real Geom2d_Circle::ReversedParameter( const Standard_Real U) const
{
- return (2. * PI - U);
+ return (2. * M_PI - U);
}
//=======================================================================
Standard_Real Geom2d_Circle::LastParameter () const
{
- return 2.0 * PI;
+ return 2.0 * M_PI;
}
//=======================================================================
Standard_Real Geom2d_Ellipse::ReversedParameter( const Standard_Real U) const
{
- return (2. * PI - U);
+ return (2. * M_PI - U);
}
//=======================================================================
Standard_Real Geom2d_Ellipse::LastParameter () const
{
- return 2.0 * PI;
+ return 2.0 * M_PI;
}
//=======================================================================
if ( R > Ruv/2.)
return 2*ASin(Ruv/(2*R));
else
- return 2*PI;
+ return 2*M_PI;
}
case GeomAbs_Ellipse: {
return Ruv / (*((Handle(Geom2d_Ellipse)*)&myCurve))->MajorRadius();
if ( UFirst > ULast) Standard_ConstructionError::Raise();
load(C,UFirst,ULast);
-}
\ No newline at end of file
+}
if ( R > R3D/2. )
return 2*ASin(R3D/(2*R));
else
- return 2*PI;
+ return 2*M_PI;
}
case GeomAbs_Ellipse: {
return R3D / (*((Handle(Geom_Ellipse)*)&myCurve))->MajorRadius();
if ( Res <= 1.)
return 2.*ASin(Res);
- return 2.*PI;
+ return 2.*M_PI;
}
//=======================================================================
if ( Res <= 1.)
return 2.*ASin(Res);
- return 2.*PI;
+ return 2.*M_PI;
}
//=======================================================================
else if ( Parameterisation == Convert_QuasiAngular) {
Convert_EllipseToBSplineCurve Convert (E2d,
0.0e0,
- 2.0e0 * PI,
+ 2.0e0 * M_PI,
Parameterisation);
TheCurve = BSplineCurveBuilder (TheConic, Convert);
else if ( Parameterisation == Convert_QuasiAngular) {
Convert_CircleToBSplineCurve Convert (C2d,
0.0e0,
- 2.0e0 * PI,
+ 2.0e0 * M_PI,
Parameterisation);
TheCurve = BSplineCurveBuilder (TheConic, Convert);
if (Strim->IsUPeriodic()) {
NbUKnots = 4;
nbUSpans = 3;
- AlfaU = PI / 3.;
+ AlfaU = M_PI / 3.;
NbUPoles = 6;
periodic = Standard_True;
}
else {
// Nombre de spans : ouverture maximale = 150 degres ( = PI / 1.2 rds)
nbUSpans =
- (Standard_Integer)IntegerPart( 1.2 * (ULast - UFirst) / PI) + 1;
+ (Standard_Integer)IntegerPart( 1.2 * (ULast - UFirst) / M_PI) + 1;
AlfaU = (ULast - UFirst) / ( nbUSpans * 2);
NbUPoles = 2 * nbUSpans + 1;
NbUKnots = nbUSpans + 1;
Standard_Real AlfaU;
NbUKnots = 4;
nbUSpans = 3;
- AlfaU = PI / 3.;
+ AlfaU = M_PI / 3.;
NbUPoles = 6;
// Compute Knots and Mults
default:
{
Standard_Integer NbSpan =
- (Standard_Integer)(Ceiling(3.*Abs(MaxAng)/2./PI));
+ (Standard_Integer)(Ceiling(3.*Abs(MaxAng)/2./M_PI));
NbPoles = 2*NbSpan+1;
NbKnots = NbSpan+1;
Degree = 2;
// Recadrage sur ]-pi/2, 3pi/2]
if (Sina <0.) {
if (Cosa > 0.) Angle = -Angle;
- else Angle = 2.*PI - Angle;
+ else Angle = 2.*M_PI - Angle;
}
switch (TConv) {
// Recadrage sur ]-pi/2, 3pi/2]
if (Sina <0.) {
if (Cosa > 0.) Angle = -Angle;
- else Angle = 2.*PI - Angle;
+ else Angle = 2.*M_PI - Angle;
}
if (Abs(Sina)>Abs(Cosa)) {
// Recadrage sur ]-pi/2, 3pi/2]
if (Sina <0.) {
if (Cosa > 0.) Angle = -Angle;
- else Angle = 2.*PI - Angle;
+ else Angle = 2.*M_PI - Angle;
}
if (Abs(Sina)>Abs(Cosa)) {
// Type de convertion ?
if (Polynomial) myTConv=Convert_Polynomial;
- else if(maxang > 0.65*PI)
+ else if(maxang > 0.65*M_PI)
myTConv=Convert_QuasiAngular; //car c'est Continue
else myTConv = Convert_TgtThetaOver2;
//car c'est le plus performant
else bound[next]->Bounds(ln,fn);
bound[next]->D1(fn,pbid,tgn);
if(rev[next]) tgn.Reverse();
- Standard_Real ang = PI - tgi.Angle(tgn);
+ Standard_Real ang = M_PI - tgi.Angle(tgn);
stat[next].TgtAng(ang);
if(bound[i]->HasNormals() && bound[next]->HasNormals()){
stat[next].Constraint();
Standard_Real tolang = Min(bound[ip]->Tolang(),bound[i]->Tolang());
Standard_Real an = stat[i].NorAng();
Standard_Boolean twist = Standard_False;
- if(an >= 0.5*PI) { twist = Standard_True; an = PI-an; }
+ if(an >= 0.5*M_PI) { twist = Standard_True; an = M_PI-an; }
if(an > tolang) stat[i].DoKill(0.);
else{
Standard_Real fact = 0.5*27./4;
dout << seg;
#endif
if(vnor.Magnitude() > 1.e-15 && vtg.Magnitude() > 1.e-15){
- Standard_Real alpha = Abs(PI/2.-Abs(vnor.Angle(vtg)));
+ Standard_Real alpha = Abs(M_PI/2.-Abs(vnor.Angle(vtg)));
if(Abs(alpha) > maxang) maxang = Abs(alpha);
}
}
vapp.SetXYZ(pbid.XYZ());
vbound = bou->Norm(uu);
if(vapp.Magnitude() > 1.e-15 && vbound.Magnitude() > 1.e-15){
- Standard_Real alpha = Abs(PI/2.-Abs(vbound.Angle(vapp)));
+ Standard_Real alpha = Abs(M_PI/2.-Abs(vbound.Angle(vapp)));
if(Abs(alpha) > maxang) maxang = Abs(alpha);
}
#ifdef DRAW
cout<<"Controle approx/contrainte sur bord "<<I<<" : "<<endl;
cout<<"Distance max : "<<maxdist<<endl;
if (donor) {
- maxang = maxang*180./PI;
+ maxang = maxang*180./M_PI;
cout<<"Angle max : "<<maxang<<" deg"<<endl;
}
}
vres[k] = V1.Crossed(V2);
if(vres[k].Magnitude() > 1.e-15 && vbound[k].Magnitude() > 1.e-15){
Standard_Real alpha = Abs(vres[k].Angle(vbound[k]));
- alpha = Min(alpha,Abs(PI-alpha));
+ alpha = Min(alpha,Abs(M_PI-alpha));
if(alpha > maxang) maxang = alpha;
ang[k] = alpha;
hasang[k] = 1;
cout<<"Controle resultat/contrainte sur bord "<<I<<" : "<<endl;
cout<<"Distance max : "<<maxdist<<endl;
if (donor) {
- Standard_Real angdeg = maxang*180./PI;
+ Standard_Real angdeg = maxang*180./M_PI;
cout<<"Angle max : "<<angdeg<<" deg"<<endl;
}
#ifdef DRAW
currParam = Last;
frenet->D0(currParam, Tangent, Normal, BN);
- if (prevTangent.Angle(Tangent) < PI/3 || i == 1) {
+ if (prevTangent.Angle(Tangent) < M_PI/3 || i == 1) {
parameters.Append(currParam);
//OCC78
SeqPoles.Append(Param);
else
Normal_rot = Normal;
Standard_Real angleAT = Normal_rot.Angle(prevNormal);
- if(angleAT > Precision::Angular() && PI - angleAT > Precision::Angular())
+ if(angleAT > Precision::Angular() && M_PI - angleAT > Precision::Angular())
if (Normal_rot.Crossed(prevNormal).IsOpposite(prevTangent, Precision::Angular()))
angleAT = -angleAT;
return angleAT;
// Purpose : This family of functions produce conversion of angle utility
//===============================================================
static Standard_Real corrPI_2PI(Standard_Real Ang){
- return Ang = (Ang >= 0.0? Ang: 2*PI+Ang);
+ return Ang = (Ang >= 0.0? Ang: 2*M_PI+Ang);
};
static Standard_Real corr2PI_PI(Standard_Real Ang){
- return Ang = (Ang < PI? Ang: Ang-2*PI);
+ return Ang = (Ang < M_PI? Ang: Ang-2*M_PI);
};
static Standard_Real diffAng(Standard_Real A, Standard_Real Ao){
- Standard_Real dA = (A-Ao) - Floor((A-Ao)/2.0/PI)*2.0*PI;
+ Standard_Real dA = (A-Ao) - Floor((A-Ao)/2.0/M_PI)*2.0*M_PI;
return dA = dA >= 0? corr2PI_PI(dA): -corr2PI_PI(-dA);
};
//===============================================================
Standard_Real DAng = CalcAngleAT(Tangent, Normal, HArrTangent->Value(iC), HArrNormal->Value(iC));
Standard_Real DA = diffAng(DAng,dAng);
// The correction (there is core of OCC78 bug)
- if(Abs(DA) > PI/2.0){
+ if(Abs(DA) > M_PI/2.0){
AngP = AngPo + DAng;
};
return AngP;
//=======================================================================
void GeomFill_DraftTrihedron::SetAngle(const Standard_Real Angle)
{
- myAngle = PI/2 + Angle;
+ myAngle = M_PI/2 + Angle;
myCos = Cos(myAngle);
}
Handle(GeomFill_TrihedronLaw) GeomFill_DraftTrihedron::Copy() const
{
Handle(GeomFill_DraftTrihedron) copy =
- new (GeomFill_DraftTrihedron) (B,myAngle-PI/2);
+ new (GeomFill_DraftTrihedron) (B,myAngle-M_PI/2);
copy->SetCurve(myCurve);
return copy;
}
D0(U + h, T, N, BN);
- if(Tangent.Angle(T) > PI/2) TFlag = -1;
- if(BiNormal.Angle(BN) > PI/2) BNFlag = -1;
+ if(Tangent.Angle(T) > M_PI/2) TFlag = -1;
+ if(BiNormal.Angle(BN) > M_PI/2) BNFlag = -1;
return Standard_True;
}
(myGuide->GetType() == GeomAbs_Line)) {
Standard_Real Angle;
Angle = myCurve->Line().Angle(myGuide->Line());
- if ((Angle<1.e-12) || ((2*PI-Angle)<1.e-12) )
+ if ((Angle<1.e-12) || ((2*M_PI-Angle)<1.e-12) )
return Standard_True;
}
Inf(1) = myGuide->FirstParameter() - Delta/10;
Sup(1) = myGuide->LastParameter() + Delta/10;
- Inf(2) = -PI;
- Sup(2) = 3*PI;
+ Inf(2) = -M_PI;
+ Sup(2) = 3*M_PI;
Delta = Ul - Uf;
Inf(3) = Uf - Delta/10;
// d'angle le plus proche de P
PInt = Int.Point(1);
a1 = PInt.U();
- InGoodPeriod (CurAngle, 2*PI, a1);
+ InGoodPeriod (CurAngle, 2*M_PI, a1);
Standard_Real Dmin = Abs(a1-CurAngle);
for (Standard_Integer jj=2;jj<=Int.NbPoints();jj++) {
a2 = Int.Point(jj).U();
- InGoodPeriod (CurAngle, 2*PI, a2);
+ InGoodPeriod (CurAngle, 2*M_PI, a2);
if (Abs(a2-CurAngle) < Dmin) {
PInt = Int.Point(jj);
Dmin = Abs(a2-CurAngle);
Angle = PInt.U();
if (ii > 1) {
Diff = Angle - OldAngle;
- if (Abs(Diff) > PI) {
- InGoodPeriod (OldAngle, 2*PI, Angle);
+ if (Abs(Diff) > M_PI) {
+ InGoodPeriod (OldAngle, 2*M_PI, Angle);
Diff = Angle - OldAngle;
}
#if DEB
- if (Abs(Diff) > PI/4) {
+ if (Abs(Diff) > M_PI/4) {
cout << "Diff d'angle trop grand !!" << endl;
}
#endif
X(1) = ElCLib::InPeriod(X(1), myGuide->FirstParameter(),
myGuide->LastParameter());
}
- X(2) = ElCLib::InPeriod(X(2), 0, 2*PI);
+ X(2) = ElCLib::InPeriod(X(2), 0, 2*M_PI);
if (mySec->IsUPeriodic()) {
X(3) = ElCLib::InPeriod(X(3), Uf, Ul);
}
// Nouvelle methode
myAdpPath = new (GeomAdaptor_HCurve) (Path);
Handle(Geom_Circle) C = new (Geom_Circle) (gp::XOY(), Radius);
- C->Rotate(gp::OZ(),PI/2.);
+ C->Rotate(gp::OZ(),M_PI/2.);
mySec = new (GeomFill_UniformSection) (C, Path->FirstParameter(),
Path->LastParameter());
Axis.YReverse();
// rotate the surface to set the iso U = 0 not in the result.
- Axis.Rotate(gp_Ax1(P0,ZRef),-PI/2.);
+ Axis.Rotate(gp_Ax1(P0,ZRef),-M_PI/2.);
mySurface = new Geom_CylindricalSurface( Axis, myRadius);
Standard_Real Alpha = V1.AngleWithRef(V2,ZRef);
mySurface =
new Geom_RectangularTrimmedSurface(mySurface,
- PI/2. ,
- PI/2. + Alpha,
+ M_PI/2. ,
+ M_PI/2. + Alpha,
myAdpPath->FirstParameter(),
myAdpPath->LastParameter());
Ok = Standard_True; //C'est bien un cylindre
if (deltaV < 0.) {
T.VReverse();
VV1 = -VV1;
- VV2 = 2*PI + VV1 - deltaV;
+ VV2 = 2*M_PI + VV1 - deltaV;
}
mySurface = new Geom_RectangularTrimmedSurface
(new Geom_ToroidalSurface(T),
beta5 = beta3*beta2;
beta6 = beta3*beta3;
- if ((PI/2 - beta)> NullAngle) {
+ if ((M_PI/2 - beta)> NullAngle) {
if (Abs(beta) < NullAngle) {
Standard_Real cf = 2.0/(3*5*7);
b = - (0.2+cf*beta2) / (1+ 0.2*beta2);
else {
b = ((Standard_Real) -1)/beta2;
bpr = (2*betaprim) / beta3;
- if ((PI/2 - beta)> NullAngle) {
+ if ((M_PI/2 - beta)> NullAngle) {
tan_b = Tan(beta);
dtan_b = betaprim * (1 + tan_b*tan_b);
b2 = tan_b - beta;
b = ((Standard_Real) -1)/beta2;
bpr = (2*betaprim) / beta3;
bsc = (2*betasecn - 6*betaprim*(betaprim/beta)) / beta3;
- if ((PI/2 - beta)> NullAngle) {
+ if ((M_PI/2 - beta)> NullAngle) {
tan_b = Tan(beta);
dtan_b = betaprim * (1 + tan_b*tan_b);
d2tan_b = betasecn * (1 + tan_b*tan_b)
penal = dist + 2;
if (angle > 1.e-3) {
- penal += 1./angle -2./PI;
+ penal += 1./angle -2./M_PI;
}
else {
penal += 1.e3;
{
Standard_Real angle;
angle = V1.Angle(V2);
- if (angle > PI/2) angle = PI - angle;
+ if (angle > M_PI/2) angle = M_PI - angle;
return angle;
}
{
Extrema_ExtPC Projector(myPoint, Path->Curve(), Precision::Confusion());
DistMini( Projector, Path->Curve(), Dist, PathParam );
- AngleMax = PI/2;
+ AngleMax = M_PI/2;
}
else
{
}
}
AngleMax = EvalAngle(VRef, dp1);
- if (isplan) AngleMax = PI/2 - AngleMax;
+ if (isplan) AngleMax = M_PI/2 - AngleMax;
Standard_Boolean Trouve = Standard_False;
Standard_Integer ii;
}
}
AngleMax = EvalAngle(VRef, dp1);
- AngleMax = PI/2 - AngleMax;
+ AngleMax = M_PI/2 - AngleMax;
}
}
Tangente(Path->Curve(), Path->LastParameter(), P, dp1);
V1.SetXYZ(TheAxe.Location().XYZ()-P.XYZ());
if (Abs(V1.Dot(VRef)) <= DistPlan ) { // On prend l'autre extremite
- alpha = PI/2 - EvalAngle(VRef, dp1);
+ alpha = M_PI/2 - EvalAngle(VRef, dp1);
distaux = PonPath.Distance(PonSec);
if (distaux > Tol) {
myExt.Perform(P);
w = Intersector.Point(ii).W();
//(1.3) test d'angle
Tangente( Path->Curve(), w, P, V);
- alpha = PI/2 - EvalAngle(V, VRef);
+ alpha = M_PI/2 - EvalAngle(V, VRef);
//(1.4) Test de distance Point-Courbe
myExt.Perform(P);
if ( myExt.IsDone() ) {
{
gp_Pnt PonPath = Path->Value( PathParam );
Dist = PonPath.Distance(myPoint);
- AngleMax = PI/2;
+ AngleMax = M_PI/2;
}
else
{
}
}
AngleMax = EvalAngle(VRef, dp1);
- if (isplan) AngleMax = PI/2 - AngleMax;
+ if (isplan) AngleMax = M_PI/2 - AngleMax;
}
done = Standard_True;
IsOpposite(axe.Direction(), 0.1) ) {
Standard_Real f, l;
// L'orientation parametrique est inversee
- l = 2*PI - UFirst;
- f = 2*PI - ULast;
+ l = 2*M_PI - UFirst;
+ f = 2*M_PI - ULast;
UFirst = f;
ULast = l;
isUReversed = Standard_True;
gp_Vec L(P1, P2), Dir(Centre1,Centre2);
Angle = L.Angle(Dir);
- if ((Angle > 0.01) && (Angle < PI/2-0.01)) {
+ if ((Angle > 0.01) && (Angle < M_PI/2-0.01)) {
if (R2<R1) Angle = -Angle;
SError = error;
gp_Ax3 Axis(Centre0, Dir, N);
if (isUReversed ) {
Standard_Real f, l;
// L'orientation parametrique est inversee
- l = 2*PI - UFirst;
- f = 2*PI - ULast;
+ l = 2*M_PI - UFirst;
+ f = 2*M_PI - ULast;
UFirst = f;
ULast = l;
}
if (mySec->IsConstant(error)) {
// La trajectoire
gp_Pnt Centre;
- isVPeriodic = (Abs(Last-First -2*PI) < 1.e-15);
+ isVPeriodic = (Abs(Last-First -2*M_PI) < 1.e-15);
Standard_Real RotRadius;
gp_Vec DP, DS, DN;
myLoc->D0(0.1, M, DS);
if (C.Position().Direction().
IsOpposite(AxisOfSphere.YDirection(), 0.1) ) {
// L'orientation parametrique est inversee
- l = 2*PI - UFirst;
- f = 2*PI - ULast;
+ l = 2*M_PI - UFirst;
+ f = 2*M_PI - ULast;
isUReversed = Standard_True;
}
// On calcul le "glissement" parametrique.
f -= rot;
l -= rot;
- if ( (f >= -PI/2) && (l <= PI/2)) {
+ if ( (f >= -M_PI/2) && (l <= M_PI/2)) {
Ok = Standard_True;
myExchUV = Standard_True;
UFirst = f;
IsOpposite(axeiso.Direction(), 0.1) ) {
Standard_Real f, l;
// L'orientation parametrique est inversee
- l = 2*PI - UFirst;
- f = 2*PI - ULast;
+ l = 2*M_PI - UFirst;
+ f = 2*M_PI - ULast;
UFirst = f;
ULast = l;
isUReversed = Standard_True;
else {
// On evalue l'angle du cone
Standard_Real Angle = Abs(Dir.Angle(L));
- if (Angle > PI/2) Angle = PI -Angle;
+ if (Angle > M_PI/2) Angle = M_PI -Angle;
if (reverse) Angle = -Angle;
aux = DS.Dot(DL);
if (aux < 0) {
Angle = - Angle;
}
- if (Abs(Abs(Angle) - PI/2) > 0.01) {
+ if (Abs(Abs(Angle) - M_PI/2) > 0.01) {
// (2.2.b) Cone
// si les 2 droites ne sont pas orthogonales
Standard_Real Radius = CentreOfSurf.Distance(L.Location());
myFirstSect = GeomConvert::CurveToBSplineCurve(Circ);
// le cercle est segmente car AppBlend_AppSurf ne gere
// pas les courbes periodiques.
- myFirstSect->Segment(0., 2.*PI);
+ myFirstSect->Segment(0., 2.*M_PI);
*/
Handle(Geom_TrimmedCurve) Circ =
new Geom_TrimmedCurve(new Geom_Circle( CircleAxis, myRadius),
- 0., 2.*PI);
+ 0., 2.*M_PI);
myFirstSect = GeomConvert::CurveToBSplineCurve(Circ,Convert_QuasiAngular);
}
{
/*
if (myType == 1) {
- Standard_Real U = 2.*PI/3.;
+ Standard_Real U = 2.*M_PI/3.;
for ( Standard_Integer i = 1; i <= 4; i++)
TKnots(i) = ( i-1) * U;
}
//
aRealEpsilon=RealEpsilon();
aNul=0.;
- aPeriod=PI+PI;
+ aPeriod=M_PI+M_PI;
//
aNbParts=myLConstruct.NbParts();
//
slineS2.Append(H1);
}
//==============================================
- } //if (Abs(fprm) > RealEpsilon() || Abs(lprm-2.*PI) > RealEpsilon())
+ } //if (Abs(fprm) > RealEpsilon() || Abs(lprm-2.*M_PI) > RealEpsilon())
//
else {// on regarde si on garde
//
if (aNbParts==1) {
- if (Abs(fprm) < RealEpsilon() && Abs(lprm-2.*PI) < RealEpsilon()) {
+ if (Abs(fprm) < RealEpsilon() && Abs(lprm-2.*M_PI) < RealEpsilon()) {
Handle(Geom_TrimmedCurve) aTC3D=new Geom_TrimmedCurve(newc,fprm,lprm);
//
sline.Append(aTC3D);
//
Standard_Real aTwoPIdiv17, u1, v1, u2, v2, TolX;
//
- aTwoPIdiv17=2.*PI/17.;
+ aTwoPIdiv17=2.*M_PI/17.;
//
for (j=0; j<=17; j++) {
gp_Pnt ptref (newc->Value (j*aTwoPIdiv17));
else {
Standard_Real anAngle = aNewVec.Angle(aVecOld);
- if((fabs(anAngle) < (Standard_PI * 0.25)) && (aNewVec.Dot(aVecOld) > 0.)) {
+ if((fabs(anAngle) < (M_PI * 0.25)) && (aNewVec.Dot(aVecOld) > 0.)) {
if(bCheckAngle1) {
Standard_Real U1, U2, V1, V2;
}
}
if(myHS1IsUPeriodic) {
- const Standard_Real lmf = PI+PI; //-- myHS1->UPeriod();
+ const Standard_Real lmf = M_PI+M_PI; //-- myHS1->UPeriod();
const Standard_Real f = myHS1->FirstUParameter();
const Standard_Real l = myHS1->LastUParameter();
while(u1 < f) { u1+=lmf; }
while(u1 > l) { u1-=lmf; }
}
if(myHS1IsVPeriodic) {
- const Standard_Real lmf = PI+PI; //-- myHS1->VPeriod();
+ const Standard_Real lmf = M_PI+M_PI; //-- myHS1->VPeriod();
const Standard_Real f = myHS1->FirstVParameter();
const Standard_Real l = myHS1->LastVParameter();
while(v1 < f) { v1+=lmf; }
while(v1 > l) { v1-=lmf; }
}
if(myHS2IsUPeriodic) {
- const Standard_Real lmf = PI+PI; //-- myHS2->UPeriod();
+ const Standard_Real lmf = M_PI+M_PI; //-- myHS2->UPeriod();
const Standard_Real f = myHS2->FirstUParameter();
const Standard_Real l = myHS2->LastUParameter();
while(u2 < f) { u2+=lmf; }
while(u2 > l) { u2-=lmf; }
}
if(myHS2IsVPeriodic) {
- const Standard_Real lmf = PI+PI; //-- myHS2->VPeriod();
+ const Standard_Real lmf = M_PI+M_PI; //-- myHS2->VPeriod();
const Standard_Real f = myHS2->FirstVParameter();
const Standard_Real l = myHS2->LastVParameter();
while(v2 < f) { v2+=lmf; }
if(typl == IntPatch_Circle || typl == IntPatch_Ellipse)
{
firstp = GeomInt_LineTool::Vertex(L,nbvtx).ParameterOnLine();
- lastp = PI + PI + GeomInt_LineTool::Vertex(L,1).ParameterOnLine();
+ lastp = M_PI + M_PI + GeomInt_LineTool::Vertex(L,1).ParameterOnLine();
const Standard_Real cadrinf = GeomInt_LineTool::FirstParameter(L);
const Standard_Real cadrsup = GeomInt_LineTool::LastParameter(L);
Standard_Real acadr = (firstp+lastp)*0.5;
- while(acadr < cadrinf) { acadr+=PI+PI; }
- while(acadr > cadrsup) { acadr-=PI+PI; }
+ while(acadr < cadrinf) { acadr+=M_PI+M_PI; }
+ while(acadr > cadrsup) { acadr-=M_PI+M_PI; }
if(acadr>=cadrinf && acadr<=cadrsup)
{
if(Abs(firstp-lastp)>Precision::PConfusion())
}
}
if (changevtx) {
- thevtx.SetParameter(prm + 2.*PI);
+ thevtx.SetParameter(prm + 2.*M_PI);
glin->Replace(i,thevtx);
}
}
return Precision::Infinite();
case IntPatch_Circle:
case IntPatch_Ellipse:
- return 2.*PI;
+ return 2.*M_PI;
default: break;
}
}
gp_Dir du(DU);
Standard_Real Angle1 = du.Angle(DX);
Standard_Real Angle2 = du.Angle(DY);
- if (Angle1 > PI/2) Angle1 = PI-Angle1;
- if (Angle2 > PI/2) Angle2 = PI-Angle2;
+ if (Angle1 > M_PI/2) Angle1 = M_PI-Angle1;
+ if (Angle2 > M_PI/2) Angle2 = M_PI-Angle2;
if (Angle2 < Angle1) {
du = DY; DY = DX; DX = du;
}
- if (DX.Angle(DU) > PI/2) DX.Reverse();
- if (DY.Angle(DV) > PI/2) DY.Reverse();
+ if (DX.Angle(DU) > M_PI/2) DX.Reverse();
+ if (DY.Angle(DV) > M_PI/2) DY.Reverse();
gp_Ax3 axe(Bary, DX^DY, DX);
Plan.SetPosition(axe);
Dn = DU^DV;
if (Dn.Magnitude() > 1.e-7) {
Standard_Real angle = Dir.Angle(Dn);
- if (angle > PI/2) {
- angle = PI - angle;
+ if (angle > M_PI/2) {
+ angle = M_PI - angle;
Dir.Reverse();
}
Essai = (angle < 0.1);
}
gp_Vec OZ1 = A;
Standard_Real theAngle = OZ.Angle( OZ1 );
- if (theAngle > PI/2)
- theAngle = PI - theAngle;
- if (theAngle > PI/3)
+ if (theAngle > M_PI/2)
+ theAngle = M_PI - theAngle;
+ if (theAngle > M_PI/3)
OZ = OZ1;
}
}
d->ChangeValue(i) = Pf.Distance(Pi);
v3i = v1i^v2i; v3f=v1f^v2f;
Standard_Real angle=v3f.Angle(v3i);
- if (angle>(PI/2))
- an->ChangeValue(i) = PI -angle;
+ if (angle>(M_PI/2))
+ an->ChangeValue(i) = M_PI -angle;
else
an->ChangeValue(i) = angle;
courb->Init(0);
myLinCont->Value(j)->D2( int2d.ParamOnSecond(), P2, v21, v22, v23, v24, v25 );
v16=v11^v12;v26=v21^v22;
Standard_Real ant=v16.Angle(v26);
- if (ant>(PI/2))
- ant= PI -ant;
+ if (ant>(M_PI/2))
+ ant= M_PI -ant;
if ((Abs(v16*v15-v16*v25)>(myTol3d/1000))
||(Abs(ant)>myTol3d/1000))
// Pas compatible ==> on enleve une zone en
myLinCont->Value(i)->Curve2dOnSurf()->D1( int2d.ParamOnFirst(), P1, V1);
myLinCont->Value(j)->Curve2dOnSurf()->D1( int2d.ParamOnSecond(), P2, V2);
A1 = V1.Angle(V2);
- if (A1>(PI/2))
- A1= PI - A1;
- if (Abs(Abs(A1)-PI)<myTolAng) Tol = 100000 * myTol3d;
+ if (A1>(M_PI/2))
+ A1= M_PI - A1;
+ if (Abs(Abs(A1)-M_PI)<myTolAng) Tol = 100000 * myTol3d;
#if PLATE_DEB
if (Affich) cout <<"Angle entre Courbe "<<i<<","<<j
- <<" "<<Abs(Abs(A1)-PI)<<endl;
+ <<" "<<Abs(Abs(A1)-M_PI)<<endl;
#endif
coin = Ci.Resolution(Tol);
}
N = vecU ^ vecV;
Standard_Real Angle = vec.Angle( N );
- Angle = Abs( PI/2-Angle );
+ Angle = Abs( M_PI/2-Angle );
if (Angle > myTolAng/10.) //????????? //if (Abs( scal ) > myTol3d/100)
{ // Pas compatible ==> on enleve une zone en
// contrainte G0 et G1 correspondant
myLinCont->Value(i)->Curve2dOnSurf()->D1( int2d.ParamOnFirst(), P1, V1);
myLinCont->Value(j)->Curve2dOnSurf()->D1( int2d.ParamOnSecond(), P2, V2);
A1 = V1.Angle( V2 );
- if (A1 > PI/2)
- A1= PI - A1;
- if (Abs(Abs(A1) - PI) < myTolAng) Tol = 100000 * myTol3d;
+ if (A1 > M_PI/2)
+ A1= M_PI - A1;
+ if (Abs(Abs(A1) - M_PI) < myTolAng) Tol = 100000 * myTol3d;
#if PLATE_DEB
if (Affich) cout <<"Angle entre Courbe "<<i<<","<<j
- <<" "<<Abs(Abs(A1)-PI)<<endl;
+ <<" "<<Abs(Abs(A1)-M_PI)<<endl;
#endif
if (myLinCont->Value(i)->Order() == 1)
{
tabP2d(Nbint+1).SetX(Length2d);
for (ii = 2; ii<= Nbint; ii++) {
- U = Uinit + (Ufinal-Uinit)*((1-Cos((ii-1)*PI/(Nbint)))/2);
+ U = Uinit + (Ufinal-Uinit)*((1-Cos((ii-1)*M_PI/(Nbint)))/2);
tabP2d(ii).SetY(U);
/* if (!HC2d.IsNull()) {
Standard_Real L = GCPnts_AbscissaPoint::Length(HC2d->Curve2d(), Uinit, U);
for (Standard_Integer j=1; j<=NbPnt_i; j++)
{ // repartition des points en cosinus selon l'ACR 2d
// Afin d'eviter les points d'acumulation dans le 2d
- //Inter=Uinit+(Uif)*((-cos(PI*((j-1)/(NbPnt_i-1)))+1)/2);
+ //Inter=Uinit+(Uif)*((-cos(M_PI*((j-1)/(NbPnt_i-1)))+1)/2);
if (j==NbPnt_i)
Inter=Ufinal;//pour parer au bug sur sun
else if (ACR) {
- CurLength = Length2d*(1-Cos((j-1)*PI/(NbPnt_i-1)))/2;
+ CurLength = Length2d*(1-Cos((j-1)*M_PI/(NbPnt_i-1)))/2;
Inter = acrlaw->Value(CurLength);
}
else {
- Inter=Uinit+(Ufinal-Uinit)*((1-Cos((j-1)*PI/(NbPnt_i-1)))/2);
+ Inter=Uinit+(Ufinal-Uinit)*((1-Cos((j-1)*M_PI/(NbPnt_i-1)))/2);
}
myParCont->ChangeValue(i).Append(Inter);// on ajoute le point
if (NbPtInter!=0)
Dist = Pf.Distance(Pi);
v3i = v1i^v2i; v3f=v1f^v2f;
Ang=v3f.Angle(v3i);
- if (Ang>(PI/2))
- Ang = PI -Ang;
+ if (Ang>(M_PI/2))
+ Ang = M_PI -Ang;
break;
case 2 :
Handle(Geom_Surface) Splate;
v2s.SetCoord(3,Digit[2]);
v3s=v1s^v2s;
- if( v3s.Angle(v3h)>(PI/2)) {
- if ((PI-v3s.Angle(v3h))>ang) {
- ang=(PI-v3s.Angle(v3h));
+ if( v3s.Angle(v3h)>(M_PI/2)) {
+ if ((M_PI-v3s.Angle(v3h))>ang) {
+ ang=(M_PI-v3s.Angle(v3h));
}
}
else {
//gka BUG 6542 1.09.04 BSpline curve was written in the IGES instead circle.
gp_Pnt pfirst,plast;
start->D0(U1,pfirst);
- if(Abs (Ufin - Udeb - 2 * PI) <= Precision::PConfusion())
+ if(Abs (Ufin - Udeb - 2 * M_PI) <= Precision::PConfusion())
plast = pfirst;
else
start->D0(U2,plast);
//#35 rln 22.10.98 BUC60391 face 9
//Closed Conic Arc is incorrectly oriented when reading back to CAS.CADE
- if (Abs (Ufin - Udeb - 2 * PI) <= Precision::PConfusion()) {
+ if (Abs (Ufin - Udeb - 2 * M_PI) <= Precision::PConfusion()) {
//#53 rln 24.12.98 CCI60005
//Trimmed ellipse. To avoid huge weights in B-Spline first rotate it and then convert
Handle(Geom_Ellipse) copystart = Handle(Geom_Ellipse)::DownCast (start->Copy());
gp_Ax2 pos = copystart->Position();
- copystart->SetPosition (pos.Rotated (pos.Axis(), gp_Ax3 (pos).Direct() ? Udeb : 2 * PI - Udeb));
+ copystart->SetPosition (pos.Rotated (pos.Axis(), gp_Ax3 (pos).Direct() ? Udeb : 2 * M_PI - Udeb));
Handle(Geom_BSplineCurve) Bspline;
//:q3 abv 17 Mar 99: use GeomConvert_ApproxCurve for precise conversion
GeomConvert_ApproxCurve approx (copystart, Precision::Approximation(),
GeomConvert::CurveToBSplineCurve (copystart, Convert_QuasiAngular);
TColStd_Array1OfReal Knots(1, Bspline->NbKnots());
Bspline->Knots (Knots);
- BSplCLib::Reparametrize (Udeb, Udeb + 2 * PI, Knots);
+ BSplCLib::Reparametrize (Udeb, Udeb + 2 * M_PI, Knots);
Bspline->SetKnots (Knots);
return TransferCurve (Bspline, Udeb, Ufin);
}
//Axis->Init(gp_XYZ(0.0, 0.0, 0.0), gp_XYZ(0.0, 0.0, 1.0/GetUnit()));
//Surf->Init (Axis, Generatrix, U1, U2);
Axis->Init(gp_XYZ (0, 0, 1. / GetUnit()), gp_XYZ (0, 0, 0));
- Surf->Init (Axis, Generatrix, 2 * PI - U2, 2 * PI - U1);
+ Surf->Init (Axis, Generatrix, 2 * M_PI - U2, 2 * M_PI - U1);
// creation de la Trsf (#124)
//Axis->Init(gp_XYZ(0.0, 0.0, 0.0), gp_XYZ(0.0, 0.0, 1.0/GetUnit()));
//Surf->Init (Axis, Generatrix, U1, U2);
Axis->Init(gp_XYZ (0, 0, 1. / GetUnit()), gp_XYZ (0, 0, 0));
- Surf->Init (Axis, Generatrix, 2 * PI - U2, 2 * PI - U1);
+ Surf->Init (Axis, Generatrix, 2 * M_PI - U2, 2 * M_PI - U1);
// creation de la Trsf (#124)
if ( Gen->IsKind(STANDARD_TYPE(IGESGeom_CircularArc))) {
//#30 rln 19.10.98 Surf->Init (Axis, Gen, U1, U2);
- Surf->Init (Axis, Gen, 2 * PI - U2, 2 * PI - U1);
+ Surf->Init (Axis, Gen, 2 * M_PI - U2, 2 * M_PI - U1);
IGESConvGeom_GeomBuilder Build;
Standard_Real xloc,yloc,zloc;
start->Sphere().Location().Coord(xloc,yloc,zloc);
//:l6 abv: CTS22022: writing full tori: if ( Gen->IsKind(STANDARD_TYPE(IGESGeom_CircularArc))) {
//#30 rln 19.10.98 Surf->Init (Axis, Gen, U1, U2);
- Surf->Init (Axis, Gen, 2 * PI - U2, 2 * PI - U1);
+ Surf->Init (Axis, Gen, 2 * M_PI - U2, 2 * M_PI - U1);
IGESConvGeom_GeomBuilder Build;
/* //:l6: useless
Standard_Real xloc,yloc,zloc;
Axis->Init(gp_XYZ(X1/GetUnit(),Y1/GetUnit(),Z1/GetUnit()),
gp_XYZ( (X1 - X2) / GetUnit(), (Y1 - Y2) / GetUnit(), (Z1 - Z2) / GetUnit()));
- Surf->Init (Axis, Generatrix, 2 * PI - U2, 2 * PI - U1);
+ Surf->Init (Axis, Generatrix, 2 * M_PI - U2, 2 * M_PI - U1);
res = Surf;
return res;
Handle(Geom_Direction) rdir = new Geom_Direction(XDir);//XAxe.Direction());
Handle(IGESGeom_Direction) refdir = GV.TransferVector(rdir);
- ConSurf->Init (aLocation, Axis, radius, angle*180./PI, refdir);
+ ConSurf->Init (aLocation, Axis, radius, angle*180./M_PI, refdir);
res = ConSurf;
return res;
}
aPosition = MkAxis.Value();
aRadius = CS->RefRadius();
aSemiAngle = CS->SemiAngle();
- if (aSemiAngle < 0. || aSemiAngle > PI/2.) {
+ if (aSemiAngle < 0. || aSemiAngle > M_PI/2.) {
Standard_DomainError::Raise("Conicalsurface not STEP conformant");
}
// Modification of the Trimming Parameters ?
// -----------------------------------------
- Standard_Real AngleFact = 180./PI;
+ Standard_Real AngleFact = 180./M_PI;
Standard_Real uFact = 1.;
Standard_Real vFact = 1.;
Standard_Real LengthFact = UnitsMethods::LengthFactor();
di << "Second argument must be a line";
return 1;
}
- Standard_Real ang = atof(a[4]) * PI180;
+ Standard_Real ang = atof(a[4]) * (M_PI / 180.0);
Geom2dGcc_Lin2dTanObl ct3(Geom2dGcc::Unqualified(C1),
L->Lin2d(),
Precision::Angular(),
if (! DrawTrSurf::GetPoint2d(cp2, P2) ) return 1;
FairCurve_Batten* Bat = new FairCurve_Batten (P1, P2, h);
- Bat->SetAngle1(a1*PI/180);
- Bat->SetAngle2(a2*PI/180);
+ Bat->SetAngle1(a1*M_PI/180);
+ Bat->SetAngle2(a2*M_PI/180);
Ok = Bat->Compute(Iana);
if (! DrawTrSurf::GetPoint2d(cp2, P2) ) return 1;
FairCurve_MinimalVariation* MVC = new FairCurve_MinimalVariation (P1, P2, h);
- MVC->SetAngle1(a1*PI/180);
- MVC->SetAngle2(a2*PI/180);
+ MVC->SetAngle1(a1*M_PI/180);
+ MVC->SetAngle2(a2*M_PI/180);
Ok = MVC->Compute(Iana);
Standard_Real par2 = atof(a[i+1]);
if (!strcasecmp(a[0],"cone")) {
- par1 *= PI180;
+ par1 *= (M_PI / 180.0);
Handle(Geom_ConicalSurface) C =
new Geom_ConicalSurface(loc,par1,par2);
result = C;
DoMinMax();
myFirstAngle = 0.;
- mySecondAngle = Standard_ShortReal(2.*Standard_PI);
+ mySecondAngle = Standard_ShortReal(2. * M_PI);
myisArc = Standard_False;
myNumOfElem = MAXPOINTS + 1;
myNumOfVert = 3;
myNumOfElem = MAXPOINTS + 1;
myNumOfVert = 3;
#ifdef PRO3730
- Standard_ShortReal TwoPI = Standard_ShortReal(2.*Standard_PI);
+ Standard_ShortReal TwoPI = Standard_ShortReal(2. * M_PI);
myFirstAngle = Standard_ShortReal (Alpha);
mySecondAngle = Standard_ShortReal (Beta);
while( myFirstAngle < 0. ) myFirstAngle += TwoPI;
- while( myFirstAngle > 2.*Standard_PI ) myFirstAngle -= TwoPI;
+ while( myFirstAngle > 2. * M_PI ) myFirstAngle -= TwoPI;
while( mySecondAngle < 0. ) mySecondAngle += TwoPI;
- while( mySecondAngle > 2.*Standard_PI ) mySecondAngle -= TwoPI;
+ while( mySecondAngle > 2. * M_PI ) mySecondAngle -= TwoPI;
if( mySecondAngle < myFirstAngle ) mySecondAngle += TwoPI;
if ( (mySecondAngle - myFirstAngle < ShortRealEpsilon()) ||
(mySecondAngle - myFirstAngle >= TwoPI) ) {
myMaxY = myMaxY < Ycur ? Ycur : myMaxY;
for( Acur = 0.,Xcur = 1.,Ycur = 0.;
- Acur < mySecondAngle; Acur += Standard_ShortReal(Standard_PI/2.) ) {
+ Acur < mySecondAngle; Acur += Standard_ShortReal(M_PI / 2.) ) {
if( Acur > myFirstAngle ) {
myMinX = ( myMinX < Xcur ? myMinX : Xcur );
myMaxX = ( myMaxX < Xcur ? Xcur : myMaxX );
E = Standard_Real (e); F = Standard_Real (f);
aTrsf.Transforms (A, B);
a = Standard_ShortReal (A); b = Standard_ShortReal (B);
- if( Abs(f-e) < Standard_ShortReal(2.*Standard_PI) ) {
+ if( Abs(f-e) < Standard_ShortReal(2. * M_PI) ) {
// To calculate new aperture angles
// the calculation is done on the trigonometric circle
// and in this case the translation is not taken into account
myY (Standard_ShortReal (Y)),
myRadius (Standard_ShortReal (Radius)),
myFirstAngle (0.0),
- mySecondAngle (Standard_ShortReal (2.*Standard_PI)) {
+ mySecondAngle (Standard_ShortReal (2. * M_PI)) {
if (myRadius <= RealEpsilon ())
Graphic2d_CircleDefinitionError::Raise ("The radius = 0.");
Standard_ShortReal mx,my,a1,a2,da;
mx = Standard_ShortReal(aDeltaX);
my = Standard_ShortReal(aDeltaY);
- a1 = (Angle1 >= 0.) ? Angle1 : Angle1 + Standard_ShortReal(2.*Standard_PI);
- a2 = (Angle2 >= 0.) ? Angle2 : Angle2 + Standard_ShortReal(2.*Standard_PI);
+ a1 = (Angle1 >= 0.) ? Angle1 : Angle1 + Standard_ShortReal(2. * M_PI);
+ a2 = (Angle2 >= 0.) ? Angle2 : Angle2 + Standard_ShortReal(2. * M_PI);
if( a2 > a1 ) {
da = a2 - a1;
} else if( a2 < a1 ) {
- da = Standard_ShortReal(2.*Standard_PI + a2 - a1);
+ da = Standard_ShortReal(2. * M_PI + a2 - a1);
} else {
- a1 = 0.; da = Standard_ShortReal(2.*Standard_PI);
+ a1 = 0.; da = Standard_ShortReal(2. * M_PI);
}
if( aRadius > 0. ) { // Try to use hardware first
Standard_ShortReal mx,my,a1,a2,da;
mx = Standard_ShortReal(aDeltaX);
my = Standard_ShortReal(aDeltaY);
- a1 = (Angle1 >= 0.) ? Angle1 : Angle1 + Standard_ShortReal(2.*Standard_PI);
- a2 = (Angle2 >= 0.) ? Angle2 : Angle2 + Standard_ShortReal(2.*Standard_PI);
+ a1 = (Angle1 >= 0.) ? Angle1 : Angle1 + Standard_ShortReal(2. * M_PI);
+ a2 = (Angle2 >= 0.) ? Angle2 : Angle2 + Standard_ShortReal(2. * M_PI);
if( a2 > a1 ) {
da = a2 - a1;
} else if( a2 < a1 ) {
- da = Standard_ShortReal(2.*Standard_PI + a2 - a1);
+ da = Standard_ShortReal(2. * M_PI + a2 - a1);
} else {
- a1 = 0.; da = Standard_ShortReal(2.*Standard_PI);
+ a1 = 0.; da = Standard_ShortReal(2. * M_PI);
}
if( aRadius > 0. ) { // Try to use hardware first
else {
Standard_ShortReal X1, Y1, X2, Y2;
Standard_Integer nbpoints = 360; // fobenselitmiter
- Standard_ShortReal teta = Standard_ShortReal(2 * Standard_PI / nbpoints);
+ Standard_ShortReal teta = Standard_ShortReal(2 * M_PI / nbpoints);
Standard_ShortReal x1 = Standard_ShortReal(myMajorRadius * Cos (myAngle));
Standard_ShortReal y1 = Standard_ShortReal(myMajorRadius * Sin (myAngle));
Standard_ShortReal x2, y2;
val = Max( 0.0044 , Min (0.7854 , 2. * ACos(1.-Def/myMajorRadius)));
else
val = 0.7854; // = PI/4.
- Standard_Integer nbpoints = Min(MAXPOINTS,Standard_Integer(2*Standard_PI/val)+2);
+ Standard_Integer nbpoints = Min(MAXPOINTS,Standard_Integer(2 * M_PI / val) + 2);
// Standard_Integer nbpoints = Max ( 8 ,Standard_Integer ( myMajorRadius / Def));
- Standard_ShortReal teta = Standard_ShortReal(2*Standard_PI /nbpoints);
+ Standard_ShortReal teta = Standard_ShortReal(2 * M_PI / nbpoints);
Standard_ShortReal x1 = Standard_ShortReal(myMajorRadius *Cos (myAngle)),
y1 = Standard_ShortReal(myMajorRadius *Sin (myAngle));
Standard_ShortReal x2,y2;
if(myMajorRadius > Def)
val = Max( 0.0044 , Min (0.7854 , 2. * ACos(1.-Def/myMajorRadius)));
else
- val = 0.7854; // = Standard_PI/4.
- Standard_Integer nbpoints = Min(MAXPOINTS,Standard_Integer(2*Standard_PI/val)+2);
+ val = 0.7854; // = PI/4.
+ Standard_Integer nbpoints = Min(MAXPOINTS,Standard_Integer(2 * M_PI / val)+2);
// Standard_Integer nbpoints = Max ( 8 ,Standard_Integer ( myMajorRadius / Def));
- Standard_ShortReal teta = Standard_ShortReal( 2*Standard_PI /nbpoints);
+ Standard_ShortReal teta = Standard_ShortReal(2 * M_PI / nbpoints);
Standard_ShortReal x1 = Standard_ShortReal( myMajorRadius *Cos (myAngle)),
y1 = Standard_ShortReal( myMajorRadius *Sin (myAngle));
Standard_ShortReal x2,y2;
if( type == Aspect_TOD_RELATIVE) {
precis = radius * coef;
}
- Standard_ShortReal value = Standard_ShortReal(Standard_PI/4.);
+ Standard_ShortReal value = Standard_ShortReal(M_PI / 4.);
if( radius > precis )
value = Standard_ShortReal(Max( 0.0044 ,
Min (0.7854 , 2. * ACos(1.-precis/radius))));
Standard_Integer n = Min(MAX_POINTS,
- Standard_Integer(2.*Standard_PI/value)+2);
- Standard_ShortReal da = Standard_ShortReal(2.*Standard_PI/n);
+ Standard_Integer(2. * M_PI / value)+2);
+ Standard_ShortReal da = Standard_ShortReal(2. * M_PI / n);
Standard_ShortReal cosin = Standard_ShortReal(Cos(da));
Standard_ShortReal x1 = radius;
Standard_ShortReal y1 = 0.;
cosin = prosca / norme1 / norme2;
if ( cosin >= 1 ) angle = 0.;
else {
- if ( cosin <= -1) angle = - Standard_PI;
+ if ( cosin <= -1) angle = - M_PI;
else
angle = Sign ( ACos ( cosin ) , provec );
}
myTextHScaleList(),
myTextWScaleList() {
- while (myAngle < 0.) myAngle += Standard_ShortReal( 2.*Standard_PI );
- while (myAngle >= 2.*Standard_PI) myAngle -= Standard_ShortReal( 2.*Standard_PI );
+ while (myAngle < 0.) myAngle += Standard_ShortReal( 2. * M_PI );
+ while (myAngle >= 2. * M_PI) myAngle -= Standard_ShortReal( 2. * M_PI );
SetZoomable() ;
SetSlant() ;
void Graphic2d_Paragraph::SetSlant (const Quantity_PlaneAngle aSlant) {
mySlant = Standard_ShortReal( aSlant );
- while (mySlant < 0.) mySlant += Standard_ShortReal( 2.*Standard_PI );
- while (mySlant >= 2.*Standard_PI) mySlant -= Standard_ShortReal( 2.*Standard_PI );
+ while (mySlant < 0.) mySlant += Standard_ShortReal( 2. * M_PI );
+ while (mySlant >= 2. * M_PI) mySlant -= Standard_ShortReal( 2. * M_PI );
}
void Graphic2d_Paragraph::SetSpacing (const Quantity_Ratio aSpacing) {
#define PRIMITIVE_PXX_INCLUDED
#define NEW_ANGLE(a) { \
- int quot = (int) (a/(2.*Standard_PI)); \
- if (Abs(quot) >= 1) a = a - 2.*Standard_PI*quot; \
+ int quot = (int) (a/(2. * M_PI)); \
+ if (Abs(quot) >= 1) a = a - 2. * M_PI * quot; \
}
#define REALEPSILON() (0.0001)
if (y < 0.) \
if (-y <= REALEPSILON ()) y = 0.; \
if (x == 0.) { \
- if (y > 0.) z = Standard_PI/2.; \
- else z = - Standard_PI/2.; \
+ if (y > 0.) z = M_PI / 2.; \
+ else z = - M_PI / 2.; \
} \
if (y == 0.) { \
if (x > 0.) z = 0.; \
- else z = Standard_PI; \
+ else z = M_PI; \
} \
if ((x < 0.) && (y > 0.)) { \
a = acos (x); \
- if ((a >= Standard_PI/2.-REALEPSILON ()) && \
- (a <= Standard_PI+REALEPSILON ())) \
+ if ((a >= M_PI / 2.-REALEPSILON ()) && \
+ (a <= M_PI + REALEPSILON ())) \
z = a; \
else \
z = - a; \
if ((x >= 0.) && (y > 0.)) { \
a = acos (x); \
if ((a >= 0.) && \
- (a <= Standard_PI/2.+REALEPSILON ())) \
+ (a <= M_PI / 2. + REALEPSILON ())) \
z = a; \
else \
z = - a; \
if ((x > 0.) && (y < 0.)) { \
a = acos (x); \
if ((a >= 0.) && \
- (a <= Standard_PI/2.+REALEPSILON ())) \
+ (a <= M_PI / 2. + REALEPSILON ())) \
z = - a; \
else \
z = a; \
SetFamily(Graphic2d_TOP_TEXT);
- while (myAngle < 0.) myAngle += Standard_ShortReal(2.*Standard_PI);
- while (myAngle >= 2.*Standard_PI) myAngle -= Standard_ShortReal(2.*Standard_PI);
+ while (myAngle < 0.) myAngle += Standard_ShortReal(2. * M_PI);
+ while (myAngle >= 2. * M_PI) myAngle -= Standard_ShortReal(2. * M_PI);
#ifndef PERF
this->ComputeMinMax();
void Graphic2d_Text::SetSlant (const Quantity_PlaneAngle aSlant) {
mySlant = Standard_ShortReal(aSlant);
- while (mySlant < 0.) mySlant += Standard_ShortReal(2.*Standard_PI);
- while (mySlant >= 2.*Standard_PI) mySlant -= Standard_ShortReal(2.*Standard_PI);
+ while (mySlant < 0.) mySlant += Standard_ShortReal(2. * M_PI);
+ while (mySlant >= 2. * M_PI) mySlant -= Standard_ShortReal(2. * M_PI);
#ifdef PERF
myMinX = myMinY = ShortRealLast ();
myMaxX = myMaxY = ShortRealFirst ();
myPrimitiveArray->vertices[i3].xyz[1],
myPrimitiveArray->vertices[i3].xyz[2]);
gp_Vec v21(p1,p2),v31(p1,p3),fn = v21.Crossed(v31);
- if( aNormal.IsOpposite(fn,Standard_PI/4.) ) {
+ if( aNormal.IsOpposite(fn, M_PI / 4.) ) {
Standard_Integer e; char v;
for( i=0,j=k-1 ; i<k/2 ; i++,j-- ) {
e = myPrimitiveArray->edges[n+i];
y = myPrimitiveArray->vnormals[e].xyz[1];
z = myPrimitiveArray->vnormals[e].xyz[2];
gp_Vec vn(x,y,z);
- if( aNormal.IsOpposite(vn,Standard_PI/4.) ) {
+ if( aNormal.IsOpposite(vn, M_PI / 4.) ) {
myPrimitiveArray->vnormals[e].xyz[0] = -x;
myPrimitiveArray->vnormals[e].xyz[1] = -y;
myPrimitiveArray->vnormals[e].xyz[2] = -z;
myPrimitiveArray->vertices[n+2].xyz[1],
myPrimitiveArray->vertices[n+2].xyz[2]);
gp_Vec v21(p1,p2),v31(p1,p3),fn = v21.Crossed(v31);
- if( aNormal.IsOpposite(fn,Standard_PI/4.) ) {
+ if( aNormal.IsOpposite(fn, M_PI / 4.) ) {
for( i=0,j=k-1 ; i<k/2 ; i++,j-- ) {
x = myPrimitiveArray->vertices[n+i].xyz[0];
y = myPrimitiveArray->vertices[n+i].xyz[1];
y = myPrimitiveArray->vnormals[n+i].xyz[1];
z = myPrimitiveArray->vnormals[n+i].xyz[2];
gp_Vec vn(x,y,z);
- if( aNormal.IsOpposite(vn,Standard_PI/4.) ) {
+ if( aNormal.IsOpposite(vn, M_PI / 4.) ) {
myPrimitiveArray->vnormals[n+i].xyz[0] = -x;
myPrimitiveArray->vnormals[n+i].xyz[1] = -y;
myPrimitiveArray->vnormals[n+i].xyz[2] = -z;
#include <HLRAlgo.ixx>
-static const Standard_Real cosu0 = cos(0.*PI/14.);
-static const Standard_Real sinu0 = sin(0.*PI/14.);
-static const Standard_Real cosu1 = cos(1.*PI/14.);
-static const Standard_Real sinu1 = sin(1.*PI/14.);
-static const Standard_Real cosu2 = cos(2.*PI/14.);
-static const Standard_Real sinu2 = sin(2.*PI/14.);
-static const Standard_Real cosu3 = cos(3.*PI/14.);
-static const Standard_Real sinu3 = sin(3.*PI/14.);
-static const Standard_Real cosu4 = cos(4.*PI/14.);
-static const Standard_Real sinu4 = sin(4.*PI/14.);
-static const Standard_Real cosu5 = cos(5.*PI/14.);
-static const Standard_Real sinu5 = sin(5.*PI/14.);
-static const Standard_Real cosu6 = cos(6.*PI/14.);
-static const Standard_Real sinu6 = sin(6.*PI/14.);
+static const Standard_Real cosu0 = cos(0.*M_PI/14.);
+static const Standard_Real sinu0 = sin(0.*M_PI/14.);
+static const Standard_Real cosu1 = cos(1.*M_PI/14.);
+static const Standard_Real sinu1 = sin(1.*M_PI/14.);
+static const Standard_Real cosu2 = cos(2.*M_PI/14.);
+static const Standard_Real sinu2 = sin(2.*M_PI/14.);
+static const Standard_Real cosu3 = cos(3.*M_PI/14.);
+static const Standard_Real sinu3 = sin(3.*M_PI/14.);
+static const Standard_Real cosu4 = cos(4.*M_PI/14.);
+static const Standard_Real sinu4 = sin(4.*M_PI/14.);
+static const Standard_Real cosu5 = cos(5.*M_PI/14.);
+static const Standard_Real sinu5 = sin(5.*M_PI/14.);
+static const Standard_Real cosu6 = cos(6.*M_PI/14.);
+static const Standard_Real sinu6 = sin(6.*M_PI/14.);
//=======================================================================
//function : UpdateMinMax
Standard_Real& OutAngl,
Standard_Real& OutDefl)
{
- static Standard_Real HAngMin = 1*PI/180;
- static Standard_Real HAngLim = 5*PI/180;
- static Standard_Real HAngMax = 35*PI/180;
+ static Standard_Real HAngMin = 1*M_PI/180;
+ static Standard_Real HAngLim = 5*M_PI/180;
+ static Standard_Real HAngMax = 35*M_PI/180;
OutAngl = InAngl;
if (OutAngl < HAngMin) OutAngl = HAngMin;
HLRBRep_PolyAlgo::HLRBRep_PolyAlgo () :
myDebug (Standard_False),
-myAngle (5 * PI / 180.),
+myAngle (5 * M_PI / 180.),
myTolSta (0.1),
myTolEnd (0.9),
myTolAngular(0.001)
HLRBRep_PolyAlgo::HLRBRep_PolyAlgo (const TopoDS_Shape& S) :
myDebug (Standard_False),
-myAngle (5 * PI / 180.),
+myAngle (5 * M_PI / 180.),
myTolSta (0.1),
myTolEnd (0.9),
myTolAngular(0.001)
Standard_Real IGESDimen_FlagNote::TipLength () const
{
- return (0.5 * (Height()/Tan((35./180.)*PI)));
+ return (0.5 * (Height()/Tan((35./180.)*M_PI)));
}
if (PR.DefinedElseSkip())
PR.ReadReal(PR.Current(),"Witness Line Angle",tempWitLineAng); //szv#4:S4163:12Mar99 `st=` not needed
else
- tempWitLineAng = PI / 2;
+ tempWitLineAng = M_PI / 2;
PR.ReadInteger(PR.Current(),"Text Alignment",tempTextAlign); //szv#4:S4163:12Mar99 `st=` not needed
if (PR.DefinedElseSkip())
slantAngles->SetValue(i, slantAngle);
}
else
- slantAngles->SetValue(i, PI/2);
+ slantAngles->SetValue(i, M_PI/2);
//st = PR.ReadReal(PR.Current(), "Rotation Angle", rotationAngle); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadReal(PR.Current(), "Rotation Angle", rotationAngle))
slantAngles->SetValue(i, slantAngle);
}
else
- slantAngles->SetValue(i, PI/2);
+ slantAngles->SetValue(i, M_PI/2);
//st = PR.ReadReal(PR.Current(), "Rotation Angle", rotationAngle); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadReal(PR.Current(), "Rotation Angle", rotationAngle))
if (PR.DefinedElseSkip())
PR.ReadReal(PR.Current(), "Angle between line and X axis", tempAngle); //szv#4:S4163:12Mar99 `st=` not needed
else
- tempAngle = PI / 4.0;
+ tempAngle = M_PI / 4.0;
Standard_Boolean st = PR.ReadInteger(PR.Current(), "Number of island curves", nbislands);
if (st && nbislands > 0)
gp_Dir2d dir2(x2-xc, y2-yc); // After shifting the centre of
// arc to the origin
Standard_Real t = dir1.Angle(dir2);
- return t + (t > 0 ? 0 : 2*PI);
+ return t + (t > 0 ? 0 : 2*M_PI);
}
gp_Dir IGESGeom_CircularArc::Axis () const
Xcen = ( cc*ee + f*b) / dn;
Ycen = (-cc*dd - f*a) / dn;
- Standard_Real teta = PI/2.;
+ Standard_Real teta = M_PI/2.;
if (Abs(b) > eps) teta = ATan (-a/b);
- if (fc < 0) teta += PI;
+ if (fc < 0) teta += M_PI;
Xax = Cos(teta);
Yax = Sin(teta);
gp_Dir2d d2(ent->EndPoint().X() - xc, ent->EndPoint().Y() - yc);
Standard_Real t1 = d0.Angle(d1);
Standard_Real t2 = d0.Angle(d2);
- t1 += (t1 > 0 ? 0 : 2*PI);
- t2 += (t2 > 0 ? 0 : 2*PI);
- t2 += (t1 <= t2 ? 0 : 2*PI);
- if ( !(0 <= t1 && t1 <= 2*PI) || !(0 <= t2-t1 && t2-t1 <= 2*PI) )
+ t1 += (t1 > 0 ? 0 : 2*M_PI);
+ t2 += (t2 > 0 ? 0 : 2*M_PI);
+ t2 += (t1 <= t2 ? 0 : 2*M_PI);
+ if ( !(0 <= t1 && t1 <= 2*M_PI) || !(0 <= t2-t1 && t2-t1 <= 2*M_PI) )
ach.AddFail("Parameter Error for Hyperbola");
}
else if (ent->FormNumber() == 3)
gp_Dir2d d2(ent->EndPoint().X() - xc, ent->EndPoint().Y() - yc);
Standard_Real t1 = d0.Angle(d1);
Standard_Real t2 = d0.Angle(d2);
- if ( !(-PI/2 < t1 && t1 < PI/2) || !(-PI/2 < t2 && t2 < PI/2) )
+ if ( !(-M_PI/2 < t1 && t1 < M_PI/2) || !(-M_PI/2 < t2 && t2 < M_PI/2) )
ach.AddFail("Parameter Error for Parabola");
}
*/
const Interface_ShareTool& , Handle(Interface_Check)& /*ach*/) const
{
// Standard_Real diffang = ent->EndAngle() - ent->StartAngle();
-// if (diffang <= 0.0 || diffang > 2.0 * PI)
+// if (diffang <= 0.0 || diffang > 2.0 * M_PI)
// ach.AddFail("0 < TA - SA <= 2Pi is not satisfied");
}
void IGESGraph_Color::HLSPercentage
(Standard_Real& Hue, Standard_Real& Lightness, Standard_Real& Saturation) const
{
- Hue = ((1.0 / (2.0 * PI)) *
+ Hue = ((1.0 / (2.0 * M_PI)) *
(ATan(((2 * theRed) - theGreen - theBlue) /
(Sqrt(3) * (theGreen - theBlue)))));
Lightness = ((1.0 / 3.0) * (theRed + theGreen + theBlue));
// Reading slantAngle(Real)
PR.ReadReal (PR.Current(), "Slant Angle", slantAngle); //szv#4:S4163:12Mar99 `st=` not needed
else
- slantAngle = PI/2.0; // Default Value
+ slantAngle = M_PI/2.0; // Default Value
// Reading rotationAngle(Real)
PR.ReadReal (PR.Current(), "Rotation Angle", rotationAngle); //szv#4:S4163:12Mar99 `st=` not needed
t1 = ElCLib::Parameter(circ, startPoint);
t2 = ElCLib::Parameter(circ, endPoint);
- if (t1 > t2 && (t1 - t2) > Precision::Confusion()) t2 += 2.*PI;
+ if (t1 > t2 && (t1 - t2) > Precision::Confusion()) t2 += 2.*M_PI;
if (Abs(t1 - t2) <= Precision::Confusion()) { // t1 = t2
Message_Msg msg1160("IGES_1160");
SendWarning(st, msg1160);
t1 = ElCLib::Parameter(elips, startPoint);
t2 = ElCLib::Parameter(elips, endPoint);
- if (t2 < t1 && (t1 -t2) > Precision::Confusion()) t2 += 2.*PI;
+ if (t2 < t1 && (t1 -t2) > Precision::Confusion()) t2 += 2.*M_PI;
if (Abs(t1 - t2) <= Precision::Confusion()) { // t1 = t2
Message_Msg msg1160("IGES_1160");
SendWarning(st, msg1160);
t1 = ElCLib::Parameter(circ, startPoint);
t2 = ElCLib::Parameter(circ, endPoint);
- if (t2 < t1 && (t1 -t2) > Precision::PConfusion()) t2 += 2.*PI;
+ if (t2 < t1 && (t1 -t2) > Precision::PConfusion()) t2 += 2.*M_PI;
if (Abs(t1 - t2) <= Precision::PConfusion()) { // t1 = t2
Message_Msg msg1160("IGES_1160");
SendWarning(st, msg1160);
t1 = ElCLib::Parameter(elips, startPoint);
t2 = ElCLib::Parameter(elips, endPoint);
- if (t2 < t1 && (t1 - t2) > Precision::PConfusion()) t2 += 2.*PI;
+ if (t2 < t1 && (t1 - t2) > Precision::PConfusion()) t2 += 2.*M_PI;
if (Abs(t1 - t2) <= Precision::PConfusion()) { // t1 = t2
Message_Msg msg1160("IGES_1160");
SendWarning(st, msg1160);
t1 = ElCLib::Parameter(circ, startPoint);
t2 = ElCLib::Parameter(circ, endPoint);
- if ( st->IsClosed() && t1>=GetEpsGeom()) t2 = t1 + 2.*PI;
+ if ( st->IsClosed() && t1>=GetEpsGeom()) t2 = t1 + 2.*M_PI;
if (!st->IsClosed() && fabs(t1 - t2) <=Precision::PConfusion()) {
// micro-arc
// cky 27 Aout 1996 : t2-t1 vaut distance(start,end)/rayon
t2 = t1 + startPoint.Distance(endPoint)/st->Radius();
}
if (!st->IsClosed() || t1>=GetEpsGeom()) {
- if (t2 < t1) t2 += 2.*PI;
+ if (t2 < t1) t2 += 2.*M_PI;
res = new Geom_TrimmedCurve(res, t1, t2);
}
t1 = ElCLib::Parameter(circ, startPoint);
t2 = ElCLib::Parameter(circ, endPoint);
- if ( st->IsClosed() && t1>=GetEpsGeom()) t2 = t1 + 2.*PI;
+ if ( st->IsClosed() && t1>=GetEpsGeom()) t2 = t1 + 2.*M_PI;
if (!st->IsClosed() && fabs(t1 -t2) <= Precision::PConfusion()) {
// micro-arc
// cky 27 Aout 1996 : t2-t1 vaut distance(start,end)/rayon
t2 = t1 + startPoint.Distance(endPoint)/st->Radius();
}
if (!st->IsClosed() || t1>= GetEpsGeom()) {
- if (t2 < t1) t2 += 2.*PI;
+ if (t2 < t1) t2 += 2.*M_PI;
res = new Geom2d_TrimmedCurve(res, t1, t2);
}
return res;
Handle(IGESGeom_Point) Point = start->LocationPoint();
Handle(IGESGeom_Direction) Axis = start->Axis();
Standard_Real radius = start->Radius();
- Standard_Real angle = start->SemiAngle()/180.*PI;
+ Standard_Real angle = start->SemiAngle()/180.*M_PI;
if (Point.IsNull()) {
Message_Msg msg174("XSTEP_174");
// Direction Reading Error : Null IGESEntity
return res;
}
- if (angle < Precision::Confusion()||angle > PI/2.) {
+ if (angle < Precision::Confusion()||angle > M_PI/2.) {
return res;
}
if (radius < 0) {
//(taken from Compute2d3d and Compute2d)
/* if (isrev) {
//#30 rln 19.10.98 transformation of pcurves for IGES Surface of Revolution
- mycurve2d ->Translate (gp_Vec2d (0, -2 * PI));
+ mycurve2d ->Translate (gp_Vec2d (0, -2 * M_PI));
mycurve2d->Mirror (gp::OX2d());
mycurve2d->Mirror (gp_Ax2d (gp::Origin2d(), gp_Dir2d (1.,1.)));
//Standard_Real startAngle = st->StartAngle();
//Standard_Real endAngle = st->EndAngle();
gp_Ax1 revolAxis(pt1, gp_Dir( gp_Vec (pt2, pt1)));
- Standard_Real startAngle = 2 * PI - st->EndAngle();
- Standard_Real endAngle = 2 * PI - st->StartAngle();
+ Standard_Real startAngle = 2 * M_PI - st->EndAngle();
+ Standard_Real endAngle = 2 * M_PI - st->StartAngle();
Standard_Real deltaAngle = endAngle - startAngle;
- Standard_Boolean IsFullAngle = ( deltaAngle > 2.*PI-Precision::PConfusion() );
- if (IsFullAngle) deltaAngle = 2.*PI; // ** CKY 18-SEP-1996
+ Standard_Boolean IsFullAngle = ( deltaAngle > 2.*M_PI-Precision::PConfusion() );
+ if (IsFullAngle) deltaAngle = 2.*M_PI; // ** CKY 18-SEP-1996
// il faudra translater les courbes 2d de startAngle pour
// etre en phase IGES et BRep
startLoc.SetRotation(revolAxis, startAngle);
tmpF = aBasisCurve->FirstParameter();
tmpL = aBasisCurve->LastParameter();
tmpToler = Precision::PConfusion();
- if ( (fabs(tmpF) >= tmpToler) && (fabs(tmpL - 2*PI) >= tmpToler) )
+ if ( (fabs(tmpF) >= tmpToler) && (fabs(tmpL - 2*M_PI) >= tmpToler) )
reparamBSpline (aBasisCurve, tmpF, tmpL);
}
gp_Vec dir (pt1, pt2);
gp_Pnt2d startpoint = circ->StartPoint();
paramv -= ElCLib::Parameter (gp_Circ2d (gp_Ax2d (circ->Center(), gp_Dir2d(1,0)), circ->Radius()), startpoint);
if (Surf->IsKind (STANDARD_TYPE(Geom_SphericalSurface)))
- paramv += ShapeAnalysis::AdjustToPeriod(paramv, - PI, PI);
+ paramv += ShapeAnalysis::AdjustToPeriod(paramv, - M_PI, M_PI);
else if (Surf->IsKind (STANDARD_TYPE(Geom_ToroidalSurface)))
- paramv += ShapeAnalysis::AdjustToPeriod(paramv, 0, PI * 2);
+ paramv += ShapeAnalysis::AdjustToPeriod(paramv, 0, M_PI * 2);
}
}
else if (st->IsKind (STANDARD_TYPE (IGESGeom_TabulatedCylinder))) {
DeclareAndCast (IGESGeom_CircularArc, circ, directrix);
gp_Pnt2d startpoint = circ->StartPoint();
paramu -= ElCLib::Parameter (gp_Circ2d (gp_Ax2d (circ->Center(), gp_Dir2d(1,0)), circ->Radius()), startpoint);
- paramu += ShapeAnalysis::AdjustToPeriod(paramu, 0, PI * 2);
+ paramu += ShapeAnalysis::AdjustToPeriod(paramu, 0, M_PI * 2);
}
}
DeclareAndCast(IGESGeom_SurfaceOfRevolution, st120, isrf);
//S4181 pdn 19.04.99 defining transformation matrix
gp_Trsf2d tmp;
- tmp.SetTranslation(gp_Vec2d (0, -2 * PI));
+ tmp.SetTranslation(gp_Vec2d (0, -2 * M_PI));
trans.PreMultiply(tmp);
tmp.SetMirror(gp::OX2d());
trans.PreMultiply(tmp);
//#30 rln 19.10.98
//CAS.CADE SA = 2*PI - IGES TA
//paramu = st120->StartAngle();
- paramu = -(2 * PI - st120->EndAngle());
+ paramu = -(2 * M_PI - st120->EndAngle());
}
else
paramu = 0.;
if (isrf->IsKind(STANDARD_TYPE(IGESSolid_CylindricalSurface))||
isrf->IsKind(STANDARD_TYPE(IGESSolid_ConicalSurface))) {
- uscale = PI/180.;
+ uscale = M_PI/180.;
}
if (isrf->IsKind(STANDARD_TYPE(IGESSolid_SphericalSurface))) {
- cscale = PI/180.;
+ cscale = M_PI/180.;
uscale = 1.;
}
tmp.SetMirror(gp_Ax2d (gp::Origin2d(), gp_Dir2d (1.,1.)));
trans.PreMultiply(tmp);
if(paramv > 0)
- paramv = paramv*180./PI;
- cscale = PI/180.;
+ paramv = paramv*180./M_PI;
+ cscale = M_PI/180.;
uscale = 1.;
}
Standard_Real& Para) const
{
Standard_Real theta,z, aTolPrecision=0.0001;
- Standard_Real PIpPI = Standard_PI+Standard_PI;
+ Standard_Real PIpPI = M_PI + M_PI;
//
switch (typequadric) {
#include <ElCLib.hxx>
-static Standard_Real PIpPI = Standard_PI+Standard_PI;
+static Standard_Real PIpPI = M_PI + M_PI;
//=============================================================================
//== E m p t y C o n s t r u c t o r
//==
Standard_Boolean IsARoot(Standard_Real u) {
Standard_Integer i;
Standard_Real aEps=RealEpsilon();
- Standard_Real PIpPI = Standard_PI+Standard_PI;
+ Standard_Real PIpPI = M_PI + M_PI;
//
for(i=0 ; i<NbRoots; ++i) {
if(Abs(u - Roots[i])<=aEps) {
{
Standard_Integer i, j, SvNbRoots;
Standard_Boolean Triee;
- Standard_Real PIpPI = Standard_PI+Standard_PI;
+ Standard_Real PIpPI = M_PI + M_PI;
//
done=Standard_False;
//
Z_NEGATIF=Standard_False;
//
Standard_Real Qxx,Qyy,Qzz,Qxy,Qxz,Qyz,Qx,Qy,Qz,Q1, aRealEpsilon, RCyl, R2;
- Standard_Real PIpPI = Standard_PI+Standard_PI;
+ Standard_Real PIpPI = M_PI + M_PI;
//
for(Standard_Integer raz = 0 ; raz < myNbMaxCurves ; raz++) {
previouscurve[raz] = nextcurve[raz] = 0;
//-- Si Positif ---> 2 Courbes
//-- Sinon ---> Pas de solution
//--------------------------------------------------------------
- if(MTF.Value(PI) >= -aRealEpsilon) {
+ if(MTF.Value(M_PI) >= -aRealEpsilon) {
TheCurve[0].SetCylinderQuadValues(Cyl,Qxx,Qyy,Qzz,Qxy,Qxz,Qyz,Qx,Qy,Qz,Q1,
myEpsilon,0.0,PIpPI,
//-- entre les 2 racines ( Ici Tout le domaine )
//-- Sinon Seulement un point Tangent
//------------------------------------------------------------
- if(MTF.Value(PolDIS.Value(1)+PI) >= -aRealEpsilon ) {
+ if(MTF.Value(PolDIS.Value(1)+M_PI) >= -aRealEpsilon ) {
//------------------------------------------------------------
//-- On a Un Point de Tangence + Une Courbe Solution
//------------------------------------------------------------
Standard_Integer i;
Standard_Real Qxx,Qyy,Qzz,Qxy,Qxz,Qyz,Qx,Qy,Qz,Q1;
Standard_Real Theta1, Theta2, TgAngle;
- Standard_Real PIpPI = Standard_PI+Standard_PI;
+ Standard_Real PIpPI = M_PI + M_PI;
//
done=Standard_True;
identical = Standard_False;
// 2
// f(z,t)=A(t)*z + B(t)*z + C(t) Discriminant(t) != 0
//
- if(!nbsol && (MTF.Value(PI)<0.) ) {
+ if(!nbsol && (MTF.Value(M_PI)<0.) ) {
//-- Discriminant signe constant negatif
return;
}
gp_Vec ldv( axec.Direction() );
gp_Vec npv( normp );
Standard_Real dA = Abs( ldv.Angle( npv ) );
- if( dA > (PI/4.) )
+ if( dA > (M_PI/4.) )
{
- Standard_Real dang = Abs( ldv.Angle( npv ) ) - PI/2.;
+ Standard_Real dang = Abs( ldv.Angle( npv ) ) - M_PI/2.;
Standard_Real dangle = Abs( dang );
if( dangle > Tolang )
{
Standard_Real A=DirCyl1.Angle(DirCyl2);
Standard_Real B;
- B=Abs(Sin(0.5*(PI-A)));
+ B=Abs(Sin(0.5*(M_PI-A)));
A=Abs(Sin(0.5*A));
if(A==0.0 || B==0.0) {
// Preliminary analysis. Determination of iRet
//
iRet=0;
- aHalfPI=0.5*PI;
+ aHalfPI=0.5*M_PI;
aD1=1.;
aPA1.SetCoord(aD1, 0.);
aP0.SetCoord(0., 0.);
aAx2=Con2.Axis();
aGamma=aAx1.Angle(aAx2);
if (aGamma>aHalfPI){
- aGamma=PI-aGamma;
+ aGamma=M_PI-aGamma;
}
aCosGamma=Cos(aGamma);
aSinGamma=Sin(aGamma);
//Other generatrixes of cones laying in maximal plane
- gp_Lin aGen1 = aGen.Rotated(Con1.Axis(), Standard_PI);
- gp_Lin aGen2 = aGen.Rotated(Con2.Axis(), Standard_PI);
+ gp_Lin aGen1 = aGen.Rotated(Con1.Axis(), M_PI);
+ gp_Lin aGen2 = aGen.Rotated(Con2.Axis(), M_PI);
//
//Intersection point of generatrixes
gp_Dir aN; //solution plane normal
Standard_Real XS = ( C1.Location().X()*R2 + C2.Location().X()*R1 ) / sum;
Standard_Real YS = ( C1.Location().Y()*R2 + C2.Location().Y()*R1 ) / sum;
Standard_Real ang1=Ox1.Angle(ax); // Resultat entre -PI et +PI
- Standard_Real ang2=Ox2.Angle(ax) + PI;
- if (ang1<0) {ang1=2*PI+ang1;} // On revient entre 0 et 2PI
+ Standard_Real ang2=Ox2.Angle(ax) + M_PI;
+ if (ang1<0) {ang1=2*M_PI+ang1;} // On revient entre 0 et 2PI
lpnt[0].SetValue(XS,YS,ang1,ang2);
}
else if (((sum-d)>Epsilon(d)) && ((d-dif)>Epsilon(d))) {
}
else {
ang1=ASin(sint1);
- if (cost1<0.0) {ang1=PI-ang1;}
+ if (cost1<0.0) {ang1=M_PI-ang1;}
}
if (Abs(cost2)<=0.707) {
ang2=ACos(cost2);
}
else {
ang2=ASin(sint2);
- if (cost2<0.0) {ang2=PI-ang2;}
+ if (cost2<0.0) {ang2=M_PI-ang2;}
}
Standard_Real ang11=ref1+ang1;
Standard_Real ang21=ref2+ang2;
Standard_Real ang12=ref1-ang1;
Standard_Real ang22=ref2-ang2;
if (ang11<0.) {
- ang11=2*PI+ang11;
+ ang11=2*M_PI+ang11;
}
- else if (ang11>=2*PI) {
- ang11=ang11-2*PI;
+ else if (ang11>=2*M_PI) {
+ ang11=ang11-2*M_PI;
}
if (ang21<0.) {
- ang21=2*PI+ang21;
+ ang21=2*M_PI+ang21;
}
- else if (ang21>=2*PI) {
- ang21=ang21-2*PI;
+ else if (ang21>=2*M_PI) {
+ ang21=ang21-2*M_PI;
}
if (ang12<0.) {
- ang12=2*PI+ang12;
+ ang12=2*M_PI+ang12;
}
- else if (ang12>=2*PI) {
- ang12=ang12-2*PI;
+ else if (ang12>=2*M_PI) {
+ ang12=ang12-2*M_PI;
}
if (ang22<0.) {
- ang22=2*PI+ang22;
+ ang22=2*M_PI+ang22;
}
- else if (ang22>=2*PI) {
- ang22=ang22-2*PI;
+ else if (ang22>=2*M_PI) {
+ ang22=ang22-2*M_PI;
}
lpnt[0].SetValue(XS1,YS1,ang11,ang21);
lpnt[1].SetValue(XS2,YS2,ang12,ang22);
gp_Vec2d Ox2(C2.XAxis().Direction());
Standard_Real ang1=Ox1.Angle(ax); // Resultat entre -PI et +PI
Standard_Real ang2=Ox2.Angle(ax);
- if (ang1<0) {ang1=2*PI+ang1;} // On revient entre 0 et 2PI
- if (ang2<0) {ang2=2*PI+ang2;} // On revient entre 0 et 2PI
+ if (ang1<0) {ang1=2*M_PI+ang1;} // On revient entre 0 et 2PI
+ if (ang2<0) {ang2=2*M_PI+ang2;} // On revient entre 0 et 2PI
Standard_Real XS = ( C1.Location().X()*R2 - C2.Location().X()*R1 ) / (R2 - R1);
Standard_Real YS = ( C1.Location().Y()*R2 - C2.Location().Y()*R1 ) / (R2 - R1);
lpnt[0].SetValue(XS,YS,ang1,ang2);
//modified by NIZNHY-PKV Fri Jun 15 09:55:00 2007f
//Standard_Real ang;
//ang = C.XAxis().Direction().Angle(L.Direction());
- //ang = ang + PI / 2.0;
+ //ang = ang + M_PI / 2.0;
//modified by NIZNHY-PKV Fri Jun 15 09:55:29 2007t
if (Abs(Abs(d)-C.Radius())<=Epsilon(C.Radius())) { // Cas de tangence
/*
u=B*(L.Location().X()-C.Location().X()) -
A*(L.Location().Y()-C.Location().Y());
- if (d<0.0) {ang=ang+PI;}
- if (ang>=2.0*PI) {
- ang=ang-2.0*PI;
+ if (d<0.0) {ang=ang+M_PI;}
+ if (ang>=2.0*M_PI) {
+ ang=ang-2.0*M_PI;
}
else if (ang<0.0) {
- ang=ang+2.0*PI;
+ ang=ang+2.0*M_PI;
}
*/
//modified by NIZNHY-PKV Fri Jun 15 09:55:41 2007t
}
else {
angt=ASin(sint);
- if (cost<0) {angt=PI-angt;}
+ if (cost<0) {angt=M_PI-angt;}
}
ang1=ang-angt;
ang2=ang+angt;
if (ang1<0.0) {
- ang1=ang1+2.0*PI;
+ ang1=ang1+2.0*M_PI;
}
- else if (ang1>=2.0*PI) {
- ang1=ang1-2.0*PI;
+ else if (ang1>=2.0*M_PI) {
+ ang1=ang1-2.0*M_PI;
}
if (ang2<0.0) {
- ang2=ang2+2.0*PI;
+ ang2=ang2+2.0*M_PI;
}
- else if (ang2>=2.0*PI) {
- ang2=ang2-2.0*PI;
+ else if (ang2>=2.0*M_PI) {
+ ang2=ang2-2.0*M_PI;
}
u1=B*(L.Location().X()-C.Location().X()) -
ps = 2.0*E*radius; // SIN
pcte= F + pss; // 1
- math_TrigonometricFunctionRoots Sol(pcc,p2sc,pc,ps,pcte,0.0,2.0*PI);
+ math_TrigonometricFunctionRoots Sol(pcc,p2sc,pc,ps,pcte,0.0,2.0*M_PI);
if(!Sol.IsDone()) {
cout << "\n\nmath_TrigonometricFunctionRoots -> NotDone\n\n"<<endl;
ty= radius*Sin(S);
Coord_Ancien_Repere(tx,ty,Axe_rep);
if(!CIsDirect)
- S = PI+PI-S;
+ S = M_PI+M_PI-S;
lpnt[i-1].SetValue(tx,ty,S);
}
Traitement_Points_Confondus(nbp,lpnt);
ps= 2.0*E*minor_radius; // SIN
pcte=F+pss; // 1
- math_TrigonometricFunctionRoots Sol(pcc,p2sc,pc,ps,pcte,0.0,2.0*PI);
+ math_TrigonometricFunctionRoots Sol(pcc,p2sc,pc,ps,pcte,0.0,2.0*M_PI);
if (!Sol.IsDone()) {
done=Standard_False;
ty=minor_radius*Sin(S);
Coord_Ancien_Repere(tx,ty,Axe_rep);
if(!EIsDirect)
- S = PI+PI-S;
+ S = M_PI+M_PI-S;
lpnt[i-1].SetValue(tx,ty,S);
}
Traitement_Points_Confondus(nbp,lpnt);
case GeomAbs_Circle:
Param=ElCLib::CircleParameter(Axis,P);
- if(Param<0.0) { Param+=PI+PI; }
+ if(Param<0.0) { Param+=M_PI+M_PI; }
break;
case GeomAbs_Ellipse: {
,Elips_a
,Elips_b
,P);
- if (Param < 0.0) { Param+=PI+PI; }
+ if (Param < 0.0) { Param+=M_PI+M_PI; }
break;
}
Inter.SetReversedParameters(ReversedParameters());
if(! DE.IsClosed()) {
IntRes2d_Domain D(DE);
- D.SetEquivalentParameters(DE.FirstParameter(),DE.FirstParameter()+PI+PI);
+ D.SetEquivalentParameters(DE.FirstParameter(),DE.FirstParameter()+M_PI+M_PI);
Inter.Perform(ITool,DL,PCurve,D,TolConf,Tol);
}
else {
IntRes2d_Domain D(DC);
if(! DC.IsClosed()) {
- D.SetEquivalentParameters(DC.FirstParameter(),DC.FirstParameter()+PI+PI);
+ D.SetEquivalentParameters(DC.FirstParameter(),DC.FirstParameter()+M_PI+M_PI);
}
Standard_Real binf = Precision::Infinite(),bsup = -Precision::Infinite(),maxtol;
if(! DC.IsClosed()) {
IntRes2d_Domain D1(DC);
- D1.SetEquivalentParameters(DC.FirstParameter(),DC.FirstParameter()+PI+PI);
+ D1.SetEquivalentParameters(DC.FirstParameter(),DC.FirstParameter()+M_PI+M_PI);
if(! DE.IsClosed()) {
IntRes2d_Domain D2(DE);
- D2.SetEquivalentParameters(DE.FirstParameter(),DE.FirstParameter()+PI+PI);
+ D2.SetEquivalentParameters(DE.FirstParameter(),DE.FirstParameter()+M_PI+M_PI);
Inter.Perform(ITool,D1,PCurve,D2,TolConf,Tol);
}
else {
else {
if(! DE.IsClosed()) {
IntRes2d_Domain D2(DE);
- D2.SetEquivalentParameters(DE.FirstParameter(),DE.FirstParameter()+PI+PI);
+ D2.SetEquivalentParameters(DE.FirstParameter(),DE.FirstParameter()+M_PI+M_PI);
Inter.Perform(ITool,DC,PCurve,D2,TolConf,Tol);
}
else {
IntRes2d_Domain D(DC);
if(! DC.IsClosed()) {
- D.SetEquivalentParameters(DC.FirstParameter(),DC.FirstParameter()+PI+PI);
+ D.SetEquivalentParameters(DC.FirstParameter(),DC.FirstParameter()+M_PI+M_PI);
}
Standard_Real binf = Precision::Infinite(),bsup = -Precision::Infinite(),maxtol;
gp_Pnt2d Pntinf,Pntsup;
IntRes2d_Domain D(DE);
if(! DE.IsClosed()) {
- D.SetEquivalentParameters(DE.FirstParameter(),DE.FirstParameter()+PI+PI);
+ D.SetEquivalentParameters(DE.FirstParameter(),DE.FirstParameter()+M_PI+M_PI);
}
//-- cout<<" Parab Elips "<<endl;
if(! DE1.IsClosed()) {
IntRes2d_Domain D1(DE1);
- D1.SetEquivalentParameters(DE1.FirstParameter(),DE1.FirstParameter()+PI+PI);
+ D1.SetEquivalentParameters(DE1.FirstParameter(),DE1.FirstParameter()+M_PI+M_PI);
if(! DE2.IsClosed()) {
IntRes2d_Domain D2(DE2);
- D2.SetEquivalentParameters(DE2.FirstParameter(),DE2.FirstParameter()+PI+PI);
+ D2.SetEquivalentParameters(DE2.FirstParameter(),DE2.FirstParameter()+M_PI+M_PI);
Inter.Perform(ITool,D1,PCurve,D2,TolConf,Tol);
}
else {
else {
if(! DE2.IsClosed()) {
IntRes2d_Domain D2(DE2);
- D2.SetEquivalentParameters(DE2.FirstParameter(),DE2.FirstParameter()+PI+PI);
+ D2.SetEquivalentParameters(DE2.FirstParameter(),DE2.FirstParameter()+M_PI+M_PI);
Inter.Perform(ITool,DE1,PCurve,D2,TolConf,Tol);
}
else {
IntRes2d_Domain DEModif(DE);
if(! DE.IsClosed()) {
- DEModif.SetEquivalentParameters(DE.FirstParameter(),DE.FirstParameter()+PI+PI);
+ DEModif.SetEquivalentParameters(DE.FirstParameter(),DE.FirstParameter()+M_PI+M_PI);
}
Standard_Real binf = Precision::Infinite(),bsup = -Precision::Infinite(),maxtol;
#define TOLERANCE_ANGULAIRE 1.e-15 //the reason is at least to make an accordance between transition and position computation.
//modified by NIZHNY-MKK Tue Feb 15 10:53:45 2000.END
-const Standard_Real PIsur2 = 0.5*PI;
+const Standard_Real PIsur2 = 0.5*M_PI;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
IntRes2d_Position FindPositionLL(Standard_Real&,const IntRes2d_Domain&);
PeriodicInterval C2Inter(C2inf,C2sup);
if(!IdentCircles) {
- if(C2Inter.Length() > PI)
+ if(C2Inter.Length() > M_PI)
C2Inter.Complement();
}
else {
SolutionC1[NbSolTotal]=PeriodicInterval(C1inf,C1sup);
if(!IdentCircles) {
- if(SolutionC1[NbSolTotal].Length() > PI)
+ if(SolutionC1[NbSolTotal].Length() > M_PI)
SolutionC1[NbSolTotal].Complement();
}
else {
//-- (permet de ne pas gerer trop de cas differents)
C1_Res1.SetValues(C1_binf1,C1_bsup1);
- if(C1_Res1.Length() > PI) C1_Res1.Complement();
+ if(C1_Res1.Length() > M_PI) C1_Res1.Complement();
if(nbsol==2) {
C1_binf2+=dAngle1; C1_bsup2+=dAngle1;
C1_Res2.SetValues(C1_binf2,C1_bsup2);
- if(C1_Res2.Length() > PI) C1_Res2.Complement();
+ if(C1_Res2.Length() > M_PI) C1_Res2.Complement();
}
else {
C1_Res2.SetNull();
#endif
if(Cinf>=Csup) { Cinf = CDomainAndRes.Binf; Csup = CDomainAndRes.Bsup; }
CircleSolution[NbSolTotal]=PeriodicInterval(Cinf,Csup);
- if(CircleSolution[NbSolTotal].Length() > PI)
+ if(CircleSolution[NbSolTotal].Length() > M_PI)
CircleSolution[NbSolTotal].Complement();
LineSolution[NbSolTotal]=LInterAndDomain;
CInt1.SetValues(binf1,bsup1);
- if(CInt1.Length() > PI) CInt1.Complement();
+ if(CInt1.Length() > M_PI) CInt1.Complement();
if(nbsol==2) {
}
CInt2.SetValues(binf2,bsup2);
- if(CInt2.Length() > PI) CInt2.Complement();
+ if(CInt2.Length() > M_PI) CInt2.Complement();
}
// Modified by Sergey KHROMOV - Thu Oct 26 17:51:05 2000 Begin
else {
bsup2 = PIpPI;
binf1 = 0.;
CInt1.SetValues(binf1,CInt1.Bsup - PIpPI);
- if(CInt1.Length() > PI) CInt1.Complement();
+ if(CInt1.Length() > M_PI) CInt1.Complement();
CInt2.SetValues(binf2,bsup2);
- if(CInt2.Length() > PI) CInt2.Complement();
+ if(CInt2.Length() > M_PI) CInt2.Complement();
}
}
// Modified by Sergey KHROMOV - Thu Oct 26 17:51:13 2000 End
#include <gp.hxx>
-static Standard_Real PIpPI = Standard_PI+Standard_PI;
+static Standard_Real PIpPI = M_PI + M_PI;
//======================================================================
//========== P R O T O T Y P E S ============
const Standard_Real Tol) {
if(!D1.IsClosed()) {
IntRes2d_Domain D(D1);
- D.SetEquivalentParameters(D1.FirstParameter(),D1.FirstParameter()+PI+PI);
+ D.SetEquivalentParameters(D1.FirstParameter(),D1.FirstParameter()+M_PI+M_PI);
Perform(IntCurve_IConicTool(C),D,PCurve,D2,TolConf,Tol);
//-- Standard_ConstructionError::Raise("Domaine incorrect");
}
const Standard_Real Tol) {
if(!D1.IsClosed()) {
IntRes2d_Domain D(D1);
- D.SetEquivalentParameters(D1.FirstParameter(),D1.FirstParameter()+PI+PI);
+ D.SetEquivalentParameters(D1.FirstParameter(),D1.FirstParameter()+M_PI+M_PI);
Perform(IntCurve_IConicTool(E),D,PCurve,D2,TolConf,Tol);
//-- Standard_ConstructionError::Raise("Domaine incorrect");
}
const Standard_Real Tol) {
if(!D1.IsClosed()) {
IntRes2d_Domain D(D1);
- D.SetEquivalentParameters(D1.FirstParameter(),D1.FirstParameter()+PI+PI);
+ D.SetEquivalentParameters(D1.FirstParameter(),D1.FirstParameter()+M_PI+M_PI);
Perform(IntCurve_IConicTool(C),D,PCurve,D2,TolConf,Tol);
//-- Standard_ConstructionError::Raise("Domaine incorrect");
}
const Standard_Real Tol) {
if(!D1.IsClosed()) {
IntRes2d_Domain D(D1);
- D.SetEquivalentParameters(D1.FirstParameter(),D1.FirstParameter()+PI+PI);
+ D.SetEquivalentParameters(D1.FirstParameter(),D1.FirstParameter()+M_PI+M_PI);
Perform(IntCurve_IConicTool(E),D,PCurve,D2,TolConf,Tol);
}
else {
gp_Pnt2d P2(TheCurveTool::Value(C1,lastparameter));
D1.SetValues(P1,firstparameter ,TolDomain,
P2,lastparameter ,TolDomain);
- D1.SetEquivalentParameters(firstparameter,firstparameter+PI+PI);
+ D1.SetEquivalentParameters(firstparameter,firstparameter+M_PI+M_PI);
break;
}
default: {
case GeomAbs_Circle:
Param=ElCLib::CircleParameter(ThePConic.Axis2(),P);
- if(Param<0.0) { Param+=PI+PI; }
+ if(Param<0.0) { Param+=M_PI+M_PI; }
break;
case GeomAbs_Ellipse: {
,ThePConic.Param1()
,ThePConic.Param2()
,P);
- if (Param < 0.0) { Param+=PI+PI; }
+ if (Param < 0.0) { Param+=M_PI+M_PI; }
break;
}
case GeomAbs_Circle:
Param=ElCLib::CircleParameter(ThePConic.Axis2(),P);
- if(Param<0.0) { Param+=PI+PI; }
+ if(Param<0.0) { Param+=M_PI+M_PI; }
break;
case GeomAbs_Ellipse: {
,ThePConic.Param1()
,ThePConic.Param2()
,P);
- if (Param < 0.0) { Param+=PI+PI; }
+ if (Param < 0.0) { Param+=M_PI+M_PI; }
break;
}
//OCC516(apo)->
static Standard_Real correction = 1.E+5*Precision::Angular();
gp_Cone cn = TheSurfaceTool::Cone(surface);
- if(Abs(cn.SemiAngle()) < PI/2.0 - correction){
+ if(Abs(cn.SemiAngle()) < M_PI/2.0 - correction){
IntAna_IntConicQuad LinCone(Line,cn);
AppendIntAna(curve,surface,LinCone);
break;
if (U1inf)
U1new = Max (0., U1new);
else
- U2new = Min (2 * PI, U2new);
+ U2new = Min (2 * M_PI, U2new);
if (! V1inf && !V2inf) return;
}
aPln = gp_Pln (gp_Ax3 (O, aNVec ,aXVec));
// make a second plane perpendicular to the first one, rotated around aXVec
- gp_Pln aPlnPrp = aPln.Rotated (gp_Ax1 (O,aXVec), PI/2.);
+ gp_Pln aPlnPrp = aPln.Rotated (gp_Ax1 (O,aXVec), M_PI/2.);
// project Line and it's X-axe symmetric one to plane and intersect
// resulting curve with projection of Basic Curev
aCyl.SetRadius(aR);
}
else if ( aR <= -TOLTANGENCY ){
- anA.Rotate(gp_Ax1(anA.Location(), anA.Direction()), PI);
+ anA.Rotate(gp_Ax1(anA.Location(), anA.Direction()), M_PI);
aCyl.SetPosition(anA);
// modified by NIZHNY-MKK Mon Oct 3 17:37:54 2005
// aCyl.SetRadius(Abs(aR));
#define EPSX ParTool::EpsX(TheParCurve)
#define NB_ECHANTILLONS
-static Standard_Real PIpPI = Standard_PI+Standard_PI;
+static Standard_Real PIpPI = M_PI + M_PI;
for(i=1; i<=nbvtx; i++) {
IntPatch_Point& VTX = svtx.ChangeValue(i);
Standard_Real p=VTX.ParameterOnLine();
- Standard_Real pmpimpi=p-PI-PI;
+ Standard_Real pmpimpi=p-M_PI-M_PI;
if(pmpimpi >= ParamMinOnLine) {
gp_Pnt P1 = Value(pmpimpi);
Standard_Real d1 = P1.Distance(VTX.Value());
svtx.Append(OVTX);
}
}
- pmpimpi=p+PI+PI;
+ pmpimpi=p+M_PI+M_PI;
if(pmpimpi <= ParamMaxOnLine) {
gp_Pnt P1 = Value(pmpimpi);
Standard_Real d1 = P1.Distance(VTX.Value());
case GeomAbs_Cylinder:
case GeomAbs_Cone:
case GeomAbs_Sphere:
- pu1=PI+PI;
+ pu1=M_PI+M_PI;
break;
default:
break;
case GeomAbs_Cylinder:
case GeomAbs_Cone:
case GeomAbs_Sphere:
- pu2=PI+PI;
+ pu2=M_PI+M_PI;
break;
default:
break;
bBothCylinders=(aType1==GeomAbs_Cylinder && aType2==GeomAbs_Cylinder);
//
while(anu1-u1 > 5.0) {
- u1+=PI+PI;
+ u1+=M_PI+M_PI;
}
while(u1-anu1 > 5.0) {
//
//
// In any case the pb does not deal with apex problem.
//
- if (u1-PI-PI<0.) {
+ if (u1-M_PI-M_PI<0.) {
break;
}
}
*/
//
- u1-=PI+PI;
+ u1-=M_PI+M_PI;
}
while(anu2-u2 > 5.0) {
- u2+=PI+PI;
+ u2+=M_PI+M_PI;
}
while(u2-anu2 > 5.0) {
//
/*
if (!bBothCylinders) {//cfe900/H6
- if (u2-PI-PI<0.) {
+ if (u2-M_PI-M_PI<0.) {
break;
}
}
*/
//
- u2-=PI+PI;
+ u2-=M_PI+M_PI;
}
}
//
// apex on the Sphere
if(aType==GeomAbs_Sphere) {
- aHalfPi=0.5*PI;
+ aHalfPi=0.5*M_PI;
if (fabs(aVx-aHalfPi)<aEpsilon) {
bFlag=!bFlag;
}
//
// apex on the Sphere
if(aType==GeomAbs_Sphere) {
- aHalfPi=0.5*PI;
+ aHalfPi=0.5*M_PI;
//
if (fabs(aVx-aHalfPi)<aEpsilon) {
aLimV=aHalfPi;
}
else {
//Check: aUx must be 0 or 2*pi
- if(fabs(aUx) < aEpsilon || fabs(aUx - 2.*PI) < aEpsilon) {
+ if(fabs(aUx) < aEpsilon || fabs(aUx - 2.*M_PI) < aEpsilon) {
//aUx = 0 or 2*pi, but may be it must be 2*pi or 0?
bFound=FindNearParameter(aALine, aTx, iDir, aTol3D, aT1);
if(!bFound) {
aP1=aALine->Value(aT1);
aQuadric.Parameters(aP1, aU1, aV1);
- if(fabs(aU1) > fabs(aU1 - 2.*PI)) {
- aUx = 2.*PI;
+ if(fabs(aU1) > fabs(aU1 - 2.*M_PI)) {
+ aUx = 2.*M_PI;
}
else {
aUx = 0.;
if(ArcType()==IntPatch_Circle || ArcType()==IntPatch_Ellipse)
{
if(fipt && lapt) {
- while(par<pf) par+=PI+PI;
- while(par>pl) par-=PI+PI;
+ while(par<pf) par+=M_PI+M_PI;
+ while(par>pl) par-=M_PI+M_PI;
if(par<pf) {
const Standard_Real PrecisionPConfusion ( Precision::PConfusion()*1000.0 );
if((pf-par)>PrecisionPConfusion) {
Standard_Real ponline = VTX.ParameterOnLine();
// eap, =>>
Standard_Real newParam = ponline;
- const Standard_Real PiPi = PI+PI;
+ const Standard_Real PiPi = M_PI+M_PI;
Standard_Boolean is2PI = ( Abs(ponline-PiPi) <= PrecisionPConfusion );
if (nbvtx > 2 && // do this check if seam edge only gives vertices
else
newParam -= PiPi;
// if( (Abs(ponline)<=PrecisionPConfusion)
-// ||(Abs(ponline-PI-PI) <=PrecisionPConfusion))
+// ||(Abs(ponline-M_PI-M_PI) <=PrecisionPConfusion))
// eap, <<=
Standard_Real u1a,v1a,u2a,v2a,u1b,v1b,u2b,v2b;
VTXM1.Parameters(u1a,v1a,u2a,v2a);
///////////////////////////////////////////////
// eap, =>>
// if (Abs(ponline) <= PrecisionPConfusion) {
-// const Standard_Real PiPi = PI+PI;
+// const Standard_Real PiPi = M_PI+M_PI;
if(newParam >= ParamMinOnLine && newParam <= ParamMaxOnLine
/*PiPi >= ParamMinOnLine && PiPi<=ParamMaxOnLine*/) {
SortAgain = Standard_True;
///////////////////////////////////////////////
// eap, =>>
// if (Abs(ponline) <= PrecisionPConfusion) {
-// const Standard_Real PiPi = PI+PI;
+// const Standard_Real PiPi = M_PI+M_PI;
if(newParam >= ParamMinOnLine && newParam <= ParamMaxOnLine
/*PiPi >= ParamMinOnLine && PiPi<=ParamMaxOnLine*/) {
SortAgain = Standard_True;
}
}
if(myHS1IsUPeriodic) {
- lmf = PI+PI; //-- myHS1->UPeriod();
+ lmf = M_PI+M_PI; //-- myHS1->UPeriod();
f = myHS1->FirstUParameter();
l = myHS1->LastUParameter();
fpls2=0.5*(f+l);
}
if(myHS1IsVPeriodic) {
- lmf = PI+PI; //-- myHS1->VPeriod();
+ lmf = M_PI+M_PI; //-- myHS1->VPeriod();
f = myHS1->FirstVParameter();
l = myHS1->LastVParameter();
fpls2=0.5*(f+l);
//-- while(v1 > l) { v1-=lmf; }
}
if(myHS2IsUPeriodic) {
- lmf = PI+PI; //-- myHS2->UPeriod();
+ lmf = M_PI+M_PI; //-- myHS2->UPeriod();
f = myHS2->FirstUParameter();
l = myHS2->LastUParameter();
fpls2=0.5*(f+l);
//-- while(u2 > l) { u2-=lmf; }
}
if(myHS2IsVPeriodic) {
- lmf = PI+PI; //-- myHS2->VPeriod();
+ lmf = M_PI+M_PI; //-- myHS2->VPeriod();
f = myHS2->FirstVParameter();
l = myHS2->LastVParameter();
fpls2=0.5*(f+l);
{
para = ElCLib::Parameter((*((Handle(IntPatch_GLine)*)&lin))->Circle(),Psurf);
if ((para <= upper && para >= lower) ||
- (para + 2.*PI <=upper && para + 2.*PI >= lower) ||
- (para - 2.*PI <=upper && para - 2.*PI >= lower)) {
+ (para + 2.*M_PI <=upper && para + 2.*M_PI >= lower) ||
+ (para - 2.*M_PI <=upper && para - 2.*M_PI >= lower)) {
pt = ElCLib::Value(para,(*((Handle(IntPatch_GLine)*)&lin))->Circle());
dist = Psurf.Distance(pt);
if (dist< distmin) {
{
para = ElCLib::Parameter((*((Handle(IntPatch_GLine)*)&lin))->Ellipse(),Psurf);
if ((para <= upper && para >= lower) ||
- (para + 2.*PI <=upper && para + 2.*PI >= lower) ||
- (para - 2.*PI <=upper && para - 2.*PI >= lower)) {
+ (para + 2.*M_PI <=upper && para + 2.*M_PI >= lower) ||
+ (para - 2.*M_PI <=upper && para - 2.*M_PI >= lower)) {
pt = ElCLib::Value(para,(*((Handle(IntPatch_GLine)*)&lin))->Ellipse());
dist = Psurf.Distance(pt);
if (dist< distmin) {
}
break;
case GeomAbs_Sphere: {
- Ptreference = ElSLib::Value(PI/4.,PI/4.,S1->Sphere());
+ Ptreference = ElSLib::Value(M_PI/4.,M_PI/4.,S1->Sphere());
}
break;
case GeomAbs_Cone: {
quad2.Parameters(P,u2,v2);
point.SetValue(P,TolArc,Standard_False);
point.SetParameters(u1,v1,u2,v2);
- point.SetParameter(PI+PI);
+ point.SetParameter(M_PI+M_PI);
glin->AddVertex(point);
}
}
quad2.Parameters(P,u2,v2);
point.SetValue(P,TolArc,Standard_False);
point.SetParameters(u1,v1,u2,v2);
- point.SetParameter(PI+PI);
+ point.SetParameter(M_PI+M_PI);
glin->AddVertex(point);
}
}
IntPatch_Point pmult1;
IntPatch_Point pmult2;
elipsol = inter.Ellipse(1);
- gp_Pnt pttang1(ElCLib::Value(PI*0.5,elipsol));
- gp_Pnt pttang2(ElCLib::Value(1.5*PI,elipsol));
+ gp_Pnt pttang1(ElCLib::Value(M_PI*0.5,elipsol));
+ gp_Pnt pttang2(ElCLib::Value(1.5*M_PI,elipsol));
Multpoint = Standard_True;
pmult1.SetValue(pttang1,Tol,Standard_True);
//-- Transition calculee au point 0 -> Trans2 , Trans1
//-- car ici, on devarit calculer en PI
Handle(IntPatch_GLine) glig = new IntPatch_GLine(elipsol,Standard_False,trans2,trans1);
- pmult1.SetParameter(PI/2.);
+ pmult1.SetParameter(M_PI/2.);
glig->AddVertex(pmult1);
glig->SetFirstPoint(1);
- pmult2.SetParameter(1.5*PI);
+ pmult2.SetParameter(1.5*M_PI);
glig->AddVertex(pmult2);
glig->SetLastPoint(2);
slin.Append(glig);
//-- Transitions calculee au point 0 OK
glig = new IntPatch_GLine(elipsol,Standard_False,trans1,trans2);
- pmult2.SetParameter(-PI/2.);
+ pmult2.SetParameter(-M_PI/2.);
glig->AddVertex(pmult2);
glig->SetFirstPoint(1);
glig->AddVertex(pmult1);
Standard_Real param2 = ElCLib::Parameter(elipsol,pttang2);
Standard_Real parampourtransition;
if (param1 < param2) {
- pmult1.SetParameter(PI*0.5);
- pmult2.SetParameter(1.5*PI);
- parampourtransition = PI;
+ pmult1.SetParameter(M_PI*0.5);
+ pmult2.SetParameter(1.5*M_PI);
+ parampourtransition = M_PI;
}
else {
- pmult1.SetParameter(-PI*0.5);
- pmult2.SetParameter(PI*0.5);
+ pmult1.SetParameter(-M_PI*0.5);
+ pmult2.SetParameter(M_PI*0.5);
parampourtransition = 0.0;
}
slin.Append(glig);
if (param1 < param2) {
- pmult2.SetParameter(-PI*0.5);
+ pmult2.SetParameter(-M_PI*0.5);
}
else {
- pmult1.SetParameter(1.5*PI);
+ pmult1.SetParameter(1.5*M_PI);
}
//-- Sur l'autre ligne, on invertse la transition
switch(typeS1)
{
case GeomAbs_Torus:
- while(V1<(V1p-1.5*PI)) V1+=PI+PI;
- while(V1>(V1p+1.5*PI)) V1-=PI+PI;
+ while(V1<(V1p-1.5*M_PI)) V1+=M_PI+M_PI;
+ while(V1>(V1p+1.5*M_PI)) V1-=M_PI+M_PI;
case GeomAbs_Cylinder:
case GeomAbs_Cone:
case GeomAbs_Sphere:
- while(U1<(U1p-1.5*PI)) U1+=PI+PI;
- while(U1>(U1p+1.5*PI)) U1-=PI+PI;
+ while(U1<(U1p-1.5*M_PI)) U1+=M_PI+M_PI;
+ while(U1>(U1p+1.5*M_PI)) U1-=M_PI+M_PI;
}
switch(typeS2)
{
case GeomAbs_Torus:
- while(V2<(V2p-1.5*PI)) V2+=PI+PI;
- while(V2>(V2p+1.5*PI)) V2-=PI+PI;
+ while(V2<(V2p-1.5*M_PI)) V2+=M_PI+M_PI;
+ while(V2>(V2p+1.5*M_PI)) V2-=M_PI+M_PI;
case GeomAbs_Cylinder:
case GeomAbs_Cone:
case GeomAbs_Sphere:
- while(U2<(U2p-1.5*PI)) U2+=PI+PI;
- while(U2>(U2p+1.5*PI)) U2-=PI+PI;
+ while(U2<(U2p-1.5*M_PI)) U2+=M_PI+M_PI;
+ while(U2>(U2p+1.5*M_PI)) U2-=M_PI+M_PI;
}
pt.SetParameters(U1,V1,U2,V2);
}
Standard_Real aCf, aTwoPI;
//
aCf=0.;
- aTwoPI=PI+PI;
- if ((U1-AnU1) > 1.5*PI) {
- while ((U1-AnU1) > (1.5*PI+aCf*aTwoPI)) {
+ aTwoPI=M_PI+M_PI;
+ if ((U1-AnU1) > 1.5*M_PI) {
+ while ((U1-AnU1) > (1.5*M_PI+aCf*aTwoPI)) {
aCf=aCf+1.;
}
U1=U1-aCf*aTwoPI;
}
//
else {
- while ((U1-AnU1) < (-1.5*PI-aCf*aTwoPI)) {
+ while ((U1-AnU1) < (-1.5*M_PI-aCf*aTwoPI)) {
aCf=aCf+1.;
}
U1=U1+aCf*aTwoPI;
}
// was:
- //if ((U1-AnU1) > 1.5*PI) {
- // U1-=PI+PI;
+ //if ((U1-AnU1) > 1.5*M_PI) {
+ // U1-=M_PI+M_PI;
//}
- //else if ((U1-AnU1) < -1.5*PI) {
- // U1+=PI+PI;
+ //else if ((U1-AnU1) < -1.5*M_PI) {
+ // U1+=M_PI+M_PI;
//}
//modified by NIZNHY-PKV Fri Mar 28 15:06:11 2008t
}
case GeomAbs_Cone:
case GeomAbs_Sphere:
case GeomAbs_Torus:
- while(U2<(AnU2-1.5*PI)) U2+=PI+PI;
- while(U2>(AnU2+1.5*PI)) U2-=PI+PI;
+ while(U2<(AnU2-1.5*M_PI)) U2+=M_PI+M_PI;
+ while(U2>(AnU2+1.5*M_PI)) U2-=M_PI+M_PI;
break;
default:
break;
}
if(typeS2==GeomAbs_Torus) {
- while(V2<(AnV2-1.5*PI)) V2+=PI+PI;
- while(V2>(AnV2+1.5*PI)) V2-=PI+PI;
+ while(V2<(AnV2-1.5*M_PI)) V2+=M_PI+M_PI;
+ while(V2>(AnV2+1.5*M_PI)) V2-=M_PI+M_PI;
}
thelin->SetUV(k,Standard_True,U2,V2);
}
case GeomAbs_Cone:
case GeomAbs_Sphere:
case GeomAbs_Torus:
- while(U2<(AnU2-1.5*PI)) U2+=PI+PI;
- while(U2>(AnU2+1.5*PI)) U2-=PI+PI;
+ while(U2<(AnU2-1.5*M_PI)) U2+=M_PI+M_PI;
+ while(U2>(AnU2+1.5*M_PI)) U2-=M_PI+M_PI;
break;
default:
break;
}
if(typeS2==GeomAbs_Torus) {
- while(V2<(AnV2-1.5*PI)) V2+=PI+PI;
- while(V2>(AnV2+1.5*PI)) V2-=PI+PI;
+ while(V2<(AnV2-1.5*M_PI)) V2+=M_PI+M_PI;
+ while(V2>(AnV2+1.5*M_PI)) V2-=M_PI+M_PI;
}
thelin->SetUV(k,Standard_False,U2,V2);
Standard_Real u = U1;
// case: no adjustment
- if( U1 > 0. && U1 < (2.*PI) )
+ if( U1 > 0. && U1 < (2.*M_PI) )
return u;
// case: near '0'
if( U1 == 0. || fabs(U1) <= 1.e-9 ) {
- if( U2 > 0. && U2 < (2.*PI) )
- u = ( U2 < ((2.*PI)-U2) ) ? 0. : (2.*PI);
+ if( U2 > 0. && U2 < (2.*M_PI) )
+ u = ( U2 < ((2.*M_PI)-U2) ) ? 0. : (2.*M_PI);
else {
Standard_Real uu = U2;
- if( U2 > (2.*PI) )
- while( uu > (2.*PI) )
- uu -= (2.*PI);
+ if( U2 > (2.*M_PI) )
+ while( uu > (2.*M_PI) )
+ uu -= (2.*M_PI);
else
while( uu < 0.)
- uu += (2.*PI);
+ uu += (2.*M_PI);
- u = ( uu < ((2.*PI)-uu) ) ? 0. : (2.*PI);
+ u = ( uu < ((2.*M_PI)-uu) ) ? 0. : (2.*M_PI);
}
}
// case: near '2PI'
- else if( U1 == (2.*PI) || fabs((2.*PI)-fabs(U1)) <= 1.e-9 ) {
- if( U2 > 0. && U2 < (2.*PI) )
- u = ( U2 < ((2.*PI)-U2) ) ? 0. : (2.*PI);
+ else if( U1 == (2.*M_PI) || fabs((2.*M_PI)-fabs(U1)) <= 1.e-9 ) {
+ if( U2 > 0. && U2 < (2.*M_PI) )
+ u = ( U2 < ((2.*M_PI)-U2) ) ? 0. : (2.*M_PI);
else {
Standard_Real uu = U2;
- if( U2 > (2.*PI) )
- while( uu > (2.*PI) )
- uu -= (2.*PI);
+ if( U2 > (2.*M_PI) )
+ while( uu > (2.*M_PI) )
+ uu -= (2.*M_PI);
else
while( uu < 0.)
- uu += (2.*PI);
+ uu += (2.*M_PI);
- u = ( uu < ((2.*PI)-uu) ) ? 0. : (2.*PI);
+ u = ( uu < ((2.*M_PI)-uu) ) ? 0. : (2.*M_PI);
}
}
// case: '<0. || >2PI'
else {
if(U1 < 0.)
while(u < 0.)
- u += 2.*PI;
- if(U1 > (2.*PI))
- while(u > (2.*PI))
- u -= (2.*PI);
+ u += 2.*M_PI;
+ if(U1 > (2.*M_PI))
+ while(u > (2.*M_PI))
+ u -= (2.*M_PI);
}
return u;
Standard_Real u = Un;
if( Un < 0. )
while(u < 0.)
- u += (2.*PI);
- else if( Un > (2.*PI) )
- while( u > (2.*PI) )
- u -= (2.*PI);
+ u += (2.*M_PI);
+ else if( Un > (2.*M_PI) )
+ while( u > (2.*M_PI) )
+ u -= (2.*M_PI);
else if(Un == 0. || fabs(Un) <= 1.e-9)
- u = (fabs(Up) < fabs(2.*PI-Up)) ? 0. : (2.*PI);
- else if(Un == (2.*PI) || fabs(Un-(2.*PI)) <= 1.e-9)
- u = (fabs(Up) < fabs(2.*PI-Up)) ? 0. : (2.*PI);
- else //( Un > 0. && Un < (2.*PI) )
+ u = (fabs(Up) < fabs(2.*M_PI-Up)) ? 0. : (2.*M_PI);
+ else if(Un == (2.*M_PI) || fabs(Un-(2.*M_PI)) <= 1.e-9)
+ u = (fabs(Up) < fabs(2.*M_PI-Up)) ? 0. : (2.*M_PI);
+ else //( Un > 0. && Un < (2.*M_PI) )
return u;
return u;
}
}
if(Quad.TypeQuadric() == GeomAbs_Sphere) {
- Standard_Real Vapx1 = PI/2., Vapx2 = -PI/2.;
+ Standard_Real Vapx1 = M_PI/2., Vapx2 = -M_PI/2.;
Standard_Real U1 = 0., V1 = 0., U2 = 0., V2 = 0.;
if(IsReversed) {
Result->Value(1).ParametersOnS2(U1,V1);
static inline Standard_Boolean IsSeamParameter(const Standard_Real U,
const Standard_Real TOL2D)
{
- return (fabs(U) <= TOL2D || fabs(2.*PI - U) <= TOL2D);
+ return (fabs(U) <= TOL2D || fabs(2.*M_PI - U) <= TOL2D);
}
static inline Standard_Real AdjustU(const Standard_Real U)
{
- Standard_Real u = U, DBLPI = 2.*PI;
+ Standard_Real u = U, DBLPI = 2.*M_PI;
if(u < 0. || u > DBLPI) {
if(u < 0.)
while(u < 0.)
else
Line->Value(ipp).ParametersOnS1(U1,V1); // S1 - quadric
Standard_Real u = AdjustUFirst(U,U1);
- if(fabs(u-U) >= 1.5*PI) {
+ if(fabs(u-U) >= 1.5*M_PI) {
Standard_Real U2 = 0., V2 = 0.;
if(IsReversed) {
Line->Value(ip).ParametersOnS1(U2,V2); // prm
}
U1 = AdjustU(U1);
U2 = AdjustU(U2);
- Standard_Boolean pnearZero = (fabs(U1) < fabs(2.*PI-U1)) ? Standard_True : Standard_False;
- Standard_Boolean cnearZero = (fabs(U) < fabs(2.*PI-U)) ? Standard_True : Standard_False;
+ Standard_Boolean pnearZero = (fabs(U1) < fabs(2.*M_PI-U1)) ? Standard_True : Standard_False;
+ Standard_Boolean cnearZero = (fabs(U) < fabs(2.*M_PI-U)) ? Standard_True : Standard_False;
if(pnearZero == cnearZero) {
if(!IsSeamParameter(U2,TOL2D) && !IsSeamParameter(U1,TOL2D)) {
- Standard_Real nU = (cnearZero) ? (2.*PI) : 0.;
+ Standard_Real nU = (cnearZero) ? (2.*M_PI) : 0.;
IntSurf_PntOn2S nP;
nP.SetValue(aP.Value());
Standard_Real U3 = 0., V3 = 0.;
}
else {
if(!IsSeamParameter(U2,TOL2D) && !IsSeamParameter(U1,TOL2D)) {
- Standard_Real nU = (cnearZero) ? (2.*PI) : 0.;
+ Standard_Real nU = (cnearZero) ? (2.*M_PI) : 0.;
IntSurf_PntOn2S nP;
nP.SetValue(aP.Value());
Standard_Real U3 = 0., V3 = 0.;
}
if(!doU && Quad.TypeQuadric() == GeomAbs_Sphere) {
- if(fabs(fabs(U1)-fabs(U2)) > (PI/16.)) doU = Standard_True;
+ if(fabs(fabs(U1)-fabs(U2)) > (M_PI/16.)) doU = Standard_True;
- if(doU && (fabs(U1) <= 1.e-9 || fabs(U1-2.*PI) <= 1.e-9)) {
- if(fabs(V1-PI/2.) <= 1.e-9 || fabs(V1+PI/2.) <= 1.e-9) {}
+ if(doU && (fabs(U1) <= 1.e-9 || fabs(U1-2.*M_PI) <= 1.e-9)) {
+ if(fabs(V1-M_PI/2.) <= 1.e-9 || fabs(V1+M_PI/2.) <= 1.e-9) {}
else {
doU = Standard_False;
}
Standard_Real Uapx = 0., Vapx = 0.;
Quad.Parameters(Quad.Cone().Apex(),Uapx,Vapx);
- if(fabs(fabs(U1)-fabs(U2)) > PI/32.) doU = Standard_True;
+ if(fabs(fabs(U1)-fabs(U2)) > M_PI/32.) doU = Standard_True;
- if(doU && (fabs(U1) <= 1.e-9 || fabs(U1-2.*PI) <= 1.e-9)) {
+ if(doU && (fabs(U1) <= 1.e-9 || fabs(U1-2.*M_PI) <= 1.e-9)) {
if(fabs(V1-Vapx) <= 1.e-9) {}
else {
doU = Standard_False;
FConjugated = 0;
}
if(IsSeamParameter(Uv,TOL2D)) {
- Standard_Real Ucv = (fabs(Uv) < fabs(2.*PI-Uv)) ? (2.*PI) : 0.;
+ Standard_Real Ucv = (fabs(Uv) < fabs(2.*M_PI-Uv)) ? (2.*M_PI) : 0.;
gp_Pnt2d a2DCV(Ucv,Vv);
Standard_Real CDist = a2DCV.Distance(a2DPF);
if(CDist < DistMinF) {
LConjugated = 0;
}
if(IsSeamParameter(Uv,TOL2D)) {
- Standard_Real Ucv = (fabs(Uv) < fabs(2.*PI-Uv)) ? (2.*PI) : 0.;
+ Standard_Real Ucv = (fabs(Uv) < fabs(2.*M_PI-Uv)) ? (2.*M_PI) : 0.;
gp_Pnt2d a2DCV(Ucv,Vv);
Standard_Real CDist = a2DCV.Distance(a2DPL);
if(CDist < DistMinL) {
else
aV.ParametersOnS1(Uv,Vv);
if(IsSeamParameter(Uv,TOL2D)) {
- Standard_Real Ucv = (fabs(Uv) < fabs(2.*PI-Uv)) ? (2.*PI) : 0.;
+ Standard_Real Ucv = (fabs(Uv) < fabs(2.*M_PI-Uv)) ? (2.*M_PI) : 0.;
Standard_Boolean test = TestMiddleOnPrm(aPF,aV,IsReversed,ArcTol,PDomain);
if(test) {
VrtF.SetValue(aV.Value());
else
aV.ParametersOnS1(Uv,Vv);
if(IsSeamParameter(Uv,TOL2D)) {
- Standard_Real Ucv = (fabs(Uv) < fabs(2.*PI-Uv)) ? (2.*PI) : 0.;
+ Standard_Real Ucv = (fabs(Uv) < fabs(2.*M_PI-Uv)) ? (2.*M_PI) : 0.;
Standard_Boolean test = TestMiddleOnPrm(aPL,aV,IsReversed,ArcTol,PDomain);
if(test) {
VrtL.SetValue(aV.Value());
Standard_Integer NbPnts = SSLine->NbPoints();
- Standard_Real BSEAM = 1.5*PI; // delta U crossing seam
- Standard_Real BAPEX = PI/16.; // delta U crossing apex
+ Standard_Real BSEAM = 1.5*M_PI; // delta U crossing seam
+ Standard_Real BAPEX = M_PI/16.; // delta U crossing apex
Standard_Integer i = 0, k = 0;
Standard_Real U1 = 0., U2 = 0., V1 = 0., V2 = 0., AnU1 = 0., AnV1 = 0., DU1 = 0., DV1 = 0.;
if(T != GeomAbs_OffsetSurface)
{
Handle(Geom_Curve) gc = GS->UIso(U);
- if(IsVP && (FirstV == 0.0 && LastV == (2.*PI))) I = gc;
+ if(IsVP && (FirstV == 0.0 && LastV == (2.*M_PI))) I = gc;
else
{
Handle(Geom_TrimmedCurve) gtc = new Geom_TrimmedCurve(gc,FirstV,LastV);
if(IsVP || IsVC || GACT == GeomAbs_BSplineCurve || GACT == GeomAbs_BezierCurve || Abs(LastV - FirstV) < 1.e+5)
{
Handle(Geom_Curve) gc = gos->UIso(U);
- if(IsVP && (FirstV == 0.0 && LastV == (2*PI))) I = gc;
+ if(IsVP && (FirstV == 0.0 && LastV == (2*M_PI))) I = gc;
else
{
Handle(Geom_TrimmedCurve) gtc = new Geom_TrimmedCurve(gc,FirstV,LastV);
if(T != GeomAbs_OffsetSurface)
{
Handle(Geom_Curve) gc = GS->VIso(V);
- if(IsUP && (FirstU == 0.0 && LastU == (2*PI))) I = gc;
+ if(IsUP && (FirstU == 0.0 && LastU == (2*M_PI))) I = gc;
else
{
Handle(Geom_TrimmedCurve) gtc = new Geom_TrimmedCurve(gc,FirstU,LastU);
if(IsUP || IsUC || GACT == GeomAbs_BSplineCurve || GACT == GeomAbs_BezierCurve || Abs(LastU - FirstU) < 1.e+5)
{
Handle(Geom_Curve) gc = gos->VIso(V);
- if(IsUP && (FirstU == 0.0 && LastU == (2*PI))) I = gc;
+ if(IsUP && (FirstU == 0.0 && LastU == (2*M_PI))) I = gc;
else
{
Handle(Geom_TrimmedCurve) gtc = new Geom_TrimmedCurve(gc,FirstU,LastU);
}
}
if(myHS1IsUPeriodic) {
- lmf = PI+PI; //-- myHS1->UPeriod();
+ lmf = M_PI+M_PI; //-- myHS1->UPeriod();
f = myHS1->FirstUParameter();
l = myHS1->LastUParameter();
while(u1 < f) { u1+=lmf; }
while(u1 > l) { u1-=lmf; }
}
if(myHS1IsVPeriodic) {
- lmf = PI+PI; //-- myHS1->VPeriod();
+ lmf = M_PI+M_PI; //-- myHS1->VPeriod();
f = myHS1->FirstVParameter();
l = myHS1->LastVParameter();
while(v1 < f) { v1+=lmf; }
while(v1 > l) { v1-=lmf; }
}
if(myHS2IsUPeriodic) {
- lmf = PI+PI; //-- myHS2->UPeriod();
+ lmf = M_PI+M_PI; //-- myHS2->UPeriod();
f = myHS2->FirstUParameter();
l = myHS2->LastUParameter();
while(u2 < f) { u2+=lmf; }
while(u2 > l) { u2-=lmf; }
}
if(myHS2IsVPeriodic) {
- lmf = PI+PI; //-- myHS2->VPeriod();
+ lmf = M_PI+M_PI; //-- myHS2->VPeriod();
f = myHS2->FirstVParameter();
l = myHS2->LastVParameter();
while(v2 < f) { v2+=lmf; }
case IntPatch_Circle:
case IntPatch_Ellipse:
- lastp = PI+PI;
+ lastp = M_PI+M_PI;
break;
default:
{
if(i!=j) {
if ((typl == IntPatch_Circle || typl == IntPatch_Ellipse) && i>j) {
IntPatch_Point Vtx=GLine->Vertex(j);
- Vtx.SetParameter(GLine->Vertex(j).ParameterOnLine()+PI+PI);
+ Vtx.SetParameter(GLine->Vertex(j).ParameterOnLine()+M_PI+M_PI);
glig->AddVertex(Vtx);
- IndexLastVertex+=AppendSameVertexG(glig,GLine,j,PI+PI,TabIndex);
+ IndexLastVertex+=AppendSameVertexG(glig,GLine,j,M_PI+M_PI,TabIndex);
}
else {
glig->AddVertex(GLine->Vertex(j));
}
if(typl == IntPatch_Circle || typl == IntPatch_Ellipse) {
firstp = GLine->Vertex(nbvtx).ParameterOnLine();
- lastp = PI + PI + GLine->Vertex(1).ParameterOnLine();
+ lastp = M_PI + M_PI + GLine->Vertex(1).ParameterOnLine();
Standard_Real cadrinf = LocalFirstParameter(L);
Standard_Real cadrsup = LocalLastParameter(L);
Standard_Real acadr = (firstp+lastp)*0.5;
- while(acadr < cadrinf) { acadr+=PI+PI; }
- while(acadr > cadrsup) { acadr-=PI+PI; }
+ while(acadr < cadrinf) { acadr+=M_PI+M_PI; }
+ while(acadr > cadrsup) { acadr-=M_PI+M_PI; }
if(acadr>=cadrinf && acadr<=cadrsup) {
if(Abs(firstp-lastp)>Precision::PConfusion()) {
intrvtested = Standard_True;
case GeomAbs_Cone:
case GeomAbs_Sphere:
case GeomAbs_Torus:
- while(U1<(U1p-1.5*PI)) U1+=PI+PI;
- while(U1>(U1p+1.5*PI)) U1-=PI+PI;
+ while(U1<(U1p-1.5*M_PI)) U1+=M_PI+M_PI;
+ while(U1>(U1p+1.5*M_PI)) U1-=M_PI+M_PI;
break;
default:
break;
}
if(typeS1==GeomAbs_Torus) {
- while(V1<(V1p-1.5*PI)) V1+=PI+PI;
- while(V1>(V1p+1.5*PI)) V1-=PI+PI;
+ while(V1<(V1p-1.5*M_PI)) V1+=M_PI+M_PI;
+ while(V1>(V1p+1.5*M_PI)) V1-=M_PI+M_PI;
}
switch(typeS2) {
case GeomAbs_Cone:
case GeomAbs_Sphere:
case GeomAbs_Torus:
- while(U2<(U2p-1.5*PI)) U2+=PI+PI;
- while(U2>(U2p+1.5*PI)) U2-=PI+PI;
+ while(U2<(U2p-1.5*M_PI)) U2+=M_PI+M_PI;
+ while(U2>(U2p+1.5*M_PI)) U2-=M_PI+M_PI;
break;
default:
break;
}
if(typeS2==GeomAbs_Torus) {
- while(V2<(V1p-1.5*PI)) V2+=PI+PI;
- while(V2>(V2p+1.5*PI)) V2-=PI+PI;
+ while(V2<(V1p-1.5*M_PI)) V2+=M_PI+M_PI;
+ while(V2>(V2p+1.5*M_PI)) V2-=M_PI+M_PI;
}
}
BPLin.Get(xmin,ymin,xmax,ymax);
g = BPLin.GetGap();
BPLin.SetVoid();
- BPLin.Update(xmin-PI-PI,ymin,
- xmax+PI+PI,ymax);
+ BPLin.Update(xmin-M_PI-M_PI,ymin,
+ xmax+M_PI+M_PI,ymax);
BPLin.SetGap(g);
}
if(SurfaceIsBiPeriodic) {
BPLin.Get(xmin,ymin,xmax,ymax);
g = BPLin.GetGap();
BPLin.SetVoid();
- BPLin.Update(xmin,ymin-PI-PI,
- xmax,ymax+PI+PI);
+ BPLin.Update(xmin,ymin-M_PI-M_PI,
+ xmax,ymax+M_PI+M_PI);
BPLin.SetGap(g);
}
do {
if(IndiceOffsetBiPeriodic == 1)
- OffsetV = -PI-PI;
+ OffsetV = -M_PI-M_PI;
else if(IndiceOffsetBiPeriodic == 2)
- OffsetV = PI+PI;
+ OffsetV = M_PI+M_PI;
do {
if(IndiceOffsetPeriodic == 1)
- OffsetU = -PI-PI;
+ OffsetU = -M_PI-M_PI;
else if(IndiceOffsetPeriodic == 2)
- OffsetU = PI+PI;
+ OffsetU = M_PI+M_PI;
Brise.SetOffset(OffsetU,OffsetV);
case GeomAbs_Cylinder:
case GeomAbs_Cone:
case GeomAbs_Sphere:
- pu1=PI+PI;
+ pu1=M_PI+M_PI;
break;
case GeomAbs_Torus:
- pu1=pv1=PI+PI;
+ pu1=pv1=M_PI+M_PI;
break;
default:
{
case GeomAbs_Cone:
case GeomAbs_Sphere:
- pu2=PI+PI;
+ pu2=M_PI+M_PI;
break;
case GeomAbs_Torus:
- pu2=pv2=PI+PI;
+ pu2=pv2=M_PI+M_PI;
break;
default:
{
|| surf->GetType()==GeomAbs_Torus
|| surf->GetType()==GeomAbs_Sphere
|| 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;
U1 = Umin-uuu*0.5;
- U2 = U1+PI+PI;
+ U2 = U1+M_PI+M_PI;
}
else {
U1=U2=0.0;
}
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;
V1 = Vmin-uuu*0.5;
- V2 = V1+PI+PI;
+ V2 = V1+M_PI+M_PI;
}
else {
V1=V2=0.0;
Standard_Real eps = 1.e-14;
if(!aPlDir.IsEqual(aCirDir, eps)) {
Standard_Integer aNbP = 11;
- Standard_Real dt = 2.*PI / (aNbP - 1), t;
- for(t = 0.; t < 2.*PI; t += dt) {
+ Standard_Real dt = 2.*M_PI / (aNbP - 1), t;
+ for(t = 0.; t < 2.*M_PI; t += dt) {
Standard_Real d = aPln.Distance(ElCLib::Value(t, aCir));
if(myTolReached3d < d) myTolReached3d = d;
}
TColStd_SequenceOfReal aSeqFprm, aSeqLprm;
aNul=0.;
- aPeriod=PI+PI;
+ aPeriod=M_PI+M_PI;
for (i=1; i<=aNbParts; i++) {
myLConstruct.Part(i, fprm, lprm);
lprm=aSeqLprm(i);
//
Standard_Real aRealEpsilon=RealEpsilon();
- if (Abs(fprm) > aRealEpsilon || Abs(lprm-2.*PI) > aRealEpsilon) {
+ if (Abs(fprm) > aRealEpsilon || Abs(lprm-2.*M_PI) > aRealEpsilon) {
//==============================================
////
IntTools_Curve aCurve;
}
mySeqOfCurve.Append(aCurve);
//==============================================
- } //if (Abs(fprm) > RealEpsilon() || Abs(lprm-2.*PI) > RealEpsilon())
+ } //if (Abs(fprm) > RealEpsilon() || Abs(lprm-2.*M_PI) > RealEpsilon())
else {
// on regarde si on garde
//
if (aNbParts==1) {
-// if (Abs(fprm) < RealEpsilon() && Abs(lprm-2.*PI) < RealEpsilon()) {
- if (Abs(fprm) <= aRealEpsilon && Abs(lprm-2.*PI) <= aRealEpsilon) {
+// if (Abs(fprm) < RealEpsilon() && Abs(lprm-2.*M_PI) < RealEpsilon()) {
+ if (Abs(fprm) <= aRealEpsilon && Abs(lprm-2.*M_PI) <= aRealEpsilon) {
IntTools_Curve aCurve;
Handle(Geom_TrimmedCurve) aTC3D=new Geom_TrimmedCurve(newc,fprm,lprm);
aCurve.SetCurve(aTC3D);
//
Standard_Real aTwoPIdiv17, u1, v1, u2, v2, Tol;
- aTwoPIdiv17=2.*PI/17.;
+ aTwoPIdiv17=2.*M_PI/17.;
for (j=0; j<=17; j++) {
gp_Pnt ptref (newc->Value (j*aTwoPIdiv17));
GeomAdaptor_Curve aC1( new Geom_Circle(aCircle1) );
GeomAdaptor_Curve aC2( new Geom_Circle(aCircle2) );
- Extrema_ExtCC anExtrema(aC1, aC2, 0, 2.*Standard_PI, 0, 2.*Standard_PI,
+ Extrema_ExtCC anExtrema(aC1, aC2, 0, 2. * M_PI, 0, 2. * M_PI,
Precision::PConfusion(), Precision::PConfusion());
if ( anExtrema.IsDone() ) {
aSeqResultRad.Append( aCriteria );
// torus is u and v periodic
- const Standard_Real twoPI = Standard_PI + Standard_PI;
+ const Standard_Real twoPI = M_PI + M_PI;
Standard_Real arr1tmp[2] = {pr1.X(), pr1.Y()};
Standard_Real arr2tmp[2] = {pr2.X(), pr2.Y()};
else {
Standard_Real anAngle = aNewVec.Angle(aVecOld);
- if((fabs(anAngle) < (Standard_PI * 0.25)) && (aNewVec.Dot(aVecOld) > 0.)) {
+ if((fabs(anAngle) < (M_PI * 0.25)) && (aNewVec.Dot(aVecOld) > 0.)) {
if(bCheckAngle1) {
Standard_Real U1, U2, V1, V2;
}
}
if(myHS1IsUPeriodic) {
- const Standard_Real lmf = PI+PI; //-- myHS1->UPeriod();
+ const Standard_Real lmf = M_PI+M_PI; //-- myHS1->UPeriod();
const Standard_Real f = myHS1->FirstUParameter();
const Standard_Real l = myHS1->LastUParameter();
while(u1 < f) { u1+=lmf; }
while(u1 > l) { u1-=lmf; }
}
if(myHS1IsVPeriodic) {
- const Standard_Real lmf = PI+PI; //-- myHS1->VPeriod();
+ const Standard_Real lmf = M_PI+M_PI; //-- myHS1->VPeriod();
const Standard_Real f = myHS1->FirstVParameter();
const Standard_Real l = myHS1->LastVParameter();
while(v1 < f) { v1+=lmf; }
while(v1 > l) { v1-=lmf; }
}
if(myHS2IsUPeriodic) {
- const Standard_Real lmf = PI+PI; //-- myHS2->UPeriod();
+ const Standard_Real lmf = M_PI+M_PI; //-- myHS2->UPeriod();
const Standard_Real f = myHS2->FirstUParameter();
const Standard_Real l = myHS2->LastUParameter();
while(u2 < f) { u2+=lmf; }
while(u2 > l) { u2-=lmf; }
}
if(myHS2IsVPeriodic) {
- const Standard_Real lmf = PI+PI; //-- myHS2->VPeriod();
+ const Standard_Real lmf = M_PI+M_PI; //-- myHS2->VPeriod();
const Standard_Real f = myHS2->FirstVParameter();
const Standard_Real l = myHS2->LastVParameter();
while(v2 < f) { v2+=lmf; }
if(typl == IntPatch_Circle || typl == IntPatch_Ellipse)
{
firstp = GeomInt_LineTool::Vertex(L,nbvtx).ParameterOnLine();
- lastp = PI + PI + GeomInt_LineTool::Vertex(L,1).ParameterOnLine();
+ lastp = M_PI + M_PI + GeomInt_LineTool::Vertex(L,1).ParameterOnLine();
const Standard_Real cadrinf = GeomInt_LineTool::FirstParameter(L);
const Standard_Real cadrsup = GeomInt_LineTool::LastParameter(L);
Standard_Real acadr = (firstp+lastp)*0.5;
- while(acadr < cadrinf) { acadr+=PI+PI; }
- while(acadr > cadrsup) { acadr-=PI+PI; }
+ while(acadr < cadrinf) { acadr+=M_PI+M_PI; }
+ while(acadr > cadrsup) { acadr-=M_PI+M_PI; }
if(acadr>=cadrinf && acadr<=cadrsup)
{
if(Abs(firstp-lastp)>Precision::PConfusion())
}
}
if (changevtx) {
- thevtx.SetParameter(prm + 2.*PI);
+ thevtx.SetParameter(prm + 2.*M_PI);
glin->Replace(i,thevtx);
}
}
Standard_Real IntTools_Tools::IntermediatePoint (const Standard_Real aFirst,
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;
Standard_Real aParm;
aParm=(1.-PAR_T)*aFirst + PAR_T*aLast;
break;
case GeomAbs_Cylinder: {
Standard_Real aRadius = myS->Cylinder().Radius();
- Standard_Real aMaxAngle = Standard_PI * 0.5;
+ Standard_Real aMaxAngle = M_PI * 0.5;
Standard_Real aDeflection = 1.e-02;
if(aRadius > aDeflection) {
if(aRadius < aCircle.Radius())
aRadius = aCircle.Radius();
- Standard_Real aMaxAngle = Standard_PI * 0.5;
+ Standard_Real aMaxAngle = M_PI * 0.5;
Standard_Real aDeflection = 1.e-02;
if(aRadius > aDeflection) {
aRadius1 = aSphere.Radius();
aRadius2 = aSphere.Radius();
}
- Standard_Real aMaxAngle = Standard_PI * 0.5;
+ Standard_Real aMaxAngle = M_PI * 0.5;
Standard_Real aDeflection = 1.e-02;
if(aRadius1 > aDeflection) {
if(aMaxAngle > Precision::Angular()) {
nbsu = Standard_Integer((usup - uinf) / aMaxAngle);
}
- aMaxAngle = Standard_PI * 0.5;
+ aMaxAngle = M_PI * 0.5;
if(aRadius2 > aDeflection) {
aMaxAngle = ACos(1. - aDeflection / aRadius2) * 2.;
anIsoDir = gp_Dir2d(1, 0);
if(aTangentZoneDir.SquareMagnitude() > gp::Resolution()) {
- Standard_Real piquota = PI*0.25;
+ Standard_Real piquota = M_PI*0.25;
if(fabs(aTangentZoneDir.Angle(anIsoDir)) > piquota) {
Standard_Integer ii = 1, nextii = 2;
}
//==================================================================================
//OCC431(apo): modified ->
- static Standard_Real CosRef2D = Cos(PI/9.0), AngRef2D = PI/2.0;
+ static Standard_Real CosRef2D = Cos(M_PI/9.0), AngRef2D = M_PI/2.0;
static Standard_Real /*tolArea = 100.0,*/ d = 7.0;
Standard_Real tolArea = 100.0;
case GeomAbs_Ellipse:
{
Standard_Real U1,U2,U3,U4;
- Standard_Real UFPlus2PI = UFirst + 2*PI;
+ Standard_Real UFPlus2PI = UFirst + 2*M_PI;
U1 = ElCLib::InPeriod(0.0 ,UFirst,UFPlus2PI);
- U2 = ElCLib::InPeriod(PI/2. ,UFirst,UFPlus2PI);
- U3 = ElCLib::InPeriod(PI ,UFirst,UFPlus2PI);
- U4 = ElCLib::InPeriod(3.*PI/2.,UFirst,UFPlus2PI);
+ U2 = ElCLib::InPeriod(M_PI/2. ,UFirst,UFPlus2PI);
+ U3 = ElCLib::InPeriod(M_PI ,UFirst,UFPlus2PI);
+ U4 = ElCLib::InPeriod(3.*M_PI/2.,UFirst,UFPlus2PI);
if (UFirst <= U1 && U1 <= ULast) {Result.AddExtCur(U1, IsMin);}
if (UFirst <= U2 && U2 <= ULast) {Result.AddExtCur(U2, IsMax);}
Standard_Boolean rev1 = (F1.Orientation() == TopAbs_REVERSED);
Standard_Boolean rev2 = (F2.Orientation() == TopAbs_REVERSED);
- Standard_Real f,l,eps,angmin = PI,angmax = -PI,ang;
+ Standard_Real f,l,eps,angmin = M_PI,angmax = -M_PI,ang;
BRep_Tool::Range(e,f,l);
eps = (l - f)/100.;
TopExp_Explorer exp(myShape,TopAbs_FACE);
Handle(GeomAdaptor_HCurve) HC = new GeomAdaptor_HCurve ();
Standard_Real binf = 0.;
- Standard_Real bsup = 2.*PI;
+ Standard_Real bsup = 2.*M_PI;
for (; exp.More(); exp.Next()) {
Standard_Real Tol = Precision::Confusion();
Handle(Geom_Circle) GC = new Geom_Circle(C);
- GeomAdaptor_Curve AC(GC,0.,2.*PI);
+ GeomAdaptor_Curve AC(GC,0.,2.*M_PI);
BRepIntCurveSurface_Inter theInt;
theInt.Init(S,AC,Tol);
Standard_Real prm1 = ElCLib::Parameter(cit,p1);
Standard_Real Tol2d = Precision::PConfusion();
if (Abs(prm1-ft) <= Tol2d) prm1 = ft;
- prm1 = ElCLib::InPeriod(prm1,ft,ft+2.*PI);
+ prm1 = ElCLib::InPeriod(prm1,ft,ft+2.*M_PI);
ElCLib::D1(prm1,cit,p1,tgt);
Standard_Real prm2 = ElCLib::Parameter(cit,p2);
if (tgt.Dot(tgf) > 0.) { // meme sens
while (prm2 <= prm1) {
- prm2 += 2.*PI;
+ prm2 += 2.*M_PI;
}
}
else {
if (Abs(prm1-ft) <= Precision::Angular()) {
- prm1 += 2.*PI;
+ prm1 += 2.*M_PI;
}
while (prm2 >= prm1) {
- prm2 -= 2.*PI;
+ prm2 -= 2.*M_PI;
}
}
p2 = ElCLib::Value(lf,cif);
Standard_Real prm1 = ElCLib::Parameter(cit,p1);
- prm1 = ElCLib::InPeriod(prm1,ft,ft+2.*PI);
+ prm1 = ElCLib::InPeriod(prm1,ft,ft+2.*M_PI);
ElCLib::D1(prm1,cit,p1,tgt);
Standard_Real prm2 = ElCLib::Parameter(cit,p2);
if (tgt.Dot(tgf) > 0.) { // meme sens
while (prm2 <= prm1) {
- prm2 += 2.*PI;
+ prm2 += 2.*M_PI;
}
}
else {
if (Abs(prm1-ft) <= Precision::Angular()) {
- prm1 += 2.*PI;
+ prm1 += 2.*M_PI;
}
while (prm2 >= prm1) {
- prm2 -= 2.*PI;
+ prm2 -= 2.*M_PI;
}
}
pl = C2d->Value(l);
Standard_Real tttol = Precision::Angular();
while (Min(pf.X(),pl.X()) >= Umaxc-tttol) {
- C2d->Translate(gp_Vec2d(-2.*PI,0));
+ C2d->Translate(gp_Vec2d(-2.*M_PI,0));
pf = C2d->Value(f);
pl = C2d->Value(l);
}
while (Max(pf.X(),pl.X()) <= Uminc+tttol) {
- C2d->Translate(gp_Vec2d(2.*PI,0));
+ C2d->Translate(gp_Vec2d(2.*M_PI,0));
pf = C2d->Value(f);
pl = C2d->Value(l);
}
pl = C2d->Value(l);
Standard_Real tttol = Precision::Angular();
while (Min(pf.X(),pl.X()) >= Umaxc - tttol) {
- C2d->Translate(gp_Vec2d(-2.*PI,0));
+ C2d->Translate(gp_Vec2d(-2.*M_PI,0));
pf = C2d->Value(f);
pl = C2d->Value(l);
}
while (Max(pf.X(),pl.X()) <= Uminc + tttol) {
- C2d->Translate(gp_Vec2d(2.*PI,0));
+ C2d->Translate(gp_Vec2d(2.*M_PI,0));
pf = C2d->Value(f);
pl = C2d->Value(l);
}
if (exp.More()) {
Standard_Real prmmax = BRep_Tool::Parameter
(TopoDS::Vertex(exp.Current()),NewEdg);
- if (Abs(prmmax - prm) <= Epsilon(2.*PI)) {
+ if (Abs(prmmax - prm) <= Epsilon(2.*M_PI)) {
if (orient == TopAbs_REVERSED) {
- prm -= 2.*PI;
+ prm -= 2.*M_PI;
}
else {
- prm += 2.*PI;
+ prm += 2.*M_PI;
}
}
}
Handle(Geom2d_Curve) C2d;
Standard_Integer index = 0, imin=0;
- Standard_Real angmax = -PI, dist, ang;
+ Standard_Real angmax = -M_PI, dist, ang;
for (It.Initialize(Poss); It.More(); It.Next()) {
ang = ref2d.Angle(gp_Dir2d(v2d));
}
else {
- ang = -PI;
+ ang = -M_PI;
}
//if ((dist < dmin - tol) ||
{ myLambda1 = norm2 / norm1;}
else { myLambda1 = norm1 / norm2;}
ang= V1.Angle(V2);
- if (ang>PI/2) myContC1=PI-ang;
+ if (ang>M_PI/2) myContC1=M_PI-ang;
else myContC1=ang;
}
else {myIsDone= Standard_False;
else {myLambda1 = norm1 / norm2;
myLambda2 = norm12 / norm22;}
ang=V12.Angle(V22);
- if (ang>PI/2) myContC2=PI-ang;
+ if (ang>M_PI/2) myContC2=M_PI-ang;
else myContC2=ang; }
else{myIsDone= Standard_False ;
{ Curv1.Tangent(Tang1);
Curv2.Tangent(Tang2);
ang=Tang1.Angle(Tang2);
- if (ang>PI/2) myContG1=PI-ang;
+ if (ang>M_PI/2) myContG1=M_PI-ang;
else myContG1=ang;
}
else {myIsDone= Standard_False ;
Curv1.Normal(D1);
Curv2.Normal(D2);
ang =D1.Angle(D2);
- if (ang>PI/2) myContG2=PI-ang;
+ if (ang>M_PI/2) myContG2=M_PI-ang;
else myContG2=ang;
myCourbC1= Curv1.Curvature();
myCourbC2 = Curv2.Curvature();
Standard_Boolean LocalAnalysis_CurveContinuity::IsC1() const
{
if (!myIsDone) { StdFail_NotDone::Raise();}
- if ( IsC0() && ( (myContC1 <= myepsC1)||(Abs(myContC1-PI)<=myepsC1)))
+ if ( IsC0() && ( (myContC1 <= myepsC1)||(Abs(myContC1-M_PI)<=myepsC1)))
return Standard_True;
else return Standard_False;
}
if (!myIsDone) { StdFail_NotDone::Raise();}
if ( IsC1())
- { if ((myContC2 <= myepsC2)||(Abs(myContC2-PI)<=myepsC2))
+ { if ((myContC2 <= myepsC2)||(Abs(myContC2-M_PI)<=myepsC2))
{ epsil1 = 0.5*myepsC1*myepsC1*myLambda1;
epsil2 = 0.5*myepsC2*myepsC2*myLambda2;
if ( (Abs(myLambda1*myLambda1-myLambda2)) <= (epsil1*epsil1+epsil2))
Standard_Boolean LocalAnalysis_CurveContinuity::IsG1() const
{
if (!myIsDone) { StdFail_NotDone::Raise();}
- if ( IsC0() && (( myContG1 <= myepsG1||(Abs(myContG1-PI)<=myepsG1))))
+ if ( IsC0() && (( myContG1 <= myepsG1||(Abs(myContG1-M_PI)<=myepsG1))))
return Standard_True;
else return Standard_False;
}
else IETA2=1;
if (IETA1 == IETA2)
{ if (IETA1 == 1)
- { Standard_Real eps= RealPart( (myContG2+myepsG2)/PI) * PI;
+ { Standard_Real eps= RealPart( (myContG2+myepsG2)/M_PI) * M_PI;
if (Abs( eps - myepsG2) < myepsG2)
{if (myG2Variation < myperce )
return Standard_True;
myLambda1V= norm2v / norm1v;
else myLambda1V = norm2v / norm1v;
angu= V1u.Angle(V2u);
- if (angu>PI/2) myContC1U=PI-angu;
+ if (angu>M_PI/2) myContC1U=M_PI-angu;
else myContC1U=angu;
angv= V1v.Angle(V2v);
- if (angv>PI/2) myContC1V=PI-angv;
+ if (angv>M_PI/2) myContC1V=M_PI-angv;
else myContC1V=angv; }
else {myIsDone = Standard_False;
myErrorStatus=LocalAnalysis_NullFirstDerivative;}
else {myLambda1U = norm11u / norm12u;
myLambda2U = norm21u / norm22u;}
ang=V21u.Angle(V22u);
- if(ang>PI/2) myContC2U=PI-ang;
+ if(ang>M_PI/2) myContC2U=M_PI-ang;
else myContC2U=ang; }
else
{ myIsDone=Standard_False;
else{ myLambda1V = norm11v / norm12v;
myLambda2V = norm21v / norm22v;}
ang= V21v.Angle(V22v);
- if (ang>PI/2) myContC2V=PI-ang;
+ if (ang>M_PI/2) myContC2V=M_PI-ang;
else myContC2V=ang;
}
else{ myIsDone= Standard_False;
{ gp_Dir D1 = Surf1.Normal();
gp_Dir D2 = Surf2.Normal();
Standard_Real ang=D1.Angle(D2);
- if (ang>PI/2) myContG1= PI-ang;
+ if (ang>M_PI/2) myContG1= M_PI-ang;
else myContG1=ang;
}
else{ myIsDone=Standard_False;
::DownCast(ChangeGeomBis(abisector->BisectorNumber()).ChangeValue());
if(bisector->BasisCurve()->IsPeriodic() && param == Precision::Infinite()) {
- param = bisector->FirstParameter() + 2*PI;
+ param = bisector->FirstParameter() + 2*M_PI;
}
if (param > bisector->BasisCurve()->LastParameter()) {
param = bisector->BasisCurve()->LastParameter();
Param = Bis->Parameter(GeomPnt (apoint));
if (Bisector->BasisCurve()->IsPeriodic()) {
- if (Bisector->FirstParameter() > Param) Param = Param + 2*PI;
+ if (Bisector->FirstParameter() > Param) Param = Param + 2*M_PI;
}
if(Bisector->FirstParameter() >= Param)return Standard_False;
if(Bisector->LastParameter() < Param)return Standard_False;
if (theCircuit->ConnexionOn(INext)) {
ParamMax = theCircuit->Connexion(INext)->ParameterOnFirst();
if (Curve->BasisCurve()->IsPeriodic()){
- ElCLib::AdjustPeriodic(0.,2*PI,Eps,ParamMin,ParamMax);
+ ElCLib::AdjustPeriodic(0.,2*M_PI,Eps,ParamMin,ParamMax);
}
}
//---------------------------------------------------------------------
Standard_Real R = C1.Circle().Radius();
Standard_Real EpsCirc = Eps;
if ( R < 1.) EpsCirc = Eps/R;
- if (!((ParamMax - ParamMin + 2*EpsCirc) < 2*PI)) {
+ if (!((ParamMax - ParamMin + 2*EpsCirc) < 2*M_PI)) {
ParamMax = ParamMax + EpsCirc; ParamMin = ParamMin - EpsCirc;
}
}
IntRes2d_Domain Domain1(Bisector1->Value(Param1),Param1,Tolerance,
Bisector1->Value(Param2),Param2,Tolerance);
if(Bisector1->BasisCurve()->IsPeriodic()) {
- Domain1.SetEquivalentParameters(0.,2.*PI);
+ Domain1.SetEquivalentParameters(0.,2.*M_PI);
}
return Domain1;
}
atext.Height = float (AHeight);
if (atext.Height < 0)
atext.Height = DefaultTextHeight();
- atext.Angle = float (Standard_PI / 2.);
+ atext.Angle = float (M_PI / 2.);
atext.Path = int (Graphic3d_TP_RIGHT);
atext.HAlign = int (Graphic3d_HTA_LEFT);
atext.VAlign = int (Graphic3d_VTA_BOTTOM);
#define GROW_SIZE_WKS 10
#define GROW_SIZE_LIGHT 8
-#ifndef M_PI
-# define M_PI 3.14159265358979323846
-#endif
-
/*----------------------------------------------------------------------*/
/*
* Types definis
#include <InterfaceGraphic_tgl_all.hxx>
#include <InterfaceGraphic_telem.hxx>
-
-#ifdef WNT
-// CAL : pas trouve de definition de PI dans les includes WNT
-#define M_PI 3.14159265358979323846
-#endif
-
#include <GL/gl.h>
#include <GL/glu.h>
#define NO_PRINT
#define NO_PRINT_MATRIX
-#ifndef M_PI
-# define M_PI 3.14159265358979323846
-#endif
-
/* on trouve que 10 vues sera suffisant */
#define GROW_SIZE_NZ_WKS 10
<< Ypos + aYradius*Sin(san) << " " << MOVETO;
(*Cout()) << GSAVE << Xpos << " " << Ypos << " " << aXradius << " ";
- if (Abs(fan)-Abs(san) >= 2.*PI) {
+ if (Abs(fan)-Abs(san) >= 2.*M_PI) {
(*Cout()) << " 0 360 " << ARC << STROKE << GRESTORE << endl;
} else {
Standard_Real a1 = san/DRAD;
if (Abs(aXradius-aYradius) <= 1.) {
PLOT_PCOLOR (myPolyColorIndex);
- if (Abs(oAngle) < 2.*PI)
+ if (Abs(oAngle) < 2.*M_PI)
(*Cout()) << Xpos << " " << Ypos << " " << MOVETO;
else
(*Cout()) << Xpos + aXradius*Cos(san) << " "
<< Ypos + aXradius*Sin(san) << " " << MOVETO;
(*Cout()) << GSAVE << Xpos << " " << Ypos << " " << aXradius << " ";
- if (Abs(fan) - Abs(san) >= 2.*PI) {
+ if (Abs(fan) - Abs(san) >= 2.*M_PI) {
(*Cout()) << " 0 360 " << ARC << FILL << GRESTORE << endl;
} else {
Standard_Real a1 = san/DRAD;
Standard_Real s = N0.CrossMagnitude(N1);
if((s < 1.e-2)&&(c<0.)) return;
Standard_Real angle = atan2(c,s);
- //if (angle < 0.) angle += PI;
+ //if (angle < 0.) angle += M_PI;
gp_XYZ d = N0^N1;
d.Normalize();
{
Standard_Boolean Done = Standard_False;
float san, oan;
- if (anOpenAngle == 0.F || anOpenAngle > 2*PI) {
- san = 0.F; oan = 2.*PI;
+ if (anOpenAngle == 0.F || anOpenAngle > 2*M_PI) {
+ san = 0.F; oan = 2.*M_PI;
} else if (anOpenAngle < 0.F) {
- san = 2.*PI + aStartAngle + anOpenAngle;
+ san = 2.*M_PI + aStartAngle + anOpenAngle;
oan = -anOpenAngle;
} else {
san = aStartAngle; oan = anOpenAngle;
if (aRadius > precis)
value = Max (0.0044, Min (0.7854, 2. * ACos(1.-precis/aRadius)));
else
- value = PI/4.;
+ value = M_PI/4.;
Standard_Integer nbpoints = Min(MAXPOINT,
Standard_Integer(Abs(oan)/value)+2);
{
Standard_Boolean Done = Standard_False;
float san, oan;
- if (anOpenAngle == 0.F || anOpenAngle > 2*PI) {
- san = 0.F; oan = 2.*PI;
+ if (anOpenAngle == 0.F || anOpenAngle > 2*M_PI) {
+ san = 0.F; oan = 2.*M_PI;
} else if (anOpenAngle < 0.F) {
- san = 2.*PI + aStartAngle + anOpenAngle;
+ san = 2.*M_PI + aStartAngle + anOpenAngle;
oan = -anOpenAngle;
} else {
san = aStartAngle; oan = anOpenAngle;
if (aRadius > precis)
value = Max (0.0044, Min (0.7854, 2. * ACos(1.-precis/aRadius)));
else
- value = PI/4.;
+ value = M_PI/4.;
Standard_Integer nbpoints = Min(MAXPOINT,
Standard_Integer(Abs(oan)/value)+2);
const TColStd_Array1OfBoolean& ams =
MarkMap ()->Entry(aMarker+1).Style().SValues();
Standard_Integer i, sl, su;
- Standard_ShortReal Ca = (float)Cos((3*Standard_PI)/2+Angle),
- Sa = (float)Sin((3*Standard_PI)/2+Angle);
+ Standard_ShortReal Ca = (float)Cos((3 * M_PI) / 2 + Angle),
+ Sa = (float)Sin((3 * M_PI) / 2 + Angle);
Standard_ShortReal dx, dy, Cx, Cy;
// Remember the old attributes
//--------------------------------------------------------
#include <math.h>
#include <stdlib.h>
+#ifndef __MATH_WNT_H
+# include <Standard_math.hxx>
+#endif /* __MATH_WNT_H */
#include <Standard_Stream.hxx>
#include <PlotMgt_fill.hxx>
-#define Standard_PI (3.14159)
#define maxDouble ((double)1.E+30)
//--------------------------------------------------------
// Determine is angle a is between b and b+c (c>0)
int mpo_inside(double a, double b, double c)
{
- while (b<0) {b += 2*Standard_PI;}; b -= 2*Standard_PI*ftrunc(b/(2*Standard_PI));
- c -= 2*Standard_PI*ftrunc(c/(2*Standard_PI));
- while (a<0) {a+=2*Standard_PI;}; a -= 2*Standard_PI*ftrunc(a/(2*Standard_PI));
-// while(c<0) {c+=2*Standard_PI;}; c-=2*Standard_PI*ftrunc(c/(2*Standard_PI));
+ while (b<0) {b += 2*M_PI;}; b -= 2*M_PI*ftrunc(b/(2*M_PI));
+ c -= 2*M_PI*ftrunc(c/(2*M_PI));
+ while (a<0) {a+=2*M_PI;}; a -= 2*M_PI*ftrunc(a/(2*M_PI));
+// while(c<0) {c+=2*M_PI;}; c-=2*M_PI*ftrunc(c/(2*M_PI));
if ((a > b) && (a < b+c)) return 1;
- else if ((2*Standard_PI+a > b) && (2*Standard_PI+a < b+c)) return 1;
+ else if ((2*M_PI+a > b) && (2*M_PI+a < b+c)) return 1;
return 0;
}
double beta, double gamma, double delta, double step)
{
int i ;
- alpha -= 2*Standard_PI*ftrunc(alpha/(2*Standard_PI)); beta -= 2*Standard_PI*ftrunc(beta/(2*Standard_PI));
+ alpha -= 2*M_PI*ftrunc(alpha/(2*M_PI)); beta -= 2*M_PI*ftrunc(beta/(2*M_PI));
if (beta < 0.0)
{
alpha += beta; beta = -beta;
int size = int( ftrunc(2*Ys/step) + 1 );
// cout << "Ysize = " << Ys << endl << flush;
// cout << "Size = " << size << endl << flush;
-// cout << "Alpha = " << alpha*180/Standard_PI << endl << flush;
-// cout << "Beta = " << beta*180/Standard_PI << endl << flush;
+// cout << "Alpha = " << alpha*180/M_PI << endl << flush;
+// cout << "Beta = " << beta*180/M_PI << endl << flush;
mpo_lines = (mpo_one_line*)malloc(sizeof(mpo_one_line)*size);
for ( i = 0; i < size; i++)
{
double Yt = Ys - i*step;
(mpo_lines+i)->X1 = (-C2*Yt - fsqrt(C2*C2*Yt*Yt - C1*(C3*Yt*Yt - a*a*b*b)))/C1;
(mpo_lines+i)->X2 = (-C2*Yt + fsqrt(C2*C2*Yt*Yt - C1*(C3*Yt*Yt - a*a*b*b)))/C1;
-// cout << "alpha = " << alpha*180/Standard_PI << " alpha+beta = " << (alpha+beta)*180/Standard_PI << endl << flush;
-// cout << "" << fatan2(Yt, (mpo_lines+i)->X2)*180/Standard_PI << " type " << (mpo_lines+i)->type << endl << flush;;
+// cout << "alpha = " << alpha*180/M_PI << " alpha+beta = " << (alpha+beta)*180/M_PI << endl << flush;
+// cout << "" << fatan2(Yt, (mpo_lines+i)->X2)*180/M_PI << " type " << (mpo_lines+i)->type << endl << flush;;
// cout << "Xleft = " << (mpo_lines+i)->X1 << " Xright = " << (mpo_lines+i)->X2 << endl << flush;
// cout << "C2*C2 - C1*(C3*Yt*Yt - a*a*b*b) = " << C2*C2 - C1*(C3*Yt*Yt - a*a*b*b) << endl << flush;
// cout << "C1*(C3*Yt*Yt - a*a*b*b) = " << C1*(C3*Yt*Yt - a*a*b*b) << endl << flush;
const Standard_Integer theSegIndex,
const NCollection_List<Standard_Integer>& theLstIndS) const
{
- Standard_Real aAngleMin = ::PI * 2;
+ Standard_Real aAngleMin = M_PI * 2;
gp_Dir aNormal;
const Helper* aHelper = getHelper();
if (!aHelper->GetNormal (theNode, aNormal))
aTgt = aTgtXYZ;
Standard_Real aAngle = aTgt.AngleWithRef(aTgtRef, aNormal);
- if (aAngle < 1e-4 - ::PI)
- aAngle = ::PI;
+ if (aAngle < 1e-4 - M_PI)
+ aAngle = M_PI;
if (aAngle < aAngleMin)
{
aAngleMin = aAngle;
const Standard_Integer theSegIndex,
const NCollection_List<Standard_Integer>& theLstIndS) const
{
- Standard_Real aAngleMin = ::PI * 2;
+ Standard_Real aAngleMin = M_PI * 2;
const Helper* aHelper = getHelper();
Link aLink = getLink(theSegIndex);
gp_Dir2d aTgtRef;
Standard_Real aAngle = aTgt.Angle(aTgtRef);
if (myRightWay)
aAngle = -aAngle;
- if (aAngle < 1e-4 - ::PI)
- aAngle = ::PI;
+ if (aAngle < 1e-4 - M_PI)
+ aAngle = M_PI;
if (aAngle < aAngleMin)
{
aAngleMin = aAngle;
const Standard_Real VMax) :
myBuilder(B),
myAxes(A),
- myAngle(2*PI),
+ myAngle(2*M_PI),
myVMin(VMin),
myVMax(VMax),
myMeridianOffset(0)
Standard_Boolean Primitives_OneAxis::HasSides() const
{
- return 2*PI - myAngle > Precision::Angular();
+ return 2*M_PI - myAngle > Precision::Angular();
}
//=======================================================================
if ( VCouture) {
if(SType == GeomAbs_Sphere) {
- if ( Abs( S - U1 ) > PI ) {
- T = PI - T;
- S = PI + S;
+ if ( Abs( S - U1 ) > M_PI ) {
+ T = M_PI - T;
+ S = M_PI + S;
}
S = ElCLib::InPeriod(S, U1, U2);
}
}
else {
UCouture = Standard_True;
- myU2 = myU1 + 2*PI;
+ myU2 = myU1 + 2*M_PI;
}
}
ElSLib::Parameters( Cone, P, U, V);
U += Delta;
d = U - U1;
- if(d > PI) {
- if( ( (IsEqual(U,(2*PI),1.e-10) && (U1 >= 0. && U1 <= PI)) &&
+ if(d > M_PI) {
+ if( ( (IsEqual(U,(2*M_PI),1.e-10) && (U1 >= 0. && U1 <= M_PI)) &&
(IsEqual(U,Ul,1.e-10) && !IsEqual(Uf,0.,1.e-10)) ) && isclandper ) U = 0.;
- else Delta -= 2*PI;
+ else Delta -= 2*M_PI;
U += Delta;
d = U - U1;
}
- else if(d < -PI) {
- if( ( (IsEqual(U,0.,1.e-10) && (U1 >= PI && U1 <= (2*PI))) &&
- (IsEqual(U,Ul,1.e-10) && !IsEqual(Uf,(2*PI),1.e-10)) ) && isclandper ) U = 2*PI;
- else Delta += 2*PI;
+ else if(d < -M_PI) {
+ if( ( (IsEqual(U,0.,1.e-10) && (U1 >= M_PI && U1 <= (2*M_PI))) &&
+ (IsEqual(U,Ul,1.e-10) && !IsEqual(Uf,(2*M_PI),1.e-10)) ) && isclandper ) U = 2*M_PI;
+ else Delta += 2*M_PI;
U += Delta;
d = U - U1;
}
if(!(Abs(pmin - W1) <= Precision::PConfusion() || Abs(pmin - W2) <= Precision::PConfusion()) ) myU1 -= dmax*.5;
if(!(Abs(pmax - W1) <= Precision::PConfusion() || Abs(pmax - W2) <= Precision::PConfusion()) ) myU2 += dmax*.5;
- if((myU1 >=0. && myU1 <= 2*PI) && (myU2 >=0. && myU2 <= 2*PI) ) UCouture = Standard_False;
+ if((myU1 >=0. && myU1 <= 2*M_PI) && (myU2 >=0. && myU2 <= 2*M_PI) ) UCouture = Standard_False;
else{
U = ( myU1 + myU2 ) /2.;
- myU1 = U - PI;
- myU2 = U + PI;
+ myU1 = U - M_PI;
+ myU2 = U + M_PI;
UCouture = Standard_True;
}
}
if ( !myCurve->IsClosed()) {
if ( myU1 < U && U < myU2) {
U = ( myU1 + myU2 ) /2.;
- myU1 = U - PI;
- myU2 = U + PI;
+ myU1 = U - M_PI;
+ myU2 = U + M_PI;
}
else {
U = ( myU1 + myU2 ) /2.;
if ( myU1 < U) {
- myU1 = U - 2*PI;
+ myU1 = U - 2*M_PI;
myU2 = U;
}
else {
myU1 = U;
- myU2 = U + 2*PI;
+ myU2 = U + 2*M_PI;
}
}
UCouture = Standard_True;
UCouture = Standard_True;
if ( dU > 0.) {
- myU2 = myU1 + 2*PI;
+ myU2 = myU1 + 2*M_PI;
}
else {
myU2 = myU1;
- myU1 -= 2*PI;
+ myU1 -= 2*M_PI;
}
}
}
Standard_Real U1, V1, U , V;
ElSLib::Parameters( Cylinder, P1, U1, V1);
Standard_Real Step = .1, Delta = 0.;
- Standard_Real eps = PI, dmax = 0., d = 0.;
+ Standard_Real eps = M_PI, dmax = 0., d = 0.;
Standard_Integer nbp = (Standard_Integer)((W2 - W1) / Step + 1);
nbp = Max(nbp, 3);
Step = (W2 - W1) / (nbp - 1);
d = U - U1;
if(d > eps) {
U -= Delta;
- Delta -= 2*PI;
+ Delta -= 2*M_PI;
U += Delta;
d = U - U1;
}
else if(d < -eps) {
U -= Delta;
- Delta += 2*PI;
+ Delta += 2*M_PI;
U += Delta;
d = U - U1;
}
if(!(Abs(pmax - W1) <= Precision::PConfusion() ||
Abs(pmax - W2) <= Precision::PConfusion()) ) myU2 += dmax*.5;
- if((myU1 >=0. && myU1 <= 2*PI) &&
- (myU2 >=0. && myU2 <= 2*PI) ) {
+ if((myU1 >=0. && myU1 <= 2*M_PI) &&
+ (myU2 >=0. && myU2 <= 2*M_PI) ) {
UCouture = Standard_False;
}
else {
U = ( myU1 + myU2 ) /2.;
- myU1 = U - PI;
- myU2 = U + PI;
+ myU1 = U - M_PI;
+ myU2 = U + M_PI;
UCouture = Standard_True;
}
}
ElSLib::Parameters(SP, P, UU, V1);
Standard_Real UUmi = Min(Min(U1,UU),Min(UU,U2));
Standard_Real UUma = Max(Max(U1,UU),Max(UU,U2));
- Standard_Boolean reCalc = ((UUmi >= 0. && UUmi <= PI) && (UUma >= 0. && UUma <= PI));
+ Standard_Boolean reCalc = ((UUmi >= 0. && UUmi <= M_PI) && (UUma >= 0. && UUma <= M_PI));
// box+sphere <<
ElSLib::Parameters(SP, P1, U1, V1);//*
Parameters(myCurve, mySurface, P1, 1, aTPC, U1, V1);
//
//
- P2 = myCurve->Value(W1+PI/8);
+ P2 = myCurve->Value(W1+M_PI/8);
ElSLib::Parameters(SP,P2,U2,V2);
//
if ( NbSolutions == 1) {
- if ( Abs(U1-U2) > PI) { // on traverse la couture
- if ( U1 > PI) {
+ if ( Abs(U1-U2) > M_PI) { // on traverse la couture
+ if ( U1 > M_PI) {
myU1 = U1;
- myU2 = U1+2*PI;
+ myU2 = U1+2*M_PI;
}
else {
myU2 = U1;
- myU1 = U1-2*PI;
+ myU1 = U1-2*M_PI;
}
}
else { // on ne traverse pas la couture
if ( U1 > U2) {
myU2 = U1;
- myU1 = U1-2*PI;
+ myU1 = U1-2*M_PI;
}
else {
myU1 = U1;
- myU2 = U1+2*PI;
+ myU2 = U1+2*M_PI;
}
}
}
gp_Pnt Center = Circle.Location();
Standard_Real U,V;
ElSLib::SphereParameters(gp_Ax3(gp::XOY()),1,Center, U, V);
- myU1 = U-PI;
- myU2 = U+PI;
+ myU1 = U-M_PI;
+ myU2 = U+M_PI;
}
//
// eval the VCouture.
UCouture = Standard_True;
if ( D/C < 0.) {
- myV1 = - PI / 2.;
- myV2 = 3 * PI / 2.;
+ myV1 = - M_PI / 2.;
+ myV2 = 3 * M_PI / 2.;
}
else {
- myV1 = -3 * PI / 2.;
- myV2 = PI / 2.;
+ myV1 = -3 * M_PI / 2.;
+ myV2 = M_PI / 2.;
}
// si P1.Z() vaut +/- R on est sur le sommet : pas significatif.
gp_Pnt Center = Circle.Location();
Standard_Real U,V;
ElSLib::SphereParameters(gp_Ax3(gp::XOY()),1,Center, U, V);
- myU1 = U-PI;
- myU2 = U+PI;
+ myU1 = U-M_PI;
+ myU2 = U+M_PI;
VCouture = Standard_False;
}
else {
//
Parameters(myCurve, mySurface, P1, 1, aTPC, U1, V1);
//
- P2 = myCurve->Value(W1+PI/8);
+ P2 = myCurve->Value(W1+M_PI/8);
ElSLib::Parameters(SP,P2,U2,V2);
- if ( Abs(U1-U2) > PI) { // on traverse la couture
- if ( U1 > PI) {
+ if ( Abs(U1-U2) > M_PI) { // on traverse la couture
+ if ( U1 > M_PI) {
myU1 = U1;
- myU2 = U1+2*PI;
+ myU2 = U1+2*M_PI;
}
else {
myU2 = U1;
- myU1 = U1-2*PI;
+ myU1 = U1-2*M_PI;
}
}
else { // on ne traverse pas la couture
if ( U1 > U2) {
myU2 = U1;
- myU1 = U1-2*PI;
+ myU1 = U1-2*M_PI;
}
else {
myU1 = U1;
- myU2 = U1+2*PI;
+ myU2 = U1+2*M_PI;
}
}
}
// box+sphere >>
myV1 = -1.e+100; myV2 = 1.e+100;
Standard_Real UU1 = myU1, UU2 = myU2;
- if((Abs(UU1) <= (2.*PI) && Abs(UU2) <= (2.*PI)) && NbSolutions == 1 && reCalc) {
+ if((Abs(UU1) <= (2.*M_PI) && Abs(UU2) <= (2.*M_PI)) && NbSolutions == 1 && reCalc) {
gp_Pnt Center = Circle.Location();
Standard_Real U,V;
ElSLib::SphereParameters(gp_Ax3(gp::XOY()),1,Center, U, V);
- myU1 = U-PI;
- myU2 = U+PI;
+ myU1 = U-M_PI;
+ myU2 = U+M_PI;
myU1 = Min(UU1,myU1);
myU2 = Max(UU2,myU2);
}
Standard_Real U1, V1, U , V;
ElSLib::Parameters( SP, P1, U1, V1);
Standard_Real Step = .1, Delta = 0.;
- Standard_Real eps = PI, dmax = 0., d = 0.;
+ Standard_Real eps = M_PI, dmax = 0., d = 0.;
Standard_Integer nbp = (Standard_Integer)((W2 - W1) / Step + 1);
nbp = Max(nbp, 3);
Step = (W2 - W1) / (nbp - 1);
d = U - U1;
if(d > eps) {
U -= Delta;
- Delta -= 2*PI;
+ Delta -= 2*M_PI;
U += Delta;
d = U - U1;
}
else if(d < -eps) {
U -= Delta;
- Delta += 2*PI;
+ Delta += 2*M_PI;
U += Delta;
d = U - U1;
}
if(!(Abs(pmax - W1) <= Precision::PConfusion() ||
Abs(pmax - W2) <= Precision::PConfusion()) ) myU2 += dmax*.5;
- if((myU1 >=0. && myU1 <= 2*PI) &&
- (myU2 >=0. && myU2 <= 2*PI) ) {
+ if((myU1 >=0. && myU1 <= 2*M_PI) &&
+ (myU2 >=0. && myU2 <= 2*M_PI) ) {
myU1 = 0.;
- myU2 = 2.*PI;
+ myU2 = 2.*M_PI;
UCouture = Standard_False;
}
else {
U = ( myU1 + myU2 ) /2.;
- myU1 = U - PI;
- myU2 = U + PI;
+ myU1 = U - M_PI;
+ myU2 = U + M_PI;
UCouture = Standard_True;
}
Standard_Real U1, V1, U , V;
ElSLib::Parameters( TR, P1, U1, V1);
Standard_Real Step = .1, DeltaU = 0., DeltaV = 0.;
- Standard_Real eps = PI, dmaxU = 0., dU = 0., dmaxV = 0., dV = 0.;
+ Standard_Real eps = M_PI, dmaxU = 0., dU = 0., dmaxV = 0., dV = 0.;
Standard_Integer nbp = (Standard_Integer)((W2 - W1) / Step + 1);
nbp = Max(nbp, 3);
Step = (W2 - W1) / (nbp - 1);
dV = V - V1;
if(dU > eps) {
U -= DeltaU;
- DeltaU -= 2*PI;
+ DeltaU -= 2*M_PI;
U += DeltaU;
dU = U - U1;
}
else if(dU < -eps) {
U -= DeltaU;
- DeltaU += 2*PI;
+ DeltaU += 2*M_PI;
U += DeltaU;
dU = U - U1;
}
if(dV > eps) {
V -= DeltaV;
- DeltaV -= 2*PI;
+ DeltaV -= 2*M_PI;
V += DeltaV;
dV = V - V1;
}
else if(dV < -eps) {
V -= DeltaV;
- DeltaV += 2*PI;
+ DeltaV += 2*M_PI;
V += DeltaV;
dV = V - V1;
}
if(!(Abs(pmaxV - W1) <= Precision::PConfusion() ||
Abs(pmaxV - W2) <= Precision::PConfusion()) ) myV2 += dmaxV*.5;
- if((myU1 >=0. && myU1 <= 2*PI) &&
- (myU2 >=0. && myU2 <= 2*PI) ) {
+ if((myU1 >=0. && myU1 <= 2*M_PI) &&
+ (myU2 >=0. && myU2 <= 2*M_PI) ) {
myU1 = 0.;
- myU2 = 2.*PI;
+ myU2 = 2.*M_PI;
UCouture = Standard_False;
}
else {
U = ( myU1 + myU2 ) /2.;
- myU1 = U - PI;
- myU2 = U + PI;
+ myU1 = U - M_PI;
+ myU2 = U + M_PI;
UCouture = Standard_True;
}
- if((myV1 >=0. && myV1 <= 2*PI) &&
- (myV2 >=0. && myV2 <= 2*PI) ) {
+ if((myV1 >=0. && myV1 <= 2*M_PI) &&
+ (myV2 >=0. && myV2 <= 2*M_PI) ) {
VCouture = Standard_False;
}
else {
V = ( myV1 + myV2 ) /2.;
- myV1 = V - PI;
- myV2 = V + PI;
+ myV1 = V - M_PI;
+ myV2 = V + M_PI;
VCouture = Standard_True;
}
GeomAbs_CurveType aCType;
gp_Pnt aP2;
//
- aTwoPI=2.*PI;
+ aTwoPI=2.*M_PI;
//
aSType=mySurface->GetType();
aCType=myCurve->GetType();
ElSLib::Parameters(aSp, aP2, aU2, aV2);
//
aU1=0.;
- if (aU2>PI) {
+ if (aU2>M_PI) {
aU1=aTwoPI;
}
}
Standard_Integer number;
if (F.VCouture)
{
- if (SType == GeomAbs_Sphere && Abs(u-F.myU1) > PI)
+ if (SType == GeomAbs_Sphere && Abs(u-F.myU1) > M_PI)
{
ToMirror = Standard_True;
- dv = -PI;
- v = PI - v;
+ dv = -M_PI;
+ v = M_PI - v;
}
Standard_Real newV = ElCLib::InPeriod( v, F.myV1, F.myV2 );
number = (Standard_Integer) (Floor((newV-v)/(F.myV2-F.myV1)));
if (F.UCouture || F.VCouture && SType == GeomAbs_Sphere)
{
gp_Pnt2d P2d = F.Value( UFirst );
- number = (Standard_Integer) (Floor((P2d.X()-u)/PI + Epsilon(PI)));
- du = -number*PI;
+ number = (Standard_Integer) (Floor((P2d.X()-u)/M_PI + Epsilon(M_PI)));
+ du = -number*M_PI;
}
if (!myBSpline.IsNull())
{
gp_Cylinder Cylinder = Surf->Cylinder();
ElSLib::Parameters( Cylinder, p, S, T);
- if(U0 < Uinf) decalU = -int((Uinf - U0)/(2*PI))-1;
- if(U0 > Usup) decalU = int((U0 - Usup)/(2*PI))+1;
- S += decalU*2*PI;
+ if(U0 < Uinf) decalU = -int((Uinf - U0)/(2*M_PI))-1;
+ if(U0 > Usup) decalU = int((U0 - Usup)/(2*M_PI))+1;
+ S += decalU*2*M_PI;
break;
}
case GeomAbs_Cone:
{
gp_Cone Cone = Surf->Cone();
ElSLib::Parameters( Cone, p, S, T);
- if(U0 < Uinf) decalU = -int((Uinf - U0)/(2*PI))-1;
- if(U0 > Usup) decalU = int((U0 - Usup)/(2*PI))+1;
- S += decalU*2*PI;
+ if(U0 < Uinf) decalU = -int((Uinf - U0)/(2*M_PI))-1;
+ if(U0 > Usup) decalU = int((U0 - Usup)/(2*M_PI))+1;
+ S += decalU*2*M_PI;
break;
}
case GeomAbs_Sphere:
{
gp_Sphere Sphere = Surf->Sphere();
ElSLib::Parameters( Sphere, p, S, T);
- if(U0 < Uinf) decalU = -int((Uinf - U0)/(2*PI))-1;
- if(U0 > Usup) decalU = int((U0 - Usup)/(2*PI))+1;
- S += decalU*2*PI;
- if(V0 < Vinf) decalV = -int((Vinf - V0)/(2*PI))-1;
- if(V0 > (Vsup+(Vsup-Vinf))) decalV = int((V0 - Vsup+(Vsup-Vinf))/(2*PI))+1;
- T += decalV*2*PI;
- if(0.4*PI < Abs(U0 - S) && Abs(U0 - S) < 1.6*PI) {
- T = PI - T;
+ if(U0 < Uinf) decalU = -int((Uinf - U0)/(2*M_PI))-1;
+ if(U0 > Usup) decalU = int((U0 - Usup)/(2*M_PI))+1;
+ S += decalU*2*M_PI;
+ if(V0 < Vinf) decalV = -int((Vinf - V0)/(2*M_PI))-1;
+ if(V0 > (Vsup+(Vsup-Vinf))) decalV = int((V0 - Vsup+(Vsup-Vinf))/(2*M_PI))+1;
+ T += decalV*2*M_PI;
+ if(0.4*M_PI < Abs(U0 - S) && Abs(U0 - S) < 1.6*M_PI) {
+ T = M_PI - T;
if(U0 < S)
- S -= PI;
+ S -= M_PI;
else
- S += PI;
+ S += M_PI;
}
break;
}
{
gp_Torus Torus = Surf->Torus();
ElSLib::Parameters( Torus, p, S, T);
- if(U0 < Uinf) decalU = -int((Uinf - U0)/(2*PI))-1;
- if(U0 > Usup) decalU = int((U0 - Usup)/(2*PI))+1;
- if(V0 < Vinf) decalV = -int((Vinf - V0)/(2*PI))-1;
- if(V0 > Vsup) decalV = int((V0 - Vsup)/(2*PI))+1;
- S += decalU*2*PI; T += decalV*2*PI;
+ if(U0 < Uinf) decalU = -int((Uinf - U0)/(2*M_PI))-1;
+ if(U0 > Usup) decalU = int((U0 - Usup)/(2*M_PI))+1;
+ if(V0 < Vinf) decalV = -int((Vinf - V0)/(2*M_PI))-1;
+ if(V0 > Vsup) decalV = int((V0 - Vsup)/(2*M_PI))+1;
+ S += decalU*2*M_PI; T += decalV*2*M_PI;
break;
}
default:
for ( i = 2 ; i <= NbOfPnts ; i++) {
Sloc = S;
ElSLib::Parameters( Cylinder, Pts(i), S, T);
- if(Abs(Sloc - S) > PI)
+ if(Abs(Sloc - S) > M_PI)
if(Sloc > S)
usens++;
else
usens--;
- Pts2d(i).SetCoord(S+usens*2*PI,T);
+ Pts2d(i).SetCoord(S+usens*2*M_PI,T);
}
myProjIsDone = Standard_True;
break;
for ( i = 2 ; i <= NbOfPnts ; i++) {
Sloc = S;
ElSLib::Parameters( Cone, Pts(i), S, T);
- if(Abs(Sloc - S) > PI)
+ if(Abs(Sloc - S) > M_PI)
if(Sloc > S)
usens++;
else
usens--;
- Pts2d(i).SetCoord(S+usens*2*PI,T);
+ Pts2d(i).SetCoord(S+usens*2*M_PI,T);
}
myProjIsDone = Standard_True;
break;
for ( i = 2 ; i <= NbOfPnts ; i++) {
Sloc = S;Tloc = T;
ElSLib::Parameters( Sphere, Pts(i), S, T);
- if(1.6*PI < Abs(Sloc - S))
+ if(1.6*M_PI < Abs(Sloc - S))
if(Sloc > S)
usens += 2;
else
usens -= 2;
- if(1.6*PI > Abs(Sloc - S) && Abs(Sloc - S) > 0.4*PI) {
+ if(1.6*M_PI > Abs(Sloc - S) && Abs(Sloc - S) > 0.4*M_PI) {
vparit = !vparit;
if(Sloc > S)
usens++;
vsens--;
}
if(vparit) {
- Pts2d(i).SetCoord(S+usens*PI,(PI - T)*(vsens-1));
+ Pts2d(i).SetCoord(S+usens*M_PI,(M_PI - T)*(vsens-1));
}
else {
- Pts2d(i).SetCoord(S+usens*PI,T+vsens*PI);
+ Pts2d(i).SetCoord(S+usens*M_PI,T+vsens*M_PI);
}
}
for ( i = 2 ; i <= NbOfPnts ; i++) {
Sloc = S; Tloc = T;
ElSLib::Parameters( Torus, Pts(i), S, T);
- if(Abs(Sloc - S) > PI)
+ if(Abs(Sloc - S) > M_PI)
if(Sloc > S)
usens++;
else
usens--;
- if(Abs(Tloc - T) > PI)
+ if(Abs(Tloc - T) > M_PI)
if(Tloc > T)
vsens++;
else
vsens--;
- Pts2d(i).SetCoord(S+usens*2*PI,T+vsens*2*PI);
+ Pts2d(i).SetCoord(S+usens*2*M_PI,T+vsens*2*M_PI);
}
myProjIsDone = Standard_True;
break;
gp_Pnt p22 = BSS->Pole(2,2);
gp_Vec V1(p11,p12);
gp_Vec V2(p21,p22);
- if(V1.IsEqual(V2,Tol3d,Tol3d/(p11.Distance(p12)*180/PI))){ //OCC217
- //if(V1.IsEqual(V2,myTolerance,myTolerance/(p11.Distance(p12)*180/PI))){
+ if(V1.IsEqual(V2,Tol3d,Tol3d/(p11.Distance(p12)*180/M_PI))){ //OCC217
+ //if(V1.IsEqual(V2,myTolerance,myTolerance/(p11.Distance(p12)*180/M_PI))){
// so the polar surface is plane
// and if it is enough to projet the poles of Curve
Standard_Integer Dist2Min = IntegerLast();
gp_Pnt p22 = BS->Pole(2,2);
gp_Vec V1(p11,p12);
gp_Vec V2(p21,p22);
- if(V1.IsEqual(V2,Tol3d,Tol3d/(p11.Distance(p12)*180/PI))){ //OCC217
- //if (V1.IsEqual(V2,myTolerance,myTolerance/(p11.Distance(p12)*180/PI))){
+ if(V1.IsEqual(V2,Tol3d,Tol3d/(p11.Distance(p12)*180/M_PI))){ //OCC217
+ //if (V1.IsEqual(V2,myTolerance,myTolerance/(p11.Distance(p12)*180/M_PI))){
// and if it is enough to project the poles of Curve
Standard_Integer Dist2Min = IntegerLast();
Standard_Real u,v;
(ZCone.IsEqual(CPos.Direction(), Precision::Angular())) ? 1 : -1;
Standard_Integer a2 =
(myCone.SemiAngle() > 0) ? 1 : -1;
- if ( ( a1 * a2) == -1) U -= PI;
+ if ( ( a1 * a2) == -1) U -= M_PI;
- if ( U < 0.) U += 2.*PI;
+ if ( U < 0.) U += 2.*M_PI;
gp_Pnt P;
gp_Vec Vu, Vv;
else {
U = ATan2( y, x);
}
- if ( U < 0.) U += 2*PI;
+ if ( U < 0.) U += 2*M_PI;
V = z / Cos(myCone.SemiAngle());
gp_Pnt2d P2d = EvalPnt2d(L.Location(),myCylinder);
if ( P2d.X() < 0.) {
- P2d.SetX(P2d.X()+2*PI);
+ P2d.SetX(P2d.X()+2*M_PI);
}
Standard_Real Signe
= L.Direction().Dot(myCylinder.Position().Direction());
if ( Abs(X) > Precision::PConfusion() ||
Abs(Y) > Precision::PConfusion() ) {
Standard_Real UU = ATan2(Y,X);
- U = ElCLib::InPeriod(UU, 0., 2*PI);
+ U = ElCLib::InPeriod(UU, 0., 2*M_PI);
}
else {
U = 0.;
P2d1 = EvalPnt2d(gp_Vec(Xc),mySphere);
P2d2 = EvalPnt2d(gp_Vec(Yc),mySphere);
- if (isIsoU && (Abs(P2d1.Y()-PI/2.) < Precision::PConfusion() ||
- Abs(P2d1.Y()+PI/2.) < Precision::PConfusion() )) {
+ if (isIsoU && (Abs(P2d1.Y()-M_PI/2.) < Precision::PConfusion() ||
+ Abs(P2d1.Y()+M_PI/2.) < Precision::PConfusion() )) {
// then P1 is on the apex of the sphere and U is undefined
// The value of U is given by P2d2.Y() .
P2d1.SetX(P2d2.X());
}
- else if ( Abs( Abs(P2d1.X()-P2d2.X()) - PI) < Precision::PConfusion()) {
+ else if ( Abs( Abs(P2d1.X()-P2d2.X()) - M_PI) < Precision::PConfusion()) {
// then we have U2 = U1 + PI; V2;
// we have to assume that U1 = U2
// so V2 = PI - V2;
P2d2.SetX( P2d1.X());
if (P2d2.Y() < 0.)
- P2d2.SetY( -PI - P2d2.Y());
+ P2d2.SetY( -M_PI - P2d2.Y());
else
- P2d2.SetY( PI - P2d2.Y());
+ P2d2.SetY( M_PI - P2d2.Y());
}
else {
P2d2.SetX( P2d1.X());
//P2d(U,V) :first point of the PCurve.
Standard_Real U = Xs.AngleWithRef(Xc, Xs^Ys);
if (U<0)
- U += 2*PI;
+ U += 2*M_PI;
Standard_Real Z = gp_Vec(O,C.Location()).Dot(Zs);
Standard_Real V = ASin(Z/mySphere.Radius());
P2d1 = gp_Pnt2d(U,V);
// first set the y of the first point in -pi/2 pi/2
Standard_Real newY, Y = ElCLib::Value(U,myLin).Y();
- newY = ElCLib::InPeriod( Y, -PI, PI);
+ newY = ElCLib::InPeriod( Y, -M_PI, M_PI);
myLin.Translate(gp_Vec2d(0.,newY-Y));
Standard_Real Tol = 1.e-7;
gp_Dir2d D2d = myLin.Direction();
// Modified by skv - Tue Aug 1 16:29:59 2006 OCC13116 Begin
-// if ((P.Y() > PI/2) ||
- if ((P.Y() - PI/2 > Tol) ||
+// if ((P.Y() > M_PI/2) ||
+ if ((P.Y() - M_PI/2 > Tol) ||
// Modified by skv - Tue Aug 1 16:29:59 2006 OCC13116 End
- (Abs(P.Y()-PI/2)<Tol && D2d.IsEqual(gp::DY2d(),Tol))) {
- Axis = gp_Ax2d( gp_Pnt2d( 0., PI/2.), gp::DX2d());
+ (Abs(P.Y()-M_PI/2)<Tol && D2d.IsEqual(gp::DY2d(),Tol))) {
+ Axis = gp_Ax2d( gp_Pnt2d( 0., M_PI/2.), gp::DX2d());
}
// Modified by skv - Tue Aug 1 16:29:59 2006 OCC13116 Begin
-// else if ((P.Y() < -PI/2) ||
- else if ((P.Y() + PI/2 < -Tol) ||
+// else if ((P.Y() < -M_PI/2) ||
+ else if ((P.Y() + M_PI/2 < -Tol) ||
// Modified by skv - Tue Aug 1 16:29:59 2006 OCC13116 End
- (Abs(P.Y()+PI/2)<Tol && D2d.IsOpposite(gp::DY2d(),Tol))) {
- Axis = gp_Ax2d( gp_Pnt2d( 0., -PI/2.), gp::DX2d());
+ (Abs(P.Y()+M_PI/2)<Tol && D2d.IsOpposite(gp::DY2d(),Tol))) {
+ Axis = gp_Ax2d( gp_Pnt2d( 0., -M_PI/2.), gp::DX2d());
}
else
return;
Trsf.SetMirror(Axis);
myLin.Transform(Trsf);
- myLin.Translate(gp_Vec2d(PI,0.));
+ myLin.Translate(gp_Vec2d(M_PI,0.));
// il faut maintenant recadrer en U
Standard_Real newX, X = ElCLib::Value(U,myLin).X();
- newX = ElCLib::InPeriod( X, 0., 2.*PI);
+ newX = ElCLib::InPeriod( X, 0., 2.*M_PI);
myLin.Translate(gp_Vec2d(newX-X,0.));
}
Standard_Real V;
if ( Z > 1.) {
- V = PI/2.; // protection stupide
+ V = M_PI/2.; // protection stupide
} // contre les erreurs de calcul
else if ( Z < -1.) { // il arrive que Z soit legerement
- V = -PI/2; // superieur a 1.
+ V = -M_PI/2; // superieur a 1.
}
else {
V = ASin(Z);
}
if (C.Radius() < myTorus.MajorRadius()) {
- V = PI - V;
+ V = M_PI - V;
}
else if ( V < 0.) {
- V += 2*PI;
+ V += 2*M_PI;
}
P1.SetY(V);
P2.SetY(V);
gp_Vec2d V2d ( P1, P2);
// Normalement Abs( P1.X() - P2.X()) = PI/2
// Si != PI/2, on a traverse la periode => On reverse la Direction
- if ( Abs( P1.X() - P2.X()) > PI) V2d.Reverse();
+ if ( Abs( P1.X() - P2.X()) > M_PI) V2d.Reverse();
gp_Dir2d D2( V2d);
if ( P1.X() < 0)
- P1.SetX( 2*PI + P1.X());
+ P1.SetX( 2*M_PI + P1.X());
myLin = gp_Lin2d( P1, D2);
}
else {
// Iso U -> U = angle( Xt, OC)
Standard_Real U = Xt.AngleWithRef( OC, Xt^Yt);
if ( U < 0.)
- U += 2*PI;
+ U += 2*M_PI;
// Origine de la droite
Standard_Real V1 = OC.AngleWithRef(Xc, OC^Zt);
if ( V1 < 0.)
- V1 += 2*PI;
+ V1 += 2*M_PI;
gp_Pnt2d P1( U, V1);
if ( myRad <= ShortRealEpsilon ())
Graphic2d_CircleDefinitionError::Raise ("The radius = 0." );
- Standard_ShortReal TwoPI = Standard_ShortReal(2.* Standard_PI);
+ Standard_ShortReal TwoPI = Standard_ShortReal(2. * M_PI);
while( myFAngle < 0. ) myFAngle += TwoPI;
- while( myFAngle > 2.* Standard_PI ) myFAngle -= TwoPI;
+ while( myFAngle > 2. * M_PI ) myFAngle -= TwoPI;
while( mySAngle < 0. ) mySAngle += TwoPI;
- while( mySAngle > 2.* Standard_PI ) mySAngle -= TwoPI;
+ while( mySAngle > 2. * M_PI ) mySAngle -= TwoPI;
if ( mySAngle < myFAngle ) mySAngle += TwoPI;
if ( ( mySAngle - myFAngle < ShortRealEpsilon() ) ||
myMaxY = myMaxY > Ycur ? myMaxY : Ycur;
for ( Acur = 0., Xcur = 1., Ycur = 0.;
- Acur < mySAngle; Acur += Standard_ShortReal(Standard_PI/2.)) {
+ Acur < mySAngle; Acur += Standard_ShortReal(M_PI / 2.)) {
if ( Acur > myFAngle ) {
myMinX = ( myMinX < Xcur ? myMinX : Xcur );
myMaxX = ( myMaxX < Xcur ? Xcur : myMaxX );
// Arrows
- Standard_Real ArrAngle = PI/180.*anArrAngle;
+ Standard_Real ArrAngle = M_PI/180.*anArrAngle;
gp_Pnt2d theOrigine(0.,0.);
gp_Pnt2d P1, P2, P3;
P2 = gp_Pnt2d( anArrLength, anArrLength*Tan( ArrAngle/2. ) );
P3 = gp_Pnt2d( anArrLength, -anArrLength*Tan( ArrAngle/2. ) );
- VDir = V1.Rotated(PI/2);
+ VDir = V1.Rotated(M_PI/2);
theAngle = VX.Angle( VDir );
P2.Rotate( theOrigine, theAngle );
P3.Rotate( theOrigine, theAngle );
P2 = gp_Pnt2d( anArrLength, anArrLength*Tan( ArrAngle/2. ) );
P3 = gp_Pnt2d( anArrLength, -anArrLength*Tan( ArrAngle/2. ) );
- VDir = V2.Rotated(-PI/2);
+ VDir = V2.Rotated(-M_PI/2);
theAngle = VX.Angle( VDir );
P2.Rotate( theOrigine, theAngle );
gp_Pnt2d pntText = theCent.Translated(textV1);
Standard_Real txtX, txtY;
pntText.Coord(txtX, txtY);
- Standard_ShortReal txtAngle = Standard_ShortReal( theAngle + 3*PI/2);
+ Standard_ShortReal txtAngle = Standard_ShortReal( theAngle + 3*M_PI/2);
Standard_ShortReal ws, hs;
aDrawer->GetTextSize( myText, ws, hs );
ts1 = Standard_ShortReal( A );
ts2 = Standard_ShortReal( B );
- if ( Abs(f-e) < Standard_ShortReal(2.*Standard_PI) ) {
+ if ( Abs(f-e) < Standard_ShortReal(2. * M_PI) ) {
aTrsf.SetValue( 1, 3, 0.0 );
aTrsf.SetValue( 2, 3, 0.0 );
gp_Pnt2d pntText = theCent.Translated(textV1);
Standard_Real txtX, txtY;
pntText.Coord(txtX, txtY);
- Standard_ShortReal txtAngle = Standard_ShortReal( theAngle + 3*PI/2);*/
+ Standard_ShortReal txtAngle = Standard_ShortReal( theAngle + 3*M_PI/2);*/
//correct by enk Mon Dec 2 11:39 2002
a = Standard_ShortReal( A );
b = Standard_ShortReal( B );
- if ( Abs(f-e) < Standard_ShortReal(2.*Standard_PI) ) {
+ if ( Abs(f-e) < Standard_ShortReal(2. * M_PI) ) {
aTrsf.SetValue( 1, 3, 0.0 );
aTrsf.SetValue( 2, 3, 0.0 );
X1 = Cos(E);
gp_Pnt2d pntText = theCent.Translated(textV1);
Standard_Real txtX, txtY;
pntText.Coord(txtX, txtY);
- Standard_ShortReal txtAngle = Standard_ShortReal( theAngle + 3*PI/2);*/
+ Standard_ShortReal txtAngle = Standard_ShortReal( theAngle + 3*M_PI/2);*/
//correct by enk Mon Dec 2 11:41 2002
/////////////////////////////////////////
gp_Vec2d textV1 = V1.Rotated( delta/2 );
theVecJ = textV1/myRad;
- theVecI = textV1.Rotated(-PI/2.)/myRad;
+ theVecI = textV1.Rotated(-M_PI/2.)/myRad;
gp_Pnt2d pntText =
Y1 = Standard_ShortReal( myY - myLength/2 ),
X2 = Standard_ShortReal( myX + myLength/2 ),
Y2 = Y1,
- X3 = Standard_ShortReal( X1 + myLength * Cos( Standard_PI / 4 ) ),
+ X3 = Standard_ShortReal( X1 + myLength * Cos( M_PI / 4 ) ),
Y3 = Standard_ShortReal( myY + myLength/2 );
gp_Pnt2d P1( X1, Y1 ),
gp_Pnt2d P1( aLocation.Location() );
gp_Dir2d AxeX( 1., 0. );
Standard_Real theAngle = AxeX.Angle( aLocation.Direction() );
- theAngle += Standard_PI;
+ theAngle += M_PI;
gp_Pnt2d P2( aLength, aLength*Tan( anAngle/2. ) );
gp_Pnt2d P3( aLength, -aLength*Tan( anAngle/2. ) );
P2.Rotate( theOrigine, theAngle );
if ( myX2 > myMaxX ) myMaxX = myX2;
if ( myY2 > myMaxY ) myMaxY = myY2;
- Standard_Real ArrAngle = PI/180.*anArrAngle, theAngle;
+ Standard_Real ArrAngle = M_PI/180.*anArrAngle, theAngle;
gp_Pnt2d theOrigine( 0., 0.), P1, P2, P3;
gp_Vec2d VX( 1., 0. ), VDir;
if ( myX1 > myMaxX ) myMaxX = myX1;
if ( myY1 > myMaxY ) myMaxY = myY1;
- Standard_Real ArrAngle = PI/180.*anArrAngle, theAngle;
+ Standard_Real ArrAngle = M_PI/180.*anArrAngle, theAngle;
gp_Pnt2d theOrigine( 0., 0.), P1, P2, P3;
gp_Vec2d VX( 1., 0. ), VDir;
if ( myX1 > myMaxX ) myMaxX = myX1;
if ( myY1 > myMaxY ) myMaxY = myY1;
- Standard_Real ArrAngle = PI/180.*anArrAngle, theAngle;
+ Standard_Real ArrAngle = M_PI/180.*anArrAngle, theAngle;
gp_Pnt2d theOrigine( 0., 0.), P1, P2, P3;
gp_Vec2d VX( 1., 0. ), VDir;
X1 = Standard_ShortReal( a1 );
Y1 = Standard_ShortReal( b1 );
}
- aDrawer->MapArcFromTo( X1, Y1, myLength/2, 0.0, Standard_ShortReal( 2. * Standard_PI ) );
+ aDrawer->MapArcFromTo( X1, Y1, myLength/2, 0.0, Standard_ShortReal( 2. * M_PI ) );
}
}
X1 = Standard_ShortReal( a1 );
Y1 = Standard_ShortReal( b1 );
}
- aDrawer->MapArcFromTo( X1, Y1, myLength/2, 0.0, Standard_ShortReal( 2. * Standard_PI ) );
- aDrawer->MapArcFromTo( X1, Y1, myLength/3, 0.0, Standard_ShortReal( 2. * Standard_PI ) );
+ aDrawer->MapArcFromTo( X1, Y1, myLength/2, 0.0, Standard_ShortReal( 2. * M_PI ) );
+ aDrawer->MapArcFromTo( X1, Y1, myLength/3, 0.0, Standard_ShortReal( 2. * M_PI ) );
}
}
gp_Vec2d theVec( thePnt1, gp_Pnt2d( X3, Y3 ) );
theVec /= 2;
thePnt1.Translate( theVec );
- Standard_ShortReal theRad = Standard_ShortReal( myLength/2*Sin(Standard_PI / 3) );
+ Standard_ShortReal theRad = Standard_ShortReal( myLength/2*Sin(M_PI / 3) );
Standard_ShortReal Xc = Standard_ShortReal(thePnt1.X()),
Yc = Standard_ShortReal(thePnt1.Y());
}
aDrawer->MapSegmentFromTo( X1, Y1, X2, Y2 );
aDrawer->MapSegmentFromTo( X4, Y4, X3, Y3 );
- aDrawer->MapArcFromTo( Xc, Yc, theRad, 0.0, Standard_ShortReal( 2. * Standard_PI ) );
+ aDrawer->MapArcFromTo( Xc, Yc, theRad, 0.0, Standard_ShortReal( 2. * M_PI ) );
}
}
if ( myX2 > myMaxX ) myMaxX = myX2;
if ( myY2 > myMaxY ) myMaxY = myY2;
- Standard_Real ArrAngle = PI/180.* anArrAngle, theAngle;
+ Standard_Real ArrAngle = M_PI/180.* anArrAngle, theAngle;
gp_Pnt2d theOrigine( 0., 0.), P1, P2, P3;
if ( ( myArrow == Prs2d_AS_FIRSTAR ) || ( myArrow == Prs2d_AS_BOTHAR ) ) {
gp_Vec2d VX( 1., 0. ), theVec(thePnt2, thePnt1);
Standard_Real theTxtAngle = VX.Angle( theVec );
gp_Pnt2d pntText;
- if ( theTxtAngle >= 0 && theTxtAngle <= PI/2 )
+ if ( theTxtAngle >= 0 && theTxtAngle <= M_PI/2 )
pntText = thePnt2.Translated( (myArrowLen+dxx)*theVec/(thePnt1.Distance(thePnt2)) );
- else if ( theTxtAngle > PI/2 && theTxtAngle <= PI ) {
+ else if ( theTxtAngle > M_PI/2 && theTxtAngle <= M_PI ) {
pntText = thePnt1.Translated( (myArrowLen+dxx)*theVec.Reversed()/(thePnt1.Distance(thePnt2)) );
theTxtAngle = VX.Angle( theVec.Reversed() );
- } else if ( theTxtAngle >= -PI/2 && theTxtAngle < 0 )
+ } else if ( theTxtAngle >= -M_PI/2 && theTxtAngle < 0 )
pntText = thePnt2.Translated( (myArrowLen+dxx)*theVec/(thePnt1.Distance(thePnt2)) );
- else if ( theTxtAngle >= -PI && theTxtAngle < -PI/2 ) {
+ else if ( theTxtAngle >= -M_PI && theTxtAngle < -M_PI/2 ) {
pntText = thePnt1.Translated( (myArrowLen+dxx)*theVec.Reversed()/(thePnt1.Distance(thePnt2)) );
theTxtAngle = VX.Angle( theVec.Reversed() );
}
gp_Vec2d VX( 1., 0. ), theVec(thePnt2, thePnt1);
Standard_Real theTxtAngle = VX.Angle( theVec );
gp_Pnt2d pntText;
- if ( theTxtAngle >= 0 && theTxtAngle <= PI/2 )
+ if ( theTxtAngle >= 0 && theTxtAngle <= M_PI/2 )
pntText = thePnt2.Translated( (myArrowLen+dxx)*theVec/(thePnt1.Distance(thePnt2)) );
- else if ( theTxtAngle > PI/2 && theTxtAngle <= PI ) {
+ else if ( theTxtAngle > M_PI/2 && theTxtAngle <= M_PI ) {
pntText = thePnt1.Translated( (myArrowLen+dxx)*theVec.Reversed()/(thePnt1.Distance(thePnt2)) );
theTxtAngle = VX.Angle( theVec.Reversed() );
- } else if ( theTxtAngle >= -PI/2 && theTxtAngle < 0 )
+ } else if ( theTxtAngle >= -M_PI/2 && theTxtAngle < 0 )
pntText = thePnt2.Translated( (myArrowLen+dxx)*theVec/(thePnt1.Distance(thePnt2)) );
- else if ( theTxtAngle >= -PI && theTxtAngle < -PI/2 ) {
+ else if ( theTxtAngle >= -M_PI && theTxtAngle < -M_PI/2 ) {
pntText = thePnt1.Translated( (myArrowLen+dxx)*theVec.Reversed()/(thePnt1.Distance(thePnt2)) );
theTxtAngle = VX.Angle( theVec.Reversed() );
}
gp_Vec2d VX( 1., 0. ), theVec(thePnt2, thePnt1);
Standard_Real theTxtAngle = VX.Angle( theVec );
gp_Pnt2d pntText;
- if ( theTxtAngle >= 0 && theTxtAngle <= PI/2 )
+ if ( theTxtAngle >= 0 && theTxtAngle <= M_PI/2 )
pntText = thePnt2.Translated( (myArrowLen+dxx)*theVec/(thePnt1.Distance(thePnt2)) );
- else if ( theTxtAngle > PI/2 && theTxtAngle <= PI ) {
+ else if ( theTxtAngle > M_PI/2 && theTxtAngle <= M_PI ) {
pntText = thePnt1.Translated( (myArrowLen+dxx)*theVec.Reversed()/(thePnt1.Distance(thePnt2)) );
theTxtAngle = VX.Angle( theVec.Reversed() );
- } else if ( theTxtAngle >= -PI/2 && theTxtAngle < 0 )
+ } else if ( theTxtAngle >= -M_PI/2 && theTxtAngle < 0 )
pntText = thePnt2.Translated( (myArrowLen+dxx)*theVec/(thePnt1.Distance(thePnt2)) );
- else if ( theTxtAngle >= -PI && theTxtAngle < -PI/2 ) {
+ else if ( theTxtAngle >= -M_PI && theTxtAngle < -M_PI/2 ) {
pntText = thePnt1.Translated( (myArrowLen+dxx)*theVec.Reversed()/(thePnt1.Distance(thePnt2)) );
theTxtAngle = VX.Angle( theVec.Reversed() );
}
theVec.Normalized();
theVecI = theVec.Reversed()*myTextPosH/theDist;
- theVecJ = theVec.Reversed().Rotated(PI/2)*myTextPosV/theDist;
+ theVecJ = theVec.Reversed().Rotated(M_PI/2)*myTextPosV/theDist;
theVec.Rotate(-myTextAngle);
gp_Pnt2d pntText;
- if ( theTxtAngle >= 0 && theTxtAngle <= PI/2 )
+ if ( theTxtAngle >= 0 && theTxtAngle <= M_PI/2 )
pntText = thePnt2.Translated(theVec/theDist);
- else if ( theTxtAngle > PI/2 && theTxtAngle <= PI ) {
+ else if ( theTxtAngle > M_PI/2 && theTxtAngle <= M_PI ) {
pntText = thePnt1.Translated(theVec.Reversed()/theDist) ;
theTxtAngle = VX.Angle( theVec.Reversed() );
- } else if ( theTxtAngle >= -PI/2 && theTxtAngle < 0 )
+ } else if ( theTxtAngle >= -M_PI/2 && theTxtAngle < 0 )
pntText = thePnt2.Translated(theVec/theDist);
- else if ( theTxtAngle >= -PI && theTxtAngle < -PI/2 ) {
+ else if ( theTxtAngle >= -M_PI && theTxtAngle < -M_PI/2 ) {
pntText = thePnt1.Translated(theVec.Reversed()/theDist);
theTxtAngle = VX.Angle( theVec.Reversed() );
}
Standard_ShortReal theRad = ( myWidth < myHeight) ? myWidth : myHeight;
gp_Pnt2d theCent( myX, myY );
gp_Vec2d theVec( theCent, gp_Pnt2d( myX + 13 * theRad/ 10, myY ) );
- theVec.Rotate( Standard_PI / 4 );
+ theVec.Rotate( M_PI / 4 );
gp_Pnt2d P1 = theCent.Translated( theVec );
gp_Pnt2d P2 = theCent.Translated( theVec.Reversed() );
}
DrawLineAttrib( aDrawer );
- aDrawer->MapArcFromTo( a, b, theRad, 0., Standard_ShortReal( 2 * Standard_PI ) );
+ aDrawer->MapArcFromTo( a, b, theRad, 0., Standard_ShortReal( 2 * M_PI ) );
aDrawer->MapSegmentFromTo( c, d, e, f );
}// end TOS_DIAMETER
DirLin2.Normalize();
DirLin1 *= aLength;
DirLin2 *= aLength;
- DirLin1.Rotate( PI/2. );
- DirLin2.Rotate( -PI/2. );
+ DirLin1.Rotate( M_PI/2. );
+ DirLin2.Rotate( -M_PI/2. );
aPntProj1 = myPntAttach1.Translated( DirLin1 );
aPntProj2 = myPntAttach2.Translated( DirLin2 );;
break;
DirLin2.Normalize();
DirLin1 *= aLength;
DirLin2 *= aLength;
- DirLin1.Rotate( PI/2. );
- DirLin2.Rotate( -PI/2. );
+ DirLin1.Rotate( M_PI/2. );
+ DirLin2.Rotate( -M_PI/2. );
aPntProj1 = myPntAttach1.Translated( DirLin1 );
aPntProj2 = myPntAttach2.Translated( DirLin2 );;
break;
void Prs2d_Length::ComputeArrows( const Standard_Boolean /*isnotPoints*/ )
{
- Standard_Real ArrAngle = PI/180. * ArrowAngle(), theAngle;
+ Standard_Real ArrAngle = M_PI/180. * ArrowAngle(), theAngle;
gp_Pnt2d aPnt1( myX1, myY1 ), aPnt2( myX2, myY2 );
gp_Pnt2d theOrigine( 0., 0.), P1, P2, P3;
gp_Vec2d VX( 1., 0. ), VDir;
theVecI = theVec*(theDist/2-theTextLen/2+myTextPosH);
tmpVec = theVec*(theDist/2+myTextPosH);
- theVecJ = theVec.Rotated(PI/2)*myTextPosV;
+ theVecJ = theVec.Rotated(M_PI/2)*myTextPosV;
theOrigine=thePnt1;
theOrigine.Translate(tmpVec);
Y1 = Standard_ShortReal( b1 );
}
- aDrawer->MapArcFromTo( X1, Y1, myLength/2, myAngle, Standard_ShortReal( Standard_PI + myAngle ) );
+ aDrawer->MapArcFromTo( X1, Y1, myLength/2, myAngle, Standard_ShortReal( M_PI + myAngle ) );
}
}
Standard_ShortReal X1 = myX - myLength/2,
Y1 = myY - myLength/2,
- X2 = Standard_ShortReal( X1 + myLength * Cos( Standard_PI / 4 ) ),
+ X2 = Standard_ShortReal( X1 + myLength * Cos( M_PI / 4 ) ),
Y2 = myY + myLength/2,
- X3 = Standard_ShortReal(myX + myLength* Cos( Standard_PI / 4 ) ),
+ X3 = Standard_ShortReal(myX + myLength* Cos( M_PI / 4 ) ),
Y3 = Y2,
X4 = myX,
Y4 = Y1;
}
aDrawer->MapSegmentFromTo( X1, Y1, X2, Y2 );
aDrawer->MapSegmentFromTo( X4, Y4, X3, Y3 );
- aDrawer->MapArcFromTo( Xc, Yc, myLength/2, 0.0, Standard_ShortReal( 2. * Standard_PI ) );
+ aDrawer->MapArcFromTo( Xc, Yc, myLength/2, 0.0, Standard_ShortReal( 2. * M_PI ) );
}
}
if ( myX2 > myMaxX ) myMaxX = myX2;
if ( myY2 > myMaxY ) myMaxY = myY2;
- Standard_Real ArrAngle = PI/180.* anArrAngle, theAngle;
+ Standard_Real ArrAngle = M_PI/180.* anArrAngle, theAngle;
gp_Pnt2d theOrigine( 0., 0. ), P1, P2, P3;
gp_Vec2d VX( 1., 0. ), VDir;
gp_Vec2d VX( 1., 0. ), theVec(thePnt2, thePnt1);
Standard_Real theTxtAngle = VX.Angle( theVec );
gp_Pnt2d pntText;
- if ( theTxtAngle >= 0 && theTxtAngle <= PI/2 )
+ if ( theTxtAngle >= 0 && theTxtAngle <= M_PI/2 )
pntText = thePnt2.Translated( (myArrowLen+d1)*theVec/(thePnt1.Distance(thePnt2)) );
- else if ( theTxtAngle > PI/2 && theTxtAngle <= PI ) {
+ else if ( theTxtAngle > M_PI/2 && theTxtAngle <= M_PI ) {
pntText = thePnt1.Translated( (myArrowLen+d1)*theVec.Reversed()/(thePnt1.Distance(thePnt2)) );
theTxtAngle = VX.Angle( theVec.Reversed() );
- } else if ( theTxtAngle >= -PI/2 && theTxtAngle < 0 )
+ } else if ( theTxtAngle >= -M_PI/2 && theTxtAngle < 0 )
pntText = thePnt2.Translated( (myArrowLen+d1)*theVec/(thePnt1.Distance(thePnt2)) );
- else if ( theTxtAngle >= -PI && theTxtAngle < -PI/2 ) {
+ else if ( theTxtAngle >= -M_PI && theTxtAngle < -M_PI/2 ) {
pntText = thePnt1.Translated( (myArrowLen+d1)*theVec.Reversed()/(thePnt1.Distance(thePnt2)) );
theTxtAngle = VX.Angle( theVec.Reversed() );
}
gp_Vec2d VX( 1., 0. ), theVec(thePnt2, thePnt1);
Standard_Real theTxtAngle = VX.Angle( theVec );
gp_Pnt2d pntText;
- if ( theTxtAngle >= 0 && theTxtAngle <= PI/2 )
+ if ( theTxtAngle >= 0 && theTxtAngle <= M_PI/2 )
pntText = thePnt2.Translated( (myArrowLen+d1)*theVec/(thePnt1.Distance(thePnt2)) );
- else if ( theTxtAngle > PI/2 && theTxtAngle <= PI ) {
+ else if ( theTxtAngle > M_PI/2 && theTxtAngle <= M_PI ) {
pntText = thePnt1.Translated( (myArrowLen+d1)*theVec.Reversed()/(thePnt1.Distance(thePnt2)) );
theTxtAngle = VX.Angle( theVec.Reversed() );
- } else if ( theTxtAngle >= -PI/2 && theTxtAngle < 0 )
+ } else if ( theTxtAngle >= -M_PI/2 && theTxtAngle < 0 )
pntText = thePnt2.Translated( (myArrowLen+d1)*theVec/(thePnt1.Distance(thePnt2)) );
- else if ( theTxtAngle >= -PI && theTxtAngle < -PI/2 ) {
+ else if ( theTxtAngle >= -M_PI && theTxtAngle < -M_PI/2 ) {
pntText = thePnt1.Translated( (myArrowLen+d1)*theVec.Reversed()/(thePnt1.Distance(thePnt2)) );
theTxtAngle = VX.Angle( theVec.Reversed() );
}
gp_Vec2d VX( 1., 0. ), theVec(thePnt2, thePnt1);
Standard_Real theTxtAngle = VX.Angle( theVec );
gp_Pnt2d pntText;
- if ( theTxtAngle >= 0 && theTxtAngle <= PI/2 )
+ if ( theTxtAngle >= 0 && theTxtAngle <= M_PI/2 )
pntText = thePnt2.Translated( (myArrowLen+d1)*theVec/(thePnt1.Distance(thePnt2)) );
- else if ( theTxtAngle > PI/2 && theTxtAngle <= PI ) {
+ else if ( theTxtAngle > M_PI/2 && theTxtAngle <= M_PI ) {
pntText = thePnt1.Translated( (myArrowLen+d1)*theVec.Reversed()/(thePnt1.Distance(thePnt2)) );
theTxtAngle = VX.Angle( theVec.Reversed() );
- } else if ( theTxtAngle >= -PI/2 && theTxtAngle < 0 )
+ } else if ( theTxtAngle >= -M_PI/2 && theTxtAngle < 0 )
pntText = thePnt2.Translated( (myArrowLen+d1)*theVec/(thePnt1.Distance(thePnt2)) );
- else if ( theTxtAngle >= -PI && theTxtAngle < -PI/2 ) {
+ else if ( theTxtAngle >= -M_PI && theTxtAngle < -M_PI/2 ) {
pntText = thePnt1.Translated( (myArrowLen+d1)*theVec.Reversed()/(thePnt1.Distance(thePnt2)) );
theTxtAngle = VX.Angle( theVec.Reversed() );
}
if ( myX2 > myMaxX ) myMaxX = myX2;
if ( myY2 > myMaxY ) myMaxY = myY2;
- Standard_Real ArrANG = Standard_PI/6., theArrLN = aRad/5., theANG;
+ Standard_Real ArrANG = M_PI / 6., theArrLN = aRad/5., theANG;
gp_Pnt2d theOrig( 0., 0. ), P2, P3;
gp_Vec2d VX( 1., 0. );
gp_Pnt2d theOrig( 0., 0. ), P1, P2, P3;
gp_Vec2d VX( 1., 0. ), VDir( aPnt1, aPnt2 );
- Standard_Real alpha = Standard_PI - anArrAngle;
+ Standard_Real alpha = M_PI - anArrAngle;
P1 = aPnt1;
P2 = gp_Pnt2d( anArrLength, anArrLength*Tan( alpha/2. ) );
P3 = gp_Pnt2d( anArrLength, -anArrLength*Tan( alpha/2. ) );
}
- if ( theAng >= 0. && theAng < PI/2) {
+ if ( theAng >= 0. && theAng < M_PI/2) {
nX -= aLenBase;
- } else if ( theAng >= PI/2 && theAng <= PI ) {
+ } else if ( theAng >= M_PI/2 && theAng <= M_PI ) {
nX += aLenBase;
myObtuse = Standard_True;
- } else if ( theAng >= -PI && theAng < -PI/2) {
+ } else if ( theAng >= -M_PI && theAng < -M_PI/2) {
nX += aLenBase;
myObtuse = Standard_True;
- } else if ( theAng >= -PI/2 && theAng < 0. )
+ } else if ( theAng >= -M_PI/2 && theAng < 0. )
nX -= aLenBase;
myXVert(3) = Standard_ShortReal( nX );
Yc = Standard_ShortReal( b1 );
}
aDrawer->MapSegmentFromTo( X1, Y1, X2, Y2 );
- aDrawer->MapArcFromTo( Xc, Yc, myLength/2, myAngle, Standard_ShortReal( Standard_PI + myAngle ) );
+ aDrawer->MapArcFromTo( Xc, Yc, myLength/2, myAngle, Standard_ShortReal( M_PI + myAngle ) );
}
}
if ( IsIn ) {
DrawLineAttrib( aDrawer );
- const Standard_Real alpha = Standard_PI / 12;
+ const Standard_Real alpha = M_PI / 12;
Standard_ShortReal X1 = myX - myLength/2,
Y1 = myY - myLength/2,
- X2 = Standard_ShortReal(X1 + myLength * Cos( Standard_PI / 4 ) ),
+ X2 = Standard_ShortReal(X1 + myLength * Cos( M_PI / 4 ) ),
Y2 = myY + myLength/2;
if ( IsIn ) {
DrawLineAttrib( aDrawer );
- const Standard_Real alpha = Standard_PI / 12;
+ const Standard_Real alpha = M_PI / 12;
Standard_ShortReal X1 = myX - myLength/2,
Y1 = myY - myLength/2,
- X2 = Standard_ShortReal(X1 + myLength * Cos( Standard_PI / 4 ) ),
+ X2 = Standard_ShortReal(X1 + myLength * Cos( M_PI / 4 ) ),
Y2 = myY + myLength/2,
X5 = myX,
Y5 = myY - myLength/2,
- X6 = Standard_ShortReal(X5 + myLength * Cos( Standard_PI / 4 ) ),
+ X6 = Standard_ShortReal(X5 + myLength * Cos( M_PI / 4 ) ),
Y6 = myY + myLength/2;
gp_Pnt2d P1( X2, Y2 );
if ( IsIn ) {
DrawLineAttrib( aDrawer );
- const Standard_Real alpha = Standard_PI / 10;
+ const Standard_Real alpha = M_PI / 10;
Standard_ShortReal X1 = myX - myLength/2,
Y1 = myY,
gp_Pnt2d Pnt0 = PntP.Translated( theV1 );
gp_Vec2d theVecG( Pnt0, gp_Pnt2d( Pnt0.X() + 1.0, Pnt0.Y() ) );
theVecG.Rotate( myAngle );
- gp_Vec2d theVecV = theVecG.Rotated( Standard_PI / 2 );
+ gp_Vec2d theVecV = theVecG.Rotated( M_PI / 2 );
theVecG.Normalize();
theVecV.Normalize();
theVecT.Normalize();
gp_Vec2d theVecG( Pnt0, gp_Pnt2d( Pnt0.X() + 1.0, Pnt0.Y() ) );
theVecG.Rotate( myAngle );
- gp_Vec2d theVecV = theVecG.Rotated( Standard_PI / 2 );
+ gp_Vec2d theVecV = theVecG.Rotated( M_PI / 2 );
theVecG.Normalize();
theVecV.Normalize();
Standard_Real x1,y1,z1,x2,y2,z2;
AttachmentPoint2.Coord(x1,y1,z1);
AttachmentPoint3.Coord(x2,y2,z2);
- Standard_Integer nbp = Max (4 , Standard_Integer (50. * alpha / PI));
+ Standard_Integer nbp = Max (4 , Standard_Integer (50. * alpha / M_PI));
Standard_Real dteta = alpha/(nbp-1);
Standard_Real x,y,z;
gp_Vec u;
for (Standard_Integer i = 1 ; i <= NbPoints ; i++) {
- cosinus = cos ( 2 * PI / NbPoints * (i-1) );
- sinus = sin ( 2 * PI / NbPoints * (i-1) );
+ cosinus = cos ( 2 * M_PI / NbPoints * (i-1) );
+ sinus = sin ( 2 * M_PI / NbPoints * (i-1) );
x = xc + (cosinus * xi + sinus * xj) * aLength * Tg;
y = yc + (cosinus * yi + sinus * yj) * aLength * Tg;
#include <Prs3d_ArrowAspect.ixx>
Prs3d_ArrowAspect::Prs3d_ArrowAspect ()
- : myAngle(PI/180.*10), myLength(1.) {
+ : myAngle(M_PI/180.*10), myLength(1.) {
#ifdef IMP120100
myArrowAspect =
new Graphic3d_AspectLine3d (
void Prs3d_ArrowAspect::SetAngle ( const Quantity_PlaneAngle anAngle) {
Prs3d_InvalidAngle_Raise_if ( anAngle <= 0. ||
- anAngle >= PI /2. , "");
+ anAngle >= M_PI /2. , "");
myAngle = anAngle;
}
Quantity_PlaneAngle Prs3d_ArrowAspect::Angle () const
G->SetPrimitivesAspect(aDrawer->TextAspect()->Aspect());
G->Text(Standard_CString("X"),A(2),16.);
#else
- Prs3d_Arrow::Draw(aPresentation,gp_Pnt(x,y,z),oX,PI/180.*10.,DS/10.);
+ Prs3d_Arrow::Draw(aPresentation,gp_Pnt(x,y,z),oX,M_PI/180.*10.,DS/10.);
Prs3d_Root::CurrentGroup(aPresentation)->Text(Standard_CString("X"),A(2),1./81.);
#endif
}
G->SetPrimitivesAspect(aDrawer->TextAspect()->Aspect());
G->Text(Standard_CString("Y"),A(2),16.);
#else
- Prs3d_Arrow::Draw(aPresentation,gp_Pnt(x,y,z),oY,PI/180.*10.,DS/10.);
+ Prs3d_Arrow::Draw(aPresentation,gp_Pnt(x,y,z),oY,M_PI/180.*10.,DS/10.);
Prs3d_Root::CurrentGroup(aPresentation)->Text(Standard_CString("Y"),A(2),1./81.);
#endif
}
G->Text(Standard_CString("Z"),A(2),16.);
#else
Prs3d_Root::CurrentGroup(aPresentation)->Text(Standard_CString("Z"),A(2),1./81.);
- Prs3d_Arrow::Draw(aPresentation,gp_Pnt(x,y,z),oZ,PI/180.*10.,DS/10.);
+ Prs3d_Arrow::Draw(aPresentation,gp_Pnt(x,y,z),oZ,M_PI/180.*10.,DS/10.);
#endif
}
}
myMaximalParameterValue(500000.),
myDeviationCoefficient(0.001),
myHLRDeviationCoefficient(0.02),
- myDeviationAngle(12*PI/180),
- myHLRAngle(20*PI/180),
+ myDeviationAngle(12*M_PI/180),
+ myHLRAngle(20*M_PI/180),
myLineDrawArrow(Standard_False),
myDrawHiddenLine(Standard_False)
{
myPlaneYLength= 1.;
myArrowsLength= 0.02;
myArrowsSize=0.1;
- myArrowsAngle=PI/8.;
+ myArrowsAngle=M_PI/8.;
}
Handle(Prs3d_LineAspect) Prs3d_PlaneAspect::EdgesAspect() const
A(2).SetCoord(x1+dx,y1+dy,z1+dz);
G->Polyline(A);
Prs3d_Arrow::Draw(aPresentation,gp_Pnt(x1+dx,y1+dy,z1+dz),gp_Dir(Vec),
- PI/180.*10.,Sqrt(dx*dx+dy*dy+dz*dz)/10.);
+ M_PI/180.*10.,Sqrt(dx*dx+dy*dy+dz*dz)/10.);
}
double R1=8, R2=16, H1=20, H2=40, angle;
gp_Pnt P0(0,0,0),
P1(0,0,20), P2(0,0,45);
- angle = 2*PI;
+ angle = 2*M_PI;
Handle(Geom_RectangularTrimmedSurface) S = GC_MakeTrimmedCone (P1, P2, R1, R2).Value();
TopoDS_Shape myshape = BRepBuilderAPI_MakeFace(S, Precision::Confusion()).Shape();
Handle(AIS_Shape) ais1 = new AIS_Shape(myshape);
return 1;
}
- Standard_Real Alpha = Standard_PI/10.;
+ Standard_Real Alpha = M_PI/10.;
Standard_Real CosAlpha = Cos (Alpha);
Standard_Real SinAlpha = Sin (Alpha);
Standard_Real MoinsCosAlpha = Cos (-Alpha);
gp_Ax2 Cone_Ax;
double R1=8, R2=16, H1=20, H2=40, angle;
gp_Pnt P0(0,0,0), P1(0,0,20), P2(0,0,45);
- angle = 2*PI;
+ angle = 2*M_PI;
Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
if(aContext.IsNull()) {
gp_Pnt P1(0, 0, 0);
gp_Dir D1(0, 0, 30);
gp_Ax1 A1(P1,D1);
- Standard_Real angle1 = 360 * PI180;
+ Standard_Real angle1 = 360 * (M_PI / 180.0);
TopoDS_Shape rs1 = BRepPrimAPI_MakeRevol(F1, A1, angle1);
BRepBuilderAPI_MakePolygon W2;
gp_Pnt P2(0, 0, 0);
gp_Dir D2(0, 0, 30);
gp_Ax1 A2(P2,D2);
- Standard_Real angle2 = 270 * PI180;
+ Standard_Real angle2 = 270 * (M_PI / 180.0);
TopoDS_Shape rs2 = BRepPrimAPI_MakeRevol(F2, A2, angle2);
BRepBuilderAPI_MakePolygon W3;
gp_Pnt P3(0, 0, 0);
gp_Dir D3(0, 0, 30);
gp_Ax1 A3(P3,D3);
- Standard_Real angle3 = 360 * PI180;
+ Standard_Real angle3 = 360 * (M_PI / 180.0);
TopoDS_Shape rs3 = BRepPrimAPI_MakeRevol(F3, A3, angle3);
TopoDS_Shape fuse32, fuse321;
TopoDS_Shape slabShape = slab.Shape();
if (fabs(draftAngle) > 0.01)
{
- Standard_Real angle = draftAngle*PI180;
+ Standard_Real angle = draftAngle*(M_PI / 180.0);
BRepOffsetAPI_DraftAngle draftSlab(slabShape);
TopoDS_Shape fShape = slab.FirstShape();
gp_Pnt P1(0, 0, 0);
gp_Dir D1(0, 30, 0);
gp_Ax1 A1(P1,D1);
- Standard_Real angle1 = 360 * PI180;
+ Standard_Real angle1 = 360 * (M_PI / 180.0);
TopoDS_Shape rev = BRepPrimAPI_MakeRevol(F1, A1, angle1);
if (index < argc) DBRep::Set(argv[index++], rev);
gp_Pnt P1(0, 0, 0);
gp_Dir D1(0, 0, 30);
gp_Ax1 A1(P1,D1);
- Standard_Real angle1 = 360 * PI180;
+ Standard_Real angle1 = 360 * (M_PI / 180.0);
TopoDS_Shape rev = BRepPrimAPI_MakeRevol(F1, A1, angle1);
if (index < argc) DBRep::Set(argv[index++], rev);
else aConsiderLocation = Standard_True;
// 2. Iniitialize aShapeUpgrade
- ShapeUpgrade_ShapeDivideAngle aShapeUpgrade(PI/2.);
+ ShapeUpgrade_ShapeDivideAngle aShapeUpgrade(M_PI/2.);
// precision
aShapeUpgrade.SetPrecision (Precision::Confusion());
// tolerance
if(aShape.IsNull()) {di << "OCC369 FAULTY. Entry shape is NULL \n"; return 0;}
// 3. Build mesh
- BRepMesh_IncrementalMesh aMesh(aShape, 0.2, Standard_True, PI/6);
+ BRepMesh_IncrementalMesh aMesh(aShape, 0.2, Standard_True, M_PI/6);
}
catch (Standard_Failure) {di << "OCC369 Exception \n" ;return 0;}
TopoDS_Shape cyl2;
TopoDS_Shape o_cut_shape;
if (CaseNumber == 1) {
- //BRepPrimAPI_MakeCylinder o_mc2 (gp_Ax2 (gp_Pnt(21.65064, -50.0, 127.5),gp_Dir(-sin(PI/3), 0.0, 0.5)), 5, 150);
- gp_Dir myDir_mc2(-sin(PI/3), 0.0, 0.5);
+ //BRepPrimAPI_MakeCylinder o_mc2 (gp_Ax2 (gp_Pnt(21.65064, -50.0, 127.5),gp_Dir(-sin(M_PI/3), 0.0, 0.5)), 5, 150);
+ gp_Dir myDir_mc2(-sin(M_PI/3), 0.0, 0.5);
gp_Pnt myPnt_mc2(21.65064, -50.0, 127.5);
gp_Ax2 myAx2_mc2(myPnt_mc2, myDir_mc2);
BRepPrimAPI_MakeCylinder o_mc2 (myAx2_mc2, 5, 150);
o_cut_shape = BRepAlgo_Cut (o_mc1.Solid (), o_mc2.Solid ());
}
} else {
- //BRepPrimAPI_MakeCylinder o_mc2 (gp_Ax2 (gp_Pnt(978.34936, -50.0, 127.5),gp_Dir(sin(PI/3), 0.0, 0.5)), 5, 150);
- gp_Dir myDir_mc2(-sin(PI/3), 0.0, 0.5);
+ //BRepPrimAPI_MakeCylinder o_mc2 (gp_Ax2 (gp_Pnt(978.34936, -50.0, 127.5),gp_Dir(sin(M_PI/3), 0.0, 0.5)), 5, 150);
+ gp_Dir myDir_mc2(-sin(M_PI/3), 0.0, 0.5);
gp_Pnt myPnt_mc2(21.65064, -50.0, 127.5);
gp_Ax2 myAx2_mc2(myPnt_mc2, myDir_mc2);
BRepPrimAPI_MakeCylinder o_mc2 (myAx2_mc2, 5, 150);
}
di<<"deflection="<< aDeflection << "\n";
- BRepMesh_IncrementalMesh aIMesh(aShape, aDeflection, Standard_False, PI/9.);
+ BRepMesh_IncrementalMesh aIMesh(aShape, aDeflection, Standard_False, M_PI/9.);
TopLoc_Location aLocation;
Handle(Poly_Triangulation) aTriang = BRep_Tool::Triangulation(TopoDS::Face(aShape), aLocation);
gp_Ax2 axis1 = reverse?
gp_Ax2(center1, gp::DY(), gp::DZ()) : gp_Ax2(center1, -gp::DY(), gp::DX());
if (Abs(angle) > gp::Resolution())
- axis1.Rotate(gp_Ax1(center1, gp::DZ()), angle*PI/180.0);
+ axis1.Rotate(gp_Ax1(center1, gp::DZ()), angle*M_PI/180.0);
gce_MakeCirc makeCirc1(axis1, rad);
if(!makeCirc1.IsDone()) return 1;
gp_Circ circ1 = makeCirc1.Value();
- GC_MakeArcOfCircle makeArc1(circ1, 0, PI/2, Standard_True);
+ GC_MakeArcOfCircle makeArc1(circ1, 0, M_PI/2, Standard_True);
if(!makeArc1.IsDone()) return 1;
Handle_Geom_TrimmedCurve arc1 = makeArc1.Value();
gce_MakeCirc makeCirc2(axis2, rad);
if(!makeCirc2.IsDone()) return 1;
gp_Circ circ2 = makeCirc2.Value();
- GC_MakeArcOfCircle makeArc2(circ2, 0, PI/2, Standard_True);
+ GC_MakeArcOfCircle makeArc2(circ2, 0, M_PI/2, Standard_True);
if(!makeArc2.IsDone()) return 1;
Handle_Geom_TrimmedCurve arc2 = makeArc2.Value();
if (argc>4) major_radius = atof(argv[4]);
if (argc>5) length = atof(argv[5]);
double bend_angle = length/major_radius;
- double PI;
-#ifdef M_PI
- PI = M_PI;
-#else
- PI = 2. * asin(1.0);
-#endif
//if ((bend_angle >= M_PI)) {
- if ((bend_angle >= PI)) {
+ if ((bend_angle >= M_PI)) {
di << "The arguments are invalid." << "\n";
return(TCL_ERROR);
}
double radius_l = 20.0;
double radius_r = 80.0;
// mkv 15.07.03 double bend_angle = M_PI/2.0;
- double PI;
-#ifdef M_PI
- PI = M_PI;
-#else
- PI = 2. * asin(1.0);
-#endif
- double bend_angle = PI/2.0;
+ double bend_angle = M_PI/2.0;
double major_rad = 280.0;
double wall_thickness = 10.0;
if (argc>5) wall_thickness = atof(argv[5]);
// mkv 15.07.03 if ((bend_angle >= 2.0*M_PI)) {
- if ((bend_angle >= 2.0*PI)) {
+ if ((bend_angle >= 2.0*M_PI)) {
di << "The arguments are invalid." << "\n";
return(TCL_ERROR);
}
gp_Circ faceCircle2(circ2axis,radius_r);
gp_Circ outFaceCircle2(circ2axis,radius_r+wall_thickness);
- TopoDS_Edge E1_1 = BRepBuilderAPI_MakeEdge(faceCircle, 0, PI);
- TopoDS_Edge E1_2 = BRepBuilderAPI_MakeEdge(faceCircle, PI, 2.*PI);
+ TopoDS_Edge E1_1 = BRepBuilderAPI_MakeEdge(faceCircle, 0, M_PI);
+ TopoDS_Edge E1_2 = BRepBuilderAPI_MakeEdge(faceCircle, M_PI, 2.*M_PI);
TopoDS_Wire Wire1_ = BRepBuilderAPI_MakeWire(E1_1, E1_2);
// Create the face at the near end for the wall solid, an annular ring.
- TopoDS_Edge Eout1_1 = BRepBuilderAPI_MakeEdge(outFaceCircle, 0, PI);
- TopoDS_Edge Eout1_2 = BRepBuilderAPI_MakeEdge(outFaceCircle, PI, 2.*PI);
+ TopoDS_Edge Eout1_1 = BRepBuilderAPI_MakeEdge(outFaceCircle, 0, M_PI);
+ TopoDS_Edge Eout1_2 = BRepBuilderAPI_MakeEdge(outFaceCircle, M_PI, 2.*M_PI);
TopoDS_Wire outerWire1_ = BRepBuilderAPI_MakeWire(Eout1_1, Eout1_2);
- TopoDS_Edge E2_1 = BRepBuilderAPI_MakeEdge(faceCircle2, 0, PI);
- TopoDS_Edge E2_2 = BRepBuilderAPI_MakeEdge(faceCircle2, PI, 2.*PI);
+ TopoDS_Edge E2_1 = BRepBuilderAPI_MakeEdge(faceCircle2, 0, M_PI);
+ TopoDS_Edge E2_2 = BRepBuilderAPI_MakeEdge(faceCircle2, M_PI, 2.*M_PI);
TopoDS_Wire Wire2_ = BRepBuilderAPI_MakeWire(E2_1, E2_2);
// Create the face at the far end for the wall solid, an annular ring.
- TopoDS_Edge Eout2_1 = BRepBuilderAPI_MakeEdge(outFaceCircle2, 0, PI);
- TopoDS_Edge Eout2_2 = BRepBuilderAPI_MakeEdge(outFaceCircle2, PI, 2.*PI);
+ TopoDS_Edge Eout2_1 = BRepBuilderAPI_MakeEdge(outFaceCircle2, 0, M_PI);
+ TopoDS_Edge Eout2_2 = BRepBuilderAPI_MakeEdge(outFaceCircle2, M_PI, 2.*M_PI);
TopoDS_Wire outerWire2_ = BRepBuilderAPI_MakeWire(Eout2_1, Eout2_2);
BRepBuilderAPI_MakeFace mkFace;
Standard_Integer k = 3;
Standard_Real tol = 100000;
Standard_Integer mode = 2;
- Standard_Real tolang = PI/2;
+ Standard_Real tolang = M_PI/2;
if(argc > k)
tol = atof(argv[k++]);
return 1;
}
anAngle = atof(argv[4]);
- anAngle = 2*PI * anAngle / 360.0;
+ anAngle = 2*M_PI * anAngle / 360.0;
gp_Pln aPln;
Handle(Geom_Surface) aSurf;
// AIS2D_KindOfSurface aSurfType;
OSD_Timer myTimer;
TheAIS2DContext()->CloseLocalContext();
- Standard_Real Step = 4*PI/180;
+ Standard_Real Step = 4*M_PI/180;
Standard_Real Angle = 0;
Handle(AIS2D_InteractiveObject) aIO;
if (atoi(argv[2]) == 1)
{
cout << " Calcul par Transformation" << endl;
- for (Standard_Real myAngle = 0; Angle < 10*2*PI; myAngle++)
+ for (Standard_Real myAngle = 0; Angle < 10*2*M_PI; myAngle++)
{
Angle = Step*myAngle;
gp_Trsf myTransfo;
TopLoc_Location myDeltaAngle (myAngleTrsf);
TopLoc_Location myTrueLoc;
- for (Standard_Real myAngle = 0; Angle < 10*2*PI; myAngle++)
+ for (Standard_Real myAngle = 0; Angle < 10*2*M_PI; myAngle++)
{
Angle = Step*myAngle;
myTrueLoc = myTrueLoc*myDeltaAngle;
// TheAIS2DContext()->Deactivate(myAisPropeller );
// Boucle de mouvement
- for (Standard_Real myAngle = 0; angleA < 2*PI*10.175; myAngle++)
+ for (Standard_Real myAngle = 0; angleA < 2*M_PI*10.175; myAngle++)
{
- angleA = thread*myAngle*PI/180;
+ angleA = thread*myAngle*M_PI/180;
X = Sin(angleA)*3/8;
angleB = atan(X / Sqrt(-X * X + 1));
// Standard_Real decal(25*0.6);
gp_Dir TheZVector (coord[3],coord[4],coord[5]);
gp_Dir TheXVector (coord[6],coord[7],coord[8]);
- if (!TheZVector.IsNormal(TheXVector,PI/180))
+ if (!TheZVector.IsNormal(TheXVector,M_PI/180))
{
cout << argv[0] << " VectorX is not normal to VectorZ" << endl;
return 1;
if (mySurface.GetType() == GeomAbs_Plane)
{
gp_Pln myPlane = mySurface.Plane();
- myPlane.Rotate(myRotAxis, PI/2);
+ myPlane.Rotate(myRotAxis, M_PI/2);
Handle(Geom_Plane) theGeomPlane = new Geom_Plane(myPlane);
gp_Pnt theMiddle ((Aa.X()+Ab.X())/2, (Aa.Y()+Ab.Y())/2, (Aa.Z()+Ab.Z())/2);
if (mySurface.GetType() == GeomAbs_Plane)
{
gp_Pln myPlane = mySurface.Plane();
- myPlane.Rotate(myRotAxis, PI/2);
+ myPlane.Rotate(myRotAxis, M_PI/2);
Handle(Geom_Plane) theGeomPlane = new Geom_Plane(myPlane);
gp_Pnt theMiddle ((Ba.X()+Bb.X())/2, (Ba.Y()+Bb.Y())/2, (Ba.Z()+Bb.Z())/2);
Handle(AIS2D_Plane) myAIS2DPlane = new AIS2D_Plane(theGeomPlane, theMiddle);
// Initialise the default value
// status : 0 if OK, else 1 2 3
lengthFactor = solidAngleFactor = 1.;
- planeAngleFactor = PI/180.;
+ planeAngleFactor = M_PI/180.;
// Standard_Real theLExp = 1.;
// Standard_Real thePAExp = 0.;
// Standard_Real theSAExp = 0.;
stat1 = myUnit.ComputeFactors(theGUAC);
Standard_Integer anglemode = Interface_Static::IVal("step.angleunit.mode");
Standard_Real angleFactor = ( anglemode == 0 ? myUnit.PlaneAngleFactor() :
- anglemode == 1 ? 1. : PI/180. );
+ anglemode == 1 ? 1. : M_PI/180. );
UnitsMethods::InitializeFactors(myUnit.LengthFactor(),
angleFactor,
myUnit.SolidAngleFactor());
Standard_Real lFactor = UnitsMethods::GetLengthFactorValue ( Interface_Static::IVal ( "write.step.unit" ) );
lFactor /= UnitsMethods::GetCasCadeLengthUnit();
Standard_Integer anglemode = Interface_Static::IVal("step.angleunit.mode");
- UnitsMethods::InitializeFactors ( lFactor, ( anglemode <= 1 ? 1. : PI/180. ), 1. );
+ UnitsMethods::InitializeFactors ( lFactor, ( anglemode <= 1 ? 1. : M_PI/180. ), 1. );
// create SDR
STEPConstruct_Part SDRTool;
Standard_Integer k = 3;
Standard_Real tol = 100000;
Standard_Integer mode = 2;
- Standard_Real tolang = PI/2;
+ Standard_Real tolang = M_PI/2;
if(n > k)
tol = atof(a[k++]);
if ( maxangle <1 ) maxangle = 1;
}
- ShapeUpgrade_ShapeDivideAngle tool(maxangle*PI/180,inputShape);
+ ShapeUpgrade_ShapeDivideAngle tool(maxangle*M_PI/180,inputShape);
tool.Perform();
TopoDS_Shape res = tool.Result();
mynbpt(NbPoints)
{
- if(myangle<=Precision::Confusion()) myangle=2*PI;
+ if(myangle<=Precision::Confusion()) myangle=2*M_PI;
}
Standard_Real theangle = (VAxx.Angle(MyVec));
theangle = Abs(theangle);
- if(theangle>=PI/2.) theangle-=PI/2;
+ if(theangle>=M_PI/2.) theangle-=M_PI/2;
- if(theangle>=PI/12. && theangle <=5*PI/12.)
+ if(theangle>=M_PI/12. && theangle <=5*M_PI/12.)
{
TColgp_Array1OfPnt2d BoxPoint (1,mymaxrect+1);
BoxPoint (1) = mystart;BoxPoint(mymaxrect+1)=myend;
else {
gp_Vec2d MyVec(myprojstart,myprojend);//,VAxx(gp_Dir2d(0.,1.));
Standard_Real theangle = Abs(gp_Dir2d(0.,1.).Angle(gp_Vec2d(myprojstart,myprojend)));
- if(theangle>=PI/2.) theangle-=PI/2;
- if(theangle>=PI/12. && theangle <=5*PI/12.)
+ if(theangle>=M_PI/2.) theangle-=M_PI/2;
+ if(theangle>=M_PI/12. && theangle <=5*M_PI/12.)
{
TColgp_Array1OfPnt2d BoxPoint (1,mymaxrect+1);
BoxPoint (1) = myprojstart;
}
// cout << "angle1 " << angle1<< endl;
// cout << "angle2 " << angle2<< endl;
- if ((angle1<=0.001 && angle2<=0.01) || ((PI-angle2)<= 0.001 && (PI-angle2)<= 0.01)) return Standard_True;
+ if ((angle1<=0.001 && angle2<=0.01) || ((M_PI-angle2)<= 0.001 && (M_PI-angle2)<= 0.01)) return Standard_True;
else return Standard_False;
}
proj = ElCLib::Value(param, aCirc);
}
closed = Standard_True;
- valclosed = 2.*PI;
+ valclosed = 2.*M_PI;
}
break;
case GeomAbs_Hyperbola:
param = ElCLib::Parameter(C3D.Ellipse(), P3D);
proj = ElCLib::Value(param, C3D.Ellipse());
closed = Standard_True;
- valclosed = 2.*PI;
+ valclosed = 2.*M_PI;
}
break;
seq.Append(curve->Value(1));
} else if ( curve->IsKind(STANDARD_TYPE(Geom_Conic))) {
seq.Append(curve->Value(0));
- seq.Append(curve->Value(PI/2));
- seq.Append(curve->Value(PI));
+ seq.Append(curve->Value(M_PI/2));
+ seq.Append(curve->Value(M_PI));
} else if ( curve->IsKind(STANDARD_TYPE(Geom_TrimmedCurve))) {
//DeclareAndCast(Geom_TrimmedCurve, Trimmed, curve);
Handle(Geom_TrimmedCurve) Trimmed = *((Handle(Geom_TrimmedCurve) *) &curve);
return Standard_True;
}
else if(curve->IsKind(STANDARD_TYPE(Geom2d_Conic))) {
- step = Min ( PI, last-first ) / 19; //:abv 05.06.02 TUBE.stp #19209...: PI/16
+ step = Min ( M_PI, last-first ) / 19; //:abv 05.06.02 TUBE.stp #19209...: M_PI/16
// if( step>(last-first) ) {
// seq.Append(curve->Value(first));
// seq.Append(curve->Value((last+first)/2));
if ( E2.Orientation() == TopAbs_REVERSED ) vec2.Reverse();
Standard_Real angl = Abs( vec1.Angle(vec2));
- if (angl > 0.95*PI) {
+ if (angl > 0.95*M_PI) {
distMax = .0;
for (Standard_Integer i = 0; i < NbControl; i++) {
Standard_Real prm = ((NbControl-1-i)*First1 + i*Last1)/(NbControl-1);
//szv#4:S4163:12Mar99 warning - possible div by zero
Standard_Real Ang = ACos (Min (1., majorR / minorR));
myPreci [0] = myPreci[1] = Max (0., majorR - minorR);
- myP3d [0] = mySurf->Value (0., PI-Ang);
- myFirstP2d[0].SetCoord (su1, PI-Ang);
- myLastP2d [0].SetCoord (su2, PI-Ang);
- myP3d [1] = mySurf->Value (0., PI+Ang);
- myFirstP2d[1].SetCoord (su2, PI+Ang);
- myLastP2d [1].SetCoord (su1, PI+Ang);
+ myP3d [0] = mySurf->Value (0., M_PI-Ang);
+ myFirstP2d[0].SetCoord (su1, M_PI-Ang);
+ myLastP2d [0].SetCoord (su2, M_PI-Ang);
+ myP3d [1] = mySurf->Value (0., M_PI+Ang);
+ myFirstP2d[1].SetCoord (su2, M_PI+Ang);
+ myLastP2d [1].SetCoord (su1, M_PI+Ang);
myFirstPar[0] = myFirstPar[1] = su1;
myLastPar [0] = myLastPar [1] = su2;
myUIsoDeg [0] = myUIsoDeg [1] = Standard_False;
{
gp_Cylinder Cylinder = SurfAdapt.Cylinder();
ElSLib::Parameters( Cylinder, P3D, S, T);
- S += ShapeAnalysis::AdjustByPeriod(S,0.5*(uf+ul),2*PI);
+ S += ShapeAnalysis::AdjustByPeriod(S,0.5*(uf+ul),2*M_PI);
break;
}
case GeomAbs_Cone :
{
gp_Cone Cone = SurfAdapt.Cone();
ElSLib::Parameters( Cone, P3D, S, T);
- S += ShapeAnalysis::AdjustByPeriod(S,0.5*(uf+ul),2*PI);
+ S += ShapeAnalysis::AdjustByPeriod(S,0.5*(uf+ul),2*M_PI);
break;
}
case GeomAbs_Sphere :
{
gp_Sphere Sphere = SurfAdapt.Sphere();
ElSLib::Parameters( Sphere, P3D, S, T);
- S += ShapeAnalysis::AdjustByPeriod(S,0.5*(uf+ul),2*PI);
+ S += ShapeAnalysis::AdjustByPeriod(S,0.5*(uf+ul),2*M_PI);
break;
}
case GeomAbs_Torus :
{
gp_Torus Torus = SurfAdapt.Torus();
ElSLib::Parameters( Torus, P3D, S, T);
- S += ShapeAnalysis::AdjustByPeriod(S,0.5*(uf+ul),2*PI);
- T += ShapeAnalysis::AdjustByPeriod(T,0.5*(vf+vl),2*PI);
+ S += ShapeAnalysis::AdjustByPeriod(S,0.5*(uf+ul),2*M_PI);
+ T += ShapeAnalysis::AdjustByPeriod(T,0.5*(vf+vl),2*M_PI);
break;
}
case GeomAbs_BezierSurface :
myStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE1 );
if ( myMax2d < Precision::PConfusion() || //:abv 03.06.02 CTS21866.stp
- ( v1.SquareMagnitude() > gp::Resolution() && Abs ( v12.Angle ( v1 ) ) > 0.9 * PI ) ||
- ( v2.SquareMagnitude() > gp::Resolution() && Abs ( v12.Angle ( v2 ) ) > 0.9 * PI ) )
+ ( v1.SquareMagnitude() > gp::Resolution() && Abs ( v12.Angle ( v1 ) ) > 0.9 * M_PI ) ||
+ ( v2.SquareMagnitude() > gp::Resolution() && Abs ( v12.Angle ( v2 ) ) > 0.9 * M_PI ) )
myStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE2 );
return Standard_True;
}
Abs(v1-VF) > Precision::PConfusion() || Abs(v2- VL) > Precision::PConfusion()) {
/*if(aSurf->IsUPeriodic() ) {
Standard_Real aDelta = (UL > UF ? UL - UF : UF - UL );
- u1 = (aDelta > 2.*PI ? 0. : UF + ShapeAnalysis::AdjustByPeriod(UF,0.5*(UL+UF),2*PI));
- u2 = (aDelta > 2.*PI ? 2.*PI : u1 + aDelta);
+ u1 = (aDelta > 2.*M_PI ? 0. : UF + ShapeAnalysis::AdjustByPeriod(UF,0.5*(UL+UF),2*M_PI));
+ u2 = (aDelta > 2.*M_PI ? 2.*M_PI : u1 + aDelta);
}*/
Standard_Boolean isTrim = Standard_False;
if(!aSurf->IsUPeriodic() ) { //else {
/*if(aSurf->IsVPeriodic()) {
Standard_Real aDelta = (VL > VF ? VL - VF : VF - VL );
- v1 = (aDelta > 2.*PI ? 0. : VF + ShapeAnalysis::AdjustByPeriod(VF,0.5*(UL+UF),2*PI)); ;
- v2 = (aDelta > 2.*PI ? 2.* PI : v1 + aDelta);
+ v1 = (aDelta > 2.*M_PI ? 0. : VF + ShapeAnalysis::AdjustByPeriod(VF,0.5*(UL+UF),2*M_PI)); ;
+ v2 = (aDelta > 2.*M_PI ? 2.* M_PI : v1 + aDelta);
}*/
if(!aSurf->IsVPeriodic()) {//else
v1 = Max(v1,VF); v2 = Min(v2,VL);
Handle(Geom_SphericalSurface) SS = Handle(Geom_SphericalSurface)::DownCast(ES);
gp_Ax2 Ax2 ( pos, X ^ dir, X );
Handle(Geom_Circle) Circ = new Geom_Circle ( Ax2, SS->Radius() );
- BasisCurve = new Geom_TrimmedCurve ( Circ, -PI/2., PI/2. );
+ BasisCurve = new Geom_TrimmedCurve ( Circ, -M_PI/2., M_PI/2. );
}
else if ( ES->IsKind(STANDARD_TYPE(Geom_ToroidalSurface)) ) {
Handle(Geom_ToroidalSurface) TS = Handle(Geom_ToroidalSurface)::DownCast(ES);
// for spherical surface, surface of revolution since based on TrimmedCurve
// has V parametrisation shifted on 2PI; translate pcurve accordingly
if ( ! ES.IsNull() && ES->IsKind(STANDARD_TYPE(Geom_SphericalSurface)) ) {
- gp_Vec2d shift ( 0., 2*PI );
+ gp_Vec2d shift ( 0., 2*M_PI );
C->Translate ( shift );
}
}
Standard_Integer index = 0;
Standard_Boolean misoriented = Standard_True, samepatch = Standard_False;
Standard_Boolean reverse = Standard_False, connected = Standard_False;
- Standard_Real angle = -PI, mindist = RealLast();
+ Standard_Real angle = -M_PI, mindist = RealLast();
Standard_Integer weigth = 0;
Standard_Real shiftu=0., shiftv=0.;
}
// short segment is to be taken with highest priority by angle
- Standard_Real ang = ( shorts(i) >0 ? PI : endTan.Angle ( lVec ) );
- if ( myClosedMode && shorts(i) <=0 && PI-ang < ::Precision::Angular() )
+ Standard_Real ang = ( shorts(i) >0 ? M_PI : endTan.Angle ( lVec ) );
+ if ( myClosedMode && shorts(i) <=0 && M_PI-ang < ::Precision::Angular() )
ang = 0.; // abv 21 Mar 00: trj3_s1-md-214.stp #2471: avoid going back
// abv 05 Feb 02: face from Parasolid: use tolerance of edges for check
// for coincidence (instead of vertex tolerance) in order
// this means that degenerated edge should be added to one of poles, and
// then usual procedure applied
if ( ismodeu && mySurf->Surface()->IsKind(STANDARD_TYPE(Geom_SphericalSurface)) ) {
- gp_Pnt2d p ( ( ismodeu < 0 ? 0. : 2.*PI ), ismodeu * 0.5 * PI );
+ gp_Pnt2d p ( ( ismodeu < 0 ? 0. : 2.*M_PI ), ismodeu * 0.5 * M_PI );
gp_Dir2d d ( -ismodeu, 0. );
Handle(Geom2d_Line) line = new Geom2d_Line ( p, d );
TopoDS_Edge edge;
B.MakeEdge ( edge );
B.Degenerated ( edge, Standard_True );
B.UpdateEdge ( edge, line, myFace, ::Precision::Confusion() );
- B.Range ( edge, myFace, 0., 2*PI );
+ B.Range ( edge, myFace, 0., 2*M_PI );
TopoDS_Vertex V;
B.MakeVertex ( V, mySurf->Value ( p.X(), p.Y() ), ::Precision::Confusion() );
V.Orientation(TopAbs_FORWARD);
if (c1->IsKind(STANDARD_TYPE(Geom_Circle)) ||
c1->IsKind(STANDARD_TYPE(Geom_Ellipse)))
{
- Standard_Real diff = PI - Abs(clast1-cfirst2)*0.5;
+ Standard_Real diff = M_PI - Abs(clast1-cfirst2)*0.5;
first1 -= diff; last1 += diff;
done1 = Standard_True;
}
else if (c1->IsKind(STANDARD_TYPE(Geom_Circle)) ||
c1->IsKind(STANDARD_TYPE(Geom_Ellipse)))
{
- domfirst1 = 0.; domlast1 = 2*PI;
+ domfirst1 = 0.; domlast1 = 2*M_PI;
}
Standard_Real domfirst2 = first2, domlast2 = last2;
if (c2->IsKind(STANDARD_TYPE(Geom_BSplineCurve)) ||
else if (c2->IsKind(STANDARD_TYPE(Geom_Circle)) ||
c2->IsKind(STANDARD_TYPE(Geom_Ellipse)))
{
- domfirst2 = 0.; domlast2 = 2*PI;
+ domfirst2 = 0.; domlast2 = 2*M_PI;
}
Standard_Real ipar1 = clast1, ipar2 = cfirst2;
if (pc1->IsKind(STANDARD_TYPE(Geom2d_Circle)) ||
pc1->IsKind(STANDARD_TYPE(Geom2d_Ellipse)))
{
- Standard_Real diff = PI - Abs(clast1-cfirst2)*0.5;
+ Standard_Real diff = M_PI - Abs(clast1-cfirst2)*0.5;
first1 -= diff; last1 += diff;
done1 = Standard_True;
}
else if (pc1->IsKind(STANDARD_TYPE(Geom2d_Circle)) ||
pc1->IsKind(STANDARD_TYPE(Geom2d_Ellipse)))
{
- domfirst1 = 0.; domlast1 = 2*PI;
+ domfirst1 = 0.; domlast1 = 2*M_PI;
}
Standard_Real domfirst2 = first2, domlast2 = last2;
if (pc2->IsKind(STANDARD_TYPE(Geom2d_BSplineCurve)) ||
else if (pc2->IsKind(STANDARD_TYPE(Geom2d_Circle)) ||
pc2->IsKind(STANDARD_TYPE(Geom2d_Ellipse)))
{
- domfirst2 = 0.; domlast2 = 2*PI;
+ domfirst2 = 0.; domlast2 = 2*M_PI;
}
Standard_Real ipar1 = clast1, ipar2 = cfirst2;
if ( edge2.Orientation() == TopAbs_REVERSED ) Vec2.Reverse();
Standard_Real tol2 = Precision::Confusion() * Precision::Confusion();
if ( Vec1.SquareMagnitude() < tol2 ||
- Vec2.SquareMagnitude() < tol2 ) Ang1 = PI/2.;
+ Vec2.SquareMagnitude() < tol2 ) Ang1 = M_PI/2.;
else Ang1 = Abs(Vec1.Angle(Vec2));
C2->D1(last2,P,Vec1);
C3->D1(first3,P,Vec2);
if ( edge2.Orientation() == TopAbs_REVERSED ) Vec1.Reverse();
if ( edge3.Orientation() == TopAbs_REVERSED ) Vec2.Reverse();
if ( Vec1.SquareMagnitude() < tol2 ||
- Vec2.SquareMagnitude() < tol2 ) Ang2 = PI/2.;
+ Vec2.SquareMagnitude() < tol2 ) Ang2 = M_PI/2.;
else Ang2 = Abs(Vec1.Angle(Vec2));
//isLimAngle = (theLimitAngle != -1 && Min(Ang1,Ang2) > theLimitAngle);
//take_next = (Ang2<Ang1);
if ( edge2.Orientation() == TopAbs_REVERSED ) Vec2.Reverse();
Standard_Real tol2 = Precision::Confusion() * Precision::Confusion();
if ( Vec1.SquareMagnitude() < tol2 ||
- Vec2.SquareMagnitude() < tol2 ) Ang1 = PI/2.;
+ Vec2.SquareMagnitude() < tol2 ) Ang1 = M_PI/2.;
else Ang1 = Abs(Vec1.Angle(Vec2));
C2->D1(last2,P,Vec1);
C3->D1(first3,P,Vec2);
if ( edge2.Orientation() == TopAbs_REVERSED ) Vec1.Reverse();
if ( edge3.Orientation() == TopAbs_REVERSED ) Vec2.Reverse();
if ( Vec1.SquareMagnitude() < tol2 ||
- Vec2.SquareMagnitude() < tol2 ) Ang2 = PI/2.;
+ Vec2.SquareMagnitude() < tol2 ) Ang2 = M_PI/2.;
else Ang2 = Abs(Vec1.Angle(Vec2));
//isLimAngle = (theLimitAngle != -1 && Min(Ang1,Ang2) > theLimitAngle);
//take_next = (Ang2<Ang1);
Handle(ShapeProcess_ShapeContext) ctx = Handle(ShapeProcess_ShapeContext)::DownCast ( context );
if ( ctx.IsNull() ) return Standard_False;
- ShapeUpgrade_ShapeDivideAngle SDA ( ctx->RealVal ( "Angle", 2*PI ), ctx->Result() );
+ ShapeUpgrade_ShapeDivideAngle SDA ( ctx->RealVal ( "Angle", 2*M_PI ), ctx->Result() );
SDA.SetMaxTolerance ( ctx->RealVal ( "MaxTolerance", 1. ) );
if ( ! SDA.Perform() && SDA.Status (ShapeExtend_FAIL) ) {
#include <Standard_OStream.hxx>
#endif
-#if defined(WNT) && !defined(__CYGWIN32__) && !defined(__MINGW32__)
-Standard_Real PI = 3.14159265358979324;
-Standard_Real PI180 = 0.017453292519943296;
-
-Standard_Real Standard_PI = 3.14159265358979324;
-Standard_Real Standard_PI180 = 0.017453292519943296;
-#else
-const Standard_Real PI = 3.14159265358979324;
-const Standard_Real PI180 = 0.017453292519943296;
-
-const Standard_Real Standard_PI = 3.14159265358979324;
-const Standard_Real Standard_PI180 = 0.017453292519943296;
-#endif
-
Handle_Standard_Type& Standard_Real_Type_()
{
static Handle_Standard_Type _aType =
XX = 1.+Value;
if (XX < RealSmall())
return 0.;
- return PI - apx_for_ACosApprox(XX);
+ return M_PI - apx_for_ACosApprox(XX);
}
XX = 1.-Value;
if (XX < RealSmall())
// if (xp < RealSmall() || xn < RealSmall())
// return 0.;
// if (Value < 0.)
-// return PI - apx_for_ACosApprox (xn);
+// return M_PI - apx_for_ACosApprox (xn);
// return apx_for_ACosApprox (xp);
}
__Standard_API Handle_Standard_Type& Standard_Real_Type_();
-//==== In this version "PI" is a global variables.
-#ifdef PI
-#undef PI
-#endif
-
-#if defined(WNT) && !defined(__CYGWIN32__) && !defined(__MINGW32__)
-extern "C" __Standard_API Standard_Real PI;
-extern "C" __Standard_API Standard_Real PI180;
-extern "C" __Standard_API Standard_Real Standard_PI;
-extern "C" __Standard_API Standard_Real Standard_PI180;
-#else
-
-extern const Standard_Real PI;
-extern const Standard_Real PI180;
-
-extern const Standard_Real Standard_PI;
-extern const Standard_Real Standard_PI180;
-#endif /* WNT */
// ===============================================
// Methods from Standard_Entity class which are redefined:
// - Hascode
__Standard_API double __cdecl asinh ( double );
__Standard_API double __cdecl atanh ( double );
-# define M_SQRT1_2 7.0710678118654752440E-1
+# ifdef M_SQRT1_2
+# undef M_SQRT1_2
+# endif
+# define M_SQRT1_2 0.707106781186547524401
+
+# ifdef M_PI_2
+# undef M_PI_2
+# endif
# define M_PI_2 1.57079632679489661923
+# ifdef M_PI
+# undef M_PI
+# endif
+# define M_PI 3.14159265358979323846
+
# endif /* __MATH_WNT_H */
#endif /* WNT */
}
case GeomAbs_Circle:
{
- if (2 * PI - Abs (wl - wf) <= Precision::Confusion())
+ if (2 * M_PI - Abs (wl - wf) <= Precision::Confusion())
{
if (BS.GetType() == GeomAbs_Cylinder ||
BS.GetType() == GeomAbs_Torus ||
//change parametrization for trimming
gp_Ax2 axnew(pc,norm,dirline.Reversed());
conic->SetPosition(axnew);
- C = new Geom_TrimmedCurve(conic, 0., PI);
+ C = new Geom_TrimmedCurve(conic, 0., M_PI);
}
}
}
}
else if (theSTEPCurve->IsKind(STANDARD_TYPE(StepGeom_Circle)) ||
theSTEPCurve->IsKind(STANDARD_TYPE(StepGeom_Ellipse))) {
-// if (trim1 > 2.1*PI || trim2 > 2.1*PI) fact = PI / 180.;
+// if (trim1 > 2.1*M_PI || trim2 > 2.1*M_PI) fact = M_PI / 180.;
fact = UnitsMethods::PlaneAngleFactor();
//:p3 abv 23 Feb 99: shift on pi/2 on ellipse with R1 < R2
const Handle(StepGeom_Ellipse) ellipse = Handle(StepGeom_Ellipse)::DownCast(theSTEPCurve);
if ( !ellipse.IsNull() && ellipse->SemiAxis1() - ellipse->SemiAxis2() < 0. )
- shift = 0.5 * PI;
+ shift = 0.5 * M_PI;
// skl 04.02.2002 for OCC133: we can not make TrimmedCurve if
// there is no X-direction in StepGeom_Axis2Placement3d
MasterRep =1;
else {
if ( SC->SenseAgreement() )
- CC = new Geom_TrimmedCurve(theCurve, 0., 2.*PI, Standard_True);
+ CC = new Geom_TrimmedCurve(theCurve, 0., 2.*M_PI, Standard_True);
else
- CC = new Geom_TrimmedCurve(theCurve, 2.*PI, 0., Standard_False);
+ CC = new Geom_TrimmedCurve(theCurve, 2.*M_PI, 0., Standard_False);
return Standard_True;
}
}
}
else if (BasisCurve->IsKind(STANDARD_TYPE(StepGeom_Circle)) ||
BasisCurve->IsKind(STANDARD_TYPE(StepGeom_Ellipse))) {
-// if (u1 > 2.1*PI || u2 > 2.1*PI) fact = PI / 180.;
+// if (u1 > 2.1*M_PI || u2 > 2.1*M_PI) fact = M_PI / 180.;
fact = UnitsMethods::PlaneAngleFactor();
//:p3 abv 23 Feb 99: shift on pi/2 on ellipse with R1 < R2
const Handle(StepGeom_Ellipse) ellipse = Handle(StepGeom_Ellipse)::DownCast(BasisCurve);
if ( !ellipse.IsNull() && ellipse->SemiAxis1() - ellipse->SemiAxis2() < 0. )
- shift = 0.5 * PI;
+ shift = 0.5 * M_PI;
}
else if (BasisCurve->IsKind(STANDARD_TYPE(StepGeom_Parabola)) ||
BasisCurve->IsKind(STANDARD_TYPE(StepGeom_Hyperbola))) {
// vec.Transform(loc);
if (modul1>Precision::Confusion () && modul2>Precision::Confusion ()) {
Standard_Real an = vec.Angle(average);
- if ( an > PI/2) {
+ if ( an > M_PI/2) {
A = V3;B=V2;C=V1;
}
else {
Standard_Real maxU = FSurf.LastUParameter();
Standard_Real minV = FSurf.FirstVParameter();
Standard_Real maxV = FSurf.LastVParameter();
- Standard_Boolean yesU = ( Abs(minU - 0.) < 1.e-9 && Abs(maxU - 2*PI) < 1.e-9 );
+ Standard_Boolean yesU = ( Abs(minU - 0.) < 1.e-9 && Abs(maxU - 2*M_PI) < 1.e-9 );
Standard_Boolean yesV = ( FSurf.GetType() == GeomAbs_Sphere ) ?
- ( Abs(minV - (-PI/2.)) < 1.e-9 && Abs(maxV - PI/2.) < 1.e-9 ) :
- ( Abs(minV - 0.) < 1.e-9 && Abs(maxV - 2*PI) < 1.e-9 );
+ ( Abs(minV - (-M_PI/2.)) < 1.e-9 && Abs(maxV - M_PI/2.) < 1.e-9 ) :
+ ( Abs(minV - 0.) < 1.e-9 && Abs(maxV - 2*M_PI) < 1.e-9 );
SolidIsSphereOrTorus = ( yesU && yesV );
}
Standard_Boolean areBothPeriodic = ( FSurf.IsUPeriodic() && FSurf.IsVPeriodic() );
if( areBothPeriodic )
{
- Standard_Boolean yesU = ( Abs(FSurf.UPeriod() - PI) < 1.e-9 || Abs(FSurf.UPeriod() - 2*PI) < 1.e-9 );
- Standard_Boolean yesV = ( Abs(FSurf.VPeriod() - PI) < 1.e-9 || Abs(FSurf.VPeriod() - 2*PI) < 1.e-9 );
+ Standard_Boolean yesU = ( Abs(FSurf.UPeriod() - M_PI) < 1.e-9 || Abs(FSurf.UPeriod() - 2*M_PI) < 1.e-9 );
+ Standard_Boolean yesV = ( Abs(FSurf.VPeriod() - M_PI) < 1.e-9 || Abs(FSurf.VPeriod() - 2*M_PI) < 1.e-9 );
SolidIsSphereOrTorus = ( yesU && yesV );
}
}
Standard_Boolean x1null = (Abs(x1) <= tol);
Standard_Boolean x2null = (Abs(x2) <= tol);
- if (x1null) par = (x2 > 0.) ? 3.*PI*.5 : PI*.5;
- else if (x2null) par = (x1 > 0.) ? 2.*PI : PI;
+ if (x1null) par = (x2 > 0.) ? 3.*M_PI*.5 : M_PI*.5;
+ else if (x2null) par = (x1 > 0.) ? 2.*M_PI : M_PI;
else {
Standard_Real ac = ACos(Abs(x1));
Standard_Boolean x1pos = (x1 > tol);
Standard_Boolean x2pos = (x2 > tol);
- if (x1pos && x2pos) par = 2.*PI-ac;
+ if (x1pos && x2pos) par = 2.*M_PI-ac;
if (x1pos && !x2pos) par = ac;
- if (!x1pos && x2pos) par = PI+ac;
- if (!x1pos && !x2pos) par = PI-ac;
+ if (!x1pos && x2pos) par = M_PI+ac;
+ if (!x1pos && !x2pos) par = M_PI-ac;
}
- if (complement) par = 2.*PI - par;
+ if (complement) par = 2.*M_PI - par;
return par;
}
{
Standard_Real tol = Precision::Parametric(Precision::Confusion());
Standard_Boolean extre = (Abs(paronEd) < tol);
- extre = extre && (Abs(2.*PI-paronEd) < tol);
+ extre = extre && (Abs(2.*M_PI-paronEd) < tol);
if (!extre) return Standard_False;
- paronEd = (inout) ? 2.*PI : 0.;
+ paronEd = (inout) ? 2.*M_PI : 0.;
return Standard_True;
}
Standard_Real par = FUN_getpar(a,x,y,complement);
par1OnEd = par;
- par2OnEd = (par > PI) ? par-PI : par+PI;
+ par2OnEd = (par > M_PI) ? par-M_PI : par+M_PI;
// kpart Ec on Fi :
Standard_Boolean changedpar1 = FUN_0or2PI(par1OnEd,T1inout);
Standard_Boolean IsTrFirst = Standard_True;
if(parOri < f ) {
- parOri = 2*PI + parOri;
+ parOri = 2*M_PI + parOri;
}
if(parOri > l ) {
- parOri = parOri - 2*PI;
+ parOri = parOri - 2*M_PI;
}
gp_Pnt2d aUV2;
if (!ok2) return;
Standard_Real sum = matfs+matfor;
- Standard_Boolean sumisPI = (Abs(sum-PI) < tola1);
- Standard_Boolean fsinfPI = (matfs < PI);
- Standard_Boolean forinfPI = (matfor < PI);
+ Standard_Boolean sumisPI = (Abs(sum-M_PI) < tola1);
+ Standard_Boolean fsinfPI = (matfs < M_PI);
+ Standard_Boolean forinfPI = (matfor < M_PI);
if (sumisPI) b = Standard_False;
- else if (sum < PI) b = Standard_True;
- else { //sum > PI
+ else if (sum < M_PI) b = Standard_True;
+ else { //sum > M_PI
if (fsinfPI && forinfPI) b = Standard_False;
else { // (!fsinfPI) || (!forinfPI)
Standard_Boolean sammat = (Abs(matfs-matfor)<tola1);
Standard_Boolean nonPV = (fabs(V) < 1e-7) ? Standard_True : Standard_False;
if(!nonPU && UP) {
- Standard_Real dU = fmod(fabs(U), 2*PI);
- nonPU = (dU > 1e-7 && (2*PI - dU > 1e-7)) ? Standard_True : Standard_False;
+ Standard_Real dU = fmod(fabs(U), 2*M_PI);
+ nonPU = (dU > 1e-7 && (2*M_PI - dU > 1e-7)) ? Standard_True : Standard_False;
}
if(!nonPV && VP) {
- Standard_Real dV = fmod(fabs(V), 2*PI);
- nonPV = (dV > 1e-7 && (2*PI - dV > 1e-7)) ? Standard_True : Standard_False;
+ Standard_Real dV = fmod(fabs(V), 2*M_PI);
+ nonPV = (dV > 1e-7 && (2*M_PI - dV > 1e-7)) ? Standard_True : Standard_False;
}
-// printf("(fmod(fabs(U), 2*PI) =%lf\n", (fmod(fabs(U), 2*PI)));
-// printf(" (fmod(fabs(V), 2*PI) > 1e-7)=%lf\n", (fmod(fabs(V), 2*PI)));
+// printf("(fmod(fabs(U), 2*M_PI) =%lf\n", (fmod(fabs(U), 2*M_PI)));
+// printf(" (fmod(fabs(V), 2*M_PI) > 1e-7)=%lf\n", (fmod(fabs(V), 2*M_PI)));
if(nonPU && nonPV && !BRep_Tool::Degenerated(anEdge))
return 1;
Standard_Integer b, k;
gp_Vec2d aTrV;
- TwoPI=2.*PI;
+ TwoPI=2.*M_PI;
BndBoxWire(anOuterWire, B2dOuterWire);
B2dOuterWire.Get(OuterU1,OuterV1,OuterU2,OuterV2);
Handle(Geom2d_Curve) PCT = Handle(Geom2d_Curve)::DownCast(C2D->Copy());
// make mirror relative to the isoline of apex -PI/2 or PI/2
gp_Trsf2d aTrsf;
- gp_Pnt2d po(0,-PI/2);
- if (maxcond) po.SetY(PI/2);
+ gp_Pnt2d po(0,-M_PI/2);
+ if (maxcond) po.SetY(M_PI/2);
aTrsf.SetMirror(gp_Ax2d(po, gp_Dir2d(1,0)));
PCT->Transform(aTrsf);
// add translation along U direction on PI
- gp_Vec2d vec(PI,0);
+ gp_Vec2d vec(M_PI,0);
Standard_Real UFirst = BAS.FirstUParameter();
- if (u2-UFirst-PI > -1e-7) vec.Reverse();
+ if (u2-UFirst-M_PI > -1e-7) vec.Reverse();
PCT->Translate(vec);
C2D = PCT;
// recompute the test point
isapex = (dist < tol);
}
if (ST == GeomAbs_Sphere) {
- Standard_Real pisur2 = PI*.5;
+ Standard_Real pisur2 = M_PI*.5;
#ifdef DEB
Standard_Real u =
#endif
}
}
if (ST == GeomAbs_Sphere) {
-// Standard_Real deuxpi = 2*PI;
- Standard_Real pisur2 = PI*.5;
+// Standard_Real deuxpi = 2*M_PI;
+ Standard_Real pisur2 = M_PI*.5;
Standard_Real u = p2d.X(),v = p2d.Y();
// Standard_Boolean u0 =(Abs(u) < toluv);
// Standard_Boolean u2pi=(Abs(u-deuxpi) < toluv);
Standard_Boolean uviso = FUN_tool_IsUViso(PC,isuiso,isviso,d2d,O2d);
if (!uviso) return Standard_False;
- Standard_Real period = 2*PI;
+ Standard_Real period = 2*M_PI;
Standard_Real piso = isuiso? O2d.X(): O2d.Y();
Standard_Real tol2d = 1.e-6;
Standard_Boolean is0 = Abs(piso) < tol2d;
if (M_REVERSED(efound.Orientation())) tg2dfound.Reverse();
Standard_Real angfound = 1.e7;
if (iStep == 1) angfound = TopOpeBRepTool_TOOL::Matter(mytg2d,tg2dfound);
- else angfound = 2.*PI - TopOpeBRepTool_TOOL::Matter(tg2dfound,mytg2d);
+ else angfound = 2.*M_PI - TopOpeBRepTool_TOOL::Matter(tg2dfound,mytg2d);
#ifdef DEB
if (trc) cout<<"ang(e"<<FUN_adds(myed)<<",e"<<FUN_adds(efound)<<")="<<angfound<<endl;
#endif
Standard_Real angi = 1.e7;
if (iStep == 1) angi = TopOpeBRepTool_TOOL::Matter(mytg2d,tg2di);
- else angi = 2.*PI - TopOpeBRepTool_TOOL::Matter(tg2di,mytg2d);
+ else angi = 2.*M_PI - TopOpeBRepTool_TOOL::Matter(tg2di,mytg2d);
Standard_Boolean eq = Abs(angi-angfound) < tola;
#ifdef DEB
if (trc) cout<<"ang(e"<<FUN_adds(myed)<<",e"<<FUN_adds(ei)<<")="<<angi<<endl;
Standard_Real ang = d1.Angle(d2);
Standard_Boolean equal = (ang < tola);
if (equal) return 0.;
- Standard_Boolean oppo = ((PI-ang) < tola);
- if (oppo) return PI;
+ Standard_Boolean oppo = ((M_PI-ang) < tola);
+ if (oppo) return M_PI;
ang = d1.AngleWithRef(d2,Ref);
- if (ang < 0) ang = 2.*PI+ang;
+ if (ang < 0) ang = 2.*M_PI+ang;
return ang;
}
z1.Reverse();
ang = xx1.AngleWithRef(xx2,z1);
if (Abs(ang) < tola) {ang = 0.; return Standard_True;}
- if (ang < 0) ang = 2.*PI+ang;
+ if (ang < 0) ang = 2.*M_PI+ang;
return Standard_True;
}
}
}
if (ST == GeomAbs_Sphere) {
- Standard_Real pisur2 = PI*.5;
+ Standard_Real pisur2 = M_PI*.5;
Standard_Real u = uv.X(),v = uv.Y();
Standard_Boolean vpisur2 = (Abs(v-pisur2) < tolv);
Standard_Boolean vmoinspisur2 = (Abs(v+pisur2) < tolv);
gp_Dir v12(gp_Vec(pf1,pf2));
Standard_Real dot = v12.Dot(nt1);
- ang = (dot < 0.) ? 0. : 2.*PI;
+ ang = (dot < 0.) ? 0. : 2.*M_PI;
// gp_Dir nt1; ok1 = TopOpeBRepTool_TOOL::Nt(uv1,f1,nt1);
// if (!ok1) return Standard_False;
// if (!ok2) return Standard_False;
// Standard_Real angapp; Standard_Boolean ok = TopOpeBRepTool_TOOL::Matter(xx1,nt1, xx2,nt2,tola,angapp);
// if (!ok) return Standard_False;
-// Standard_Boolean is0 = (Abs(angapp) < Abs(2.*PI-angapp));
-// ang = is0 ? 0. : 2.*PI;
+// Standard_Boolean is0 = (Abs(angapp) < Abs(2.*M_PI-angapp));
+// ang = is0 ? 0. : 2.*M_PI;
return Standard_True;
}
Standard_Real ang = 1.e7;
if (isONi) {
Standard_Real dot = dirINcle.Dot(tgi);
- ang = (dot > 0) ? 0 : PI;
+ ang = (dot > 0) ? 0 : M_PI;
// outin = (ang > 0); -xpu190499
outin = Standard_True;
}
else outin = (dot < 0);
}//!isONi
- Standard_Real Cang = (ang > PI) ? ang-PI : ang+PI;
+ Standard_Real Cang = (ang > M_PI) ? ang-M_PI : ang+M_PI;
par1 = outin ? ang : Cang;
par2 = outin ? Cang : ang;
return Standard_True;
// convert basis curve to bspline in order to avoid self-intersecting
// surface of revolution (necessary e.g. for CATIA)
- if ( VL - VF - 2 * PI < -Precision::PConfusion() )
+ if ( VL - VF - 2 * M_PI < -Precision::PConfusion() )
BasisCurve = ShapeAlgo::AlgoContainer()->ConvertCurveToBSpline (BasisCurve, VF, VL, Precision::Approximation(),
GeomAbs_C1, 100, 9);
// BasisCurve = new Geom_TrimmedCurve ( BasisCurve, VF, VL );
/* //:j1 abv 22 Oct 98: radians are used in the produced STEP file (at least by default)
if(C->IsKind(STANDARD_TYPE(Geom_Circle)) ||
C->IsKind(STANDARD_TYPE(Geom_Ellipse))) {
- Standard_Real fact = 180. / PI;
+ Standard_Real fact = 180. / M_PI;
trim1 = trim1 * fact;
trim2 = trim2 * fact;
}
DrawCircle(aDrawer,xc,yc,s,Standard_False);
s+=ds;
}
- Standard_Real a = Standard_PI / Standard_Real(Division);
+ Standard_Real a = M_PI / Standard_Real(Division);
for (Standard_Integer j=1; j<= Division; j++) {
aDrawer->MapInfiniteLineFromTo(OX,OY ,
Standard_ShortReal(Cos(angle+Standard_Real(j)*a)),
if(myRadius > Def)
val = Max( 0.0044 , Min (0.7854 , 2. * ACos(1.-Def/myRadius)));
else
- val = 0.7854; // = Standard_PI/4.
+ val = 0.7854; // = PI / 4.
Standard_Integer nbpoints;
if(DrawPoints) {
nbpoints = Division *2;
}
else {
- nbpoints = Standard_Integer(Abs(2*Standard_PI)/val) +2;
+ nbpoints = Standard_Integer(Abs (2 * M_PI) / val) + 2;
}
- Standard_ShortReal teta = Standard_ShortReal(Abs(2*Standard_PI) /nbpoints);
+ Standard_ShortReal teta = Standard_ShortReal(Abs(2 * M_PI) / nbpoints);
Standard_ShortReal x1 = myRadius;
Standard_ShortReal y1 = 0;
Standard_ShortReal x2,y2,x3,y3;
myGraphicObject->RemovePrimitives();
myGrid = new V2d_RectangularGraphicGrid
(myGraphicObject,
- XStep(),YStep(),FirstAngle()+RotationAngle(),SecondAngle()+RotationAngle()+Standard_PI/2.,XOrigin(),YOrigin(),myColorIndex2);
+ XStep(),YStep(),FirstAngle()+RotationAngle(),SecondAngle()+RotationAngle() + M_PI / 2.,XOrigin(),YOrigin(),myColorIndex2);
myGrid->SetColorIndex(myColorIndex1);
myGrid->SetDrawMode(DrawMode());
#ifndef BUC60639 //See V2d_RectangularGraphicGrid
Handle(Graphic2d_Marker) MK1 = new Graphic2d_Marker(myGraphicObject,14,XOrigin(),YOrigin(),0.01,0.01,FirstAngle()+RotationAngle());
- Handle(Graphic2d_Marker) MK2 = new Graphic2d_Marker(myGraphicObject,14,XOrigin(),YOrigin(),0.01,0.01,SecondAngle()+RotationAngle()+Standard_PI/2.);
+ Handle(Graphic2d_Marker) MK2 = new Graphic2d_Marker(myGraphicObject,14,XOrigin(),YOrigin(),0.01,0.01,SecondAngle()+RotationAngle() + M_PI / 2.);
MK1->SetColorIndex(myColorIndex2);
MK2->SetColorIndex(myColorIndex2);
#endif
for (i = 1 ; i <= NbPoints ; i++) {
- cosinus = Cos ( 2 * Standard_PI / NbPoints * (i-1) );
- sinus = Sin ( 2 * Standard_PI / NbPoints * (i-1) );
+ cosinus = Cos ( 2 * M_PI / NbPoints * (i-1) );
+ sinus = Sin ( 2 * M_PI / NbPoints * (i-1) );
X = Xc + (cosinus * Xi + sinus * Xj) * Lng * Tg;
Y = Yc + (cosinus * Yi + sinus * Yj) * Lng * Tg;
Standard_Real VX,VY,VZ,X,Y,Z,Xn,Yn,Zn,Xi,Yi,Zi,Xj,Yj,Zj,Norme;
Standard_Integer NFACES = 30 , i;
Standard_Real Alpha = 0. ;
-Standard_Real Dalpha = 2.*Standard_PI/NFACES ;
+Standard_Real Dalpha = 2. * M_PI / NFACES ;
Graphic3d_Array1OfVertex Points(0,NFACES);
Norme = Sqrt ( DX*DX + DY*DY + DZ*DZ );
Standard_Real R,X,Y,Z ;
Standard_Real Beta = 0. ;
Standard_Real Alpha = 0. ;
- Standard_Real Dbeta = 2.*Standard_PI/NFACES ;
- Standard_Real Dalpha = 2.*Standard_PI/NFACES ;
+ Standard_Real Dbeta = 2. * M_PI / NFACES ;
+ Standard_Real Dalpha = 2. * M_PI / NFACES ;
Standard_Integer i,j ;
for( j=0 ; j<NFACES/2 ; j++ ) {
Alpha = 0. ;
#include <Aspect_Window.hxx>
//-Declarations
-#define DEUXPI (2.*Standard_PI)
+#define DEUXPI (2. * M_PI)
//-Constructors
void V3d_Camera::SetAperture(const Standard_Real Angle) {
- Viewer_BadValue_Raise_if( Angle <= 0. || Angle >= Standard_PI ,"V3d_Camera::SetAperture, bad angle");
+ Viewer_BadValue_Raise_if( Angle <= 0. || Angle >= M_PI ,"V3d_Camera::SetAperture, bad angle");
MyAperture = Angle ;
}
Standard_Real Xc1,Yc1,Zc1,Xc2,Yc2,Zc2,Xi,Yi,Zi,Xj,Yj,Zj;
Standard_Real Xn,Yn,Zn,X,Y,Z,Norme;
Standard_Real cosinus,sinus;
- Standard_Real Alpha = Standard_PI/4.;
+ Standard_Real Alpha = M_PI / 4.;
Standard_Integer NbPoints = 4, i;
Graphic3d_Array1OfVertex VN1(1,NbPoints+1);
Graphic3d_Array1OfVertex VN2(1,NbPoints+1);
// Scheme of the case
for (i = 1 ; i <= NbPoints ; i++) {
- cosinus = Cos ( Alpha + (i - 1) * Standard_PI/2. );
- sinus = Sin ( Alpha + (i - 1) * Standard_PI/2. );
+ cosinus = Cos ( Alpha + (i - 1) * M_PI / 2. );
+ sinus = Sin ( Alpha + (i - 1) * M_PI/2. );
// First base square
X = Xc1 + (cosinus * Xi + sinus * Xj) * Lng / 2.;
// Scheme of the objective
for (i = 1 ; i <= NbPoints ; i++) {
- cosinus = Cos ( Alpha + (i - 1) * Standard_PI/2. );
- sinus = Sin ( Alpha + (i - 1) * Standard_PI/2. );
+ cosinus = Cos ( Alpha + (i - 1) * M_PI / 2. );
+ sinus = Sin ( Alpha + (i - 1) * M_PI / 2. );
// Premier carre de base
X = Xc2 + (cosinus * Xi + sinus * Xj) * Lng / 6.;
gnopick->Polyline(PRadius);
V3d::ArrowOfRadius(gExtArrow,X-(X-X0)/10.,
Y-(Y-Y0)/10.,
- Z-(Z-Z0)/10.,X-X0,Y-Y0,Z-Z0,Standard_PI/15.,Rayon/20.);
- V3d::ArrowOfRadius(gIntArrow,X0,Y0,Z0,X0-X,Y0-Y,Z0-Z,Standard_PI/15.,
+ Z-(Z-Z0)/10., X-X0, Y-Y0, Z-Z0, M_PI / 15., Rayon / 20.);
+ V3d::ArrowOfRadius(gIntArrow, X0, Y0, Z0, X0-X, Y0-Y, Z0-Z, M_PI / 15.,
Rayon/20.);
TCollection_AsciiString ValOfRadius(Rayon);
PText.SetCoord( (X0+X)/2., (Y0+Y)/2. , (Z0+Z)/2. );
if ( Ypix != IPY ) {
aView->Size(Width,Height);
IHeight = aView->Convert(Height);
- Beta = ((IPY - Ypix)*Standard_PI)/(IHeight*2.);
+ Beta = ((IPY - Ypix) * M_PI) / (IHeight * 2.);
aView->Proj(VX,VY,VZ);
aView->Up(DXH,DYH,DZH);
A = VY*DZH - VZ*DYH;
// Find the rolling determined by Xpix
if ( Xpix != IPX ) {
IWidth = aView->Convert(Width);
- Beta = ((IPX - Xpix)*Standard_PI)/(IWidth*2.);
+ Beta = ((IPX - Xpix) * M_PI) / (IWidth * 2.);
MyAngle = MyAngle + Beta;
}
}
if ( Ypix != IPY ) {
aView->Size(Width,Height);
IHeight = aView->Convert(Height);
- Beta = ((IPY - Ypix)*Standard_PI)/(IHeight*2.);
+ Beta = ((IPY - Ypix) * M_PI) / (IHeight * 2.);
aView->Proj(VX,VY,VZ);
aView->Up(DXH,DYH,DZH);
A = VY*DZH - VZ*DYH;
// an axis // a vector above passing through the eye
if ( Xpix != IPX ) {
IWidth = aView->Convert(Width);
- Beta = ((IPX - Xpix)*Standard_PI)/(IWidth*2.);
+ Beta = ((IPX - Xpix) * M_PI) / (IWidth * 2.);
aView->Up(A,B,C);
Dist = Sqrt( A*A + B*B + C*C);
A = A/Dist; B = B/Dist; C = C/Dist;
Standard_Real r;
Standard_Real aStep = RadiusStep ();
Standard_Real aDivision = DivisionNumber ();
-Standard_Real alpha = Standard_PI / aDivision;
+Standard_Real alpha = M_PI / aDivision;
Standard_Integer Division = (Standard_Integer )( (aDivision >= DIVISION ? aDivision : DIVISION));
Graphic3d_Array1OfVertex Cercle (0, 2*Division);
myGroup2->SetGroupPrimitivesAspect (LineAttrib);
#endif
myGroup2->BeginPrimitives ();
- alpha = Standard_PI / Division;
+ alpha = M_PI / Division;
for (r=aStep; r<=myRadius; r+=aStep) {
for (i=0; i<=2*Division; i++) {
xl = Cos (alpha*i)*r;
Standard_Real r;
Standard_Real aStep = RadiusStep ();
Standard_Real aDivision = DivisionNumber ();
-Standard_Real alpha = Standard_PI / aDivision;
+Standard_Real alpha = M_PI / aDivision;
Graphic3d_Array1OfVertex Cercle (0,(Standard_Integer )(2*aDivision));
Standard_Real xl, yl, zl = myOffSet;
// A sphere is drawn
V3d::CircleInPlane(gsymbol,Xi,Yi,Zi,VX,VY,VZ,Rayon/40.);
for( j=1 ; j<=3 ; j++ ) {
- Beta = j * Standard_PI/4.;
+ Beta = j * M_PI / 4.;
CosBeta = Cos(Beta);
SinBeta = Sin(Beta);
Coef = 1. - CosBeta;
Line(0).SetCoord(Xi,Yi,Zi);
Line(1).SetCoord(X,Y,Z);
gsymbol->Polyline(Line);
- V3d::ArrowOfRadius(gsymbol,X,Y,Z,DX,DY,DZ,Standard_PI/15.,Rayon/20.);
+ V3d::ArrowOfRadius(gsymbol, X, Y, Z, DX, DY, DZ, M_PI / 15., Rayon / 20.);
}
void V3d_DirectionalLight::Display( const Handle(V3d_View)& aView,
Standard_Real focale,Umin,Vmin,Umax,Vmax,Dxv,Dyv,Rap,Xrp,Yrp;
- Viewer_BadValue_Raise_if ( Angle <= 0. || Angle >= Standard_PI, "V3d_PerspectiveView::SetAngle, bad angle");
+ Viewer_BadValue_Raise_if ( Angle <= 0. || Angle >= M_PI, "V3d_PerspectiveView::SetAngle, bad angle");
MyViewMapping.WindowLimit(Umin,Vmin,Umax,Vmax) ;
Dxv = Abs(Umax - Umin)/2. ; Dyv = Abs(Vmax - Vmin)/2.;
// Graphic3d_Vertex Prp ;
Standard_Real focale,Umin,Vmin,Umax,Vmax,Dxv,Dyv ;
- Standard_Real angle = Standard_PI ;
+ Standard_Real angle = M_PI ;
MyViewMapping.WindowLimit(Umin,Vmin,Umax,Vmax) ;
focale = Focale() ;
Standard_Real Umin,Vmin,Umax,Vmax,Xrp,Yrp,Zrp,du,dv;
Viewer_BadValue_Raise_if ( ZNear <= 0. || ZFar <= 0. || ZNear >= ZFar, "V3d_PerspectiveView::SetPerspective, bad distances");
- Viewer_BadValue_Raise_if ( Angle <= 0. || Angle >= Standard_PI, "V3d_PerspectiveView::SetAngle, bad angle");
+ Viewer_BadValue_Raise_if ( Angle <= 0. || Angle >= M_PI, "V3d_PerspectiveView::SetAngle, bad angle");
Graphic3d_Vertex PRP = MyViewMapping.ProjectionReferencePoint() ;
Xrp = Yrp = Zrp = 0.;
gnopick->Polyline(PRadius);
V3d::ArrowOfRadius(gExtArrow,X-(X-X0)/10.,
Y-(Y-Y0)/10.,
- Z-(Z-Z0)/10.,X-X0,Y-Y0,Z-Z0,PI/15.,Rayon/20.);
- V3d::ArrowOfRadius(gIntArrow,X0,Y0,Z0,X0-X,Y0-Y,Z0-Z,PI/15.,Rayon/20.);
+ Z-(Z-Z0)/10.,X-X0,Y-Y0,Z-Z0,M_PI/15.,Rayon/20.);
+ V3d::ArrowOfRadius(gIntArrow,X0,Y0,Z0,X0-X,Y0-Y,Z0-Z,M_PI/15.,Rayon/20.);
TCollection_AsciiString ValOfRadius(Rayon);
PText.SetCoord( (X0+X)/2., (Y0+Y)/2. , (Z0+Z)/2. );
gradius->Text(ValOfRadius.ToCString(),PText,0.01);
// A sphere is drawn
V3d::CircleInPlane(gsymbol,Xi,Yi,Zi,VX,VY,VZ,Rayon/40.);
for( j=1 ; j<=3 ; j++ ) {
- Beta = j * Standard_PI/4.;
+ Beta = j * M_PI / 4.;
CosBeta = Cos(Beta);
SinBeta = Sin(Beta);
Coef = 1. - CosBeta;
gnopick->Polyline(PRadius);
V3d::ArrowOfRadius(gExtArrow,X-(X-X0)/10.,
Y-(Y-Y0)/10.,
- Z-(Z-Z0)/10.,X-X0,Y-Y0,Z-Z0,Standard_PI/15.,Rayon/20.);
- V3d::ArrowOfRadius(gIntArrow,X0,Y0,Z0,X0-X,Y0-Y,Z0-Z,Standard_PI/15.,Rayon/20.);
+ Z-(Z-Z0) / 10., X-X0, Y-Y0, Z-Z0, M_PI / 15., Rayon / 20.);
+ V3d::ArrowOfRadius(gIntArrow, X0, Y0, Z0, X0-X, Y0-Y, Z0-Z, M_PI / 15., Rayon / 20.);
TCollection_AsciiString ValOfRadius(Rayon);
PText.SetCoord( (X0+X)/2., (Y0+Y)/2. , (Z0+Z)/2. );
gradius->Text(ValOfRadius.ToCString(),PText,0.01);
V3d_SpotLight::V3d_SpotLight(const Handle(V3d_Viewer)& VM, const Standard_Real X, const Standard_Real Y, const Standard_Real Z, const V3d_TypeOfOrientation Direction, const Quantity_NameOfColor Name, const Standard_Real A1, const Standard_Real A2, const Standard_Real CN, const Standard_Real AN):V3d_PositionLight(VM) {
Viewer_BadValue_Raise_if( A1 < 0 || A1 > 1. || A2 < 0 || A2 > 1
- || AN < 0. || AN > PI, "V3d_SpotLight, bad coefficient or angle");
+ || AN < 0. || AN > M_PI, "V3d_SpotLight, bad coefficient or angle");
Quantity_Color C(Name) ;
Graphic3d_Vector D = V3d::GetProjAxis(Direction) ;
V3d_SpotLight::V3d_SpotLight(const Handle(V3d_Viewer)& VM, const Standard_Real Xt, const Standard_Real Yt, const Standard_Real Zt, const Standard_Real Xp, const Standard_Real Yp, const Standard_Real Zp, const Quantity_NameOfColor Name, const Standard_Real A1, const Standard_Real A2, const Standard_Real CN, const Standard_Real AN):V3d_PositionLight(VM) {
Viewer_BadValue_Raise_if( A1 < 0 || A1 > 1. || A2 < 0 || A2 > 1
- || AN < 0. || AN > PI, "V3d_SpotLight, bad coefficient or angle");
+ || AN < 0. || AN > M_PI, "V3d_SpotLight, bad coefficient or angle");
Quantity_Color C(Name) ;
Graphic3d_Vertex T(Xt,Yt,Zt) ;
void V3d_SpotLight::SetAngle(const Standard_Real Angle) {
- Viewer_BadValue_Raise_if( Angle <= 0. || Angle >= PI,
+ Viewer_BadValue_Raise_if( Angle <= 0. || Angle >= M_PI,
"V3d_SpotLight::SetAngle, bad angle");
MyLight->SetAngle(Angle) ;
this->Position(X,Y,Z);
this->Direction(DX,DY,DZ);
Rayon = this->Radius();
- V3d::ArrowOfRadius(gsymbol,X,Y,Z,-DX,-DY,-DZ,PI/8.,Rayon/15.);
+ V3d::ArrowOfRadius(gsymbol,X,Y,Z,-DX,-DY,-DZ,M_PI/8.,Rayon/15.);
}
void V3d_SpotLight::Display( const Handle(V3d_View)& aView,
gnopick->Polyline(PRadius);
V3d::ArrowOfRadius(gExtArrow,X-(X-X0)/10.,
Y-(Y-Y0)/10.,
- Z-(Z-Z0)/10.,X-X0,Y-Y0,Z-Z0,Standard_PI/15.,Rayon/20.);
- V3d::ArrowOfRadius(gIntArrow,X0,Y0,Z0,X0-X,Y0-Y,Z0-Z,Standard_PI/15.,Rayon/20.);
+ Z-(Z-Z0) / 10., X-X0, Y-Y0, Z-Z0, M_PI / 15., Rayon / 20.);
+ V3d::ArrowOfRadius(gIntArrow, X0, Y0, Z0, X0-X, Y0-Y, Z0-Z, M_PI / 15., Rayon / 20.);
TCollection_AsciiString ValOfRadius(Rayon);
PText.SetCoord( (X0+X)/2., (Y0+Y)/2. , (Z0+Z)/2. );
gradius->Text(ValOfRadius.ToCString(),PText,0.01);
*/
#define Zmargin 1.
-#define DEUXPI (2.*Standard_PI)
+#define DEUXPI (2. * M_PI)
// in case of NO_TRACE_ECHO and NO_TRACE_POINTS, in V3d_View_4.cxx and in
// V3d_View.cxx, change MyGridEchoStructure and MyGridEchoGroup in cdl
if( angle > 1. ) angle = 1. ;
else if( angle < -1. ) angle = -1. ;
angle = asin(angle) ;
- if( sca < 0. ) angle = Standard_PI - angle ;
- if( angle > 0. && angle < Standard_PI ) {
+ if( sca < 0. ) angle = M_PI - angle ;
+ if( angle > 0. && angle < M_PI ) {
sca = pvx*Xpn + pvy*Ypn + pvz*Zpn ;
if( sca < 0. ) angle = DEUXPI - angle ;
}
dz = atan2(Standard_Real(X)-rx/2., ry/2.-Standard_Real(Y)) -
atan2(sx-rx/2.,ry/2.-sy);
} else {
- dx = (Standard_Real(X) - sx) * Standard_PI/rx;
- dy = (sy - Standard_Real(Y)) * Standard_PI/ry;
+ dx = (Standard_Real(X) - sx) * M_PI / rx;
+ dy = (sy - Standard_Real(Y)) * M_PI / ry;
}
Rotate(dx, dy, dz, gx, gy, gz, Standard_False);
#else
- Standard_Real dx = (Standard_Real(X - sx)) * Standard_PI;
- Standard_Real dy = (Standard_Real(sy - Y)) * Standard_PI;
+ Standard_Real dx = (Standard_Real(X - sx)) * M_PI;
+ Standard_Real dy = (Standard_Real(sy - Y)) * M_PI;
Rotate(dx/rx, dy/ry, 0., gx, gy, gz, Standard_False);
#endif
#ifdef IMP020300
#define NO_TRACE_POINTS
#define MYEPSILON1 0.0001 // Comparison with 0.0
-#define MYEPSILON2 Standard_PI / 180. // Delta between 2 angles
+#define MYEPSILON2 M_PI / 180. // Delta between 2 angles
#ifdef TRACE_POINTS
#include <Graphic3d_AspectLine3d.hxx>
// Casw when the plane of the grid and the plane of the view
// are perpendicular to MYEPSILON2 close radians
- if (Abs (VPN.Angle (GPN) - Standard_PI / 2.) < MYEPSILON2) {
+ if (Abs (VPN.Angle (GPN) - M_PI / 2.) < MYEPSILON2) {
NewPoint.SetCoord (X1, Y1, Z1);
#ifdef TRACE_POINTS
TextAttrib->SetColor (Quantity_Color (Quantity_NOC_RED));
*(Handle(Aspect_CircularGrid) *) &MyGrid;
RS = theGrid->RadiusStep ();
DN = theGrid->DivisionNumber ();
- Alpha = Standard_PI / Standard_Real (DN);
+ Alpha = M_PI / Standard_Real (DN);
Standard_Real DistOP = Sqrt (XPp*XPp + YPp*YPp);
Standard_Real Angle, AngleCur;
Standard_Real XCurp=0, YCurp=0;
gp_Dir2d OP (XPp, YPp);
- AngleCur = 2 * Standard_PI;
+ AngleCur = 2 * M_PI;
for (i=1; i<=DN*2; i++) {
X1 = XO + Cos (Alpha * i) * RS,
Y1 = YO + Sin (Alpha * i) * RS,
SetDefaultVisualization(Visualization) ;
SetDefaultShadingModel(ShadingModel) ;
SetDefaultSurfaceDetail(SurfaceDetail) ;
- SetDefaultAngle(Standard_PI/2.);
+ SetDefaultAngle(M_PI / 2.);
SetDefaultTypeOfView(V3d_ORTHOGRAPHIC);
Quantity_Color Color1 (Quantity_NOC_GRAY50);
return 1;
}
anAngle = atof(argv[4]);
- anAngle = 2*PI * anAngle / 360.0;
+ anAngle = 2*M_PI * anAngle / 360.0;
gp_Pln aPln;
Handle(Geom_Surface) aSurf;
// AIS2D_KindOfSurface aSurfType;
gp_Pnt2d rightTopPoint(location.X() + length/2, location.Y() + length);
gp_Trsf2d trsf;
- trsf.SetRotation(location, angle*PI/180);
+ trsf.SetRotation(location, angle*M_PI/180);
startPoint.Transform(trsf);
leftTopPoint.Transform(trsf);
OSD_Timer myTimer;
TheAIS2DContext()->CloseLocalContext();
- Standard_Real Step = 4*PI/180;
+ Standard_Real Step = 4*M_PI/180;
Standard_Real Angle = 0;
Handle(AIS2D_InteractiveObject) aIO;
if (atoi(argv[2]) == 1)
{
cout << " Calcul par Transformation" << endl;
- for (Standard_Real myAngle = 0; Angle < 10*2*PI; myAngle++)
+ for (Standard_Real myAngle = 0; Angle < 10*2*M_PI; myAngle++)
{
Angle = Step*myAngle;
gp_Trsf myTransfo;
TopLoc_Location myDeltaAngle (myAngleTrsf);
TopLoc_Location myTrueLoc;
- for (Standard_Real myAngle = 0; Angle < 10*2*PI; myAngle++)
+ for (Standard_Real myAngle = 0; Angle < 10*2*M_PI; myAngle++)
{
Angle = Step*myAngle;
myTrueLoc = myTrueLoc*myDeltaAngle;
// TheAIS2DContext()->Deactivate(myAisPropeller );
// Boucle de mouvement
- for (Standard_Real myAngle = 0; angleA < 2*PI*10.175; myAngle++)
+ for (Standard_Real myAngle = 0; angleA < 2*M_PI*10.175; myAngle++)
{
- angleA = thread*myAngle*PI/180;
+ angleA = thread*myAngle*M_PI/180;
X = Sin(angleA)*3/8;
angleB = atan(X / Sqrt(-X * X + 1));
// Standard_Real decal(25*0.6);
gp_Dir TheZVector (coord[3],coord[4],coord[5]);
gp_Dir TheXVector (coord[6],coord[7],coord[8]);
- if (!TheZVector.IsNormal(TheXVector,PI/180))
+ if (!TheZVector.IsNormal(TheXVector,M_PI/180))
{
cout << argv[0] << " VectorX is not normal to VectorZ" << endl;
return 1;
if (mySurface.GetType() == GeomAbs_Plane)
{
gp_Pln myPlane = mySurface.Plane();
- myPlane.Rotate(myRotAxis, PI/2);
+ myPlane.Rotate(myRotAxis, M_PI/2);
Handle(Geom_Plane) theGeomPlane = new Geom_Plane(myPlane);
gp_Pnt theMiddle ((Aa.X()+Ab.X())/2, (Aa.Y()+Ab.Y())/2, (Aa.Z()+Ab.Z())/2);
if (mySurface.GetType() == GeomAbs_Plane)
{
gp_Pln myPlane = mySurface.Plane();
- myPlane.Rotate(myRotAxis, PI/2);
+ myPlane.Rotate(myRotAxis, M_PI/2);
Handle(Geom_Plane) theGeomPlane = new Geom_Plane(myPlane);
gp_Pnt theMiddle ((Ba.X()+Bb.X())/2, (Ba.Y()+Bb.Y())/2, (Ba.Z()+Bb.Z())/2);
Handle(AIS2D_Plane) myAIS2DPlane = new AIS2D_Plane(theGeomPlane, theMiddle);
if (TheAISContext()->HasOpenedContext())
TheAISContext()->CloseLocalContext();
- Standard_Real Step=2*PI/180;
+ Standard_Real Step=2*M_PI/180;
Standard_Real Angle=0;
// R est le rayon de l'hellicoide
Standard_Real R=50;
// boucle generant le mouvement
if(argc==3) {
di<<" Transformations"<<"\n";
- for (Standard_Real myAngle=0;Angle<5*2*PI; myAngle++) {
+ for (Standard_Real myAngle=0;Angle<5*2*M_PI; myAngle++) {
Angle=Step*myAngle;
- gp_Ax3 newBase(gp_Pnt(R*cos(Angle), R*sin(Angle), D*Angle/(2*PI) ), gp_Vec(0,0,1), gp_Vec(1,0,0) );
+ gp_Ax3 newBase(gp_Pnt(R*cos(Angle), R*sin(Angle), D*Angle/(2*M_PI) ), gp_Vec(0,0,1), gp_Vec(1,0,0) );
gp_Trsf myTransfo;
myTransfo.SetTransformation(newBase.Rotated(gp_Ax1(gp_Pnt(R*cos(Angle),R*sin(Angle),0), gp_Dir(0,0,1) ),Angle ) );
TheAISContext()->SetLocation(aIO,myTransfo);
TopLoc_Location myDeltaDist (myDistTrsf);
TopLoc_Location myTrueLoc;
- for (Standard_Real myAngle=0;Angle<5*2*PI; myAngle++) {
+ for (Standard_Real myAngle=0;Angle<5*2*M_PI; myAngle++) {
Angle=Step*myAngle;
myTrueLoc=myTrueLoc*myDeltaAngle*myDeltaDist;
if (TheAISContext()->HasOpenedContext())
TheAISContext()->CloseLocalContext();
- Standard_Real Step=4*PI/180;
+ Standard_Real Step=4*M_PI/180;
Standard_Real Angle=0;
Handle(AIS_InteractiveObject) aIO;
// Movement par transformation
if(atoi(argv[2]) ==1) {
di<<" Calcul par Transformation"<<"\n";
- for (Standard_Real myAngle=0;Angle<10*2*PI; myAngle++) {
+ for (Standard_Real myAngle=0;Angle<10*2*M_PI; myAngle++) {
Angle=Step*myAngle;
gp_Trsf myTransfo;
TopLoc_Location myDeltaAngle (myAngleTrsf);
TopLoc_Location myTrueLoc;
- for (Standard_Real myAngle=0;Angle<10*2*PI; myAngle++) {
+ for (Standard_Real myAngle=0;Angle<10*2*M_PI; myAngle++) {
Angle=Step*myAngle;
myTrueLoc=myTrueLoc*myDeltaAngle;
TheAISContext()->Deactivate(myAisPropeller );
// Boucle de mouvement
- for (Standard_Real myAngle = 0;angleA<2*PI*10.175 ;myAngle++) {
+ for (Standard_Real myAngle = 0;angleA<2*M_PI*10.175 ;myAngle++) {
- angleA = thread*myAngle*PI/180;
+ angleA = thread*myAngle*M_PI/180;
X = Sin(angleA)*3/8;
angleB = atan(X / Sqrt(-X * X + 1));
Standard_Real decal(25*0.6);
return 1;
}
anAngle = atof(argv[4]);
- anAngle = 2*PI * anAngle / 360.0;
+ anAngle = 2*M_PI * anAngle / 360.0;
gp_Pln aPln;
Handle( Geom_Surface )aSurf;
AIS_KindOfSurface aSurfType;
gp_Dir TheZVector(coord[3],coord[4],coord[5]);
gp_Dir TheXVector(coord[6],coord[7],coord[8]);
- if ( !TheZVector.IsNormal(TheXVector,PI/180)) {di<<argv[0]<<" VectorX is not normal to VectorZ"<<"\n"; return 1;}
+ if ( !TheZVector.IsNormal(TheXVector,M_PI/180)) {di<<argv[0]<<" VectorX is not normal to VectorZ"<<"\n"; return 1;}
Handle(Geom_Axis2Placement) OrigineAndAxii=new Geom_Axis2Placement(ThePoint,TheZVector,TheXVector);
if (mySurface.GetType()==GeomAbs_Plane ) {
gp_Pln myPlane=mySurface.Plane();
// On effectue une rotation d'1/2 tour autour de l'axe de rotation
- myPlane.Rotate(myRotAxis , PI/2 );
+ myPlane.Rotate(myRotAxis , M_PI/2 );
Handle(Geom_Plane) theGeomPlane=new Geom_Plane (myPlane );
// construit un plan parallele a theGeomPlane contenant l'edgeA (De centre le milieu de l'edgeA)
if (mySurface.GetType()==GeomAbs_Plane ) {
gp_Pln myPlane=mySurface.Plane();
// On effectue une rotation d'1/2 tour autour de l'axe de rotation
- myPlane.Rotate(myRotAxis , PI/2 );
+ myPlane.Rotate(myRotAxis , M_PI/2 );
Handle(Geom_Plane) theGeomPlane=new Geom_Plane (myPlane );
// construit un plan parallele a theGeomPlane contenant l'edgeA (De centre le milieu de l'edgeA)
gp_Pnt theMiddle ((Ba.X()+Bb.X() )/2 , (Ba.Y()+Bb.Y() )/2 , (Ba.Z()+Bb.Z() )/2 );
// Check data, determine increments, and convert to radians
startTheta = (localStartTheta < localEndTheta ? localStartTheta : localEndTheta);
- startTheta *= Standard_PI / 180.0;
+ startTheta *= M_PI / 180.0;
endTheta = (localEndTheta > localStartTheta ? localEndTheta : localStartTheta);
- endTheta *= Standard_PI / 180.0;
+ endTheta *= M_PI / 180.0;
startPhi = ( mStartPhi < mEndPhi ? mStartPhi : mEndPhi);
- startPhi *= Standard_PI / 180.0;
+ startPhi *= M_PI / 180.0;
endPhi = ( mEndPhi > mStartPhi ? mEndPhi : mStartPhi);
- endPhi *= Standard_PI / 180.0;
+ endPhi *= M_PI / 180.0;
phiResolution = mPhiResolution - numPoles;
deltaPhi = (endPhi - startPhi) / ( mPhiResolution - 1);
number_point = 3;
for ( i=0; i < localThetaResolution; i++){
- theta = localStartTheta * Standard_PI / 180.0 + i*deltaTheta;
+ theta = localStartTheta * M_PI / 180.0 + i*deltaTheta;
for ( j = jStart; j < jEnd; j++){
phi = startPhi + j*deltaPhi;
radius = mRadius * sin((double)phi);
TheAISContext()->CloseLocalContext(myCurrentIndex);
// Construction de l'AIS dimension
- Handle (AIS_AngleDimension) myAISDim= new AIS_AngleDimension (TopoDS::Edge(ShapeA) ,TopoDS::Edge(ShapeB) ,theGeomPlane ,PI/2.0 ,TheMessage_Str );
+ Handle (AIS_AngleDimension) myAISDim= new AIS_AngleDimension (TopoDS::Edge(ShapeA) ,TopoDS::Edge(ShapeB) ,theGeomPlane ,M_PI/2.0 ,TheMessage_Str );
GetMapOfAIS().Bind (myAISDim,argv[1]);
TheAISContext()->Display(myAISDim );
// on verifie si les edges sont orthogonaux.
//gp_Lin theLineA=theCurveA.Line();
//gp_Lin theLineB=theCurveB.Line();
- //if (abs(theLineA.Angle(theLineB) ) != PI/2 ) {cout<<"vperpendicular error: Edges are not othogonals."<<endl;return 1;}
+ //if (abs(theLineA.Angle(theLineB) ) != M_PI/2 ) {cout<<"vperpendicular error: Edges are not othogonals."<<endl;return 1;}
// On recupere 3 points A,B,C des curves.
gp_Pnt A=theCurveA.Value(0.1);
Standard_Boolean Visual3d_Light::IsValid (const Standard_Real AAngle) {
- return ( (AAngle < Standard_PI) && (AAngle >= 0.0) );
+ return ( (AAngle < M_PI) && (AAngle >= 0.0) );
}
/* Compute Angle */
if (angle > 1.) angle = 1. ;
else if ( angle < -1. ) angle = -1. ;
- angle = asin (angle)/Standard_PI180 ;
+ angle = asin (angle) / (M_PI / 180.0);
sca = a1*a2 + b1*b2 + c1*c2 ;
if (sca < 0.) angle = 180. - angle ;
if ( (angle > 0.) && (angle < 180.) ) {
if (sca > 0.) angle = 360. - angle ;
}
- return (angle*Standard_PI/180.0);
+ return (angle * M_PI / 180.0);
#else
- return (Standard_PI/180.0);
+ return (M_PI / 180.0);
#endif
}
Standard_EXPORT void Convert (const Standard_Boolean theExtractFaces,
const Standard_Boolean theExtractEdges,
const Standard_Real theDeflection = 0.01,
- const Standard_Real theDeflAngle = 20.*PI/180.);
+ const Standard_Real theDeflAngle = 20.*M_PI/180.);
//this value of theDeflAngle is used by default
//for tesselation while shading (Drawer->HLRAngle())
Quantity_Length width, height;
WorkSpace (width, height);
if (myFlags & FLAG_ROTATE) {
- a -> myAngle = Standard_PI / 2;
+ a -> myAngle = M_PI / 2;
a -> myPivot.x = Convert (height / 2);
a -> myPivot.y = Convert (width / 2);
a -> myMove.x =
#include <WNT_Bitmap.h>
-#define M_PI 3.1415
#define TRASH_SIZE 8
#define PWND ( ( WNT_WindowPtr )myWindow )
#define max(a,b) (a<b ? b : a)
#endif
-#ifndef PI
-#define PI 3.14159
-#endif
-
-#define DRAD (PI/180.)
+#define DRAD (M_PI/180.)
#define MAXLINES 256
#define MAXPOLYS 256
pltextlist->upoints[i].y = (short int )( yp + YROTATE(x,y) );
a = pltextlist->rangles[i] + angle ;
if( a > 0. ) {
- while( a > 2.*PI ) a -= 2.*PI ;
+ while( a > 2.*M_PI ) a -= 2.*M_PI ;
} else if( a < 0. ) {
- while( a < -2.*PI ) a += 2.*PI ;
+ while( a < -2.*M_PI ) a += 2.*M_PI ;
}
pltextlist->uangles[i] = a ;
pltextlist->uscalex[i] = pltextlist->rscalex[i] ;
pptextlist->upoints[i].y = (short int )( yp + YROTATE(x,y) );
a = pptextlist->rangles[i] + angle ;
if( a > 0. ) {
- while( a > 2.*PI ) a -= 2.*PI ;
+ while( a > 2.*M_PI ) a -= 2.*M_PI ;
} else if( a < 0. ) {
- while( a < -2.*PI ) a += 2.*PI ;
+ while( a < -2.*M_PI ) a += 2.*M_PI ;
}
pptextlist->uangles[i] = a ;
pptextlist->uscalex[i] = pptextlist->rscalex[i] ;
ptextlist->slants[ntext] = 0. ;
strcpy(ptextlist->ptexts[ntext],text) ;
if( angle > 0. ) {
- while( angle > 2.*PI ) angle -= 2.*PI ;
+ while( angle > 2.*M_PI ) angle -= 2.*M_PI ;
} else if( angle < 0. ) {
- while( angle < -2.*PI ) angle += 2.*PI ;
+ while( angle < -2.*M_PI ) angle += 2.*M_PI ;
}
ptextlist->rangles[ntext] = angle ;
ptextlist->marges[ntext] = marge ;
ptextlist->slants[ntext] = 0. ;
strcpy(ptextlist->ptexts[ntext],text) ;
if( angle > 0. ) {
- while( angle > 2.*PI ) angle -= 2.*PI ;
+ while( angle > 2.*M_PI ) angle -= 2.*M_PI ;
} else if( angle < 0. ) {
- while( angle < -2.*PI ) angle += 2.*PI ;
+ while( angle < -2.*M_PI ) angle += 2.*M_PI ;
}
ptextlist->rangles[ntext] = angle ;
{
if (Radius < 0.0) { TheError = gce_NegativeRadius; }
else {
- if (Ang <= gp::Resolution() || PI/2-Ang <= gp::Resolution()) {
+ if (Ang <= gp::Resolution() || M_PI/2-Ang <= gp::Resolution()) {
TheError = gce_BadAngle;
}
else {
Standard_Real Dist4 = L1.Distance(P4);
Standard_Real DifRad = Dist3-Dist4;
Standard_Real angle = Abs(ATan(DifRad/(Dist13-Dist14)));
- if(Abs(PI/2.-angle) < RealEpsilon() || Abs(angle) < RealEpsilon()) { TheError = gce_NullRadius; return; }
+ if(Abs(M_PI/2.-angle) < RealEpsilon() || Abs(angle) < RealEpsilon()) { TheError = gce_NullRadius; return; }
Standard_Real R1 = PP3.Distance(P3);
Standard_Real R2 = PP4.Distance(P4);
if (R1 < 0.0 || R2 < 0.0) { TheError = gce_NegativeRadius; return; }
}
else {
Standard_Real Angle = Abs(atan((R1-R2)/dist));
- if (Abs(PI/2.-Angle)<RealEpsilon() || Abs(Angle)<RealEpsilon()) {
+ if (Abs(M_PI/2.-Angle)<RealEpsilon() || Abs(Angle)<RealEpsilon()) {
TheError = gce_NullAngle;
}
else {
}
inline Standard_Real gp_Circ::Area() const
-{ return Standard_PI*radius*radius; }
+{ return M_PI * radius * radius; }
inline const gp_Ax1& gp_Circ::Axis () const
{ return pos.Axis(); }
inline Standard_Real gp_Circ::Length() const
-{ return 2.*Standard_PI*radius; }
+{ return 2. * M_PI * radius; }
inline const gp_Pnt& gp_Circ::Location () const
{ return pos.Location(); }
}
inline Standard_Real gp_Circ2d::Area() const
-{ return Standard_PI*radius*radius; }
+{ return M_PI * radius * radius; }
inline void gp_Circ2d::Coefficients (Standard_Real& A,
Standard_Real& B,
}
inline Standard_Real gp_Circ2d::Length() const
-{ return 2.*Standard_PI*radius; }
+{ return 2. * M_PI * radius; }
inline const gp_Pnt2d& gp_Circ2d::Location () const
{return pos.Location(); }
inline gp_Cone::gp_Cone () :
radius (RealLast()),
-semiAngle (Standard_PI * 0.25)
+semiAngle (M_PI * 0.25)
{ }
inline gp_Cone::gp_Cone (const gp_Ax3& A3,
Standard_ConstructionError_Raise_if
(radius < 0. ||
val <= gp::Resolution() ||
- Standard_PI * 0.5 - val <= gp::Resolution(), "");
+ M_PI * 0.5 - val <= gp::Resolution(), "");
}
inline void gp_Cone::SetAxis (const gp_Ax1& A1)
if (val < 0) val = - val;
Standard_ConstructionError_Raise_if
(val <= gp::Resolution() ||
- Standard_PI * 0.5 - val <= gp::Resolution(),"");
+ M_PI * 0.5 - val <= gp::Resolution(),"");
semiAngle = Ang;
}
return acos (Cosinus);
else {
Standard_Real Sinus = (coord.Crossed (Other.coord)).Modulus ();
- if(Cosinus < 0.0) return Standard_PI - asin (Sinus);
+ if(Cosinus < 0.0) return M_PI - asin (Sinus);
else return asin (Sinus);
}
}
if (Cosinus > -0.70710678118655 && Cosinus < 0.70710678118655)
Ang = acos (Cosinus);
else {
- if(Cosinus < 0.0) Ang = Standard_PI - asin (Sinus);
+ if(Cosinus < 0.0) Ang = M_PI - asin (Sinus);
else Ang = asin (Sinus);
}
if (XYZ.Dot (Vref.coord) >= 0.0) return Ang;
(const gp_Dir& Other,
const Standard_Real AngularTolerance) const
{
- Standard_Real Ang = Standard_PI / 2.0 - Angle (Other);
+ Standard_Real Ang = M_PI / 2.0 - Angle (Other);
if (Ang < 0) Ang = - Ang;
return Ang <= AngularTolerance;
}
inline Standard_Boolean gp_Dir::IsOpposite
(const gp_Dir& Other,
const Standard_Real AngularTolerance) const
-{ return Standard_PI - Angle (Other) <= AngularTolerance; }
+{ return M_PI - Angle (Other) <= AngularTolerance; }
inline Standard_Boolean gp_Dir::IsParallel
(const gp_Dir& Other,
const Standard_Real AngularTolerance) const
{
Standard_Real Ang = Angle (Other);
- return Ang <= AngularTolerance || Standard_PI - Ang <= AngularTolerance;
+ return Ang <= AngularTolerance || M_PI - Ang <= AngularTolerance;
}
inline void gp_Dir::Cross (const gp_Dir& Right)
else {
if (Cosinus > 0.0) return asin (Sinus);
else {
- if (Sinus > 0.0) return Standard_PI - asin (Sinus);
- else return -Standard_PI - asin (Sinus);
+ if (Sinus > 0.0) return M_PI - asin (Sinus);
+ else return -M_PI - asin (Sinus);
}
}
}
{
Standard_Real Ang = Angle(Other);
if (Ang < 0) Ang = - Ang;
- Ang = Standard_PI / 2.0 - Ang;
+ Ang = M_PI / 2.0 - Ang;
if (Ang < 0) Ang = - Ang;
return Ang <= AngularTolerance;
}
{
Standard_Real Ang = Angle(Other);
if (Ang < 0) Ang = - Ang;
- return Standard_PI - Ang <= AngularTolerance;
+ return M_PI - Ang <= AngularTolerance;
}
inline Standard_Boolean gp_Dir2d::IsParallel
{
Standard_Real Ang = Angle(Other);
if (Ang < 0) Ang = - Ang;
- return Ang <= AngularTolerance || Standard_PI - Ang <= AngularTolerance;
+ return Ang <= AngularTolerance || M_PI - Ang <= AngularTolerance;
}
inline Standard_Real gp_Dir2d::Crossed (const gp_Dir2d& Right) const
}
inline Standard_Real gp_Elips::Area() const
-{ return Standard_PI * majorRadius * minorRadius; }
+{ return M_PI * majorRadius * minorRadius; }
inline Standard_Real gp_Elips::MajorRadius() const
{ return majorRadius; }
{ pos.SetYAxis(A); }
inline Standard_Real gp_Elips2d::Area() const
-{ return Standard_PI * majorRadius * minorRadius; }
+{ return M_PI * majorRadius * minorRadius; }
inline gp_Ax2d gp_Elips2d::Directrix1() const
{
}
inline Standard_Real gp_Sphere::Area () const
-{ return 4.0 * Standard_PI * radius * radius; }
+{ return 4.0 * M_PI * radius * radius; }
inline void gp_Sphere::UReverse()
{ pos.YReverse(); }
{ return radius; }
inline Standard_Real gp_Sphere::Volume () const
-{ return (4.0 * Standard_PI * radius * radius * radius) / 3.0; }
+{ return (4.0 * M_PI * radius * radius * radius) / 3.0; }
inline gp_Ax1 gp_Sphere::XAxis () const
{ return gp_Ax1(pos.Location(), pos.XDirection()); }
{ pos = A3; }
inline Standard_Real gp_Torus::Area () const
-{ return 4.0 * Standard_PI * Standard_PI * minorRadius * majorRadius; }
+{ return 4.0 * M_PI * M_PI * minorRadius * majorRadius; }
inline void gp_Torus::UReverse()
{ pos.YReverse(); }
{ return minorRadius; }
inline Standard_Real gp_Torus::Volume () const
-{ return (Standard_PI * minorRadius * minorRadius) * (2.0 * Standard_PI * majorRadius); }
+{ return (M_PI * minorRadius * minorRadius) * (2.0 * M_PI * majorRadius); }
inline gp_Ax1 gp_Torus::XAxis () const
{ return gp_Ax1(pos.Location(), pos.XDirection()); }
(const gp_Vec& Other,
const Standard_Real AngularTolerance) const
{
- Standard_Real Ang = Standard_PI / 2.0 - Angle(Other);
+ Standard_Real Ang = M_PI / 2.0 - Angle(Other);
if (Ang < 0) Ang = - Ang;
return Ang <= AngularTolerance;
}
(const gp_Vec& Other,
const Standard_Real AngularTolerance) const
{
- Standard_Real Ang = Standard_PI - Angle(Other);
+ Standard_Real Ang = M_PI - Angle(Other);
return Ang <= AngularTolerance;
}
const Standard_Real AngularTolerance) const
{
Standard_Real Ang = Angle (Other);
- return Ang <= AngularTolerance || Standard_PI - Ang <= AngularTolerance;
+ return Ang <= AngularTolerance || M_PI - Ang <= AngularTolerance;
}
inline Standard_Real gp_Vec::Angle (const gp_Vec& Other) const
if (Cosinus > 0.0) return asin (Sinus);
else
{
- if (Sinus > 0.0) return PI - asin (Sinus);
- else return - PI - asin (Sinus);
+ if (Sinus > 0.0) return M_PI - asin (Sinus);
+ else return - M_PI - asin (Sinus);
}
}
}
{
Standard_Real Ang = Angle(Other);
if (Ang < 0) Ang = - Ang;
- Ang = Standard_PI / 2.0 - Angle(Other);
+ Ang = M_PI / 2.0 - Angle(Other);
if (Ang < 0) Ang = - Ang;
return Ang <= AngularTolerance;
}
{
Standard_Real Ang = Angle(Other);
if (Ang < 0) Ang = - Ang;
- return Standard_PI - Ang <= AngularTolerance;
+ return M_PI - Ang <= AngularTolerance;
}
inline Standard_Boolean gp_Vec2d::IsParallel
{
Standard_Real Ang = Angle(Other);
if (Ang < 0) Ang = - Ang;
- return Ang <= AngularTolerance || Standard_PI - Ang <= AngularTolerance;
+ return Ang <= AngularTolerance || M_PI - Ang <= AngularTolerance;
}
inline Standard_Real gp_Vec2d::Magnitude() const
else {
Omega = atan(0.5 * Q / sqrt(- Discr));
Sp3 = sqrt(-P / 3.0);
- Y1 = -2.0 * Sb * Sp3 * cos(PI / 6.0 - Sb * Omega / 3.0);
+ Y1 = -2.0 * Sb * Sp3 * cos(M_PI / 6.0 - Sb * Omega / 3.0);
TheRoots[0] = - Beta / 3.0 + Y1;
if(Beta * Q <= 0.0) {
TheRoots[1] = - Beta / 3.0 + 2.0 * Sp3 * sin(Omega / 3.0);
Eps = 1.e-12;
- Depi = PI+PI;
+ Depi = M_PI+M_PI;
if (InfBound <= RealFirst() && SupBound >= RealLast()) {
MyBorneInf = 0.0;
Delta = Depi;
}
Zer(1) = ASin(AA);
- Zer(2) = PI - Zer(1);
+ Zer(2) = M_PI - Zer(1);
NZer = 2;
for (i = 1; i <= NZer; i++) {
if (Zer(i) <= -Eps) {
}
// On rend les solutions entre InfBound et SupBound:
// =================================================
- Zer(i) += IntegerPart(Mod)*2.*PI;
+ Zer(i) += IntegerPart(Mod)*2.*M_PI;
X = Zer(i)-MyBorneInf;
if ((X >= (-Epsilon(Delta))) && (X <= Delta+ Epsilon(Delta))) {
NbSol++;
if(NbSol<4) {
Standard_Integer startIndex = NbSol + 1;
for( Standard_Integer solIt = startIndex; solIt <= 4; solIt++) {
- Teta = PI + IntegerPart(Mod)*2.0*PI;;
+ Teta = M_PI + IntegerPart(Mod)*2.0*M_PI;;
X = Teta - MyBorneInf;
if ((X >= (-Epsilon(Delta))) && (X <= Delta + Epsilon(Delta))) {
if (Abs(A-C+E) <= Eps) {