]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/ModuleBase/ModuleBase_Operation.cpp
Salome HOME
Merge branch 'master' of newgeom:newgeom
[modules/shaper.git] / src / ModuleBase / ModuleBase_Operation.cpp
index 76459c132203a50b7d311cc2f89c6a73d67885c3..d5a0ce993ebb9c9e6bd49deeb7a00da8c59ba640 100644 (file)
@@ -7,6 +7,8 @@
 
 #include "ModuleBase_Operation.h"
 
+#include "ModuleBase_WidgetCustom.h"
+
 #include <ModelAPI_AttributeDouble.h>
 #include <ModelAPI_Document.h>
 #include <ModelAPI_Feature.h>
@@ -194,6 +196,19 @@ void ModuleBase_Operation::start()
   emit started();
 }
 
+/*!
+ * \brief Resumes operation
+ *
+ * Public slot. Verifies whether operation can be started and starts operation.
+ * This slot is not virtual and cannot be redefined. Redefine startOperation method
+ * to change behavior of operation. There is no point in using this method. It would
+ * be better to inherit own operator from base one and redefine startOperation method
+ * instead.
+ */
+void ModuleBase_Operation::resume()
+{
+}
+
 /*!
  * \brief Aborts operation
  *
@@ -264,6 +279,27 @@ void ModuleBase_Operation::storeReal(double theValue)
   aReal->setValue(theValue);
 }
 
+/*!
+ * \brief Stores a real value in model.
+ * \param theValue - to store
+ *
+ * Public slot. Passes theValue into the model.
+ */
+void ModuleBase_Operation::storeCustomValue()
+{
+  if(!myFeature){
+    #ifdef _DEBUG
+    qDebug() << "ModuleBase_Operation::storeCustom: " <<
+        "trying to store value without opening a transaction.";
+    #endif
+    return;
+  }
+
+  ModuleBase_WidgetCustom* aCustom = dynamic_cast<ModuleBase_WidgetCustom*>(sender());
+  if (aCustom)
+    aCustom->store(myFeature);
+}
+
 /*!
  * \brief Verifies whether operator is ready to start.
  * \return TRUE if operation is ready to start