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 #ifndef MITKTRANFERFUNCTIONPROPERTY_H_HEADER_INCLUDED 00020 #define MITKTRANFERFUNCTIONPROPERTY_H_HEADER_INCLUDED 00021 00022 #include "mitkBaseProperty.h" 00023 #include "mitkTransferFunction.h" 00024 00025 00026 namespace mitk { 00027 00028 class MITK_CORE_EXPORT TransferFunctionProperty : public BaseProperty 00029 { 00030 public: 00031 mitkClassMacro(TransferFunctionProperty, BaseProperty); 00032 00033 itkNewMacro(TransferFunctionProperty); 00034 mitkNewMacro1Param(TransferFunctionProperty, mitk::TransferFunction::Pointer); 00035 00036 itkSetMacro(Value, mitk::TransferFunction::Pointer ); 00037 itkGetConstMacro(Value, mitk::TransferFunction::Pointer ); 00038 00042 virtual bool operator==(const BaseProperty& property) const { 00043 00044 const Self *other = dynamic_cast<const Self*>(&property); 00045 00046 if(other==NULL) 00047 return false; 00048 else 00049 return *(m_Value.GetPointer()) == *(other->m_Value.GetPointer()); 00050 } 00051 00055 std::string GetValueAsString() const { 00056 std::stringstream myStr; 00057 myStr << GetValue() ; 00058 return myStr.str(); 00059 } 00060 00061 protected: 00062 mitk::TransferFunction::Pointer m_Value; 00063 00064 TransferFunctionProperty() 00065 : BaseProperty() 00066 {}; 00067 00068 virtual ~TransferFunctionProperty() 00069 { 00070 }; 00071 00072 TransferFunctionProperty( mitk::TransferFunction::Pointer value ) 00073 : BaseProperty(), m_Value( value ) 00074 {}; 00075 }; 00076 00077 00078 // typedef GenericProperty<mitk::TransferFunction::Pointer> TransferFunctionProperty; 00079 } // namespace mitk 00080 00081 #endif /* MITKTRANFERFUNCTIONPROPERTY_H_HEADER_INCLUDED */