MatOCAD Logo

Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

Tgrafico3d.hpp

Go to the documentation of this file.
00001 //------------------------------------------------------------------------------
00002 //
00003 // Name:        Tgrafico3d.hpp
00004 // Author:      Alex Carpentieri
00005 // Created:     7/17/2004 12:11:38 AM
00006 // Copyright:
00007 //
00008 //-----------------------------------------------------------------------------
00009 
00010 
00011 
00012 
00013 #ifndef __grafico3d_
00014 #define __grafico3d_
00015 
00016 
00017 
00018 #include "opzioni3d/Opz3dDlg.h"
00019 
00020 #include "../Parser/TParserScomponi.h"
00021 #include "../Parser/TParserValore.h"
00022 #include <wx/glcanvas.h>
00023 #include <GL/gl.h>
00024 #include <GL/glu.h>
00025 #include "ListaFx3D/TLista3D.h"
00026 #include "../BasePanel/TBasePanel.h"
00027 
00028 class WxGrafico : public wxGLCanvas
00029 {
00030 
00031 public:
00032     //variabili che contengono la posizione corrente del mouse
00033     long cur_x,cur_y;
00034     //flag che indica se è stata aperta una finestra delle
00035     //opzioni oppure no
00036     char opzAperta;
00037     //lista contenente le opzioni di visualizzazione di ogni
00038     //grafico e dell'intera scena.
00039     TLista3D opzioni;
00040     WxGrafico(wxWindow *parent,
00041               const wxSize& size = wxDefaultSize,
00042               int* gl_attrib = NULL,
00043               const wxWindowID id = -1,
00044               const wxPoint& pos = wxDefaultPosition,
00045               long style = 0,
00046               const wxString& name = _T("Grafico 3d")
00047              );
00048 
00049     ~WxGrafico(void);
00050 
00051     //INIZIO funzioni e variabili OpenGL
00052 
00053 
00054 
00055     double assex;
00056     double assey;
00057     double assez;
00058 
00059     double zoom;
00060 
00061 
00062     void drawGL(void);
00063     void initGL(void);
00064     void disegna_assi();
00065     void disegna_grafico(pr *funzione_corrente);
00066     void disegna_griglia(float **punti);
00067 
00068     // FINE  funzioni e variabili OpenGL
00069 
00070 
00071     //  EVENTI a cui wxgrafico è sensibile
00072     void OnPaint(wxPaintEvent& event);
00073     void OnSize(wxSizeEvent& event);
00074     void OnChar(wxKeyEvent& event);
00075     void OnMouseEvent(wxMouseEvent& event);
00076     void GraficoLeftDown(wxMouseEvent& event);
00077     void GraficoRightDown(wxMouseEvent& event);
00078         void OnEraseBackGround(wxEraseEvent& event);
00079 
00080     void click_menu_popup_opz(wxCommandEvent&  Event);
00081 
00083 
00086     wxMenu* GetPopUp();
00087 
00088 
00089     DECLARE_EVENT_TABLE()
00090 private:
00091 
00092     wxMenu *Lista3d; //menù a comparsa
00093 
00094     char delta(long x1,long x2);
00095     void ruota_destra(double *assex,double *assey,double *assez);
00096     void ruota_sinistra(double *assex,double *assey,double *assez);
00097     void ruota_su(double *assex,double *assey,double *assez);
00098     void ruota_giu(double *assex,double *assey,double *assez);
00099 
00100 };
00101 
00102 #endif
00103 //******************************************************************************
00104 
00105 

 

SourceForge Logo