| 80 | } |
| 81 | |
| 82 | mitk::OperationEvent::OperationEvent(OperationActor *destination, |
| 83 | Operation *operation, |
| 84 | Operation *undoOperation, |
| 85 | std::string description) |
| 86 | : UndoStackItem(description), |
| 87 | m_Destination(destination), |
| 88 | m_Operation(operation), |
| 89 | m_UndoOperation(undoOperation), |
| 90 | m_Invalid(false) |
| 91 | { |
| 92 | // connect to delete event |
| 93 | if (auto *object = dynamic_cast<itk::Object *>(m_Destination)) |
| 94 | { |
| 95 | itk::SimpleMemberCommand<OperationEvent>::Pointer command = itk::SimpleMemberCommand<OperationEvent>::New(); |
| 96 | command->SetCallbackFunction(this, &OperationEvent::OnObjectDeleted); |
| 97 | m_DelObserver.Reset(object, itk::DeleteEvent(), command); |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | mitk::OperationEvent::~OperationEvent() |
| 102 | { |