2 * ModuleBase_IOperation.cpp
4 * Created on: May 5, 2014
8 #include "ModuleBase_IOperation.h"
9 #include "ModuleBase_OperationDescription.h"
10 #include "ModuleBase_ModelWidget.h"
12 #include <ModelAPI_Document.h>
13 #include <ModelAPI_PluginManager.h>
19 ModuleBase_IOperation::ModuleBase_IOperation(const QString& theId, QObject* theParent)
22 myDescription = new ModuleBase_OperationDescription(theId);
25 ModuleBase_IOperation::~ModuleBase_IOperation()
30 ModuleBase_OperationDescription* ModuleBase_IOperation::getDescription() const
35 bool ModuleBase_IOperation::canBeCommitted() const
40 bool ModuleBase_IOperation::isGranted(ModuleBase_IOperation* /*theOperation*/) const
45 /*void ModuleBase_IOperation::setModelWidgets(const std::string& theXmlRepresentation,
46 QList<ModuleBase_ModelWidget*> theWidgets)
48 QList<ModuleBase_ModelWidget*>::const_iterator anIt = theWidgets.begin(), aLast = theWidgets.end();
49 for (; anIt != aLast; anIt++) {
50 QObject::connect(*anIt, SIGNAL(valuesChanged()), this, SLOT(storeCustomValue()));
52 getDescription()->setModelWidgets(theXmlRepresentation, theWidgets);
55 boost::shared_ptr<ModelAPI_Document> ModuleBase_IOperation::document() const
57 return ModelAPI_PluginManager::get()->rootDocument();
60 void ModuleBase_IOperation::start()
62 document()->startOperation();
68 void ModuleBase_IOperation::resume()
73 void ModuleBase_IOperation::abort()
80 document()->abortOperation();
84 void ModuleBase_IOperation::commit()
91 document()->finishOperation();
94 afterCommitOperation();
97 void ModuleBase_IOperation::setRunning(bool theState)