]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Restore deflection management
authorvsv <vsv@opencascade.com>
Mon, 30 Mar 2020 13:19:50 +0000 (16:19 +0300)
committervsv <vsv@opencascade.com>
Mon, 30 Mar 2020 13:20:21 +0000 (16:20 +0300)
src/ModuleBase/ModuleBase_ResultPrs.cpp
src/PartSet/PartSet_ResultSketchPrs.cpp
src/XGUI/XGUI_OperationMgr.cpp

index 5149a63347134e6d61260179991acfd97d6a8186..517336b241aeefe97b7c37c791ea7ff1e1f0ebf3 100644 (file)
@@ -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);
   }
index 652a89b471eeda2e459f46e159ea236868f08867..6f07b0f225bb39268a7288c791ae3ec67fc4d6b5 100644 (file)
@@ -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);
   }
index 53c92f32f04e7e7a5d0d7110121b81e030727faf..c199a2f6880180bed3238c642ad3637e66fe4237 100644 (file)
@@ -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<QKeyEvent*>(theEvent);
         if (aKeyEvent) {
@@ -94,12 +94,10 @@ public:
         }
       }
       else if (theEvent->type() == QEvent::KeyPress) {
-        if (!qApp->modalWindow()) {
-          if (myOperationMgr->hasOperation()) {
-            QKeyEvent* aKeyEvent = dynamic_cast<QKeyEvent*>(theEvent);
-            myOperationMgr->setSHIFTPressed(aKeyEvent->modifiers() & Qt::ShiftModifier);
-            isAccepted = myOperationMgr->onKeyPressed(theObject, aKeyEvent);
-          }
+        if (myOperationMgr->hasOperation()) {
+          QKeyEvent* aKeyEvent = dynamic_cast<QKeyEvent*>(theEvent);
+          myOperationMgr->setSHIFTPressed(aKeyEvent->modifiers() & Qt::ShiftModifier);
+          isAccepted = myOperationMgr->onKeyPressed(theObject, aKeyEvent);
         }
       }
     }