]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
#1454 Constraints visibility in sketch
authornds <nds@opencascade.com>
Wed, 4 May 2016 09:25:37 +0000 (12:25 +0300)
committernds <nds@opencascade.com>
Wed, 4 May 2016 09:26:02 +0000 (12:26 +0300)
src/PartSet/PartSet_Module.cpp
src/PartSet/PartSet_Module.h

index 9ad6a8e00c8c274f42d20a71edbaeebfd1b2e7d5..ab3bca3caff1cd8d7b798c8bf3145cf1ee16c9b0 100755 (executable)
@@ -148,9 +148,7 @@ PartSet_Module::PartSet_Module(ModuleBase_IWorkshop* theWshop)
   mySelectionFilters.Append(new PartSet_GlobalFilter(myWorkshop));
   mySelectionFilters.Append(new PartSet_FilterInfinite(myWorkshop));
 
-  myHasConstraintShown[PartSet_Tools::Geometrical] = true;
-  myHasConstraintShown[PartSet_Tools::Dimensional] = true;
-  myHasConstraintShown[PartSet_Tools::Expressions] = false;
+  setDefaultConstraintShown();
 
   Config_PropManager::registerProp("Visualization", "operation_parameter_color",
                           "Reference shape wireframe color in operation", Config_Prop::Color,
@@ -394,6 +392,8 @@ void PartSet_Module::operationStopped(ModuleBase_Operation* theOperation)
   if (PartSet_SketcherMgr::isNestedSketchOperation(theOperation)) {
     mySketchMgr->stopNestedSketch(theOperation);
   }
+  else if (PartSet_SketcherMgr::isSketchOperation(theOperation))
+    setDefaultConstraintShown();
 
   //VSV: Viewer is updated on feature update and redisplay
   if (isModified) {
@@ -405,7 +405,6 @@ void PartSet_Module::operationStopped(ModuleBase_Operation* theOperation)
   QMap<PartSet_Tools::ConstraintVisibleState, bool>::const_iterator anIt = myHasConstraintShown.begin(),
                                                                     aLast = myHasConstraintShown.end();
   for (; anIt != aLast; anIt++) {
-    myHasConstraintShown[anIt.key()];
     mySketchMgr->updateBySketchParameters(anIt.key(), anIt.value());
   }
 }
@@ -1315,3 +1314,11 @@ XGUI_Workshop* PartSet_Module::getWorkshop() const
   XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(workshop());
   return aConnector->workshop();
 }
+
+//******************************************************
+void PartSet_Module::setDefaultConstraintShown()
+{
+  myHasConstraintShown[PartSet_Tools::Geometrical] = true;
+  myHasConstraintShown[PartSet_Tools::Dimensional] = true;
+  myHasConstraintShown[PartSet_Tools::Expressions] = false;
+}
index b5aed0bdd53e27de5266d1e1ccde3fb8ae838003..925dc1760b9aa1b30301d30789d5600f6f97e73f 100755 (executable)
@@ -376,14 +376,15 @@ protected:
    void onActiveDocPopup(const QPoint&);
 
  private:
-
   //! Delete features
   virtual bool deleteObjects();
 
   /// Returns the workshop
   XGUI_Workshop* getWorkshop() const;
 
- private:
+  void setDefaultConstraintShown();
+
+private:
   SelectMgr_ListOfFilter mySelectionFilters;
 
   PartSet_SketcherMgr* mySketchMgr;