00001 /*========================================================================= 00002 00003 Program: Medical Imaging & Interaction Toolkit 00004 Language: C++ 00005 Date: $Date$ 00006 Version: $Revision$ 00007 00008 Copyright (c) German Cancer Research Center, Division of Medical and 00009 Biological Informatics. All rights reserved. 00010 See MITKCopyright.txt or https://www.mitk.org/copyright.html for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 00018 00019 #include "mitkLevelWindowProperty.h" 00020 00021 00022 mitk::LevelWindowProperty::LevelWindowProperty() 00023 { 00024 } 00025 00026 mitk::LevelWindowProperty::LevelWindowProperty(const mitk::LevelWindow &levWin) 00027 { 00028 SetLevelWindow(levWin); 00029 } 00030 00031 mitk::LevelWindowProperty::~LevelWindowProperty() 00032 { 00033 } 00034 00035 bool mitk::LevelWindowProperty::operator==(const BaseProperty& property) const 00036 { 00037 const Self *other = dynamic_cast<const Self*>(&property); 00038 00039 if(other==NULL) return false; 00040 00041 return other->m_LevWin==m_LevWin; 00042 } 00043 00044 const mitk::LevelWindow & mitk::LevelWindowProperty::GetLevelWindow() const 00045 { 00046 return m_LevWin; 00047 } 00048 00049 void mitk::LevelWindowProperty::SetLevelWindow(const mitk::LevelWindow &levWin) 00050 { 00051 if(m_LevWin != levWin) 00052 { 00053 m_LevWin = levWin; 00054 Modified(); 00055 } 00056 } 00057 00058 std::string mitk::LevelWindowProperty::GetValueAsString() const 00059 { 00060 std::stringstream myStr; 00061 myStr << "L:" << m_LevWin.GetLevel() << " W:" << m_LevWin.GetWindow(); 00062 return myStr.str(); 00063 }