myCurrentFeature = FeaturePtr();
}
commitOperation();
- // check whether there are modifications performed during the current operation
- // in the model
- // in case if there are no modifications, do not increase the undo/redo stack
- if (aMgr->isModified())
- aMgr->finishOperation();
- else
- aMgr->abortOperation();
+ aMgr->finishOperation();
stopOperation();
emit stopped();
ModuleBase_IViewer* aViewer = myModule->workshop()->viewer();
aViewer->enableSelection(false);
- ModuleBase_Operation* aOperation = getCurrentOperation();
- if (!aOperation)
+ ModuleBase_Operation* aCurrentOperation = getCurrentOperation();
+ if (!aCurrentOperation)
return;
- if (isSketchOperation(aOperation))
+ if (isSketchOperation(aCurrentOperation))
return; // No edit operation activated
Handle(V3d_View) aView = theWnd->v3dView();
FeatureToSelectionMap::const_iterator anIt = myCurrentSelection.begin(),
aLast = myCurrentSelection.end();
// 4. the features and attributes modification(move)
+ bool isModified = false;
for (; anIt != aLast; anIt++) {
FeaturePtr aFeature = anIt.key();
if (aPoint.get() != NULL) {
bool isImmutable = aPoint->setImmutable(true);
aPoint->move(dX, dY);
+ isModified = true;
ModelAPI_EventCreator::get()->sendUpdated(aFeature, aMoveEvent);
aPoint->setImmutable(isImmutable);
}
std::dynamic_pointer_cast<SketchPlugin_Feature>(aFeature);
if (aSketchFeature) {
aSketchFeature->move(dX, dY);
+ isModified = true;
ModelAPI_EventCreator::get()->sendUpdated(aSketchFeature, aMoveEvent);
}
}
}
+ // the modified state of the current operation should be updated if there are features, which
+ // were changed here
+ if (isModified)
+ aCurrentOperation->onValuesChanged();
Events_Loop::loop()->flush(aMoveEvent); // up all move events - to be processed in the solver
//Events_Loop::loop()->flush(aUpdateEvent); // up update events - to redisplay presentations
void XGUI_OperationMgr::onOperationStopped()
{
ModuleBase_Operation* aSenderOperation = dynamic_cast<ModuleBase_Operation*>(sender());
- ModuleBase_Operation* anOperation = currentOperation();
- if (!aSenderOperation || !anOperation || aSenderOperation != anOperation)
+ ModuleBase_Operation* aCurrentOperation = currentOperation();
+ if (!aSenderOperation || !aCurrentOperation || aSenderOperation != aCurrentOperation)
return;
- myOperations.removeAll(anOperation);
- anOperation->deleteLater();
+ myOperations.removeAll(aCurrentOperation);
+ aCurrentOperation->deleteLater();
- emit operationStopped(anOperation);
+ emit operationStopped(aCurrentOperation);
// get last operation which can be resumed
ModuleBase_Operation* aResultOp = 0;
}
}
if (aResultOp) {
+ bool isModified = aCurrentOperation->isModified();
+ aResultOp->setIsModified(isModified);
resumeOperation(aResultOp);
onValidateOperation();
}