experiments/evorobot/include/holisticviewer.h

00001 /********************************************************************************
00002  *  FARSA Experiments Library                                                   *
00003  *  Copyright (C) 2007-2012                                                     *
00004  *  Stefano Nolfi <stefano.nolfi@istc.cnr.it>                                   *
00005  *  Onofrio Gigliotta <onofrio.gigliotta@istc.cnr.it>                           *
00006  *  Gianluca Massera <emmegian@yahoo.it>                                        *
00007  *  Tomassino Ferrauto <tomassino.ferrauto@istc.cnr.it>                         *
00008  *                                                                              *
00009  *  This program is free software; you can redistribute it and/or modify        *
00010  *  it under the terms of the GNU General Public License as published by        *
00011  *  the Free Software Foundation; either version 2 of the License, or           *
00012  *  (at your option) any later version.                                         *
00013  *                                                                              *
00014  *  This program is distributed in the hope that it will be useful,             *
00015  *  but WITHOUT ANY WARRANTY; without even the implied warranty of              *
00016  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               *
00017  *  GNU General Public License for more details.                                *
00018  *                                                                              *
00019  *  You should have received a copy of the GNU General Public License           *
00020  *  along with this program; if not, write to the Free Software                 *
00021  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA  *
00022  ********************************************************************************/
00023 
00024 #ifndef HOLISTICVIEWER_H
00025 #define HOLISTICVIEWER_H
00026 
00027 #include <QWidget>
00028 #include <QGridLayout>
00029 #include <QVBoxLayout>
00030 #include <QHBoxLayout>
00031 #include <QComboBox>
00032 #include <QLabel>
00033 #include <QPaintEvent>
00034 #include <QVector>
00035 #include "evonet.h"
00036 #include "evodataviewer.h"
00037 #include "evorobotexperiment.h"
00038 
00039 namespace farsa {
00040 
00041 class FARSA_EXPERIMENTS_API HolisticViewer : public QWidget
00042 {
00043     Q_OBJECT
00044 private:
00045     QVector<QLabel*> labels;
00046     Evonet* net;
00047     QGridLayout* grid;
00048     QVBoxLayout* mainLayout;
00049     QHBoxLayout* neuronChoice;
00050     QComboBox *neuronX, *neuronY;
00051     int getNeuronAct(int);
00052 protected:
00053     void paintEvent(QPaintEvent* qpe);
00054 public:
00055     HolisticViewer(Evonet*, QWidget* parent=0, Qt::WindowFlags flags=0);
00056     void updateGrid();
00057     void updatePlot();
00058 };
00059 
00060 } //end namespace farsa
00061 
00062 #endif