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