From: vsv Date: Wed, 9 Jan 2019 11:59:35 +0000 (+0300) Subject: Issue #2825: Set the same deflection value from preferences on highlighting as on... X-Git-Tag: Jan2019~39 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=172ce7a2ed4d4e33049db91a5aa72170aadce655;p=modules%2Fshaper.git Issue #2825: Set the same deflection value from preferences on highlighting as on a presentation object. --- diff --git a/src/XGUI/XGUI_Displayer.cpp b/src/XGUI/XGUI_Displayer.cpp index 202afd6b2..6c54faa53 100644 --- a/src/XGUI/XGUI_Displayer.cpp +++ b/src/XGUI/XGUI_Displayer.cpp @@ -86,6 +86,7 @@ #include #include +#include #include @@ -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; } diff --git a/src/XGUI/XGUI_ViewerProxy.cpp b/src/XGUI/XGUI_ViewerProxy.cpp index 7c9af296a..01a002729 100644 --- a/src/XGUI/XGUI_ViewerProxy.cpp +++ b/src/XGUI/XGUI_ViewerProxy.cpp @@ -34,6 +34,8 @@ #include #include +#include + #include #include @@ -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);