debug/src/channelcolors.h

00001 /***************************************************************************
00002                           channelcolors.h  -  description
00003                              -------------------
00004     begin                : Tue Sep 16 2004
00005     copyright            : (C) 2003 by Lynn Hazan
00006     email                : lynn.hazan@myrealbox.com
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef CHANNELCOLORS_H
00019 #define CHANNELCOLORS_H
00020 
00021 // include files for Qt
00022 #include <qptrlist.h>
00023 #include <qcolor.h>
00024 #include <qvaluelist.h>
00025 
00033 class ChannelColors  {
00034 
00035 public:
00036 
00037   ChannelColors();
00038   virtual ~ChannelColors();
00039   ChannelColors(const ChannelColors& channelcolors);
00040 
00041 private:
00042 
00044   struct ChannelColor{
00045     int channelId;
00046     QColor color;
00047     QColor groupColor;
00048     QColor spikeGroupColor;
00049 
00050     ChannelColor(int id,QColor c,QColor gc,QColor gdc){
00051       channelId = id;
00052       color = c;
00053       groupColor = gc;
00054       spikeGroupColor = gdc;
00055     }
00056     ChannelColor(const ChannelColor& origin):channelId(origin.channelId),
00057     color(origin.color),groupColor(origin.groupColor),spikeGroupColor(origin.spikeGroupColor){};
00058     ~ChannelColor(){};
00059   };
00060 
00062   QPtrList<ChannelColor> channelList;
00063 
00069   virtual ChannelColor* channelColor(int channelId) const;
00070 
00076   virtual int channelColorIndex(int channelId) const;
00077 
00078 public:
00079 
00083   inline void removeAll(){channelList.clear();};
00084   
00090   virtual QColor color(int identifier);
00091 
00097   virtual QColor groupColor(int identifier);
00098 
00104   virtual QColor spikeGroupColor(int identifier);
00105 
00111   virtual void setColor(int identifier,QColor color);
00112 
00118   virtual void setGroupColor(int identifier,QColor color);
00119 
00125   virtual void setSpikeGroupColor(int identifier,QColor color);
00126 
00132   virtual int channelId(int index);
00133 
00139   virtual bool contains(int channelId);
00140 
00145   virtual inline uint numberOfChannels() const {return channelList.count();};
00146 
00155   virtual uint append(int channelId, QColor color,QColor groupColor,QColor spikeGroupColor);
00156 
00164   virtual uint append(int channelId, QColor color);
00165 
00174   virtual void insert(int channelId,int index,QColor color,QColor groupColor,QColor spikeGroupColor);
00175 
00176 
00182   virtual bool remove(int identifier);
00183 
00184 };
00185 
00186 #endif

Generated on Mon Sep 17 20:47:30 2007 for NeuroScope by  doxygen 1.5.1