00001 /*========================================================================= 00002 00003 Program: Medical Imaging & Interaction Toolkit 00004 Language: C++ 00005 Date: $Date$ 00006 Version: $Revision$ 00007 00008 Copyright (c) German Cancer Research Center, Division of Medical and 00009 Biological Informatics. All rights reserved. 00010 See MITKCopyright.txt or https://www.mitk.org/copyright.html for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 00018 00019 #ifndef OPERATION_H_HEADER_INCLUDED_C16E7D9E 00020 #define OPERATION_H_HEADER_INCLUDED_C16E7D9E 00021 00022 #include "mitkCommon.h" 00023 00024 namespace mitk { 00025 typedef int OperationType ; 00026 00027 //##Documentation 00028 //## @brief Base class of all Operation-classes 00029 //## 00030 //## @ingroup Undo 00031 class MITK_CORE_EXPORT Operation 00032 { 00033 public: 00034 //##Documentation 00035 //## Constructor 00036 Operation(OperationType operationType); 00037 00038 virtual ~Operation(); 00039 00040 OperationType GetOperationType(); 00041 00042 protected: 00043 OperationType m_OperationType; 00044 }; 00045 00046 class MITK_CORE_EXPORT OperationEndEvent : public itk::EndEvent 00047 { 00048 public: 00049 typedef OperationEndEvent Self; 00050 typedef itk::EndEvent Superclass; 00051 OperationEndEvent(Operation* operation = NULL) : 00052 m_Operation(operation) {} 00053 virtual ~OperationEndEvent() {} 00054 virtual const char * GetEventName() const { return "OperationEndEvent"; } 00055 virtual bool CheckEvent(const ::itk::EventObject* e) const 00056 { return dynamic_cast<const Self*>(e); } 00057 virtual ::itk::EventObject* MakeObject() const 00058 { return new Self(m_Operation); } 00059 Operation* GetOperation() const { return m_Operation; } 00060 private: 00061 Operation* m_Operation; 00062 OperationEndEvent(const Self&); 00063 void operator=(const Self&); 00064 }; 00065 00066 }//namespace mitk 00067 #endif /* OPERATION_H_HEADER_INCLUDED_C16E7D9E */