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
mitkRenderingModeProperty.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 
20 {
21  this->AddRenderingModes();
23 }
24 
26 {
27  this->AddRenderingModes();
28  if (IsValidEnumerationValue(value))
29  {
30  this->SetValue(value);
31  }
32  else
33  MITK_WARN << "Warning: invalid image rendering mode";
34 }
35 
37 {
38  this->AddRenderingModes();
39  if (IsValidEnumerationValue(value))
40  {
41  this->SetValue(value);
42  }
43  else
44  MITK_WARN << "Invalid image rendering mode";
45 }
46 
48 {
49  return static_cast<int>(this->GetValueAsId());
50 }
51 
53 {
54  AddEnum("LookupTable_LevelWindow_Color", LOOKUPTABLE_LEVELWINDOW_COLOR);
55  AddEnum("ColorTransferFunction_LevelWindow_Color", COLORTRANSFERFUNCTION_LEVELWINDOW_COLOR);
56  AddEnum("LookupTable_Color", LOOKUPTABLE_COLOR);
57  AddEnum("ColorTransferFunction_Color", COLORTRANSFERFUNCTION_COLOR);
58 }
59 
60 bool mitk::RenderingModeProperty::AddEnum(const std::string &name, const IdType &id)
61 {
62  return Superclass::AddEnum(name, id);
63 }
64 
65 itk::LightObject::Pointer mitk::RenderingModeProperty::InternalClone() const
66 {
67  itk::LightObject::Pointer result(new Self(*this));
68  result->UnRegister();
69  return result;
70 }
virtual bool SetValue(const std::string &name)
itk::SmartPointer< Self > Pointer
#define MITK_WARN
Definition: mitkLogMacros.h:23
virtual bool AddEnum(const std::string &name, const IdType &id) override