Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkPlanarFigureControlPointStyleProperty.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 ===================================================================*/
17 
19 {
20  this->AddEnumTypes();
21  this->SetValue(static_cast<IdType>(Square));
22 }
23 
25 {
26  this->AddEnumTypes();
27  if (this->IsValidEnumerationValue(value))
28  {
29  this->SetValue(value);
30  }
31  else
32  {
33  this->SetValue(static_cast<IdType>(Square));
34  }
35 }
36 
38 {
39  this->AddEnumTypes();
40  if (this->IsValidEnumerationValue(value))
41  {
42  this->SetValue(value);
43  }
44  else
45  {
46  this->SetValue(static_cast<IdType>(Square));
47  }
48 }
49 
51 {
52  this->AddEnum("Square", static_cast<IdType>(Square));
53  this->AddEnum("Circle", static_cast<IdType>(Circle));
54 }
55 
56 bool mitk::PlanarFigureControlPointStyleProperty::AddEnum(const std::string &name, const IdType &id)
57 {
58  return Superclass::AddEnum(name, id);
59 }
60 
62 {
63  return static_cast<mitk::PlanarFigureControlPointStyleProperty::Shape>(this->GetValueAsId());
64 }
65 
67 {
68  this->SetValue(static_cast<IdType>(shape));
69 }
70 
71 itk::LightObject::Pointer mitk::PlanarFigureControlPointStyleProperty::InternalClone() const
72 {
73  itk::LightObject::Pointer result(new Self(*this));
74  result->UnRegister();
75  return result;
76 }
virtual bool SetValue(const std::string &name)
itk::SmartPointer< Self > Pointer
virtual bool AddEnum(const std::string &name, const IdType &id) override