Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
Medical Imaging Interaction Toolkit
mitkPointSetShapeProperty.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 
16 {
17  this->AddPointSetShapes();
18  this->SetValue(CROSS);
19 }
20 
22 {
23  this->AddPointSetShapes();
24  if (IsValidEnumerationValue(value))
25  {
26  this->SetValue(value);
27  }
28  else
29  MITK_WARN << "Warning: invalid point set shape";
30 }
31 
33 {
34  this->AddPointSetShapes();
35  if (IsValidEnumerationValue(value))
36  {
37  this->SetValue(value);
38  }
39  else
40  MITK_WARN << "Invalid point set shape";
41 }
42 
44 {
45  return static_cast<int>(this->GetValueAsId());
46 }
47 
49 {
50  AddEnum("None", NONE);
51  AddEnum("Vertex", VERTEX);
52  AddEnum("Dash", DASH);
53  AddEnum("Cross", CROSS);
54  AddEnum("ThickCross", THICK_CROSS);
55  AddEnum("Triangle", TRIANGLE);
56  AddEnum("Square", SQUARE);
57  AddEnum("Circle", CIRCLE);
58  AddEnum("Diamond", DIAMOND);
59  AddEnum("Arrow", ARROW);
60  AddEnum("ThickArrow", THICK_ARROW);
61  AddEnum("HookedArrow", HOOKED_ARROW);
62 }
63 
64 bool mitk::PointSetShapeProperty::AddEnum(const std::string &name, const IdType &id)
65 {
66  return Superclass::AddEnum(name, id);
67 }
68 
69 itk::LightObject::Pointer mitk::PointSetShapeProperty::InternalClone() const
70 {
71  itk::LightObject::Pointer result(new Self(*this));
72  result->UnRegister();
73  return result;
74 }
virtual IdType GetValueAsId() const
virtual bool SetValue(const std::string &name)
virtual bool AddEnum(const std::string &name, const IdType &id)
#define MITK_WARN
Definition: mitkLogMacros.h:19
bool AddEnum(const std::string &name, const IdType &id) override
virtual bool IsValidEnumerationValue(const IdType &id) const