// MorphingDlg.h : header file
//

#if !defined(AFX_MORPHINGDLG_H__47FDAD39_C106_4EDC_A765_205B2CEEAA68__INCLUDED_)
#define AFX_MORPHINGDLG_H__47FDAD39_C106_4EDC_A765_205B2CEEAA68__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#define		DEFAULT_WIDTH	480
#define		DEFAULT_HEIGHT	260

/////////////////////////////////////////////////////////////////////////////
// CMorphingDlg dialog

#include "MeshWarp.h"
#include "FieldWarp.h"
#include "IMG.h"
#include "IMGList.h"
#include "MorphPlayDlg.h"

class CMorphingDlg : public CDialog
{
// Construction
public:
	bool m_bStartPoint;
	int m_nSelected;
	bool m_bMouseClick;
	int m_nNumLine;
	int m_nMode;
	void DrawMeshMorphPoint(CDC *pSrcDC, CDC *pDestDC);
	void DrawFieldMorphLine(CDC *pSrcDC, CDC *pDestDC);
	void SetWindowSize(int width, int height);
	void Draw(CDC *dc, CIMG *src, int x, int y);
	void DeallocateMeshPoint();
	void DeallocateFieldLine();
	void AllocateMeshPoint();
	void AllocateFieldLine();
	CMorphingDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	//{{AFX_DATA(CMorphingDlg)
	enum { IDD = IDD_MORPHING_DIALOG };
	CProgressCtrl	m_ctlProgress;
	CString	m_strStep;
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CMorphingDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CMorphingDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnConvert();
	afx_msg void OnDestroy();
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	afx_msg void OnOpen();
	afx_msg void OnRadioMesh();
	afx_msg void OnRadioField();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
private:
	BOOL			m_bOpened;
	CIMG			*m_pSrcIMG;
	CIMG			*m_pDestIMG;
	MESHPOINT		*m_pSrcMeshPoint;
	MESHPOINT		*m_pDestMeshPoint;
	FIELDLINE		*m_pSrcFieldLine;
	FIELDLINE		*m_pDestFieldLine;
	int				m_nMeshWidth;
	int				m_nMeshHeight;
	int				m_nMorphStep;
	POINT			m_srcPoint;
	POINT			m_destPoint;
	POINT			m_mouseMesh;
	CEdit			m_editBox;
	CMeshWarp		*m_pMeshWarp;
	CFieldWarp		*m_pFieldWarp;
	// for Double buffering
	CDC				*m_pSrcBackDC;
	CDC				*m_pDestBackDC;
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_MORPHINGDLG_H__47FDAD39_C106_4EDC_A765_205B2CEEAA68__INCLUDED_)
