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