Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkPlaneOrientationProperty.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 
18 
19 namespace mitk
20 {
22  {
23  this->AddDecorationTypes();
24  this->SetValue(static_cast<IdType>(PLANE_DECORATION_NONE));
25  }
26 
28  {
29  this->AddDecorationTypes();
30  if (this->IsValidEnumerationValue(value))
31  {
32  this->SetValue(value);
33  }
34  else
35  {
36  this->SetValue(static_cast<IdType>(PLANE_DECORATION_NONE));
37  }
38  }
39 
41  {
42  this->AddDecorationTypes();
43  if (this->IsValidEnumerationValue(value))
44  {
45  this->SetValue(value);
46  }
47  else
48  {
49  this->SetValue(static_cast<IdType>(PLANE_DECORATION_NONE));
50  }
51  }
52 
53  int PlaneOrientationProperty::GetPlaneDecoration() { return static_cast<int>(this->GetValueAsId()); }
55  {
56  this->SetValue(static_cast<IdType>(PLANE_DECORATION_NONE));
57  }
58 
60  {
61  this->SetValue(static_cast<IdType>(PLANE_DECORATION_POSITIVE_ORIENTATION));
62  }
63 
65  {
66  this->SetValue(static_cast<IdType>(PLANE_DECORATION_NEGATIVE_ORIENTATION));
67  }
68 
70  {
71  this->AddEnum("No plane decoration", static_cast<IdType>(PLANE_DECORATION_NONE));
72  this->AddEnum("Arrows in positive direction", static_cast<IdType>(PLANE_DECORATION_POSITIVE_ORIENTATION));
73  this->AddEnum("Arrows in negative direction", static_cast<IdType>(PLANE_DECORATION_NEGATIVE_ORIENTATION));
74  }
75 
76  bool PlaneOrientationProperty::AddEnum(const std::string &name, const IdType &id)
77  {
78  return Superclass::AddEnum(name, id);
79  }
80 
81  itk::LightObject::Pointer PlaneOrientationProperty::InternalClone() const
82  {
83  itk::LightObject::Pointer result(new Self(*this));
84  result->UnRegister();
85  return result;
86  }
87 
88 } // namespace
virtual bool SetValue(const std::string &name)
itk::SmartPointer< Self > Pointer
virtual bool IsValidEnumerationValue(const IdType &val) const
DataCollection - Class to facilitate loading/accessing structured data.
virtual bool AddEnum(const std::string &name, const IdType &id)
virtual bool AddEnum(const std::string &name, const IdType &id) override
virtual IdType GetValueAsId() const