CartonRippleView.h
上传用户:sycq158
上传日期:2008-10-22
资源大小:15361k
文件大小:3k
源码类别:

游戏

开发平台:

Visual C++

  1. // CartonRippleView.h : interface of the CCartonRippleView class
  2. //
  3. /////////////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_CARTONRIPPLEVIEW_H__0F248A79_2142_4AA7_8B57_D9CF66785322__INCLUDED_)
  5. #define AFX_CARTONRIPPLEVIEW_H__0F248A79_2142_4AA7_8B57_D9CF66785322__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. #define TIMER_NUM 10 //最多有10个ripple同时发生
  10. #define LIFE_TIME 4000 //ripple的生命周期是5秒
  11. int const RIPPLE_SPEED=100; //10 piexel every second
  12. int const RIPPLE_RADIUS=50; //初始涟波半径
  13. double const HEIGHTTOHEIGHT=0.7;//涟波椭圆的a/b之比
  14. int const RIPPLE_DISTANCE=40; //涟波间距,涟波间距是变化的量
  15. #define BMP_WIDTH 800
  16. #define BMP_HEIGHT 600
  17. #include "CWaterRoutine.h"
  18. #include "DIBSectionLite.h"
  19. #include "ParameterSettingDlg.h"
  20. class CCartonRippleDoc;
  21. class CCartonRippleView : public CView
  22. {
  23. protected: // create from serialization only
  24. CCartonRippleView();
  25. DECLARE_DYNCREATE(CCartonRippleView)
  26. // Attributes
  27. public:
  28. CCartonRippleDoc* GetDocument();
  29. CDIBSectionLite m_bmpRenderSource;
  30. CDIBSectionLite m_bmpRenderTarget;
  31. CWaterRoutine m_myWater;
  32. int m_iMouseClickedRadius;
  33. int m_iMouseClickedHeight;
  34. int m_iMouseMoveRadius;
  35. int m_iMouseMoveHeight;
  36. int m_iRainFrequency;
  37. // int m_iDampFraction;
  38. int m_iRefreshFrequency;
  39. CParameterSettingDlg *m_pParameterDlg;
  40. void ResetRainEffect();
  41. void ResetRefreshFrequency();
  42. // Operations
  43. public:
  44. // Overrides
  45. // ClassWizard generated virtual function overrides
  46. //{{AFX_VIRTUAL(CCartonRippleView)
  47. public:
  48. virtual void OnDraw(CDC* pDC);  // overridden to draw this view
  49. virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  50. virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
  51. protected:
  52. virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
  53. virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
  54. virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
  55. //}}AFX_VIRTUAL
  56. // Implementation
  57. public:
  58. void DrawRipple(int ID);
  59. virtual ~CCartonRippleView();
  60. #ifdef _DEBUG
  61. virtual void AssertValid() const;
  62. virtual void Dump(CDumpContext& dc) const;
  63. #endif
  64. protected:
  65. // Generated message map functions
  66. protected:
  67. //{{AFX_MSG(CCartonRippleView)
  68. afx_msg void OnTimer(UINT nIDEvent);
  69. afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  70. afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  71. afx_msg void OnLoadFile();
  72. afx_msg void OnRainEffect();
  73. afx_msg void OnStoneEffect();
  74. afx_msg void OnSettingParameter();
  75. //}}AFX_MSG
  76. DECLARE_MESSAGE_MAP()
  77. };
  78. #ifndef _DEBUG  // debug version in CartonRippleView.cpp
  79. inline CCartonRippleDoc* CCartonRippleView::GetDocument()
  80.    { return (CCartonRippleDoc*)m_pDocument; }
  81. #endif
  82. /////////////////////////////////////////////////////////////////////////////
  83. //{{AFX_INSERT_LOCATION}}
  84. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  85. #endif // !defined(AFX_CARTONRIPPLEVIEW_H__0F248A79_2142_4AA7_8B57_D9CF66785322__INCLUDED_)