From 966e4f9778d95122a62e9db0b4d7cf79fdd33750 Mon Sep 17 00:00:00 2001 From: rnc Date: Wed, 11 Jul 2012 16:21:09 +0000 Subject: [PATCH] Display of angle values during sketch creation --- src/EntityGUI/EntityGUI_3DSketcherDlg.cxx | 24 ++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/src/EntityGUI/EntityGUI_3DSketcherDlg.cxx b/src/EntityGUI/EntityGUI_3DSketcherDlg.cxx index 3b6d41899..ff8ee6e8a 100755 --- a/src/EntityGUI/EntityGUI_3DSketcherDlg.cxx +++ b/src/EntityGUI/EntityGUI_3DSketcherDlg.cxx @@ -22,6 +22,8 @@ // Author : DMV, OCN // #include +#include +#include #include "EntityGUI_3DSketcherDlg.h" #include "EntityGUI_Widgets.h" @@ -44,6 +46,7 @@ #include #include +//OCCT includes //#include //#include //#include @@ -58,10 +61,13 @@ #include #include +#include #include #include #include #include +#include +#include // This include must be *AFTER* SOCC_ViewModel.h because // of the constant ROTATE which is a #define in @@ -845,9 +851,19 @@ void EntityGUI_3DSketcherDlg::displayAngle(double theAngle1, double theAngle2, d gce_MakePln gce_MP(Last_Pnt, P1, P2); Handle(Geom_Plane) aPlane = new Geom_Plane(gce_MP.Value()); - Standard_CString aStr = "45°"; + // Covert angles to string + std::string Angle1_str = boost::lexical_cast(theAngle1); + std::string Angle2_str = boost::lexical_cast(theAngle2); + Handle(AIS_AngleDimension) anAngleIO = new AIS_AngleDimension(anEdge1, anEdge2, aPlane, theAngle1 * M_PI / 180., - TCollection_ExtendedString(aStr)); + TCollection_ExtendedString(Angle1_str.c_str())); + + SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); + int w = resMgr->integerValue("Geometry", "measures_line_width", 1); + + Handle(Prs3d_AngleAspect) asp = new Prs3d_AngleAspect(); + asp->LineAspect()->SetWidth(w); + anAngleIO->Attributes()->SetAngleAspect(asp); SOCC_Prs* aSPrs = dynamic_cast(((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->CreatePrs(0)); @@ -860,7 +876,9 @@ void EntityGUI_3DSketcherDlg::displayAngle(double theAngle1, double theAngle2, d Handle(Geom_Plane) aPlane2 = new Geom_Plane(gce_MP2.Value()); Handle(AIS_AngleDimension) anAngle2IO = new AIS_AngleDimension(anEdge2, anEdge3, aPlane2, theAngle2 * M_PI / 180., - TCollection_ExtendedString(aStr)); + TCollection_ExtendedString(Angle2_str.c_str())); + + anAngle2IO->Attributes()->SetAngleAspect(asp); aSPrs->AddObject(anAngle2IO); } -- 2.39.2