mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0022792: Globally defined symbol PI conflicts with VTK definition (Intel compiler)
This commit is contained in:
@@ -439,7 +439,7 @@ void DsgPrs::ComputeFacesAnglePresentation( const Standard_Real ArrowLength,
|
||||
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 );
|
||||
@@ -475,8 +475,8 @@ void DsgPrs::ComputeFacesAnglePresentation( const Standard_Real ArrowLength,
|
||||
}
|
||||
else if (Sign1 == -1 && Sign2 == 1)
|
||||
{
|
||||
Par1 += PI;
|
||||
Par2 += PI;
|
||||
Par1 += M_PI;
|
||||
Par2 += M_PI;
|
||||
FirstParAngleCirc = Par1;
|
||||
LastParAngleCirc = Par2;
|
||||
}
|
||||
@@ -541,7 +541,7 @@ void DsgPrs::ComputeFacesAnglePresentation( const Standard_Real ArrowLength,
|
||||
Intersection.NearestPoints( ProjAttachPoint2, ProjAttachPoint2 );
|
||||
|
||||
Standard_Real U2 = ElCLib::Parameter( AttachCirc, ProjAttachPoint2 );
|
||||
if (U2 <= PI)
|
||||
if (U2 <= M_PI)
|
||||
{
|
||||
FirstParAttachCirc = 0;
|
||||
LastParAttachCirc = U2;
|
||||
@@ -549,7 +549,7 @@ void DsgPrs::ComputeFacesAnglePresentation( const Standard_Real ArrowLength,
|
||||
else
|
||||
{
|
||||
FirstParAttachCirc = U2;
|
||||
LastParAttachCirc = 2*PI;
|
||||
LastParAttachCirc = 2*M_PI;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -577,7 +577,7 @@ void DsgPrs::ComputeFilletRadiusPresentation( const Standard_Real ArrowLength,
|
||||
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 )
|
||||
@@ -616,7 +616,7 @@ void DsgPrs::ComputeFilletRadiusPresentation( const Standard_Real ArrowLength,
|
||||
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); //***
|
||||
|
||||
}
|
||||
@@ -712,37 +712,37 @@ Standard_Real DsgPrs::DistanceFromApex(const gp_Elips & elips,
|
||||
{
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -96,7 +96,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
|
||||
|
||||
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
|
||||
|
||||
@@ -130,8 +130,8 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
|
||||
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 ) {
|
||||
@@ -157,15 +157,15 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
|
||||
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);
|
||||
@@ -183,9 +183,9 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
|
||||
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);
|
||||
@@ -210,7 +210,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
|
||||
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);
|
||||
@@ -293,11 +293,11 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
|
||||
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;
|
||||
}
|
||||
@@ -305,16 +305,16 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
|
||||
}
|
||||
|
||||
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;
|
||||
@@ -429,10 +429,10 @@ void DsgPrs_AnglePresentation::Add( const Handle(Prs3d_Presentation)& aPresentat
|
||||
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;
|
||||
@@ -484,7 +484,7 @@ void DsgPrs_AnglePresentation::Add( const Handle(Prs3d_Presentation)& aPresentat
|
||||
{
|
||||
// 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;
|
||||
@@ -536,7 +536,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
|
||||
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));
|
||||
@@ -558,11 +558,11 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
|
||||
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;
|
||||
}
|
||||
@@ -570,16 +570,16 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
|
||||
}
|
||||
|
||||
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;
|
||||
@@ -660,7 +660,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
|
||||
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));
|
||||
@@ -682,11 +682,11 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
|
||||
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;
|
||||
}
|
||||
@@ -694,16 +694,16 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
|
||||
}
|
||||
|
||||
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;
|
||||
@@ -788,7 +788,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
|
||||
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));
|
||||
@@ -810,11 +810,11 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
|
||||
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;
|
||||
}
|
||||
@@ -822,16 +822,16 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
|
||||
}
|
||||
|
||||
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;
|
||||
@@ -904,7 +904,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
|
||||
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;
|
||||
|
@@ -32,7 +32,7 @@ void DsgPrs_ConcentricPresentation::Add(
|
||||
//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;
|
||||
|
@@ -114,18 +114,18 @@ static Standard_Boolean DsgPrs_InDomain(const Standard_Real fpar,
|
||||
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;
|
||||
}
|
||||
@@ -148,9 +148,9 @@ void DsgPrs_DiameterPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
|
||||
{
|
||||
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();
|
||||
@@ -167,8 +167,8 @@ void DsgPrs_DiameterPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
|
||||
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);
|
||||
|
@@ -122,7 +122,7 @@ void DsgPrs_EllipseRadiusPresentation::Add (const Handle(Prs3d_Presentation)& aP
|
||||
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;
|
||||
@@ -181,7 +181,7 @@ void DsgPrs_EllipseRadiusPresentation::Add (const Handle(Prs3d_Presentation)& aP
|
||||
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;
|
||||
|
@@ -190,16 +190,16 @@ void DsgPrs_EqualDistancePresentation::Add( const Handle( Prs3d_Presentation )&
|
||||
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);
|
||||
@@ -209,9 +209,9 @@ void DsgPrs_EqualDistancePresentation::Add( const Handle( Prs3d_Presentation )&
|
||||
|
||||
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;
|
||||
@@ -224,9 +224,9 @@ void DsgPrs_EqualDistancePresentation::Add( const Handle( Prs3d_Presentation )&
|
||||
|
||||
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;
|
||||
|
@@ -92,7 +92,7 @@ void DsgPrs_FilletRadiusPresentation::Add (const Handle(Prs3d_Presentation)& aPr
|
||||
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;
|
||||
|
@@ -62,7 +62,7 @@ void DsgPrs_FixPresentation::Add(
|
||||
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);
|
||||
|
@@ -118,8 +118,8 @@ void DsgPrs_IdenticPresentation::Add(const Handle(Prs3d_Presentation)& aPresenta
|
||||
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);
|
||||
@@ -170,8 +170,8 @@ void DsgPrs_IdenticPresentation::Add(const Handle(Prs3d_Presentation)& aPresenta
|
||||
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);
|
||||
@@ -217,8 +217,8 @@ void DsgPrs_IdenticPresentation::Add(const Handle(Prs3d_Presentation)& aPresenta
|
||||
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);
|
||||
|
@@ -384,7 +384,7 @@ void DsgPrs_LengthPresentation::Add( const Handle(Prs3d_Presentation)& aPresenta
|
||||
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;
|
||||
@@ -399,7 +399,7 @@ void DsgPrs_LengthPresentation::Add( const Handle(Prs3d_Presentation)& aPresenta
|
||||
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;
|
||||
|
@@ -56,7 +56,7 @@ void DsgPrs_MidPointPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
|
||||
// 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);
|
||||
@@ -131,7 +131,7 @@ void DsgPrs_MidPointPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
|
||||
// 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);
|
||||
@@ -213,7 +213,7 @@ void DsgPrs_MidPointPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
|
||||
// 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);
|
||||
@@ -259,8 +259,8 @@ void DsgPrs_MidPointPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
|
||||
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);
|
||||
@@ -306,7 +306,7 @@ void DsgPrs_MidPointPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
|
||||
// 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);
|
||||
@@ -352,8 +352,8 @@ void DsgPrs_MidPointPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
|
||||
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);
|
||||
|
@@ -38,7 +38,7 @@ static Standard_Boolean DsgPrs_InDomain(const Standard_Real fpar,
|
||||
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;
|
||||
}
|
||||
@@ -60,9 +60,9 @@ void DsgPrs_RadiusPresentation::Add (const Handle(Prs3d_Presentation)& aPresenta
|
||||
{
|
||||
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());
|
||||
@@ -70,8 +70,8 @@ void DsgPrs_RadiusPresentation::Add (const Handle(Prs3d_Presentation)& aPresenta
|
||||
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;
|
||||
|
@@ -268,7 +268,7 @@ void DsgPrs_ShapeDirPresentation::Add(const Handle(Prs3d_Presentation)& prs,
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -577,8 +577,8 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -588,8 +588,8 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
|
||||
}
|
||||
}
|
||||
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);
|
||||
}
|
||||
@@ -630,8 +630,8 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
|
||||
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);
|
||||
}
|
||||
@@ -641,8 +641,8 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
|
||||
}
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
@@ -43,7 +43,7 @@ void DsgPrs_XYZAxisPresentation::Add(
|
||||
|
||||
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.);
|
||||
|
||||
}
|
||||
@@ -79,7 +79,7 @@ void DsgPrs_XYZAxisPresentation::Add(const Handle(Prs3d_Presentation)& aPresenta
|
||||
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
|
||||
|
Reference in New Issue
Block a user