Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
mitkVtkInterpolationProperty.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_GOURAUD));
24 }
25 
27 {
28  AddInterpolationTypes();
29  if (IsValidEnumerationValue(value))
30  {
31  SetValue(value);
32  }
33  else
34  {
35  SetValue(static_cast<IdType>(VTK_GOURAUD));
36  }
37 }
38 
40 {
41  AddInterpolationTypes();
42  if (IsValidEnumerationValue(value))
43  {
44  SetValue(value);
45  }
46  else
47  {
48  SetValue(static_cast<IdType>(VTK_GOURAUD));
49  }
50 }
51 
53 {
54  return static_cast<int>(GetValueAsId());
55 }
56 
58 {
59  SetValue(static_cast<IdType>(VTK_FLAT));
60 }
61 
63 {
64  SetValue(static_cast<IdType>(VTK_GOURAUD));
65 }
66 
68 {
69  SetValue(static_cast<IdType>(VTK_PHONG));
70 }
71 
73 {
74  AddEnum("Flat", static_cast<IdType>(VTK_FLAT));
75  AddEnum("Gouraud", static_cast<IdType>(VTK_GOURAUD));
76  AddEnum("Phong", static_cast<IdType>(VTK_PHONG));
77 }
78 
79 bool mitk::VtkInterpolationProperty::AddEnum(const std::string &name, const IdType &id)
80 {
81  return Superclass::AddEnum(name, id);
82 }
83 
84 itk::LightObject::Pointer mitk::VtkInterpolationProperty::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