Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkOperation.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef OPERATION_H_HEADER_INCLUDED_C16E7D9E
18 #define OPERATION_H_HEADER_INCLUDED_C16E7D9E
19 
20 #include <MitkCoreExports.h>
21 #include <itkEventObject.h>
22 
23 #include <mitkCommon.h>
24 
25 namespace mitk
26 {
27  typedef int OperationType;
28 
29  //##Documentation
30  //## @brief Base class of all Operation-classes
31  //##
32  //## @ingroup Undo
34  {
35  public:
37 
38  //##Documentation
39  //## Constructor
40  Operation(OperationType operationType);
41 
42  virtual ~Operation();
43 
44  OperationType GetOperationType();
45 
46  protected:
47  OperationType m_OperationType;
48  };
49 
50  class MITKCORE_EXPORT OperationEndEvent : public itk::EndEvent
51  {
52  public:
54  typedef itk::EndEvent Superclass;
55  OperationEndEvent(Operation *operation = nullptr) : m_Operation(operation) {}
56  virtual ~OperationEndEvent() {}
57  virtual const char *GetEventName() const override { return "OperationEndEvent"; }
58  virtual bool CheckEvent(const ::itk::EventObject *e) const override { return dynamic_cast<const Self *>(e); }
59  virtual ::itk::EventObject *MakeObject() const override { return new Self(m_Operation); }
60  Operation *GetOperation() const { return m_Operation; }
61  private:
62  Operation *m_Operation;
63  OperationEndEvent(const Self &);
64  void operator=(const Self &);
65  };
66 
67 } // namespace mitk
68 #endif /* OPERATION_H_HEADER_INCLUDED_C16E7D9E */
#define MITKCORE_EXPORT
Operation * GetOperation() const
Definition: mitkOperation.h:60
Base class of all Operation-classes.
Definition: mitkOperation.h:33
DataCollection - Class to facilitate loading/accessing structured data.
virtual bool CheckEvent(const ::itk::EventObject *e) const override
Definition: mitkOperation.h:58
virtual const char * GetEventName() const override
Definition: mitkOperation.h:57
#define mitkClassMacroNoParent(className)
Definition: mitkCommon.h:65
OperationEndEvent Self
Definition: mitkOperation.h:53
virtual ::itk::EventObject * MakeObject() const override
Definition: mitkOperation.h:59
itk::EndEvent Superclass
Definition: mitkOperation.h:54
int OperationType
Definition: mitkOperation.h:27
OperationEndEvent(Operation *operation=nullptr)
Definition: mitkOperation.h:55