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/LowLevelPlotWidget.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 <ICLQt/AbstractPlotWidget.h> 00035 00036 namespace icl{ 00037 namespace qt{ 00038 00039 00041 00200 00203 00209 00213 00225 00239 00246 class ICLQt_API LowLevelPlotWidget : public virtual AbstractPlotWidget{ 00247 class Data; 00248 Data *data; 00249 00250 class DrawState; 00251 protected: 00252 00254 virtual void drawLegend(QPainter &p,const utils::Rect &where, bool horizontal); 00255 00257 virtual bool drawSeriesData(QPainter &p, const DrawState &state); 00258 00260 virtual bool drawScatterData(QPainter &p, const DrawState &state); 00261 00263 virtual bool drawBarPlotData(QPainter &p, const DrawState &state); 00264 00266 virtual bool drawData(QPainter &p); 00267 00269 virtual utils::Range32f estimateDataXRange() const; 00270 00272 virtual utils::Range32f estimateDataYRange() const; 00273 00274 public: 00275 00277 LowLevelPlotWidget(QWidget *parent=0); 00278 00280 ~LowLevelPlotWidget(); 00281 00283 00284 virtual utils::Rect32f getDataViewPort() const; 00285 00287 00299 void addSeriesData(const float *data, int len, 00300 const AbstractPlotWidget::PenPtr &style = new AbstractPlotWidget::Pen(QColor(255,0,0)), 00301 const std::string &name="", int stride=1, bool deepCopy=true, bool passOwnerShip=false); 00302 00303 00305 00308 void addBarPlotData(const float *data, int len, 00309 const AbstractPlotWidget::PenPtr &style = new AbstractPlotWidget::Pen(QColor(255,0,0)), 00310 const std::string &name="", int stride=1, bool deepCopy=true, bool passOwnerShip=false); 00311 00313 00334 void addScatterData(char symbol, const float *xs, const float *ys, int num, 00335 const std::string &name = "", 00336 int r=255, int g=0, int b=0, int size=5, bool connectingLine=false, 00337 int xStride=1, int yStride=1, bool filled = false, 00338 bool deepCopyData=true, bool passDataOwnerShip=false); 00339 00341 void clearScatterData(); 00342 00344 void clearSeriesData(); 00345 00347 void clearBarPlotData(); 00348 00350 void clear(); 00351 00352 00353 00354 00355 }; 00356 } // namespace qt 00357 } 00358