www.pudn.com > 3DSLOADER.rar > 3DSLOADERVIEW.H


// 3DSLoaderView.h : interface of the CMy3DSLoaderView class 
// 
///////////////////////////////////////////////////////////////////////////// 
 
#if !defined(AFX_MYSDOPENGLVIEW_H__75C5AAEC_37B0_4A8B_9132_9A0C663F6DDC__INCLUDED_) 
#define AFX_MYSDOPENGLVIEW_H__75C5AAEC_37B0_4A8B_9132_9A0C663F6DDC__INCLUDED_ 
 
#if _MSC_VER > 1000 
#pragma once 
#endif // _MSC_VER > 1000 
 
#include "glStructures.h"	//数据结构定义 
#include "3dsReader.h"		//C3dsReader说明文件 
#include "TriList.h"		//CTriList说明文件 
 
class CMy3DSLoaderView : public CView 
{ 
protected: // create from serialization only 
	CMy3DSLoaderView(); 
	DECLARE_DYNCREATE(CMy3DSLoaderView) 
 
// Attributes 
public: 
	CMy3DSLoaderDoc* GetDocument(); 
 
// Operations 
public: 
 
// Overrides 
	// ClassWizard generated virtual function overrides 
	//{{AFX_VIRTUAL(CMy3DSLoaderView) 
	public: 
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view 
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs); 
	protected: 
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo); 
	virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo); 
	virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo); 
	//}}AFX_VIRTUAL 
 
// Implementation 
public: 
	virtual ~CMy3DSLoaderView(); 
///////////////////////////////////////////////////////////////// 
//添加成员函数与成员变量 
	BOOL RenderScene(); 
	BOOL SetupPixelFormat(void); 
	void SetLogicalPalette(void); 
	BOOL InitializeOpenGL(CDC* pDC); 
 
	HGLRC		m_hRC;			//OpenGL绘制描述表 
	HPALETTE	m_hPalette;		//OpenGL调色板 
	CDC*	    m_pDC;			//OpenGL设备描述表 
///////////////////////////////////////////////////////////////// 
	void Init(GLvoid); 
	void Draw3ds(); 
	void DrawAxis(); 
	void SetSceneRot(int axis, int value, BOOL increment, BOOL apply); 
	void SetCamPos(int axis, int value, BOOL increment, BOOL apply); 
	BOOL OpenFile(LPCTSTR lpszPathName); 
 
	CTriList	m_triList;		 
	BOOL		m_3dsLoaded;	 
	float		camRot[3];		 
	float		camPos[3];		 
	float		sceneRot[3];	 
	float		scenePos[3];	 
	BOOL		mouserightdown;	 
	BOOL		mouseleftdown;	 
	CPoint		mouseprevpoint;  
 
#ifdef _DEBUG 
	virtual void AssertValid() const; 
	virtual void Dump(CDumpContext& dc) const; 
#endif 
 
protected: 
 
// Generated message map functions 
protected: 
	//{{AFX_MSG(CMy3DSLoaderView) 
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); 
	afx_msg void OnDestroy(); 
	afx_msg void OnSize(UINT nType, int cx, int cy); 
	afx_msg void OnTimer(UINT nIDEvent); 
	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 OnRButtonDown(UINT nFlags, CPoint point); 
	afx_msg void OnRButtonUp(UINT nFlags, CPoint point); 
	//}}AFX_MSG 
	DECLARE_MESSAGE_MAP() 
}; 
 
#ifndef _DEBUG  // debug version in 3DSLoaderView.cpp 
inline CMy3DSLoaderDoc* CMy3DSLoaderView::GetDocument() 
   { return (CMy3DSLoaderDoc*)m_pDocument; } 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
 
//{{AFX_INSERT_LOCATION}} 
// Microsoft Visual C++ will insert additional declarations immediately before the previous line. 
 
#endif // !defined(AFX_MYSDOPENGLVIEW_H__75C5AAEC_37B0_4A8B_9132_9A0C663F6DDC__INCLUDED_)