SpikeStream Application Library  0.2
NetworkDisplay.h
Go to the documentation of this file.
00001 #ifndef NETWORKDISPLAY_H
00002 #define NETWORKDISPLAY_H
00003 
00004 //SpikeStream includes
00005 #include "ConfigLoader.h"
00006 #include "Connection.h"
00007 #include "RGBColor.h"
00008 using namespace spikestream;
00009 
00010 //Qt includes
00011 #include <QHash>
00012 #include <QList>
00013 #include <QMutex>
00014 
00015 namespace spikestream {
00016 
00019         class NetworkDisplay : public QObject {
00020                 Q_OBJECT
00021 
00022                 public:
00023                         NetworkDisplay();
00024                         ~NetworkDisplay();
00025                         void addDefaultColor(RGBColor* color);
00026                         void addHighlightNeurons(const QList<unsigned int>& neuronIDs, RGBColor* color);
00027                         void addHighlightNeurons(const QHash< unsigned int, RGBColor*>& colorMap);
00028                         void removeHighlightNeurons(const QList<unsigned int>& neuronIDs);
00029                         bool connectionGroupVisible(unsigned int connGrpID);
00030                         unsigned int getConnectionMode() { return connectionMode; }
00031                         unsigned getConnectionQuality() { return connectionQuality; }
00032                         unsigned getConnectionThinningThreshold();
00033                         QHash<unsigned int, RGBColor*>& getNeuronColorMap() { return *neuronColorMap; }
00034                         RGBColor* getDefaultNeuronColor() { return &defaultNeuronColor; }
00035                         RGBColor* getDefaultNeuronColorFullRender() { return &defaultNeuronColorFullRender; }
00036                         RGBColor* getArchiveFiringNeuronColor() { return &archiveFiringNeuronColor; }
00037                         RGBColor* getSimulationFiringNeuronColor() { return &simulationFiringNeuronColor; }
00038                         RGBColor* getHighlightNeuronColor() { return &highlightNeuronColor; }
00039                         float getMinimumConnectionRadius() { return minimumConnectionRadius; }
00040                         RGBColor& getSingleNeuronColor() { return singleNeuronColor; }
00041                         RGBColor& getToNeuronColor() { return toNeuronColor; }
00042                         RGBColor* getNegativeConnectionColor(){ return &negativeConnectionColor; }
00043                         float getNeuronTransparency() { return neuronTransparency; }
00044                         RGBColor* getPositiveConnectionColor(){ return &positiveConnectionColor; }
00045                         unsigned getSphereQuality() { return sphereQuality; }
00046                         float getSphereRadius() { return sphereRadius; }
00047                         float getVertexSize() { return vertexSize; }
00048                         QList<unsigned int> getVisibleConnectionGroupIDs() { return connGrpDisplayMap.keys(); }
00049                         QList<Connection*>& getVisibleConnectionsList() { return visibleConnectionsList; }
00050                         QList<unsigned int> getVisibleNeuronGroupIDs() { return neurGrpDisplayMap.keys(); }
00051                         float getWeightRadiusFactor() { return weightRadiusFactor; }
00052                         unsigned getWeightRenderMode() { return weightRenderMode; }
00053                         unsigned int getZoomNeuronGroupID() { return zoomNeuronGroupID; }
00054                         int getZoomStatus () { return zoomStatus; }
00055                         bool isFullRenderMode() { return fullRenderMode; }
00056                         bool isDrawAxes() { return drawAxes; }
00057                         bool isZoomEnabled();
00058                         void loadDisplaySettings(ConfigLoader* configLoader);
00059                         void lockMutex();
00060                         bool neuronGroupVisible(unsigned int neurGrpID);
00061                         void disableWeightRender();
00062                         void renderTempWeights();
00063                         void renderCurrentWeights();
00064                         void setConnectionModeFlag(unsigned int flag);
00065                         void unsetConnectionModeFlag(unsigned int flag);
00066                         void setConnectionGroupVisibility(unsigned int conGrpID, bool visible);
00067                         void setDefaultNeuronColor(RGBColor& color) { defaultNeuronColor = color; }
00068                         void setFullRenderMode(bool fullRenderMode);
00069                         void setNeuronColorMap(QHash<unsigned int, RGBColor*>* newMap);
00070                         void setNeuronGroupVisibility(unsigned int neurGrpID, bool visible);
00071                         void setNeuronTransparency(float neuronTransparency);
00072                         void setVisibleConnectionGroupIDs(const QList<unsigned int>& connGrpIDs, bool emitDisplayChangedSignal = true);
00073                         void setVisibleNeuronGroupIDs(const QList<unsigned int>& neurGrpIDs, bool emitDisplayChangedSignal = true);
00074                         void setZoom(unsigned int neurGrpID, int status);
00075                         void unlockMutex();
00076 
00077                         unsigned int getSingleNeuronID() { return singleNeuronID; }
00078                         unsigned int getToNeuronID() { return toNeuronID; }
00079                         void setSelectedNeuronID(unsigned int id, bool ctrlBtnDown=false);
00080 
00081                         void clearWeightFiltering();
00082                         void showNegativeConnections();
00083                         void showPositiveConnections();
00084 
00085                         void clearDirectionFiltering();
00086                         void showFromConnections();
00087                         void showToConnections();
00088 
00089 
00090                         //=========================  VARIABLES  =========================
00092                         static const int NO_ZOOM = 0;
00093 
00095                         static const int ZOOM_SIDE = 1;
00096 
00098                         static const int ZOOM_ABOVE = 2;
00099 
00100 
00101                 signals:
00102                         void networkDisplayChanged();
00103                         void neuronGroupDisplayChanged();
00104                         void visibleConnectionsChanged();
00105 
00106 
00107                 public slots:
00108                         void networkChanged();
00109 
00110                 private slots:
00111                         void clearZoom();
00112 
00113                 private:
00114                         //========================  VARIABLES  ========================
00116                         QMutex mutex;
00117 
00119                         QHash<unsigned int, bool> connGrpDisplayMap;
00120 
00122                         QHash<unsigned int, bool> neurGrpDisplayMap;
00123 
00125                         QHash<unsigned int, RGBColor*>* neuronColorMap;
00126 
00128                         RGBColor defaultNeuronColor;
00129 
00131                         RGBColor defaultNeuronColorFullRender;
00132 
00134                         RGBColor singleNeuronColor;
00135 
00137                         RGBColor toNeuronColor;
00138 
00140                         RGBColor positiveConnectionColor;
00141 
00143                         RGBColor negativeConnectionColor;
00144 
00146                         RGBColor archiveFiringNeuronColor;
00147 
00149                         RGBColor simulationFiringNeuronColor;
00150 
00152                         RGBColor highlightNeuronColor;
00153 
00156                         QHash<RGBColor*, bool> defaultColorMap;
00157 
00160                         unsigned int zoomNeuronGroupID;
00161 
00163                         int zoomStatus;
00164 
00167                         unsigned int connectionMode;
00168 
00170                         unsigned weightRenderMode;
00171 
00173                         unsigned int singleNeuronID;
00174 
00176                         unsigned int toNeuronID;
00177 
00179                         bool fullRenderMode;
00180 
00182                         float vertexSize;
00183 
00185                         bool drawAxes;
00186 
00188                         float sphereRadius;
00189 
00191                         unsigned sphereQuality;
00192 
00194                         float neuronTransparency;
00195 
00199                         int connectionVisibilityThreshold_fast;
00200 
00204                         int connectionVisibilityThreshold_full;
00205 
00208                         float weightRadiusFactor;
00209 
00211                         float minimumConnectionRadius;
00212 
00214                         unsigned connectionQuality;
00215 
00218                         unsigned connectionThinningThreshold_fast;
00219 
00222                         unsigned connectionThinningThreshold_full;
00223 
00226                         QList<Connection*> visibleConnectionsList;
00227 
00228 
00229                         //=========================  METHODS  =========================
00230                         void checkConnectionModeFlag(unsigned int flag);
00231                         void checkWeightRenderFlag(unsigned int flag);
00232                         void clearNeuronColorMap();
00233                         void setDefaultVisibleConnectionGroupIDs();
00234                         void setWeightRenderFlag(unsigned flag);
00235                         void unsetWeightRenderFlag(unsigned flag);
00236         };
00237 
00238 }
00239 
00240 #endif//NETWORKDISPLAY_H
00241 
 All Classes Files Functions Variables Typedefs Friends Defines