Salome HOME
Mantis issue 0021541: EDF 2213 GEOM: Filling accuracy
[modules/geom.git] / src / MeasureGUI / MeasureGUI_AngleDlg.cxx
index 49b62445aa6ca8228716da793a353a72b6ee34a5..90a87dcd9abbf0623034dccbd90c86b57c81ee84 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -18,9 +18,9 @@
 //
 
 // GEOM GEOMGUI : GUI for Geometry component
-//  File   : MeasureGUI_AngleDlg.cxx
-//  Author : Julia DOROVSKIKH, Open CASCADE S.A.S.
-//
+// File   : MeasureGUI_AngleDlg.cxx
+// Author : Julia DOROVSKIKH, Open CASCADE S.A.S.
+
 #include "MeasureGUI_AngleDlg.h"
 #include "MeasureGUI_Widgets.h"
 
@@ -28,6 +28,8 @@
 #include <GEOMBase.h>
 #include <GeometryGUI.h>
 
+#include <Basics_OCCTVersion.hxx>
+
 #include <SUIT_Session.h>
 #include <SUIT_Desktop.h>
 #include <SUIT_ResourceMgr.h>
@@ -53,6 +55,9 @@
 #include <gce_MakePln.hxx>
 #include <Precision.hxx>
 #include <AIS.hxx>
+#include <AIS_Drawer.hxx>
+#include <Prs3d_AngleAspect.hxx>
+#include <Prs3d_LineAspect.hxx>
 
 // QT Includes
 #include <qlineedit.h>
@@ -307,7 +312,7 @@ SALOME_Prs* MeasureGUI_AngleDlg::buildPrs()
 
   if (anAngle > Precision::Angular()) {
     try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#if OCC_VERSION_LARGE > 0x06010000
       OCC_CATCH_SIGNALS;
 #endif
       TopoDS_Shape S1, S2;
@@ -348,8 +353,8 @@ SALOME_Prs* MeasureGUI_AngleDlg::buildPrs()
         aLabel.sprintf("%.1f", anAngle);
 
         Handle(AIS_AngleDimension) anIO = new AIS_AngleDimension
-          (anEdge1, anEdge2, aPlane, anAngle * PI180,
-            TCollection_ExtendedString((Standard_CString)aLabel.toLatin1().data()));
+          (anEdge1, anEdge2, aPlane, anAngle * M_PI / 180.,
+           TCollection_ExtendedString((Standard_CString)aLabel.toLatin1().data()));
         Handle(Geom_Line) geom_lin1,geom_lin2;
         gp_Pnt ptat11,ptat12,ptat21,ptat22;
         Standard_Boolean isInfinite1,isInfinite2;
@@ -376,6 +381,12 @@ SALOME_Prs* MeasureGUI_AngleDlg::buildPrs()
           anIO->SetArrowSize(arrowSize);
         }
 
+       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);
+       anIO->Attributes()->SetAngleAspect(asp);
+
         SOCC_Prs* aPrs =
           dynamic_cast<SOCC_Prs*>(((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->CreatePrs(0));