00001 /***************************************************************** 00002 * 00003 * This file is part of the FLIRTLib project 00004 * 00005 * FLIRTLib Copyright (c) 2010 Gian Diego Tipaldi and Kai O. Arras 00006 * 00007 * This software is licensed under the "Creative Commons 00008 * License (Attribution-NonCommercial-ShareAlike 3.0)" 00009 * and is copyrighted by Gian Diego Tipaldi and Kai O. Arras 00010 * 00011 * Further information on this license can be found at: 00012 * http://creativecommons.org/licenses/by-nc-sa/3.0/ 00013 * 00014 * FLIRTLib is distributed in the hope that it will be useful, 00015 * but WITHOUT ANY WARRANTY; without even the implied 00016 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00017 * PURPOSE. 00018 * 00019 *****************************************************************/ 00020 00021 00022 00023 #ifndef DESCRIPTORPRESENTER_H_ 00024 #define DESCRIPTORPRESENTER_H_ 00025 00026 #include <feature/Descriptor.h> 00027 #include <QtGui/QWidget> 00028 #include <QtCore/QObject> 00029 #include <gui/ParameterWidget.h> 00030 00031 class DescriptorPresenter: public QObject{ 00032 public: 00033 DescriptorPresenter(DescriptorGenerator* descriptor, ParameterWidget* peakParameter): 00034 m_descriptor(descriptor), 00035 m_descriptorParameter(peakParameter) 00036 { } 00037 00038 inline void activate() 00039 {if(m_descriptorParameter) m_descriptorParameter->activate();} 00040 inline void deactivate() 00041 {if(m_descriptorParameter) m_descriptorParameter->deactivate();} 00042 00043 virtual void setDescriptor(DescriptorGenerator* descriptor) = 0; 00044 00045 virtual void setDescriptorParameter(ParameterWidget* peakParameter) = 0; 00046 00047 inline const DescriptorGenerator* getDescriptor() const 00048 {return m_descriptor;} 00049 00050 inline const ParameterWidget* getDescriptorParameter() const 00051 {return m_descriptorParameter;} 00052 00053 inline DescriptorGenerator* getDescriptor() 00054 {return m_descriptor;} 00055 00056 inline ParameterWidget* getDescriptorParameter() 00057 {return m_descriptorParameter;} 00058 00059 protected: 00060 DescriptorGenerator* m_descriptor; 00061 ParameterWidget* m_descriptorParameter; 00062 }; 00063 00064 #endif