00001
00007 #pragma once
00008 #include "afxwin.h"
00009 #include "OpenGLDevice.h"
00010 #include "list_node.h"
00011 #include "visbsp_mfcDoc.h"
00012
00013
00014 #define COLOR_NODE_WIDTH 3
00015
00019 class COpenGLControl :
00020 public CWnd
00021 {
00022 protected:
00023 CDocument* m_pDocument;
00024
00025 list_node *pDragNode;
00026 list_node **pAnchorDrag;
00027 int draged;
00028 public:
00029 int nWidth, nHeight;
00030 list_node *pColorListe;
00031 list_node *pOpaciListe;
00032 OpenGLDevice openGLDevice;
00033 CClientDC* dc;
00034 float rotation;
00035 float barWidth;
00036
00037 void InitGL();
00038 void DrawGLScene();
00039
00040 list_node* getHittedNode( long x, list_node *pAnchor ) ;
00041 void newNode( long pos, int color, list_node **pAnchor );
00042 void delNode( list_node *pDel, list_node **pAnchor );
00043 COLORREF getColorDlg( DWORD curColor );
00044
00045
00046 COpenGLControl(Cvisbsp_mfcDoc *pDoc);
00047 ~COpenGLControl(void);
00048 void Create( CRect rect, CWnd* pParentWnd );
00049 DECLARE_MESSAGE_MAP()
00050 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00051 afx_msg void OnSize(UINT nType, int cx, int cy);
00052 afx_msg void OnPaint();
00053 afx_msg BOOL OnEraseBkgnd(CDC* pDC);
00054 afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
00055 afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
00056 afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
00057 afx_msg void OnMouseMove(UINT nFlags, CPoint point);
00058 list_node* copyList(list_node* pAnchor);
00059 afx_msg void OnDestroy();
00060 };