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 DETECTORPRESENTER_H_ 00024 #define DETECTORPRESENTER_H_ 00025 00026 #include <feature/Detector.h> 00027 #include <gui/ParameterWidget.h> 00028 #include <QtGui/QWidget> 00029 #include <QtCore/QObject> 00030 00031 #include <iostream> 00032 00033 class DetectorPresenter: public QObject{ 00034 public: 00035 DetectorPresenter(Detector* detector, ParameterWidget* detectorParameter): 00036 m_detector(detector), 00037 m_detectorParameter(detectorParameter) 00038 { } 00039 00040 virtual inline void activate() 00041 {if(m_detectorParameter){m_detectorParameter->activate();}} 00042 virtual inline void deactivate() 00043 {if(m_detectorParameter) m_detectorParameter->deactivate();} 00044 00045 virtual void setDetector(Detector* detector) = 0; 00046 00047 virtual void setDetectorParameter(ParameterWidget* detectorParameter) = 0; 00048 00049 inline const Detector* getDetector() const 00050 {return m_detector;} 00051 00052 inline const ParameterWidget* getDetectorParameter() const 00053 {return m_detectorParameter;} 00054 00055 inline Detector* getDetector() 00056 {return m_detector;} 00057 00058 inline ParameterWidget* getDetectorParameter() 00059 {return m_detectorParameter;} 00060 00061 00062 protected: 00063 virtual void syncronize() = 0; 00064 virtual void reconnect() = 0; 00065 00066 Detector* m_detector; 00067 ParameterWidget* m_detectorParameter; 00068 }; 00069 00070 #endif