Medical Imaging Interaction Toolkit
2018.4.99-389bf124
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
13
#include "
mitkPointSetShapeProperty.h
"
14
15
mitk::PointSetShapeProperty::PointSetShapeProperty
()
16
{
17
this->
AddPointSetShapes
();
18
this->
SetValue
(
CROSS
);
19
}
20
21
mitk::PointSetShapeProperty::PointSetShapeProperty
(
const
IdType
&value)
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
32
mitk::PointSetShapeProperty::PointSetShapeProperty
(
const
std::string &value)
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
43
int
mitk::PointSetShapeProperty::GetPointSetShape
()
const
44
{
45
return
static_cast<
int
>
(this->
GetValueAsId
());
46
}
47
48
void
mitk::PointSetShapeProperty::AddPointSetShapes
()
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
}
mitk::EnumerationProperty::GetValueAsId
virtual IdType GetValueAsId() const
Definition:
mitkEnumerationProperty.cpp:69
mitk::EnumerationProperty::SetValue
virtual bool SetValue(const std::string &name)
Definition:
mitkEnumerationProperty.cpp:43
mitk::PointSetShapeProperty::Self
PointSetShapeProperty Self
Definition:
mitkPointSetShapeProperty.h:47
mitk::PointSetShapeProperty::CROSS
Definition:
mitkPointSetShapeProperty.h:62
mitk::PointSetShapeProperty::VERTEX
Definition:
mitkPointSetShapeProperty.h:60
mitk::EnumerationProperty::IdType
unsigned int IdType
Definition:
mitkEnumerationProperty.h:48
mitk::PointSetShapeProperty::SQUARE
Definition:
mitkPointSetShapeProperty.h:65
mitk::PointSetShapeProperty::HOOKED_ARROW
Definition:
mitkPointSetShapeProperty.h:70
mitk::PointSetShapeProperty::THICK_CROSS
Definition:
mitkPointSetShapeProperty.h:63
mitk::PointSetShapeProperty::DIAMOND
Definition:
mitkPointSetShapeProperty.h:67
mitk::EnumerationProperty::AddEnum
virtual bool AddEnum(const std::string &name, const IdType &id)
Definition:
mitkEnumerationProperty.cpp:29
mitk::PointSetShapeProperty::DASH
Definition:
mitkPointSetShapeProperty.h:61
mitk::PointSetShapeProperty::ARROW
Definition:
mitkPointSetShapeProperty.h:68
MITK_WARN
#define MITK_WARN
Definition:
mitkLogMacros.h:19
mitk::PointSetShapeProperty::AddEnum
bool AddEnum(const std::string &name, const IdType &id) override
Definition:
mitkPointSetShapeProperty.cpp:64
mitkPointSetShapeProperty.h
mitk::PointSetShapeProperty::AddPointSetShapes
virtual void AddPointSetShapes()
Definition:
mitkPointSetShapeProperty.cpp:48
mitk::PointSetShapeProperty::GetPointSetShape
virtual int GetPointSetShape() const
Definition:
mitkPointSetShapeProperty.cpp:43
mitk::PointSetShapeProperty::THICK_ARROW
Definition:
mitkPointSetShapeProperty.h:69
mitk::PointSetShapeProperty::NONE
Definition:
mitkPointSetShapeProperty.h:59
mitk::PointSetShapeProperty::TRIANGLE
Definition:
mitkPointSetShapeProperty.h:64
mitk::PointSetShapeProperty::PointSetShapeProperty
PointSetShapeProperty()
Definition:
mitkPointSetShapeProperty.cpp:15
mitk::PointSetShapeProperty::CIRCLE
Definition:
mitkPointSetShapeProperty.h:66
mitk::EnumerationProperty::IsValidEnumerationValue
virtual bool IsValidEnumerationValue(const IdType &id) const
Definition:
mitkEnumerationProperty.cpp:138
Source
Modules
Core
src
DataManagement
mitkPointSetShapeProperty.cpp
Generated on Thu Mar 12 2020 10:24:01 for Medical Imaging Interaction Toolkit by
1.8.13