Medical Imaging Interaction Toolkit  2016.11.0
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,
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 #include <vtkProperty.h>
19 
21 {
23  SetValue(static_cast<IdType>(VTK_SURFACE));
24 }
25 
27 {
28  AddRepresentationTypes();
29  if (IsValidEnumerationValue(value))
30  {
31  SetValue(value);
32  }
33  else
34  {
35  SetValue(static_cast<IdType>(VTK_SURFACE));
36  }
37 }
38 
40 {
41  AddRepresentationTypes();
42  if (IsValidEnumerationValue(value))
43  {
44  SetValue(value);
45  }
46  else
47  {
48  SetValue(static_cast<IdType>(VTK_SURFACE));
49  }
50 }
51 
53 {
54  return static_cast<int>(GetValueAsId());
55 }
56 
58 {
59  SetValue(static_cast<IdType>(VTK_POINTS));
60 }
61 
63 {
64  SetValue(static_cast<IdType>(VTK_WIREFRAME));
65 }
66 
68 {
69  SetValue(static_cast<IdType>(VTK_SURFACE));
70 }
71 
73 {
74  AddEnum("Points", static_cast<IdType>(VTK_POINTS));
75  AddEnum("Wireframe", static_cast<IdType>(VTK_WIREFRAME));
76  AddEnum("Surface", static_cast<IdType>(VTK_SURFACE));
77 }
78 
79 bool mitk::VtkRepresentationProperty::AddEnum(const std::string &name, const IdType &id)
80 {
81  return Superclass::AddEnum(name, id);
82 }
83 
84 itk::LightObject::Pointer mitk::VtkRepresentationProperty::InternalClone() const
85 {
86  itk::LightObject::Pointer result(new Self(*this));
87  result->UnRegister();
88  return result;
89 }
virtual bool SetValue(const std::string &name)
itk::SmartPointer< Self > Pointer
virtual bool AddEnum(const std::string &name, const IdType &id) override