Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
mitkVtkRepresentationProperty.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 #include <vtkProperty.h>
15 
17 {
19  SetValue(static_cast<IdType>(VTK_SURFACE));
20 }
21 
23 {
25  if (IsValidEnumerationValue(value))
26  {
27  SetValue(value);
28  }
29  else
30  {
31  SetValue(static_cast<IdType>(VTK_SURFACE));
32  }
33 }
34 
36 {
38  if (IsValidEnumerationValue(value))
39  {
40  SetValue(value);
41  }
42  else
43  {
44  SetValue(static_cast<IdType>(VTK_SURFACE));
45  }
46 }
47 
49 {
50  return static_cast<int>(GetValueAsId());
51 }
52 
54 {
55  SetValue(static_cast<IdType>(VTK_POINTS));
56 }
57 
59 {
60  SetValue(static_cast<IdType>(VTK_WIREFRAME));
61 }
62 
64 {
65  SetValue(static_cast<IdType>(VTK_SURFACE));
66 }
67 
69 {
70  AddEnum("Points", static_cast<IdType>(VTK_POINTS));
71  AddEnum("Wireframe", static_cast<IdType>(VTK_WIREFRAME));
72  AddEnum("Surface", static_cast<IdType>(VTK_SURFACE));
73 }
74 
75 bool mitk::VtkRepresentationProperty::AddEnum(const std::string &name, const IdType &id)
76 {
77  return Superclass::AddEnum(name, id);
78 }
79 
80 itk::LightObject::Pointer mitk::VtkRepresentationProperty::InternalClone() const
81 {
82  itk::LightObject::Pointer result(new Self(*this));
83  result->UnRegister();
84  return result;
85 }
virtual IdType GetValueAsId() const
virtual bool SetValue(const std::string &name)
virtual bool AddEnum(const std::string &name, const IdType &id)
bool AddEnum(const std::string &name, const IdType &id) override
virtual bool IsValidEnumerationValue(const IdType &id) const