//// Version: $Id: wxmodel.h 162 2014-01-08 15:09:14Z gk $//// WxWidgets GUI for visualization and demonstration purposes///*
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/#include<wx/wx.h>#include"wx/glcanvas.h"#include<wx/thread.h>#include<wx/event.h>// externclassLANetwork;classLAApp: public wxApp
{
public:
LAWindow* window;
LANetwork* network;
virtual boolOnInit();
};
typedefmap<int, wxPoint>::iterator pt_iterator;
classLAPanel: public wxPanel
{
public:
LAPanel(wxFrame*);
LANetwork* network;
bool hasStarted ;
map<int, wxPoint> nrnpoints;
protected:
voiddrawPyrCell(wxPaintDC& dc, LANeuron* n, int x , int y);
voiddrawInCell(wxPaintDC& dc, LANeuron* n, int x , int y);
voidOnPaint(wxPaintEvent& event);
voidOnTimer(wxCommandEvent& );
voidOnClick(wxMouseEvent& );
};
classLAGLPane;classLAWindow: public wxFrame
{
public:
LAPanel* network_panel;
LAGLPane* network_glpanel;
LANetwork* network;
wxTimer* timer;
int timersRun;
LAWindow(const wxString& title, LANetwork* net);
voidOnRun(wxCommandEvent& ev);
voidOnRefresh(wxCommandEvent& ev);
voidOnQuit(wxCommandEvent& ev);
voidUpdatePanel()
{
this->network_panel->Refresh();
this->SetStatusText(wxString::Format(wxT("T=%d"), this->network->T));
this->Update();
}
protected:
voidOnTimer(wxCommandEvent& );
DECLARE_EVENT_TABLE()
};
classLAGLPane : public wxGLCanvas
{
wxGLContext* m_context;
GLUquadric* m_quadric;
public:
LANetwork* m_network;
LAGLPane(wxFrame* parent, LANetwork* net, int* args);
virtual ~LAGLPane();
voidresized(wxSizeEvent& evt);
intgetWidth();
intgetHeight();
voidrender(wxPaintEvent& evt);
voidprepare3DViewport(int topleft_x, int topleft_y, int bottomrigth_x, int bottomrigth_y);
voidprepare2DViewport(int topleft_x, int topleft_y, int bottomrigth_x, int bottomrigth_y);
voiddrawPyrNeuron( LANeuron* n);
// events//void mouseMoved(wxMouseEvent& event);//void mouseDown(wxMouseEvent& event);//void mouseWheelMoved(wxMouseEvent& event);//void mouseReleased(wxMouseEvent& event);//void rightClick(wxMouseEvent& event);//void mouseLeftWindow(wxMouseEvent& event);//void keyPressed(wxKeyEvent& event);//void keyReleased(wxKeyEvent& event);//
DECLARE_EVENT_TABLE()
};