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;