⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 read3dsdoc.cpp

📁 这是书上的代码
💻 CPP
字号:
//********************************************
// Read3DSDoc.cpp
//********************************************
// The active document, contain a SceneGraph
//********************************************
// Created : 05/17/1999
// Modified: 10/26/1999
//********************************************


#include "stdafx.h"
#include "math.h"
#include "Read3DS.h"
#include "MainFrm.h"

#include "Read3DSDoc.h"
//#include "Camera.h"

//#include "Output3ds.h"
#include "3dsload.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
BOOL g_IsOpen3DSFile=FALSE;
/////////////////////////////////////////////////////////////////////////////
// CRead3DSDoc
IMPLEMENT_DYNCREATE(CRead3DSDoc, CDocument)

BEGIN_MESSAGE_MAP(CRead3DSDoc, CDocument)
	//{{AFX_MSG_MAP(CRead3DSDoc)
		// NOTE - the ClassWizard will add and remove mapping macros here.
		//    DO NOT EDIT what you see in these blocks of generated code!
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CRead3DSDoc construction/destruction

//********************************************
// Constructor
//********************************************
CRead3DSDoc::CRead3DSDoc()
{
}

//********************************************
// Destructor
//********************************************
CRead3DSDoc::~CRead3DSDoc()
{
	
}

/////////////////////////////////////////////////////////////////////////////
// CRead3DSDoc serialization

void CRead3DSDoc::Serialize(CArchive& ar)
{
	if (ar.IsStoring())
	{
		// TODO: add storing code here
	}
	else
	{
		// TODO: add loading code here
	}
}

/////////////////////////////////////////////////////////////////////////////
// CRead3DSDoc diagnostics

#ifdef _DEBUG
void CRead3DSDoc::AssertValid() const
{
	CDocument::AssertValid();
}

void CRead3DSDoc::Dump(CDumpContext& dc) const
{
	CDocument::Dump(dc);
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CRead3DSDoc commands
void CRead3DSDoc::OnCloseDocument() 
{
	CDocument::OnCloseDocument();
}


BOOL CRead3DSDoc::OnOpenDocument(LPCTSTR lpszPathName) 
{
//	int flip,PolygonWinding,threshold,strip,center;

	if (!CDocument::OnOpenDocument(lpszPathName))
		return FALSE;
//	threshold=0;
//	strip=0;
//	flip=0;
//	PolygonWinding=0;
//	center=0;

//	OutGLInitialize((char*)lpszPathName,threshold,strip,center);
	::SetCursor(::LoadCursor(NULL,IDC_WAIT));
	if((m_Real3DS=Load3DSObject((char*)lpszPathName))==NULL){
		char buf[256];
		sprintf(buf,"Can't parse %s!",lpszPathName);
		AfxMessageBox(buf);
	}
	g_IsOpen3DSFile=TRUE;
	::SetCursor(::LoadCursor(NULL,IDC_ARROW));
	
//	if(flip)
/*		OutGLFlipNormals()*/;
//	if(PolygonWinding)
/*OutGLReverseWinding()*/;
	
//	CameraReset();

	return TRUE;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -