00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef GCU_GL_VIEW_H
00026 #define GCU_GL_VIEW_H
00027
00028 #include "macros.h"
00029 #include "matrix.h"
00030 #include <gtk/gtkwidget.h>
00031 #include <libgnomeprint/gnome-print.h>
00032
00033 extern double DefaultPsi, DefaultTheta, DefaultPhi;
00034
00035 namespace gcu {
00036
00037 class GLDocument;
00038
00039 class GLView
00040 {
00041 public:
00043
00048 GLView (GLDocument* pDoc);
00050
00053 virtual ~GLView ();
00054
00055 GtkWidget *GetWidget () {return m_pWidget;}
00059 void Init ();
00063 void Reshape ();
00067 void Draw ();
00074 bool OnPressed (GdkEventButton *event);
00081 void OnMotion (GdkEventMotion *event);
00086 void Update ();
00087 void SetRotation (double psi, double theta, double phi);
00088 void Print (GnomePrintContext *pc, gdouble width, gdouble height);
00089
00090 private:
00097 void Rotate (gdouble x, gdouble y);
00098
00099 protected:
00100 GtkWidget *m_pWidget;
00101 unsigned m_nGLList;
00102
00103 private:
00104 bool m_bInit;
00105 GLDocument *m_pDoc;
00106 Matrix m_Euler;
00107 double m_Radius, m_Height, m_Width, m_Near, m_Far;
00108 double m_Lastx, m_Lasty;
00109
00110
00111 GCU_PROP (double, Angle)
00112 GCU_PROP (double, Psi)
00113 GCU_PROP (double, Phi)
00114 GCU_PROP (double, Theta)
00115 GCU_PROP (float, Red)
00116 GCU_PROP (float, Green)
00117 GCU_PROP (float, Blue)
00118 GCU_PROP (float, Alpha)
00119 };
00120
00121 }
00122
00123 #endif // GCU_GL_VIEW_H