From cb0a7bdbea9f94ea30879522b230cbe773b60dc3 Mon Sep 17 00:00:00 2001 From: vsv Date: Mon, 30 Mar 2020 16:19:50 +0300 Subject: [PATCH] Restore deflection management --- src/ModuleBase/ModuleBase_ResultPrs.cpp | 8 +++----- src/PartSet/PartSet_ResultSketchPrs.cpp | 7 ++++--- src/XGUI/XGUI_OperationMgr.cpp | 12 +++++------- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/src/ModuleBase/ModuleBase_ResultPrs.cpp b/src/ModuleBase/ModuleBase_ResultPrs.cpp index 5149a6334..517336b24 100644 --- a/src/ModuleBase/ModuleBase_ResultPrs.cpp +++ b/src/ModuleBase/ModuleBase_ResultPrs.cpp @@ -100,7 +100,6 @@ ModuleBase_ResultPrs::ModuleBase_ResultPrs(ResultPtr theResult) // Set own free boundaries aspect in order to have free // and unfree boundaries with different colors Handle(Prs3d_Drawer) aDrawer = Attributes(); - //aDrawer->SetTypeOfDeflection(Aspect_TOD_ABSOLUTE); aDrawer->SetUnFreeBoundaryAspect( new Prs3d_LineAspect(Quantity_NOC_YELLOW, Aspect_TOL_SOLID, 1)); aDrawer->SetFreeBoundaryAspect(new Prs3d_LineAspect(Quantity_NOC_GREEN, Aspect_TOL_SOLID, 1)); @@ -141,8 +140,6 @@ ModuleBase_ResultPrs::ModuleBase_ResultPrs(ResultPtr theResult) SetDynamicHilightAttributes(aDrawer); } } - //if (!aDrawer.IsNull()) - // aDrawer->SetTypeOfDeflection(Aspect_TOD_ABSOLUTE); myHiddenSubShapesDrawer = new AIS_ColoredDrawer(myDrawer); Handle(Prs3d_ShadingAspect) aShadingAspect = new Prs3d_ShadingAspect(); @@ -154,6 +151,9 @@ ModuleBase_ResultPrs::ModuleBase_ResultPrs(ResultPtr theResult) // Define colors for wireframe mode setEdgesDefaultColor(); + + ModuleBase_Tools::setDefaultDeviationCoefficient(Shape(), DynamicHilightAttributes()); + ModuleBase_Tools::setDefaultDeviationCoefficient(Shape(), Attributes()); } //******************************************************************** @@ -285,8 +285,6 @@ void ModuleBase_ResultPrs::Compute( } } // change deviation coefficient to provide more precise circle - ModuleBase_Tools::setDefaultDeviationCoefficient(Shape(), DynamicHilightAttributes()); - ModuleBase_Tools::setDefaultDeviationCoefficient(Shape(), Attributes()); try { AIS_Shape::Compute(thePresentationManager, thePresentation, theMode); } diff --git a/src/PartSet/PartSet_ResultSketchPrs.cpp b/src/PartSet/PartSet_ResultSketchPrs.cpp index 652a89b47..6f07b0f22 100644 --- a/src/PartSet/PartSet_ResultSketchPrs.cpp +++ b/src/PartSet/PartSet_ResultSketchPrs.cpp @@ -78,6 +78,10 @@ PartSet_ResultSketchPrs::PartSet_ResultSketchPrs(ResultPtr theResult) SetAutoHilight(anOwner.get() == NULL); ModuleBase_Tools::setPointBallHighlighting(this); + + // change deviation coefficient to provide more precise circle + ModuleBase_Tools::setDefaultDeviationCoefficient(Shape(), DynamicHilightAttributes()); + ModuleBase_Tools::setDefaultDeviationCoefficient(Shape(), Attributes()); } void PartSet_ResultSketchPrs::Compute( @@ -105,9 +109,6 @@ void PartSet_ResultSketchPrs::Compute( setAuxiliaryPresentationStyle(false); - // change deviation coefficient to provide more precise circle - ModuleBase_Tools::setDefaultDeviationCoefficient(Shape(), DynamicHilightAttributes()); - ModuleBase_Tools::setDefaultDeviationCoefficient(Shape(), Attributes()); try { AIS_Shape::Compute(thePresentationManager, thePresentation, theMode); } diff --git a/src/XGUI/XGUI_OperationMgr.cpp b/src/XGUI/XGUI_OperationMgr.cpp index 53c92f32f..c199a2f68 100644 --- a/src/XGUI/XGUI_OperationMgr.cpp +++ b/src/XGUI/XGUI_OperationMgr.cpp @@ -78,7 +78,7 @@ public: virtual bool eventFilter(QObject *theObject, QEvent *theEvent) { bool isAccepted = false; - if (myIsActive) { + if (myIsActive && (!qApp->modalWindow())) { if (theEvent->type() == QEvent::KeyRelease) { QKeyEvent* aKeyEvent = dynamic_cast(theEvent); if (aKeyEvent) { @@ -94,12 +94,10 @@ public: } } else if (theEvent->type() == QEvent::KeyPress) { - if (!qApp->modalWindow()) { - if (myOperationMgr->hasOperation()) { - QKeyEvent* aKeyEvent = dynamic_cast(theEvent); - myOperationMgr->setSHIFTPressed(aKeyEvent->modifiers() & Qt::ShiftModifier); - isAccepted = myOperationMgr->onKeyPressed(theObject, aKeyEvent); - } + if (myOperationMgr->hasOperation()) { + QKeyEvent* aKeyEvent = dynamic_cast(theEvent); + myOperationMgr->setSHIFTPressed(aKeyEvent->modifiers() & Qt::ShiftModifier); + isAccepted = myOperationMgr->onKeyPressed(theObject, aKeyEvent); } } } -- 2.39.2