]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
#1091 Validate is disabled when Create group
authornds <nds@opencascade.com>
Tue, 17 Nov 2015 14:40:47 +0000 (17:40 +0300)
committernds <nds@opencascade.com>
Tue, 17 Nov 2015 14:41:07 +0000 (17:41 +0300)
1. deactivate created extrusion sketch in the local sketch selection
2. avoid left of the cross over viewer after contour is closed.

src/PartSet/PartSet_SketcherMgr.cpp
src/PartSet/PartSet_WidgetSketchCreator.cpp

index 81d1cf6c869328daa5dd42f3a347992ee124f7f0..6e600764e86a4fced79ba3502d9080eefbe665c9 100755 (executable)
@@ -75,6 +75,7 @@
 
 #include <QMouseEvent>
 #include <QApplication>
+#include <QCursor>
 
 //#define DEBUG_DO_NOT_BY_ENTER
 
@@ -200,10 +201,13 @@ void PartSet_SketcherMgr::onEnterViewPort()
   #endif
 
   if (canChangeCursor(getCurrentOperation())) {
+    QCursor* aCurrentCursor = QApplication::overrideCursor();
+    if (!aCurrentCursor || aCurrentCursor->shape() != Qt::CrossCursor) {
+      QApplication::setOverrideCursor(QCursor(Qt::CrossCursor));
 #ifdef DEBUG_CURSOR
-    qDebug("onEnterViewPort() : Qt::CrossCursor");
+      qDebug("onEnterViewPort() : Qt::CrossCursor");
 #endif
-    QApplication::setOverrideCursor(QCursor(Qt::CrossCursor));
+    }
   }
 
   if (!isNestedCreateOperation(getCurrentOperation()))
@@ -925,10 +929,13 @@ void PartSet_SketcherMgr::stopSketch(ModuleBase_Operation* theOperation)
 void PartSet_SketcherMgr::startNestedSketch(ModuleBase_Operation* theOperation)
 {
   if (canChangeCursor(theOperation) && myIsMouseOverWindow) {
-    QApplication::setOverrideCursor(QCursor(Qt::CrossCursor));
+    QCursor* aCurrentCursor = QApplication::overrideCursor();
+    if (!aCurrentCursor || aCurrentCursor->shape() != Qt::CrossCursor) {
+      QApplication::setOverrideCursor(QCursor(Qt::CrossCursor));
 #ifdef DEBUG_CURSOR
-    qDebug("startNestedSketch() : Qt::CrossCursor");
+      qDebug("startNestedSketch() : Qt::CrossCursor");
 #endif
+    }
   }
 }
 
index 6bc043eb449df089d233010bd42d0ab6e673dabc..308dd965f0f544f8e1d579071a0bb958266e6715 100644 (file)
@@ -22,6 +22,7 @@
 #include <ModelAPI_AttributeSelection.h>
 #include <ModelAPI_AttributeSelectionList.h>
 #include <ModelAPI_Validator.h>
+#include <ModelAPI_Events.h>
 
 #include <SketchPlugin_SketchEntity.h>
 #include <FeaturesPlugin_CompositeBoolean.h>
@@ -32,6 +33,8 @@
 #include <ModuleBase_OperationFeature.h>
 #include <Config_WidgetAPI.h>
 
+#include <Events_Loop.h>
+
 #include <QLabel>
 #include <QLineEdit>
 #include <QFormLayout>
@@ -228,5 +231,12 @@ void PartSet_WidgetSketchCreator::onResumed(ModuleBase_Operation* theOp)
         }
       }
     }
+    else {
+      // this is a workarount to display the feature results in the operation selection mode
+      // if this is absent, sketch point/line local selection is available on extrusion cut result
+      static Events_ID anUpdateEvent = Events_Loop::eventByName(EVENT_OBJECT_UPDATED);
+      ModelAPI_EventCreator::get()->sendUpdated(feature(), anUpdateEvent);
+      updateObject(feature());
+    }
   }
 }