Medical Imaging Interaction Toolkit  2016.11.0
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,
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 #include "mitkAction.h"
18 
19 namespace mitk
20 {
24  Action::Action(int actionId) : m_ActionId(actionId), m_PropertiesList(nullptr) {}
29  void Action::AddProperty(const char *propertyKey, BaseProperty *property)
30  {
31  if (m_PropertiesList.IsNull())
32  m_PropertiesList = PropertyList::New();
33  m_PropertiesList->SetProperty(propertyKey, property);
34  }
35 
39  int Action::GetActionId() const { return m_ActionId; }
43  mitk::BaseProperty *Action::GetProperty(const char *propertyKey) const
44  {
45  if (m_PropertiesList.IsNotNull())
46  return m_PropertiesList->GetProperty(propertyKey);
47  else
48  return nullptr;
49  }
50 
51 } // namespace mitk
Action(int actionId)
Default Constructor. Set the actionId.
Definition: mitkAction.cpp:24
static Pointer New()
int GetActionId() const
Returns the Id of this action.
Definition: mitkAction.cpp:39
DataCollection - Class to facilitate loading/accessing structured data.
~Action()
Default Destructor.
Definition: mitkAction.cpp:25
Abstract base class for properties.
mitk::BaseProperty * GetProperty(const char *propertyKey) const
returns the specified property
Definition: mitkAction.cpp:43
void AddProperty(const char *propertyKey, BaseProperty *property)
Adds a property to the list of properties.
Definition: mitkAction.cpp:29