Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
mitkAction.cpp
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 #include "mitkAction.h"
14 
15 namespace mitk
16 {
20  Action::Action(int actionId) : m_ActionId(actionId), m_PropertiesList(nullptr) {}
25  void Action::AddProperty(const char *propertyKey, BaseProperty *property)
26  {
27  if (m_PropertiesList.IsNull())
28  m_PropertiesList = PropertyList::New();
29  m_PropertiesList->SetProperty(propertyKey, property);
30  }
31 
35  int Action::GetActionId() const { return m_ActionId; }
39  mitk::BaseProperty *Action::GetProperty(const char *propertyKey) const
40  {
41  if (m_PropertiesList.IsNotNull())
42  return m_PropertiesList->GetProperty(propertyKey);
43  else
44  return nullptr;
45  }
46 
47 } // namespace mitk
Action(int actionId)
Default Constructor. Set the actionId.
Definition: mitkAction.cpp:20
mitk::BaseProperty * GetProperty(const char *propertyKey) const
returns the specified property
Definition: mitkAction.cpp:39
static Pointer New()
DataCollection - Class to facilitate loading/accessing structured data.
~Action() override
Default Destructor.
Definition: mitkAction.cpp:21
int GetActionId() const
Returns the Id of this action.
Definition: mitkAction.cpp:35
Abstract base class for properties.
void AddProperty(const char *propertyKey, BaseProperty *property)
Adds a property to the list of properties.
Definition: mitkAction.cpp:25