Image Component Library (ICL)
DispHandle.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/DispHandle.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 <ICLUtils/CompatMacros.h>
34 #include <ICLUtils/Array2D.h>
35 #include <ICLQt/LabelHandle.h>
36 #include <ICLQt/GUIHandle.h>
37 
38 namespace icl{
39  namespace qt{
40 
41 
43 
45 
47  class DispHandle : public GUIHandle<LabelMatrix>{
48  public:
51 
54 
56  inline LabelHandle &operator()(int x,int y){ return (***this)(x,y); }
57 
59  inline const LabelHandle &operator()(int x,int y) const { return (***this)(x,y); }
60 
61 
63  inline int getWidth() const { return (***this).getWidth(); }
64 
66  inline int getHeight() const { return (***this).getHeight(); }
67 
69  inline int getDim() const { return (***this).getDim(); }
70 
72  inline void enable(){
73  for(int i=0;i<getWidth();++i){
74  for(int j=0;j<getHeight();++j){
75  (*this)(i,j).enable();
76  }
77  }
78  }
79 
81  inline void disable(){
82  for(int i=0;i<getWidth();++i){
83  for(int j=0;j<getHeight();++j){
84  (*this)(i,j).disable();
85  }
86  }
87  }
88 
89 
90  };
91 
92  } // namespace qt
93 }
94 
const LabelHandle & operator()(int x, int y) const
index access operator (const)
Definition: DispHandle.h:59
undocument this line if you encounter any issues!
Definition: Any.h:37
int getDim() const
returns the number of matrix elements w*h
Definition: DispHandle.h:69
Handle class for disp components.
Definition: DispHandle.h:47
LabelHandle & operator()(int x, int y)
index access operator
Definition: DispHandle.h:56
DispHandle(LabelMatrix *lm, GUIWidget *w)
Create a new DispHandle with given.
Definition: DispHandle.h:53
Abstract base class for Handle classes.
Definition: GUIHandle.h:40
void enable()
enables all components
Definition: DispHandle.h:72
int getHeight() const
height of the matrix (max y index is h()-1
Definition: DispHandle.h:66
Class for GUI-Label handling.
Definition: LabelHandle.h:48
Abstract class for GUI components.
Definition: GUIWidget.h:52
DispHandle()
create an empty handle
Definition: DispHandle.h:50
Simple 2D-Array class that provides shallow copy per default.
Definition: Array2D.h:61
void disable()
disables all components
Definition: DispHandle.h:81
utils::Array2D< LabelHandle > LabelMatrix
Type definition for handling GUI-"disp" components.
Definition: DispHandle.h:44
int getWidth() const
width of the matrix (max x index is w()-1
Definition: DispHandle.h:63