Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkVtkResliceInterpolationProperty.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 {
22  this->AddInterpolationTypes();
23  this->SetValue(static_cast<IdType>(VTK_RESLICE_NEAREST));
24 }
25 
27 {
28  this->AddInterpolationTypes();
29  if (IsValidEnumerationValue(value))
30  {
31  this->SetValue(value);
32  }
33  else
34  {
35  this->SetValue(static_cast<IdType>(VTK_RESLICE_NEAREST));
36  }
37 }
38 
40 {
41  this->AddInterpolationTypes();
42  if (IsValidEnumerationValue(value))
43  {
44  this->SetValue(value);
45  }
46  else
47  {
48  this->SetValue(static_cast<IdType>(VTK_RESLICE_NEAREST));
49  }
50 }
51 
53 {
54  return static_cast<int>(this->GetValueAsId());
55 }
56 
58 {
59  this->SetValue(static_cast<IdType>(VTK_RESLICE_NEAREST));
60 }
61 
63 {
64  this->SetValue(static_cast<IdType>(VTK_RESLICE_LINEAR));
65 }
66 
68 {
69  this->SetValue(static_cast<IdType>(VTK_RESLICE_CUBIC));
70 }
71 
73 {
74  AddEnum("Nearest", static_cast<IdType>(VTK_RESLICE_NEAREST));
75  AddEnum("Linear", static_cast<IdType>(VTK_RESLICE_LINEAR));
76  AddEnum("Cubic", static_cast<IdType>(VTK_RESLICE_CUBIC));
77 }
78 
79 bool mitk::VtkResliceInterpolationProperty::AddEnum(const std::string &name, const IdType &id)
80 {
81  return Superclass::AddEnum(name, id);
82 }
83 
84 itk::LightObject::Pointer mitk::VtkResliceInterpolationProperty::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