Medical Imaging Interaction Toolkit  2018.4.99-1bab67a2
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 (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 <vtkAbstractMapper.h>
15 
17 {
20 }
21 
23 {
25  if (IsValidEnumerationValue(value))
26  {
27  SetValue(value);
28  }
29  else
30  {
32  }
33 }
34 
36 {
38  if (IsValidEnumerationValue(value))
39  {
40  SetValue(value);
41  }
42  else
43  {
45  }
46 }
47 
49 {
50  return static_cast<int>(GetValueAsId());
51 }
52 
54 {
55  SetValue(static_cast<IdType>(VTK_SCALAR_MODE_DEFAULT));
56 }
57 
59 {
60  SetValue(static_cast<IdType>(VTK_SCALAR_MODE_USE_POINT_DATA));
61 }
62 
64 {
65  SetValue(static_cast<IdType>(VTK_SCALAR_MODE_USE_CELL_DATA));
66 }
67 
69 {
70  SetValue(static_cast<IdType>(VTK_SCALAR_MODE_USE_POINT_FIELD_DATA));
71 }
72 
74 {
75  SetValue(static_cast<IdType>(VTK_SCALAR_MODE_USE_CELL_FIELD_DATA));
76 }
77 
79 {
80  AddEnum("Default", static_cast<IdType>(VTK_SCALAR_MODE_DEFAULT));
81  AddEnum("PointData", static_cast<IdType>(VTK_SCALAR_MODE_USE_POINT_DATA));
82  AddEnum("CellData", static_cast<IdType>(VTK_SCALAR_MODE_USE_CELL_DATA));
83  AddEnum("PointFieldData", static_cast<IdType>(VTK_SCALAR_MODE_USE_POINT_FIELD_DATA));
84  AddEnum("CellFieldData", static_cast<IdType>(VTK_SCALAR_MODE_USE_CELL_FIELD_DATA));
85 }
86 
87 bool mitk::VtkScalarModeProperty::AddEnum(const std::string &name, const IdType &id)
88 {
89  return Superclass::AddEnum(name, id);
90 }
91 
92 itk::LightObject::Pointer mitk::VtkScalarModeProperty::InternalClone() const
93 {
94  itk::LightObject::Pointer result(new Self(*this));
95  result->UnRegister();
96  return result;
97 }
virtual IdType GetValueAsId() const
virtual bool SetValue(const std::string &name)
bool AddEnum(const std::string &name, const IdType &id) override
virtual bool AddEnum(const std::string &name, const IdType &id)
virtual bool IsValidEnumerationValue(const IdType &id) const