Salome HOME
Accessibility of constraint operations under editing of sketch elements
[modules/shaper.git] / src / ModuleBase / ModuleBase_IOperation.cpp
index 6853d0d70a27a9f3106c9423e98831c824e10ab7..cc398e5b03df0b227fb47b3b153740eb501fe097 100644 (file)
@@ -7,6 +7,7 @@
 
 #include "ModuleBase_IOperation.h"
 #include "ModuleBase_OperationDescription.h"
+#include "ModuleBase_ModelWidget.h"
 
 #include <ModelAPI_Document.h>
 #include <ModelAPI_PluginManager.h>
@@ -16,7 +17,7 @@
 #endif
 
 ModuleBase_IOperation::ModuleBase_IOperation(const QString& theId, QObject* theParent)
- : QObject(theParent)
+ : QObject(theParent), myIsEditing(false), myIsModified(false)
 {
   myDescription = new ModuleBase_OperationDescription(theId);
 }
@@ -31,11 +32,26 @@ ModuleBase_OperationDescription* ModuleBase_IOperation::getDescription() const
   return myDescription;
 }
 
+bool ModuleBase_IOperation::canBeCommitted() const
+{
+  return true;
+}
+
 bool ModuleBase_IOperation::isGranted(ModuleBase_IOperation* /*theOperation*/) const
 {
   return false;
 }
 
+/*void ModuleBase_IOperation::setModelWidgets(const std::string& theXmlRepresentation,
+                                            QList<ModuleBase_ModelWidget*> theWidgets)
+{
+  QList<ModuleBase_ModelWidget*>::const_iterator anIt = theWidgets.begin(), aLast = theWidgets.end();
+  for (; anIt != aLast; anIt++) {
+    QObject::connect(*anIt, SIGNAL(valuesChanged()),  this, SLOT(storeCustomValue()));
+  }
+  getDescription()->setModelWidgets(theXmlRepresentation, theWidgets);
+}*/
+
 boost::shared_ptr<ModelAPI_Document> ModuleBase_IOperation::document() const
 {
   return ModelAPI_PluginManager::get()->rootDocument();
@@ -51,6 +67,7 @@ void ModuleBase_IOperation::start()
 
 void ModuleBase_IOperation::resume()
 {
+  emit resumed();
 }
 
 void ModuleBase_IOperation::abort()
@@ -73,6 +90,8 @@ void ModuleBase_IOperation::commit()
 
   document()->finishOperation();
   emit stopped();
+  
+  afterCommitOperation();
 }
 
 void ModuleBase_IOperation::setRunning(bool theState)