]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix possible exception in case if deflection parameter is not defined in preferences
authorvsv <vsv@opencascade.com>
Wed, 9 Jan 2019 14:34:25 +0000 (17:34 +0300)
committervsv <vsv@opencascade.com>
Wed, 9 Jan 2019 14:34:25 +0000 (17:34 +0300)
src/XGUI/XGUI_Displayer.cpp

index 6c54faa53b78dba79c96a0e3516bad58834e84ee..8eb1c126118cfbcf8c535fa5d4c4580b82a40db4 100644 (file)
@@ -38,6 +38,7 @@
 #include <ModelAPI_Tools.h>
 #include <ModelAPI_AttributeIntArray.h>
 #include <ModelAPI_ResultBody.h>
+#include <ModelAPI_ResultConstruction.h>
 
 #include <ModuleBase_BRepOwner.h>
 #include <ModuleBase_IModule.h>
@@ -697,7 +698,10 @@ Handle(AIS_InteractiveContext) XGUI_Displayer::AISContext() const
 
     ModuleBase_IViewer::DefaultHighlightDrawer = aContext->HighlightStyle();
     Handle(Prs3d_Drawer) aSelStyle = aContext->SelectionStyle();
-    double aDeflection = Config_PropManager::real("Visualization", "construction_deflection");
+    double aDeflection = QString(ModelAPI_ResultConstruction::DEFAULT_DEFLECTION().c_str()).toDouble();
+    try {
+      aDeflection = Config_PropManager::real("Visualization", "construction_deflection");
+    } catch (...) {}
 
     ModuleBase_IViewer::DefaultHighlightDrawer->SetDeviationCoefficient(aDeflection);
     aSelStyle->SetDeviationCoefficient(aDeflection);