Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

SpikeGraph.cpp

Go to the documentation of this file.
00001 // SpikeGraph.cpp: implementation of the SpikeGraph class.
00002 //
00004 
00005 #include "SpikeGraph.h"
00006 
00008 // Construction/Destruction
00010 
00011 SpikeGraph::SpikeGraph(int nNeurons, int bufferSize):bufferSize(bufferSize),nNeurons(nNeurons){
00012    data=new bool*[nNeurons];
00013    for(int i=0;i<nNeurons;i++){
00014       data[i]=new bool[bufferSize];
00015    }
00016    dataSize=0;
00017    index=0;
00018 }
00019 
00020 SpikeGraph::~SpikeGraph(){
00021    for(int i=0;i<nNeurons;i++){
00022       delete[] data[i];
00023    }
00024    delete[] data;
00025 }
00026 
00027 void SpikeGraph::draw(wxDC* outdc, int x0, int y0, int h){
00028    int i, j, x, y;
00029    outdc->SetPen(*wxBLACK_PEN);
00030    for(i=0;i<nNeurons;i++){
00031       for(j=0;j<dataSize;j++){
00032          if(getValue(i,j)){
00033             x=x0+j;
00034             y=y0+i*h;
00035             outdc->DrawLine(x,y,x,y+h);
00036          }
00037       }
00038    }
00039 }

Thyrix homepageUsers' guide

(C) Arxia 2004-2005