Medical Imaging Interaction Toolkit  2018.4.99-eed36131
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 (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 ============================================================================*/
13 
15 {
16  this->AddEnumTypes();
17  this->SetValue(static_cast<IdType>(Square));
18 }
19 
21 {
22  this->AddEnumTypes();
23  if (this->IsValidEnumerationValue(value))
24  {
25  this->SetValue(value);
26  }
27  else
28  {
29  this->SetValue(static_cast<IdType>(Square));
30  }
31 }
32 
34 {
35  this->AddEnumTypes();
36  if (this->IsValidEnumerationValue(value))
37  {
38  this->SetValue(value);
39  }
40  else
41  {
42  this->SetValue(static_cast<IdType>(Square));
43  }
44 }
45 
47 {
48  this->AddEnum("Square", static_cast<IdType>(Square));
49  this->AddEnum("Circle", static_cast<IdType>(Circle));
50 }
51 
52 bool mitk::PlanarFigureControlPointStyleProperty::AddEnum(const std::string &name, const IdType &id)
53 {
54  return Superclass::AddEnum(name, id);
55 }
56 
58 {
60 }
61 
63 {
64  this->SetValue(static_cast<IdType>(shape));
65 }
66 
67 itk::LightObject::Pointer mitk::PlanarFigureControlPointStyleProperty::InternalClone() const
68 {
69  itk::LightObject::Pointer result(new Self(*this));
70  result->UnRegister();
71  return result;
72 }
virtual IdType GetValueAsId() const
virtual bool SetValue(const std::string &name)
bool AddEnum(const std::string &name, const IdType &id) override
virtual bool IsValidEnumerationValue(const IdType &id) const