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 FEATURESETMATCHERPRESENTER_H_ 00024 #define FEATURESETMATCHERPRESENTER_H_ 00025 00026 #include <feature/AbstractFeatureSetMatcher.h> 00027 #include <QtGui/QWidget> 00028 #include <QtCore/QObject> 00029 #include <gui/ParameterWidget.h> 00030 00031 class FeatureSetMatcherPresenter: public QObject{ 00032 Q_OBJECT 00033 00034 public: 00035 FeatureSetMatcherPresenter(AbstractFeatureSetMatcher* featureSetMatcher, ParameterWidget* featureSetMatcherParameter); 00036 00037 inline virtual void activate() 00038 {if(m_featureSetMatcherParameter) m_featureSetMatcherParameter->activate();} 00039 inline virtual void deactivate() 00040 {if(m_featureSetMatcherParameter) m_featureSetMatcherParameter->deactivate();} 00041 00042 virtual void setFeatureSetMatcher(AbstractFeatureSetMatcher* featureSetMatcher) = 0; 00043 00044 virtual void setFeatureSetMatcherParameter(ParameterWidget* peakParameter) = 0; 00045 00046 00047 inline const AbstractFeatureSetMatcher* getFeatureSetMatcher() const 00048 {return m_featureSetMatcher;} 00049 inline const ParameterWidget* getFeatureSetMatcherParameter() const 00050 {return m_featureSetMatcherParameter;} 00051 00052 inline AbstractFeatureSetMatcher* getFeatureSetMatcher() 00053 {return m_featureSetMatcher;} 00054 inline ParameterWidget* getFeatureSetMatcherParameter() 00055 {return m_featureSetMatcherParameter;} 00056 00057 signals: 00058 void featureSetMatcherChanged(); 00059 00060 public slots: 00061 void changeParameter(const QString& name); 00062 void changeAcceptanceThreshold(double value); 00063 00064 protected: 00065 virtual void syncronize(); 00066 virtual void reconnect(); 00067 00068 AbstractFeatureSetMatcher* m_featureSetMatcher; 00069 ParameterWidget* m_featureSetMatcherParameter; 00070 }; 00071 00072 #endif