SpikeStream Application Library  0.2
NeuronGroupModel.h
Go to the documentation of this file.
00001 #ifndef NEURONGROUPMODEL_H
00002 #define NEURONGROUPMODEL_H
00003 
00004 //SpikeStream includes
00005 #include "NeuronGroupInfo.h"
00006 using namespace spikestream;
00007 
00008 //Qt includes
00009 #include <QAbstractTableModel>
00010 #include <QStringList>
00011 
00012 namespace spikestream {
00013 
00016     class NeuronGroupModel : public QAbstractTableModel {
00017                 Q_OBJECT
00018 
00019                 public:
00020                         NeuronGroupModel();
00021                         ~NeuronGroupModel();
00022                         void clearSelection();
00023                         int columnCount(const QModelIndex& parent = QModelIndex()) const;
00024                         QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
00025                         NeuronGroupInfo getInfo(const QModelIndex& index) const;
00026                         QHash<QString, double> getParameters(int row);
00027                         QList<unsigned int> getSelectedNeuronGroupIDs();
00028                         QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
00029                         void reload();
00030                         int rowCount(const QModelIndex& parent = QModelIndex()) const;
00031                         void selectAllOrNone();
00032                         void showAllOrNone();
00033                         bool setData(const QModelIndex& index, const QVariant& value, int role=Qt::EditRole);
00034 
00035                         friend class NeuronGroupTableView;
00036 
00037                 private slots:
00038                         void loadNeuronGroups();
00039                         void networkDisplayChanged();
00040 
00041                 private:
00042                         //====================  VARIABLES  ====================
00045                         QList<NeuronGroupInfo> neurGrpInfoList;
00046 
00048                         QList<unsigned> neurGrpSizeList;
00049 
00051                         QHash<unsigned int, bool> selectionMap;
00052 
00053                         static const int NUM_COLS = 9;
00054                         static const int VIS_COL = 0;
00055                         static const int ZOOM_COL = 1;
00056                         static const int ID_COL = 2;
00057                         static const int NAME_COL = 3;
00058                         static const int DESC_COL = 4;
00059                         static const int SIZE_COL = 5;
00060                         static const int NEUR_TYPE_COL = 6;
00061                         static const int SELECT_COL = 7;
00062                         static const int PARAM_COL = 8;
00063                 };
00064 
00065 }
00066 
00067 #endif//NEURONGROUPMODEL_H
00068 
 All Classes Files Functions Variables Typedefs Friends Defines