Image Component Library (ICL)
|
00001 /******************************************************************** 00002 ** Image Component Library (ICL) ** 00003 ** ** 00004 ** Copyright (C) 2006-2013 CITEC, University of Bielefeld ** 00005 ** Neuroinformatics Group ** 00006 ** Website: www.iclcv.org and ** 00007 ** http://opensource.cit-ec.de/projects/icl ** 00008 ** ** 00009 ** File : ICLQt/src/ICLQt/MultiDrawHandle.h ** 00010 ** Module : ICLQt ** 00011 ** Authors: Christof Elbrechter ** 00012 ** ** 00013 ** ** 00014 ** GNU LESSER GENERAL PUBLIC LICENSE ** 00015 ** This file may be used under the terms of the GNU Lesser General ** 00016 ** Public License version 3.0 as published by the ** 00017 ** ** 00018 ** Free Software Foundation and appearing in the file LICENSE.LGPL ** 00019 ** included in the packaging of this file. Please review the ** 00020 ** following information to ensure the license requirements will ** 00021 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt ** 00022 ** ** 00023 ** The development of this software was supported by the ** 00024 ** Excellence Cluster EXC 277 Cognitive Interaction Technology. ** 00025 ** The Excellence Cluster EXC 277 is a grant of the Deutsche ** 00026 ** Forschungsgemeinschaft (DFG) in the context of the German ** 00027 ** Excellence Initiative. ** 00028 ** ** 00029 ********************************************************************/ 00030 00031 #pragma once 00032 00033 #include <ICLQt/GUIHandle.h> 00034 #include <QTabBar> 00035 #include <vector> 00036 #include <map> 00037 #include <QtCore/QObject> 00038 00039 namespace icl{ 00040 00042 namespace core{ class ImgBase; } 00045 namespace qt{ 00046 00048 class ICLDrawWidget; 00051 00052 class MultiDrawHandle : public QObject, public GUIHandle<ICLDrawWidget>{ 00053 Q_OBJECT 00054 00055 public: 00056 00058 ICLQt_API MultiDrawHandle(); 00059 00061 ICLQt_API MultiDrawHandle(ICLDrawWidget *w, QTabBar *t, std::vector<core::ImgBase*> *imageBuffer, bool bufferAll, bool bufferDeeply, GUIWidget *guiw); 00062 00064 ICLQt_API MultiDrawHandle(const MultiDrawHandle &other); 00065 00066 ICLQt_API ~MultiDrawHandle(); 00067 00068 class Assigner{ 00069 public: 00070 MultiDrawHandle *d; 00071 int idx; 00072 00073 ICLQt_API void setImage(const core::ImgBase *image); 00074 void operator=(const core::ImgBase *image){ setImage(image); } 00075 void operator=(const core::ImgBase &image){ setImage(&image); } 00076 }; 00077 00078 ICLQt_API Assigner operator[](int idx); 00079 ICLQt_API Assigner operator[](const std::string &name); 00080 00082 ICLQt_API void render(); 00083 ICLQt_API int getSelectedIndex(); 00084 ICLQt_API int getNumTabs(); 00085 ICLQt_API std::string getSelected(); 00086 ICLQt_API bool isSelected(const std::string &text); 00087 00088 public slots: 00089 ICLQt_API void tabChanged(int idx); 00090 00091 00092 private: 00093 00094 std::vector<core::ImgBase*> *m_imageBuffer; 00095 QTabBar *m_tabBar; 00096 std::map<std::string,int> m_map; 00097 bool m_bufferAll; 00098 bool m_bufferDeeply; 00099 }; 00100 00101 } // namespace qt 00102 } 00103