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.GPL ** 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/AbstractPlotWidget.h> 00034 00035 namespace icl{ 00036 namespace qt{ 00037 00038 00040 00199 00202 00208 00212 00224 00238 00245 class LowLevelPlotWidget : public virtual AbstractPlotWidget{ 00246 class Data; 00247 Data *data; 00248 00249 class DrawState; 00250 protected: 00251 00253 virtual void drawLegend(QPainter &p,const utils::Rect &where, bool horizontal); 00254 00256 virtual bool drawSeriesData(QPainter &p, const DrawState &state); 00257 00259 virtual bool drawScatterData(QPainter &p, const DrawState &state); 00260 00262 virtual bool drawBarPlotData(QPainter &p, const DrawState &state); 00263 00265 virtual bool drawData(QPainter &p); 00266 00268 virtual utils::Range32f estimateDataXRange() const; 00269 00271 virtual utils::Range32f estimateDataYRange() const; 00272 00273 public: 00274 00276 LowLevelPlotWidget(QWidget *parent=0); 00277 00279 ~LowLevelPlotWidget(); 00280 00282 00283 virtual utils::Rect32f getDataViewPort() const; 00284 00286 00298 void addSeriesData(const float *data, int len, 00299 const AbstractPlotWidget::PenPtr &style = new AbstractPlotWidget::Pen(QColor(255,0,0)), 00300 const std::string &name="", int stride=1, bool deepCopy=true, bool passOwnerShip=false); 00301 00302 00304 00307 void addBarPlotData(const float *data, int len, 00308 const AbstractPlotWidget::PenPtr &style = new AbstractPlotWidget::Pen(QColor(255,0,0)), 00309 const std::string &name="", int stride=1, bool deepCopy=true, bool passOwnerShip=false); 00310 00312 00333 void addScatterData(char symbol, const float *xs, const float *ys, int num, 00334 const std::string &name = "", 00335 int r=255, int g=0, int b=0, int size=5, bool connectingLine=false, 00336 int xStride=1, int yStride=1, bool filled = false, 00337 bool deepCopyData=true, bool passDataOwnerShip=false); 00338 00340 void clearScatterData(); 00341 00343 void clearSeriesData(); 00344 00346 void clearBarPlotData(); 00347 00349 void clear(); 00350 00351 00352 00353 00354 }; 00355 } // namespace qt 00356 } 00357