www.pudn.com > OpenGL实现三维绘图.rar > Test1View.h


// Test1View.h : interface of the CTest1View class 
// 
///////////////////////////////////////////////////////////////////////////// 
 
#if !defined(AFX_TEST1VIEW_H__5C9CAAD1_A88D_46D3_A756_DC509BDDBE2D__INCLUDED_) 
#define AFX_TEST1VIEW_H__5C9CAAD1_A88D_46D3_A756_DC509BDDBE2D__INCLUDED_ 
 
#include "Test1Doc.h" 
#if _MSC_VER > 1000 
#pragma once 
#endif // _MSC_VER > 1000 
 
 
class CMainFrame; 
 
class CTest1View : public CView 
{ 
protected: // create from serialization only 
	CTest1View(); 
	DECLARE_DYNCREATE(CTest1View) 
	CClientDC *m_pDC; 
	int		nWithy;//确定图形围谁转0X,1Y,2Z; 
	int		m_Prox,m_Proy,m_Proz; //缩放因子 
	int		m_First,m_Second,m_Third; //数组值 
	bool	m_bDown; 
	long	m_xM,m_yM;	//记录鼠标落下时落点的横纵坐标 
	long	m_xRect, m_yRect; //当前窗口的大小 
	CPoint  m_MouseDown, m_MouseMove; 
	bool    m_bIsMove; //判断当前选中的是选择按钮还是旋转按钮 
						//true为旋转,false为选取 
	CMainFrame *m_pFr; 
	bool	m_bMoveSel; //要进行选取的标志 
	int		m_SelType; //选取方式,0为矩形,1为椭圆 
	HBITMAP m_hBmp;    //拷贝下来的位图句柄 
	int		m_Zoom;		//放大倍数 
	GLfloat m_xMove, m_yMove, m_zMove;	//画点时需要移动坐标像素数 
	bool	m_bLighting; //是否使用光照效果 
// Attributes 
public: 
	CTest1Doc* GetDocument(); 
	bool IsMouseInWndRect(CPoint point);	 
// Operations 
public: 
	bool m_bGetFileSuccess; 
	CString m_FileName; 
	GLfloat m_nMinDepth; 
	GLfloat m_nMaxDepth; 
	CRect   m_SelRect; 
// Overrides 
	// ClassWizard generated virtual function overrides 
	//{{AFX_VIRTUAL(CTest1View) 
	public: 
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view 
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs); 
	virtual void OnInitialUpdate(); 
	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 SetViewPort(int cx, int cy); 
	bool IsMouseinSelRect(CRect rect, CPoint point); 
	GLfloat GetMidZPoint(); 
	GLfloat GetMidYPoint(); 
	GLfloat GetMidXPoint(); 
	BOOL SaveBitmapToFile(HBITMAP hBitmap ,LPSTR lpFileName); 
	HBITMAP CopySelArearToBitmap(LPRECT lpRect); 
	void Draw3DRect(); 
	void DrawText(); 
	void DrawSelArea(CDC *pDC); 
	GLfloat GetMinDepth(); 
	GLfloat GetMaxDepth(); 
	static UINT ReadFile(LPVOID lp); 
	void ZeroArray(); 
	void ResortData(); 
	void PutPoint(); 
	void DrawLines(); 
	void IniOpenGL(); 
	bool bSetPixelFormat(); 
	bool GetFileData(CString filename); 
	virtual ~CTest1View(); 
#ifdef _DEBUG 
	virtual void AssertValid() const; 
	virtual void Dump(CDumpContext& dc) const; 
#endif 
 
protected: 
 
// Generated message map functions 
protected: 
	//{{AFX_MSG(CTest1View) 
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); 
	afx_msg void OnDestroy(); 
	afx_msg void OnSize(UINT nType, int cx, int cy); 
	afx_msg void OnTurnx(); 
	afx_msg void OnTurny(); 
	afx_msg void OnTurnz(); 
	afx_msg BOOL OnEraseBkgnd(CDC* pDC); 
	afx_msg void OnResume(); 
	afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt); 
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point); 
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point); 
	afx_msg void OnMouseMove(UINT nFlags, CPoint point); 
	afx_msg void OnContextMenu(CWnd* pWnd, CPoint point); 
	afx_msg void OnKillFocus(CWnd* pNewWnd); 
	//}}AFX_MSG 
	DECLARE_MESSAGE_MAP() 
}; 
 
#ifndef _DEBUG  // debug version in Test1View.cpp 
inline CTest1Doc* CTest1View::GetDocument() 
   { return (CTest1Doc*)m_pDocument; } 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
 
//{{AFX_INSERT_LOCATION}} 
// Microsoft Visual C++ will insert additional declarations immediately before the previous line. 
 
#endif // !defined(AFX_TEST1VIEW_H__5C9CAAD1_A88D_46D3_A756_DC509BDDBE2D__INCLUDED_)