Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkVtkScalarModeProperty.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 <vtkAbstractMapper.h>
19 
21 {
24 }
25 
27 {
28  AddInterpolationTypes();
29  if (IsValidEnumerationValue(value))
30  {
31  SetValue(value);
32  }
33  else
34  {
35  SetScalarModeToDefault();
36  }
37 }
38 
40 {
41  AddInterpolationTypes();
42  if (IsValidEnumerationValue(value))
43  {
44  SetValue(value);
45  }
46  else
47  {
48  SetScalarModeToDefault();
49  }
50 }
51 
53 {
54  return static_cast<int>(GetValueAsId());
55 }
56 
58 {
59  SetValue(static_cast<IdType>(VTK_SCALAR_MODE_DEFAULT));
60 }
61 
63 {
64  SetValue(static_cast<IdType>(VTK_SCALAR_MODE_USE_POINT_DATA));
65 }
66 
68 {
69  SetValue(static_cast<IdType>(VTK_SCALAR_MODE_USE_CELL_DATA));
70 }
71 
73 {
74  SetValue(static_cast<IdType>(VTK_SCALAR_MODE_USE_POINT_FIELD_DATA));
75 }
76 
78 {
79  SetValue(static_cast<IdType>(VTK_SCALAR_MODE_USE_CELL_FIELD_DATA));
80 }
81 
83 {
84  AddEnum("Default", static_cast<IdType>(VTK_SCALAR_MODE_DEFAULT));
85  AddEnum("PointData", static_cast<IdType>(VTK_SCALAR_MODE_USE_POINT_DATA));
86  AddEnum("CellData", static_cast<IdType>(VTK_SCALAR_MODE_USE_CELL_DATA));
87  AddEnum("PointFieldData", static_cast<IdType>(VTK_SCALAR_MODE_USE_POINT_FIELD_DATA));
88  AddEnum("CellFieldData", static_cast<IdType>(VTK_SCALAR_MODE_USE_CELL_FIELD_DATA));
89 }
90 
91 bool mitk::VtkScalarModeProperty::AddEnum(const std::string &name, const IdType &id)
92 {
93  return Superclass::AddEnum(name, id);
94 }
95 
96 itk::LightObject::Pointer mitk::VtkScalarModeProperty::InternalClone() const
97 {
98  itk::LightObject::Pointer result(new Self(*this));
99  result->UnRegister();
100  return result;
101 }
itk::SmartPointer< Self > Pointer
virtual bool AddEnum(const std::string &name, const IdType &id) override