CartonRippleView.h
上传用户:sycq158
上传日期:2008-10-22
资源大小:15361k
文件大小:3k
- // CartonRippleView.h : interface of the CCartonRippleView class
- //
- /////////////////////////////////////////////////////////////////////////////
- #if !defined(AFX_CARTONRIPPLEVIEW_H__0F248A79_2142_4AA7_8B57_D9CF66785322__INCLUDED_)
- #define AFX_CARTONRIPPLEVIEW_H__0F248A79_2142_4AA7_8B57_D9CF66785322__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #define TIMER_NUM 10 //最多有10个ripple同时发生
- #define LIFE_TIME 4000 //ripple的生命周期是5秒
- int const RIPPLE_SPEED=100; //10 piexel every second
- int const RIPPLE_RADIUS=50; //初始涟波半径
- double const HEIGHTTOHEIGHT=0.7;//涟波椭圆的a/b之比
- int const RIPPLE_DISTANCE=40; //涟波间距,涟波间距是变化的量
- #define BMP_WIDTH 800
- #define BMP_HEIGHT 600
- #include "CWaterRoutine.h"
- #include "DIBSectionLite.h"
- #include "ParameterSettingDlg.h"
- class CCartonRippleDoc;
- class CCartonRippleView : public CView
- {
- protected: // create from serialization only
- CCartonRippleView();
- DECLARE_DYNCREATE(CCartonRippleView)
- // Attributes
- public:
- CCartonRippleDoc* GetDocument();
- CDIBSectionLite m_bmpRenderSource;
- CDIBSectionLite m_bmpRenderTarget;
- CWaterRoutine m_myWater;
- int m_iMouseClickedRadius;
- int m_iMouseClickedHeight;
- int m_iMouseMoveRadius;
- int m_iMouseMoveHeight;
- int m_iRainFrequency;
- // int m_iDampFraction;
- int m_iRefreshFrequency;
- CParameterSettingDlg *m_pParameterDlg;
- void ResetRainEffect();
- void ResetRefreshFrequency();
- // Operations
- public:
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CCartonRippleView)
- public:
- virtual void OnDraw(CDC* pDC); // overridden to draw this view
- virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
- virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
- protected:
- virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
- virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
- virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
- //}}AFX_VIRTUAL
- // Implementation
- public:
- void DrawRipple(int ID);
- virtual ~CCartonRippleView();
- #ifdef _DEBUG
- virtual void AssertValid() const;
- virtual void Dump(CDumpContext& dc) const;
- #endif
- protected:
- // Generated message map functions
- protected:
- //{{AFX_MSG(CCartonRippleView)
- afx_msg void OnTimer(UINT nIDEvent);
- afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
- afx_msg void OnMouseMove(UINT nFlags, CPoint point);
- afx_msg void OnLoadFile();
- afx_msg void OnRainEffect();
- afx_msg void OnStoneEffect();
- afx_msg void OnSettingParameter();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- };
- #ifndef _DEBUG // debug version in CartonRippleView.cpp
- inline CCartonRippleDoc* CCartonRippleView::GetDocument()
- { return (CCartonRippleDoc*)m_pDocument; }
- #endif
- /////////////////////////////////////////////////////////////////////////////
- //{{AFX_INSERT_LOCATION}}
- // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
- #endif // !defined(AFX_CARTONRIPPLEVIEW_H__0F248A79_2142_4AA7_8B57_D9CF66785322__INCLUDED_)