]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
An improvement for the sketch operation restarting mode change.
authornds <natalia.donis@opencascade.com>
Fri, 5 Dec 2014 06:36:57 +0000 (09:36 +0300)
committernds <natalia.donis@opencascade.com>
Fri, 5 Dec 2014 06:36:57 +0000 (09:36 +0300)
Ename the enumeration values for better readability.

src/PartSet/PartSet_Module.cpp
src/PartSet/PartSet_Module.h

index c0875b7c103317edfaeb9cc655310baf3fa46591..6306448264cfa573ded0d5855851c4f77738a89f 100644 (file)
@@ -145,10 +145,10 @@ void PartSet_Module::onOperationComitted(ModuleBase_Operation* theOperation)
   FeaturePtr aFeature = theOperation->feature();
   std::shared_ptr<SketchPlugin_Feature> aSPFeature = 
             std::dynamic_pointer_cast<SketchPlugin_Feature>(aFeature);
-  if (aSPFeature && (myRestartingMode == RM_LastFeatureUse ||
-                     myRestartingMode == RM_LastFeatureUse)) {
+  if (aSPFeature && (myRestartingMode == RM_LastFeatureUsed ||
+                     myRestartingMode == RM_EmptyFeatureUsed)) {
     myLastOperationId = theOperation->id();
-    myLastFeature = myRestartingMode == RM_LastFeatureUse ? theOperation->feature() : FeaturePtr();
+    myLastFeature = myRestartingMode == RM_LastFeatureUsed ? theOperation->feature() : FeaturePtr();
     launchOperation(myLastOperationId);
   }
   breakOperationSequence();
@@ -517,7 +517,7 @@ void PartSet_Module::onKeyRelease(ModuleBase_IViewWindow* theWnd, QKeyEvent* the
 
 void PartSet_Module::onEnterReleased()
 {
-  myRestartingMode = RM_LastFeatureEmpty;
+  myRestartingMode = RM_EmptyFeatureUsed;
 }
 
 void PartSet_Module::onNoMoreWidgets()
@@ -529,8 +529,8 @@ void PartSet_Module::onNoMoreWidgets()
     std::shared_ptr<SketchPlugin_Feature> aSPFeature = 
               std::dynamic_pointer_cast<SketchPlugin_Feature>(aFeature);
     if (aSPFeature) {
-      if (myRestartingMode != RM_ForbidRestarting)
-        myRestartingMode = RM_LastFeatureUse;
+      if (myRestartingMode != RM_Forbided)
+        myRestartingMode = RM_LastFeatureUsed;
       aOperation->commit();
     }
   }
@@ -560,7 +560,7 @@ void PartSet_Module::onVertexSelected(ObjectPtr theObject, const TopoDS_Shape& t
     ModuleBase_IPropertyPanel* aPanel = aOperation->propertyPanel();
     const QList<ModuleBase_ModelWidget*>& aWidgets = aPanel->modelWidgets();
     if (aWidgets.last() == aPanel->activeWidget()) {
-      myRestartingMode = RM_ForbidRestarting;
+      myRestartingMode = RM_Forbided;
     }
   }
 }
index 86a813d160416e9fd3bc68127554fe235c250eed..1d9fc45df8b5486bba4c272d17ce92989193bcb6 100644 (file)
@@ -31,9 +31,9 @@ Q_OBJECT
 /// Enumeration to specify the restart operation properties.
 enum RestartingMode {
   RM_None, /// the operation should not be restarted
-  RM_ForbidRestarting, /// the operation should not be restarted after there is no active widget
-  RM_LastFeatureUse, /// the operation is restarted and use the previous feature for own initialization
-  RM_LastFeatureEmpty /// the operation is restarted and does not use the previous feature
+  RM_Forbided, /// the operation should not be restarted after there is no active widget
+  RM_LastFeatureUsed, /// the operation is restarted and use the previous feature for own initialization
+  RM_EmptyFeatureUsed /// the operation is restarted and does not use the previous feature
 };
 
 public: