]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/PartSet/PartSet_MenuMgr.cpp
Salome HOME
Correction for restart of point create operation.
[modules/shaper.git] / src / PartSet / PartSet_MenuMgr.cpp
index 7b60d802cd274cf7027b32a926c5908a1c17f39b..676ed379074a7209016acbbb786282ea0eaa4239 100644 (file)
@@ -112,7 +112,8 @@ bool PartSet_MenuMgr::addViewerMenu(const QMap<QString, QAction*>& theStdActions
 
   ModuleBase_Operation* anOperation = myModule->workshop()->currentOperation();
   if (!PartSet_SketcherMgr::isSketchOperation(anOperation) &&
-      !PartSet_SketcherMgr::isNestedSketchOperation(anOperation))
+      !PartSet_SketcherMgr::isNestedSketchOperation(anOperation,
+                                                    myModule->sketchMgr()->activeSketch()))
     return false;
 
   myCoinsideLines.clear();
@@ -205,7 +206,8 @@ void PartSet_MenuMgr::updateViewerMenu(const QMap<QString, QAction*>& theStdActi
   ModuleBase_Operation* anOperation = myModule->workshop()->currentOperation();
 
   bool isActiveSketch = PartSet_SketcherMgr::isSketchOperation(anOperation) ||
-                        PartSet_SketcherMgr::isNestedSketchOperation(anOperation);
+                        PartSet_SketcherMgr::isNestedSketchOperation(anOperation,
+                                                            myModule->sketchMgr()->activeSketch());
   if (isActiveSketch) {
     theStdActions["WIREFRAME_CMD"]->setEnabled(false);
     theStdActions["SHADING_CMD"]->setEnabled(false);
@@ -326,15 +328,16 @@ void PartSet_MenuMgr::setAuxiliary(const bool isChecked)
 {
   ModuleBase_Operation* anOperation = myModule->workshop()->currentOperation();
 
+  CompositeFeaturePtr aSketch = myModule->sketchMgr()->activeSketch();
   bool isActiveSketch = PartSet_SketcherMgr::isSketchOperation(anOperation) ||
-                        PartSet_SketcherMgr::isNestedSketchOperation(anOperation);
+                        PartSet_SketcherMgr::isNestedSketchOperation(anOperation, aSketch);
   if (!isActiveSketch)
     return;
 
   QObjectPtrList anObjects;
   bool isUseTransaction = false;
   // 1. change auxiliary type of a created feature
-  if (PartSet_SketcherMgr::isNestedCreateOperation(anOperation) &&
+  if (PartSet_SketcherMgr::isNestedCreateOperation(anOperation, aSketch) &&
       PartSet_SketcherMgr::isEntity(anOperation->id().toStdString()) ) {
       ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
                                                                (anOperation);
@@ -391,14 +394,15 @@ bool PartSet_MenuMgr::canSetAuxiliary(bool& theValue) const
   bool anEnabled = false;
   ModuleBase_Operation* anOperation = myModule->workshop()->currentOperation();
 
+  CompositeFeaturePtr aSketch = myModule->sketchMgr()->activeSketch();
   bool isActiveSketch = PartSet_SketcherMgr::isSketchOperation(anOperation) ||
-                        PartSet_SketcherMgr::isNestedSketchOperation(anOperation);
+                        PartSet_SketcherMgr::isNestedSketchOperation(anOperation, aSketch);
   if (!isActiveSketch)
     return anEnabled;
 
   QObjectPtrList anObjects;
   // 1. change auxiliary type of a created feature
-  if (PartSet_SketcherMgr::isNestedCreateOperation(anOperation) &&
+  if (PartSet_SketcherMgr::isNestedCreateOperation(anOperation, aSketch) &&
     PartSet_SketcherMgr::isEntity(anOperation->id().toStdString()) ) {
     ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>(anOperation);
     if (aFOperation)
@@ -407,7 +411,8 @@ bool PartSet_MenuMgr::canSetAuxiliary(bool& theValue) const
   else {
     /// The operation should not be aborted here, because the method does not changed
     /// the auxilliary state, but checks the possibility to perform this
-    ///if (PartSet_SketcherMgr::isNestedSketchOperation(anOperation))
+    ///if (PartSet_SketcherMgr::isNestedSketchOperation(anOperation,
+    //                                                  myModule->sketchMgr()->activeSketch()))
     ///  anOperation->abort();
     // 2. change auxiliary type of selected sketch entities
     ModuleBase_ISelection* aSelection = myModule->workshop()->selection();