Medical Imaging Interaction Toolkit  2018.4.99-68f53314
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 (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef OPERATION_H_HEADER_INCLUDED_C16E7D9E
14 #define OPERATION_H_HEADER_INCLUDED_C16E7D9E
15 
16 #include <MitkCoreExports.h>
17 #include <itkEventObject.h>
18 
19 #include <mitkCommon.h>
20 
21 namespace mitk
22 {
23  typedef int OperationType;
24 
25  //##Documentation
26  //## @brief Base class of all Operation-classes
27  //##
28  //## @ingroup Undo
30  {
31  public:
33 
34  //##Documentation
35  //## Constructor
36  Operation(OperationType operationType);
37 
38  virtual ~Operation();
39 
40  OperationType GetOperationType();
41 
42  protected:
43  OperationType m_OperationType;
44  };
45 
46  class MITKCORE_EXPORT OperationEndEvent : public itk::EndEvent
47  {
48  public:
50  typedef itk::EndEvent Superclass;
51  OperationEndEvent(Operation *operation = nullptr) : m_Operation(operation) {}
52  ~OperationEndEvent() override {}
53  const char *GetEventName() const override { return "OperationEndEvent"; }
54  bool CheckEvent(const ::itk::EventObject *e) const override { return dynamic_cast<const Self *>(e); }
55  ::itk::EventObject *MakeObject() const override { return new Self(m_Operation); }
56  Operation *GetOperation() const { return m_Operation; }
57  private:
58  Operation *m_Operation;
59  OperationEndEvent(const Self &);
60  void operator=(const Self &);
61  };
62 
63 } // namespace mitk
64 #endif /* OPERATION_H_HEADER_INCLUDED_C16E7D9E */
#define MITKCORE_EXPORT
bool CheckEvent(const ::itk::EventObject *e) const override
Definition: mitkOperation.h:54
Base class of all Operation-classes.
Definition: mitkOperation.h:29
DataCollection - Class to facilitate loading/accessing structured data.
~OperationEndEvent() override
Definition: mitkOperation.h:52
#define mitkClassMacroNoParent(className)
Definition: mitkCommon.h:61
::itk::EventObject * MakeObject() const override
Definition: mitkOperation.h:55
OperationEndEvent Self
Definition: mitkOperation.h:49
itk::EndEvent Superclass
Definition: mitkOperation.h:50
Operation * GetOperation() const
Definition: mitkOperation.h:56
OperationType m_OperationType
Definition: mitkOperation.h:43
int OperationType
Definition: mitkOperation.h:23
const char * GetEventName() const override
Definition: mitkOperation.h:53
OperationEndEvent(Operation *operation=nullptr)
Definition: mitkOperation.h:51