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/DispHandle.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 <ICLUtils/CompatMacros.h> 00034 #include <ICLUtils/Array2D.h> 00035 #include <ICLQt/LabelHandle.h> 00036 #include <ICLQt/GUIHandle.h> 00037 00038 namespace icl{ 00039 namespace qt{ 00040 00041 00043 00044 typedef utils::Array2D<LabelHandle> LabelMatrix; 00045 00047 class DispHandle : public GUIHandle<LabelMatrix>{ 00048 public: 00050 DispHandle(){} 00051 00053 DispHandle(LabelMatrix *lm, GUIWidget *w) : GUIHandle<LabelMatrix>(lm,w){} 00054 00056 inline LabelHandle &operator()(int x,int y){ return (***this)(x,y); } 00057 00059 inline const LabelHandle &operator()(int x,int y) const { return (***this)(x,y); } 00060 00061 00063 inline int getWidth() const { return (***this).getWidth(); } 00064 00066 inline int getHeight() const { return (***this).getHeight(); } 00067 00069 inline int getDim() const { return (***this).getDim(); } 00070 00072 inline void enable(){ 00073 for(int i=0;i<getWidth();++i){ 00074 for(int j=0;j<getHeight();++j){ 00075 (*this)(i,j).enable(); 00076 } 00077 } 00078 } 00079 00081 inline void disable(){ 00082 for(int i=0;i<getWidth();++i){ 00083 for(int j=0;j<getHeight();++j){ 00084 (*this)(i,j).disable(); 00085 } 00086 } 00087 } 00088 00089 00090 }; 00091 00092 } // namespace qt 00093 } 00094