Main Page   Namespace List   Alphabetical List   Compound List   File List   Compound Members   File Members  

nviz3d.h

Go to the documentation of this file.
00001 
00002 // Name:        nviz3d.h
00003 // Purpose:     3D Visualization Header
00004 // Author:      Chad Rempp
00005 // Modified by:
00006 // Created:     06-01-03
00007 // Copyright:   (c) Chad Rempp 2003
00008 // Licence:     GNU Public License
00010 
00011 #ifndef _NVIZ3D_H_
00012 #define _NVIZ3D_H_
00013 
00014 #include "wx/wx.h"
00015 #include "wx/glcanvas.h"
00016 #include "GL/glu.h"
00017 
00018 // !!--TODO--!!
00019 // Try to get rid of these.
00020 
00021 GLfloat neuron_radius = 0.5;
00022 int neuron_stacks = 10;
00023 int neuron_slices = 10;
00024 
00025 static float last_x = 0,
00026              last_y = 0;
00027 static GLfloat camera_x = 0;
00028 static GLfloat camera_y = 0;
00029 static GLfloat camera_zoom = -6.0;
00030 static GLfloat camera_rotate = 0.0;
00031 
00032 GLfloat drag_scale_x = 0.05;
00033 GLfloat drag_scale_y = 0.05;
00034 GLfloat rotate_scale = 0.01;
00035 GLfloat zoom_scale   = 0.05;
00036 
00037 wxTextCtrl *txt_drag_scale_x;
00038 wxTextCtrl *txt_drag_scale_y;
00039 
00040 GLUquadricObj *gl_neuron_00 = gluNewQuadric();
00041 GLUquadricObj *gl_neuron_01 = gluNewQuadric();
00042 GLUquadricObj *gl_neuron_02 = gluNewQuadric();
00043 GLUquadricObj *gl_neuron_03 = gluNewQuadric();
00044 GLUquadricObj *gl_neuron_04 = gluNewQuadric();
00045 GLUquadricObj *gl_neuron_05 = gluNewQuadric();
00046 
00047 //-----------------------------------------------------------------------------
00048 //  NViz3DApp class Definition
00049 //-----------------------------------------------------------------------------
00050 class Nviz3DApp: public wxApp
00051 {
00052 public:
00053     bool OnInit(void);
00054 };
00055 
00056 //-----------------------------------------------------------------------------
00057 //  NVizFrame class Definition
00058 //-----------------------------------------------------------------------------
00059 class Nviz3DCanvas;
00060 class NvizFrame: public wxFrame
00061 {
00062 public:
00063     NvizFrame(wxFrame *frame, const wxString& title, const wxPoint& pos,
00064               const wxSize& size, long style = wxDEFAULT_FRAME_STYLE);
00065 
00066     void OnExit(wxCommandEvent& event);
00067     void OnSettings(wxCommandEvent &event);
00068     
00069 public:
00070     Nviz3DCanvas*    glc_nvizcanvas;
00071 
00072 DECLARE_EVENT_TABLE()
00073 };
00074 
00075 //-----------------------------------------------------------------------------
00076 //  NViz3DCanvas class Definition
00077 //-----------------------------------------------------------------------------
00078 class Nviz3DCanvas: public wxGLCanvas
00079 {
00080   friend class NVizFrame;
00081 public:
00082     Nviz3DCanvas(wxWindow *parent, const wxWindowID id = -1,
00083                  const wxPoint& pos = wxDefaultPosition,
00084                  const wxSize& size = wxDefaultSize,
00085                  long style = 0, const wxString& name = "TestGLCanvas");
00086     ~Nviz3DCanvas(void);
00087     void DrawNeuron(GLUquadricObj *obj, GLfloat x, GLfloat y, GLfloat z);
00088     void InitGL(void);
00089     void OnEnterWindow( wxMouseEvent& event );
00090     void OnEraseBackground(wxEraseEvent& event);
00091     void OnMouse( wxMouseEvent& event );
00092     void OnPaint(wxPaintEvent& event);
00093     void OnSize(wxSizeEvent& event);
00094     void Render( void );
00095 
00096 private:
00097     bool   m_init;
00098 
00099 DECLARE_EVENT_TABLE()
00100 };
00101 
00102 //-----------------------------------------------------------------------------
00103 //  Menu Item enum
00104 //-----------------------------------------------------------------------------
00105 enum
00106 {
00107     SETTINGS
00108 };
00109 #endif
00110 

Generated on Mon Jun 9 19:13:21 2003 for NeReK Documentation by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002