Standard_Real radius = 5;
Handle(Geom2d_Circle) C =
new Geom2d_Circle(gp::OX2d(),radius);
-Standard_Real param = 1.2*PI;
+Standard_Real param = 1.2*M_PI;
Geom2dLProp_CLProps2d CLP
(C,param,2,Precision::PConfusion());
gp_Dir2d D;
Handle(Geom2d_Circle) C =
new Geom2d_Circle(gp::OX2d(),radius);
Geom2dAdaptor_Curve GAC (C);
-Standard_Real startparam = 10*PI180;
-Standard_Real abscissa = 45*PI180;
+Standard_Real startparam = 10*M_PI/180;
+Standard_Real abscissa = 45*M_PI/180;
gp_Pnt2d P1;
C->D0(startparam,P1);
// abscissa is the distance along the curve from startparam
cout<<" D1.Angle(D2) : "<<ang<<endl;
TCollection_AsciiString Message2 (ang);
- TCollection_AsciiString Message3 (ang/PI180);
+ TCollection_AsciiString Message3 (ang/M_PI/180);
Message += " ang = ";
Message += Message2;
gp_Pnt2d P2(20 ,84);
Standard_Real aheight = 1;
FairCurve_Batten B (P1,P2,aheight);
-B.SetAngle1(22*PI180);
-B.SetAngle2(44*PI180);
+B.SetAngle1(22*M_PI/180);
+B.SetAngle2(44*M_PI/180);
FairCurve_AnalysisCode anAnalysisCode;
B.Compute(anAnalysisCode);
Handle(Geom2d_BSplineCurve) C = B.Curve();
gp_Pnt2d P2(20 ,24);
Standard_Real aheight = 1;
FairCurve_MinimalVariation MV (P1,P2,aheight);
-MV.SetAngle1(22*PI180);
-MV.SetAngle2(44*PI180);
+MV.SetAngle1(22*M_PI/180);
+MV.SetAngle2(44*M_PI/180);
FairCurve_AnalysisCode anAnalysisCode;
MV.Compute(anAnalysisCode);
Standard_Real minor = 4;
gp_Ax2d axis = gp::OX2d();
gp_Elips2d EE(axis,major,minor);;
-Handle(Geom2d_TrimmedCurve) arc = GCE2d_MakeArcOfEllipse(EE,0.0,PI/4);
+Handle(Geom2d_TrimmedCurve) arc = GCE2d_MakeArcOfEllipse(EE,0.0,M_PI/4);
//==============================================================
TCollection_AsciiString Message (" \
aDoc->GetISessionContext()->Display(aCurve, Standard_False);
Handle(ISession2D_Curve) aCurve2 = new ISession2D_Curve(arc);
aDoc->GetISessionContext()->Display(aCurve2, Standard_False);
- TCollection_AsciiString Message2 (PI);
+ TCollection_AsciiString Message2 (M_PI);
Message += " PI = ";Message+= Message2;
PostProcess(aDoc,ID_BUTTON_Test_32,TheDisplayType,Message.ToCString());
}
Handle(Geom_Circle) circle =
GC_MakeCircle(centre,axispoint,radius);
-Handle(Geom_Geometry) aRotatedEntity = circle->Rotated(gp::OZ(),PI/4);
+Handle(Geom_Geometry) aRotatedEntity = circle->Rotated(gp::OZ(),M_PI/4);
Standard_CString aRotatedEntityTypeName = aRotatedEntity->DynamicType()->Name();
Handle(Geom_Geometry) aMirroredEntity = aRotatedEntity->Mirrored(gp::ZOX());
DisplayCurve(aDoc,Handle(Geom_Curve)::DownCast(aScaledEntity), Quantity_NOC_GREEN,false);
DisplayCurve(aDoc,Handle(Geom_Curve)::DownCast(aTranslatedEntity),Quantity_NOC_WHITE,false);
- TCollection_AsciiString Message0 (PI);
+ TCollection_AsciiString Message0 (M_PI);
Message += " PI = ";
Message+= Message0;
Message += "\n";
Handle(Geom_Axis1Placement) Gax1 = new Geom_Axis1Placement(axe);
Handle (AIS_Axis) ax1 = new AIS_Axis(Gax1);
myAISContext->Display(ax1,Standard_False);
- theTransformation.SetRotation(axe,30*PI/180);
+ theTransformation.SetRotation(axe,30*M_PI/180);
BRepBuilderAPI_Transform myBRepTransformation(S,theTransformation);
TopoDS_Shape S2 = myBRepTransformation.Shape();
Handle(AIS_Shape) ais2 = new AIS_Shape(S2);
myAISContext->Display(aCyl1,Standard_False);
TopoDS_Shape C2 = BRepPrimAPI_MakeCylinder (gp_Ax2(gp_Pnt(200.,200.,0.),
gp_Dir(0.,0.,1.)),
- 40.,110.,210.*PI180);
+ 40.,110.,210.*M_PI/180);
Handle(AIS_Shape) aCyl2 = new AIS_Shape(C2);
myAISContext->SetMaterial(aCyl2,Graphic3d_NOM_PLASTIC,Standard_False);
myAISContext->SetColor(aCyl2,Quantity_NOC_MATRABLUE,Standard_False);
myAISContext->Display(ais1,Standard_False);
TopoDS_Shape C2 = BRepPrimAPI_MakeCone(gp_Ax2(gp_Pnt(100.,100.,0.),
gp_Dir(0.,0.,1.)),
- 60.,0.,150.,210.*PI180);
+ 60.,0.,150.,210.*M_PI/180);
Handle(AIS_Shape) ais2 = new AIS_Shape(C2);
myAISContext->SetMaterial(ais2,Graphic3d_NOM_PLASTIC,Standard_False);
myAISContext->SetColor(ais2,Quantity_NOC_GREEN,Standard_False);
myAISContext->SetColor(ais1,Quantity_NOC_AZURE,Standard_False);
myAISContext->SetMaterial(ais1,Graphic3d_NOM_PLASTIC,Standard_False);
myAISContext->Display(ais1,Standard_False);
- TopoDS_Shape S2 = BRepPrimAPI_MakeSphere(100.,120.*PI180);
+ TopoDS_Shape S2 = BRepPrimAPI_MakeSphere(100.,120.*M_PI/180);
Handle(AIS_Shape) ais2 = new AIS_Shape(S2);
myAISContext->SetColor(ais2,Quantity_NOC_GREEN,Standard_False);
myAISContext->SetMaterial(ais2,Graphic3d_NOM_PLASTIC,Standard_False);
myAISContext->Display(ais2,Standard_False);
TopoDS_Shape S3 = BRepPrimAPI_MakeSphere(gp_Pnt(200.,250.,0.),100.,
- -60.*PI180, 60.*PI180);
+ -60.*M_PI/180, 60.*M_PI/180);
Handle(AIS_Shape) ais3 = new AIS_Shape(S3);
myAISContext->SetColor(ais3,Quantity_NOC_RED,Standard_False);
myAISContext->SetMaterial(ais3,Graphic3d_NOM_PLASTIC,Standard_False);
myAISContext->Display(ais3,Standard_False);
TopoDS_Shape S4 = BRepPrimAPI_MakeSphere(gp_Pnt(0.,0.,-300.),150.,
- -45.*PI180, 45.*PI180, 45.*PI180);
+ -45.*M_PI/180, 45.*M_PI/180, 45.*M_PI/180);
Handle(AIS_Shape) ais4 = new AIS_Shape(S4);
myAISContext->SetColor(ais4,Quantity_NOC_MATRABLUE,Standard_False);
myAISContext->SetMaterial(ais4,Graphic3d_NOM_PLASTIC,Standard_False);
myAISContext->SetMaterial(ais1,Graphic3d_NOM_PLASTIC,Standard_False);
myAISContext->Display(ais1,Standard_False);
TopoDS_Shape S2 = BRepPrimAPI_MakeTorus(gp_Ax2(gp_Pnt(100.,100.,0.),gp_Dir(1.,1.,1.)),
- 50.,20.,210.*PI180);
+ 50.,20.,210.*M_PI/180);
Handle(AIS_Shape) ais2 = new AIS_Shape(S2);
myAISContext->SetColor(ais2,Quantity_NOC_GREEN,Standard_False);
myAISContext->SetMaterial(ais2,Graphic3d_NOM_PLASTIC,Standard_False);
myAISContext->Display(ais2,Standard_False);
TopoDS_Shape S3 = BRepPrimAPI_MakeTorus(gp_Ax2(gp_Pnt(-200.,-150.,-100),gp_Dir(0.,1.,0.)),
- 60.,20.,-45.*PI180,45.*PI180,90.*PI180);
+ 60.,20.,-45.*M_PI/180,45.*M_PI/180,90.*M_PI/180);
Handle(AIS_Shape) ais3= new AIS_Shape(S3);
myAISContext->SetColor(ais3,Quantity_NOC_CORAL,Standard_False);
myAISContext->SetMaterial(ais3,Graphic3d_NOM_PLASTIC,Standard_False);
Handle(Geom_Axis1Placement) Gax3 = new Geom_Axis1Placement(axe);
Handle (AIS_Axis) ax3 = new AIS_Axis(Gax3);
myAISContext->Display(ax3,Standard_False);
- TopoDS_Shape S3 = BRepPrimAPI_MakeRevol(W,axe, 210.*PI180);
+ TopoDS_Shape S3 = BRepPrimAPI_MakeRevol(W,axe, 210.*M_PI/180);
Handle(AIS_Shape) ais5 = new AIS_Shape(W);
myAISContext->Display(ais5,Standard_False);
Handle(AIS_Shape) ais6 = new AIS_Shape(S3);
Handle(Geom_Axis1Placement) Gax4 = new Geom_Axis1Placement(axe);
Handle (AIS_Axis) ax4 = new AIS_Axis(Gax4);
myAISContext->Display(ax4,Standard_False);
- TopoDS_Shape S4 = BRepPrimAPI_MakeRevol(F,axe, 90.*PI180);
+ TopoDS_Shape S4 = BRepPrimAPI_MakeRevol(F,axe, 90.*M_PI/180);
Handle(AIS_Shape) ais8 = new AIS_Shape(S4);
myAISContext->SetColor(ais8,Quantity_NOC_MATRABLUE,Standard_False);
myAISContext->SetMaterial(ais8,Graphic3d_NOM_PLASTIC,Standard_False);
gp_Pln apln = surf->Pln();
gp_Dir dirF = apln.Axis().Direction();
if (dirF.IsNormal(gp_Dir(0.,0.,1.),Precision::Angular()))
- adraft.Add(F, gp_Dir(0.,0.,1.), 15.*PI180, gp_Pln(gp::XOY()));
+ adraft.Add(F, gp_Dir(0.,0.,1.), 15.*M_PI/180, gp_Pln(gp::XOY()));
}
ais1->Set(adraft.Shape());
myAISContext->Redisplay(ais1,Standard_False);
TColgp_Array1OfPnt2d TabPoint2(1,20);
for (Standard_Integer i=0; i<=19; i++) {
- gp_Pnt2d Point2d(i*2*PI/19,60*cos(i*PI/19-PI/2)+10);
+ gp_Pnt2d Point2d(i*2*M_PI/19,60*cos(i*M_PI/19-M_PI/2)+10);
TabPoint2.SetValue(i+1,Point2d);
}
gp_Circ2d c(gp_Ax2d(gp_Pnt2d(200.,130.),gp_Dir2d(1.,0.)),50.);
BRepBuilderAPI_MakeWire MW;
Handle(Geom2d_Curve) aline = new Geom2d_Circle(c);
- MW.Add(BRepBuilderAPI_MakeEdge(aline,surf,0.,PI));
- MW.Add(BRepBuilderAPI_MakeEdge(aline,surf,PI,2.*PI));
+ MW.Add(BRepBuilderAPI_MakeEdge(aline,surf,0.,M_PI));
+ MW.Add(BRepBuilderAPI_MakeEdge(aline,surf,M_PI,2.*M_PI));
BRepBuilderAPI_MakeFace MKF;
MKF.Init(surf,Standard_False, Precision::Confusion());
MKF.Add(MW.Wire());
TopoDS_Face FP = MKF.Face();
BRepLib::BuildCurves3d(FP);
- BRepFeat_MakeDPrism MKDP(S,FP,F,10*PI180,1,Standard_True);
+ BRepFeat_MakeDPrism MKDP(S,FP,F,10*M_PI/180,1,Standard_True);
MKDP.Perform(200);
TopoDS_Shape res1 = MKDP.Shape();
//////////////The red edge
gp_Elips Elips(gp_Ax2(gp_Pnt(10,0,0),gp_Dir(1,1,1)),60,30);
- RedEdge = BRepBuilderAPI_MakeEdge(Elips,0,PI/2);
+ RedEdge = BRepBuilderAPI_MakeEdge(Elips,0,M_PI/2);
/////////////The green edge and the both extreme vertex
////////////The red wire is build from a single edge
gp_Elips Elips(gp_Ax2(gp_Pnt(250,0,0),gp_Dir(1,1,1)),160,90);
- Edge1 = BRepBuilderAPI_MakeEdge(Elips,0,PI/2);
+ Edge1 = BRepBuilderAPI_MakeEdge(Elips,0,M_PI/2);
RedWire = BRepBuilderAPI_MakeWire(Edge1);
///////////the yellow wire is build from an existing wire and an edge
gp_Circ circle(gp_Ax2(gp_Pnt(-300,0,0),gp_Dir(1,0,0)),80);
- Edge2 = BRepBuilderAPI_MakeEdge(circle,0,PI);
+ Edge2 = BRepBuilderAPI_MakeEdge(circle,0,M_PI);
ExistingWire = BRepBuilderAPI_MakeWire(Edge2);
//////////we use the methods Add, Edge and Vertex from BRepBuilderAPI_MakeWire.
gp_Circ circle2(gp_Ax2(gp_Pnt(0,0,0),gp_Dir(0,1,0)),200);
- Edge4 = BRepBuilderAPI_MakeEdge(circle2,0,PI);
+ Edge4 = BRepBuilderAPI_MakeEdge(circle2,0,M_PI);
ExistingWire2 = BRepBuilderAPI_MakeWire(Edge4);
////////////////////
gp_Circ circle(gp_Ax2(gp_Pnt(0,0,0),gp_Dir(1,0,0)),80);
- Edge1 = BRepBuilderAPI_MakeEdge(circle,0,PI);
+ Edge1 = BRepBuilderAPI_MakeEdge(circle,0,M_PI);
Edge2 = BRepBuilderAPI_MakeEdge(gp_Pnt(0,0,-80),gp_Pnt(0,-10,40));
Edge3 = BRepBuilderAPI_MakeEdge(gp_Pnt(0,-10,40),gp_Pnt(0,0,80));
B.Add(EX01,V101);
//Parameters
B.UpdateVertex(V001,0,EX01,precision);
- B.UpdateVertex(V101,PI,EX01,precision);
+ B.UpdateVertex(V101,M_PI,EX01,precision);
//Edge EX11
C = new Geom_Circle(gp_Ax2(gp_Pnt(100,150,100),gp_Dir(0,1,0),gp_Dir(-1,0,0)),100);
B.Add(EX11,V111);
//Parameters
B.UpdateVertex(V011,0,EX11,precision);
- B.UpdateVertex(V111,PI,EX11,precision);
+ B.UpdateVertex(V111,M_PI,EX11,precision);
//Build wire and faces
//Faces normals are along the axis X,Y,Z
C2d = new Geom2d_Circle(gp_Ax2d(gp_Pnt2d(100,100),gp_Dir2d(0,-1)),100);
B.UpdateEdge(EX01,C2d,FYMAX,precision);
B.UpdateVertex(V001,0,EX01,FYMAX,precision);
- B.UpdateVertex(V101,PI,EX01,FYMAX,precision);
+ B.UpdateVertex(V101,M_PI,EX01,FYMAX,precision);
EZ10.Orientation(TopAbs_REVERSED);
B.Add(W,EZ10);
C2d = new Geom2d_Circle(gp_Ax2d(gp_Pnt2d(100,100),gp_Dir2d(0,-1)),100);
B.UpdateEdge(EX11,C2d,FYMIN,precision);
B.UpdateVertex(V011,0,EX11,FYMIN,precision);
- B.UpdateVertex(V111,PI,EX11,FYMIN,precision);
+ B.UpdateVertex(V111,M_PI,EX11,FYMIN,precision);
EZ11.Orientation(TopAbs_REVERSED);
B.Add(W,EZ11);
L2d = new Geom2d_Line(gp_Ax2d(gp_Pnt2d(0,0),gp_Dir2d(1,0)));
B.UpdateEdge(EX01,L2d,FZMIN,precision);
B.UpdateVertex(V001,0,EX01,FZMIN,precision);
- B.UpdateVertex(V101,PI,EX01,FZMIN,precision);
+ B.UpdateVertex(V101,M_PI,EX01,FZMIN,precision);
EY11.Orientation(TopAbs_FORWARD);
B.Add(W,EY11);
//pcurve
- L2d = new Geom2d_Line(gp_Pnt2d(PI,0),gp_Dir2d(0,1));
+ L2d = new Geom2d_Line(gp_Pnt2d(M_PI,0),gp_Dir2d(0,1));
B.UpdateEdge(EY11,L2d,FZMIN,precision);
EX11.Orientation(TopAbs_REVERSED);
//pcurve
L2d = new Geom2d_Line(gp_Ax2d(gp_Pnt2d(0,150),gp_Dir2d(1,0)));
B.UpdateEdge(EX11,L2d,FZMIN,precision);
- B.UpdateVertex(V111,PI,EX11,FZMIN,precision);
+ B.UpdateVertex(V111,M_PI,EX11,FZMIN,precision);
B.UpdateVertex(V011,0,EX11,FZMIN,precision);
EY01.Orientation(TopAbs_REVERSED);
ClientToScreen ( (HWND)(aWNTWindow->HWindow()),&winCoord);
pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON , winCoord.x, winCoord.y ,
AfxGetMainWnd());
-}
\ No newline at end of file
+}