Image Component Library (ICL)
MultiDrawHandle.h
Go to the documentation of this file.
1 /********************************************************************
2 ** Image Component Library (ICL) **
3 ** **
4 ** Copyright (C) 2006-2013 CITEC, University of Bielefeld **
5 ** Neuroinformatics Group **
6 ** Website: www.iclcv.org and **
7 ** http://opensource.cit-ec.de/projects/icl **
8 ** **
9 ** File : ICLQt/src/ICLQt/MultiDrawHandle.h **
10 ** Module : ICLQt **
11 ** Authors: Christof Elbrechter **
12 ** **
13 ** **
14 ** GNU LESSER GENERAL PUBLIC LICENSE **
15 ** This file may be used under the terms of the GNU Lesser General **
16 ** Public License version 3.0 as published by the **
17 ** **
18 ** Free Software Foundation and appearing in the file LICENSE.LGPL **
19 ** included in the packaging of this file. Please review the **
20 ** following information to ensure the license requirements will **
21 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt **
22 ** **
23 ** The development of this software was supported by the **
24 ** Excellence Cluster EXC 277 Cognitive Interaction Technology. **
25 ** The Excellence Cluster EXC 277 is a grant of the Deutsche **
26 ** Forschungsgemeinschaft (DFG) in the context of the German **
27 ** Excellence Initiative. **
28 ** **
29 ********************************************************************/
30 
31 #pragma once
32 
33 #include <ICLQt/GUIHandle.h>
34 #include <QTabBar>
35 #include <vector>
36 #include <map>
37 #include <QtCore/QObject>
38 
39 namespace icl{
40 
42  namespace core{ class ImgBase; }
45  namespace qt{
46 
48  class ICLDrawWidget;
51  class MultiDrawHandle : public QObject, public GUIHandle<ICLDrawWidget>{
53  Q_OBJECT
54 
55  public:
56 
59 
61  ICLQt_API MultiDrawHandle(ICLDrawWidget *w, QTabBar *t, std::vector<core::ImgBase*> *imageBuffer, bool bufferAll, bool bufferDeeply, GUIWidget *guiw);
62 
65 
67 
68  class Assigner{
69  public:
71  int idx;
72 
73  ICLQt_API void setImage(const core::ImgBase *image);
74  void operator=(const core::ImgBase *image){ setImage(image); }
75  void operator=(const core::ImgBase &image){ setImage(&image); }
76  };
77 
78  ICLQt_API Assigner operator[](int idx);
79  ICLQt_API Assigner operator[](const std::string &name);
80 
82  ICLQt_API void render();
84  ICLQt_API int getNumTabs();
85  ICLQt_API std::string getSelected();
86  ICLQt_API bool isSelected(const std::string &text);
87 
88  public Q_SLOTS:
89  ICLQt_API void tabChanged(int idx);
90 
91 
92  private:
93 
94  std::vector<core::ImgBase*> *m_imageBuffer;
95  QTabBar *m_tabBar;
96  std::map<std::string,int> m_map;
99  };
100 
101  } // namespace qt
102 }
103 
ICLQt_API Assigner operator[](int idx)
undocument this line if you encounter any issues!
Definition: Any.h:37
ICLQt_API int getSelectedIndex()
std::map< std::string, int > m_map
Definition: MultiDrawHandle.h:96
ICLQt_API void text(ImgQ &image, int x, int y, const string &text)
renders a text into an image (only available with Qt-Support)
void operator=(const core::ImgBase *image)
Definition: MultiDrawHandle.h:74
ICLQt_API void render()
calles updated internally
bool m_bufferDeeply
Definition: MultiDrawHandle.h:98
ICLQt_API int getNumTabs()
MultiDrawHandle * d
Definition: MultiDrawHandle.h:70
ICLQt_API MultiDrawHandle()
Create an empty draw handle.
std::vector< core::ImgBase * > * m_imageBuffer
Definition: MultiDrawHandle.h:94
ICLQt_API std::string getSelected()
ICLQt_API ~MultiDrawHandle()
void operator=(const core::ImgBase &image)
Definition: MultiDrawHandle.h:75
ICLQt_API void setImage(const core::ImgBase *image)
#define ICLQt_API
Definition: CompatMacros.h:178
Definition: MultiDrawHandle.h:68
ICLQt_API void tabChanged(int idx)
QTabBar * m_tabBar
Definition: MultiDrawHandle.h:95
bool m_bufferAll
Definition: MultiDrawHandle.h:97
Handle class for image components.
Definition: MultiDrawHandle.h:52
ImgBase is the Image-Interface class that provides save access to underlying Img-template .
Definition: ImgBase.h:131
ICLQt_API bool isSelected(const std::string &text)
int idx
Definition: MultiDrawHandle.h:71