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