IvfMfcView.h

00001 //
00002 // Copyright 1999-2006 by Structural Mechanics, Lund University.
00003 //
00004 // This library is free software; you can redistribute it and/or
00005 // modify it under the terms of the GNU Library General Public
00006 // License as published by the Free Software Foundation; either
00007 // version 2 of the License, or (at your option) any later version.
00008 //
00009 // This library is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 // Library General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU Library General Public
00015 // License along with this library; if not, write to the Free Software
00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00017 // USA.
00018 //
00019 // Please report all bugs and problems to "ivf@byggmek.lth.se".
00020 //
00021 //
00022 // Written by Jonas Lindemann
00023 //
00024 
00025 #ifndef _CIvfMfcView_h_
00026 #define _CIvfMfcView_h_
00027 
00028 #include <afxwin.h>
00029 
00030 #include <ivfwidget/IvfWidgetBase.h>
00031 
00040 class CIvfMfcView : public CWnd, public CIvfWidgetBase {
00041 private:
00042     HDC                         m_hDC;          
00043     HGLRC                       m_hRC;          
00044 
00045         LARGE_INTEGER   m_countsPerSec;
00046         double                  m_elapsedTime;
00047         double                  m_zeroTime;
00048 
00049         int                             m_size[2];
00050         int                             m_pos[2];
00051         int                             m_colorBits;
00052 
00053         int                             m_mousePos[2];
00054 
00055         bool                    m_initDone;
00056 
00057         double largeToDouble(LARGE_INTEGER &value);
00058 public:
00060         CIvfMfcView();
00061 
00062         BOOL SetPixelformat(HDC hdc);
00063     virtual BOOL PreCreateWindow( CREATESTRUCT& cs );
00064 
00065         virtual void doInit(int width, int height);
00066         virtual void doDestroy();
00067         virtual void doRedraw();
00068         virtual void doEnableTimeout(float time, int nbr);
00069         virtual void doDisableTimeout(int nbr);
00070         virtual void doDisableIdleProcessing();
00071         virtual void doEnableIdleProcessing();
00072         virtual double doElapsedTime();
00073         virtual void doSetPosition(int x, int y);
00074         virtual void doSetSize(int w, int h);
00075 
00076 protected:
00077     afx_msg void OnPaint();
00078     afx_msg int  OnCreate(LPCREATESTRUCT lpCreateStruct);
00079     afx_msg void OnSize(UINT nType, int cx, int cy );
00080     afx_msg BOOL OnEraseBkgnd( CDC* pDC );
00081         afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
00082         afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);    
00083         afx_msg void OnSysKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
00084         afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
00085         afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
00086         afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
00087         afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
00088         afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
00089         afx_msg void OnMouseMove(UINT nFlags, CPoint point);
00090         afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
00091         afx_msg void OnClose();
00092         afx_msg void OnDestroy();
00093         afx_msg void OnTimer(UINT nIDEvent);
00094 
00095         DECLARE_MESSAGE_MAP()
00096 };
00101 #endif

Generated on Fri Sep 1 15:36:47 2006 for Interactive Visualisation Framework - Ivf++ by  doxygen 1.4.6-NO