]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #2825: Set the same deflection value from preferences on highlighting as on...
authorvsv <vsv@opencascade.com>
Wed, 9 Jan 2019 11:59:35 +0000 (14:59 +0300)
committervsv <vsv@opencascade.com>
Wed, 9 Jan 2019 11:59:35 +0000 (14:59 +0300)
src/XGUI/XGUI_Displayer.cpp
src/XGUI/XGUI_ViewerProxy.cpp

index 202afd6b2c7d6253e1a0075e0ec7f1825162bd37..6c54faa53b78dba79c96a0e3516bad58834e84ee 100644 (file)
@@ -86,6 +86,7 @@
 
 #include <Events_Loop.h>
 #include <ModelAPI_Events.h>
+#include <Config_PropManager.h>
 
 #include <set>
 
@@ -693,7 +694,13 @@ Handle(AIS_InteractiveContext) XGUI_Displayer::AISContext() const
       selectionActivate()->deactivateTrihedron(true);
     aContext->DefaultDrawer()->VIsoAspect()->SetNumber(0);
     aContext->DefaultDrawer()->UIsoAspect()->SetNumber(0);
+
     ModuleBase_IViewer::DefaultHighlightDrawer = aContext->HighlightStyle();
+    Handle(Prs3d_Drawer) aSelStyle = aContext->SelectionStyle();
+    double aDeflection = Config_PropManager::real("Visualization", "construction_deflection");
+
+    ModuleBase_IViewer::DefaultHighlightDrawer->SetDeviationCoefficient(aDeflection);
+    aSelStyle->SetDeviationCoefficient(aDeflection);
   }
   return aContext;
 }
index 7c9af296a12d98afc75201f8e7525dac9172511e..01a002729cb681a4c32962cd1e5d44ea45243818 100644 (file)
@@ -34,6 +34,8 @@
 #include <GeomAPI_Shape.h>
 #include <ModelAPI_ResultConstruction.h>
 
+#include <Config_PropManager.h>
+
 #include <AIS_Shape.hxx>
 
 #include <QEvent>
@@ -410,6 +412,7 @@ void XGUI_ViewerProxy::displayHighlight()
 {
   Handle(AIS_InteractiveContext) aContext = AISContext();
 
+  double aDeflection;
   if (myResult->groupName() == ModelAPI_ResultConstruction::group()) {
     FeaturePtr aFeature = ModelAPI_Feature::feature(myResult);
     if (aFeature.get()) {
@@ -423,6 +426,8 @@ void XGUI_ViewerProxy::displayHighlight()
         aAis = new AIS_Shape(aTShape);
         aAis->SetColor(HIGHLIGHT_COLOR);
         aAis->SetZLayer(1); //Graphic3d_ZLayerId_Topmost
+        aDeflection = Config_PropManager::real("Visualization", "construction_deflection");
+        aAis->Attributes()->SetDeviationCoefficient(aDeflection);
         myHighlights.Append(aAis);
         aContext->Display(aAis, false);
         aContext->Deactivate(aAis);
@@ -434,6 +439,8 @@ void XGUI_ViewerProxy::displayHighlight()
     Handle(AIS_Shape) aAis = new AIS_Shape(aTShape);
     aAis->SetColor(HIGHLIGHT_COLOR);
     aAis->SetZLayer(1); //Graphic3d_ZLayerId_Topmost
+    aDeflection = Config_PropManager::real("Visualization", "body_deflection");
+    aAis->Attributes()->SetDeviationCoefficient(aDeflection);
     myHighlights.Append(aAis);
     aContext->Display(aAis, false);
     aContext->Deactivate(aAis);