]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #1629 : it is not anymore possible to select entities first in the sketcher...
authornds <nds@opencascade.com>
Mon, 11 Jul 2016 08:00:20 +0000 (11:00 +0300)
committernds <nds@opencascade.com>
Mon, 11 Jul 2016 08:00:20 +0000 (11:00 +0300)
src/PartSet/PartSet_Module.cpp
src/PartSet/PartSet_Module.h
src/PartSet/PartSet_SketcherMgr.cpp

index 2473454c7a8c13e1ef7378572f7d1f432aff4948..7f8367528bca7d198a240a322e25a06e8536e304 100755 (executable)
@@ -123,7 +123,8 @@ extern "C" PARTSET_EXPORT ModuleBase_IModule* createModule(ModuleBase_IWorkshop*
 
 PartSet_Module::PartSet_Module(ModuleBase_IWorkshop* theWshop)
 : ModuleBase_IModule(theWshop),
-  myVisualLayerId(0)
+  myVisualLayerId(0),
+  myIsOperationIsLaunched(false)
 {
   new PartSet_IconFactory();
 
@@ -557,6 +558,17 @@ bool PartSet_Module::isMouseOverWindow()
   return mySketchMgr->isMouseOverWindow();
 }
 
+bool PartSet_Module::isSketchNeutralPointActivated() const
+{
+  bool isNeutralPoint = true;
+  if (sketchReentranceMgr()->isInternalEditStarted())
+    isNeutralPoint = false;
+  if (myIsOperationIsLaunched)
+    isNeutralPoint = false;
+
+  return isNeutralPoint;
+}
+
 void PartSet_Module::closeDocument()
 {
   clearViewer();
@@ -845,10 +857,13 @@ bool PartSet_Module::canCommitOperation() const
 void PartSet_Module::launchOperation(const QString& theCmdId,
                                      const bool isUpdatePropertyPanel)
 {
+  myIsOperationIsLaunched = true;
   storeConstraintsState(theCmdId.toStdString());
   updateConstraintsState(theCmdId.toStdString());
 
   ModuleBase_IModule::launchOperation(theCmdId, isUpdatePropertyPanel);
+
+  myIsOperationIsLaunched = false;
 }
 
 void PartSet_Module::storeConstraintsState(const std::string& theFeatureKind)
index ada0628974d81061bca4c319eb9be891dee7620f..0ad602e0c62a9786fd6a2146584a14817bd12455 100755 (executable)
@@ -202,12 +202,17 @@ public:
   PartSet_SketcherMgr* sketchMgr() const { return mySketchMgr; }
 
   /// Returns sketch reentrant manager
-  PartSet_SketcherReetntrantMgr* sketchReentranceMgr() { return mySketchReentrantMgr; }
+  PartSet_SketcherReetntrantMgr* sketchReentranceMgr() const { return mySketchReentrantMgr; }
 
   /// Returns listener of overconstraint signal
   /// \return the listener
   PartSet_OverconstraintListener* overconstraintListener() { return myOverconstraintListener; }
 
+  /// Returns true if the current operation is not reentrant and the current state of the
+  /// application is not in launch operation mode
+  /// \return boolean value
+  bool isSketchNeutralPointActivated() const;
+
   /// Performs functionality on closing document
   virtual void closeDocument();
 
@@ -401,6 +406,7 @@ protected:
   void setDefaultConstraintShown();
 
 private:
+  bool myIsOperationIsLaunched; /// state of application between launch and stop operation
   SelectMgr_ListOfFilter mySelectionFilters;
 
   PartSet_SketcherMgr* mySketchMgr;
index c6a7a18842f48ad2e05757a781345f844bead4f4..29a428ed1ccc30d97572ff80572df44d93e5da78 100755 (executable)
@@ -1048,7 +1048,7 @@ void PartSet_SketcherMgr::stopNestedSketch(ModuleBase_Operation* theOperation)
   /// improvement to deselect automatically all eventual selected objects, when
   // returning to the neutral point of the Sketcher
   // if the operation is restarted, the previous selection is used to initialize started operation
-  if (!myModule->sketchReentranceMgr()->isInternalEditStarted())
+  if (myModule->isSketchNeutralPointActivated())
     workshop()->selector()->clearSelection();
 }