www.pudn.com > Map_OpenGL.rar > Map_OpenGLDoc.cpp


// Map_OpenGLDoc.cpp : implementation of the CMap_OpenGLDoc class 
// 
 
#include "stdafx.h" 
#include "Map_OpenGL.h" 
#include "Map_Tool.h" 
#include "Map_OpenGLDoc.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
// CMap_OpenGLDoc 
 
IMPLEMENT_DYNCREATE(CMap_OpenGLDoc, CDocument) 
 
BEGIN_MESSAGE_MAP(CMap_OpenGLDoc, CDocument) 
	//{{AFX_MSG_MAP(CMap_OpenGLDoc) 
		// 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() 
 
///////////////////////////////////////////////////////////////////////////// 
// CMap_OpenGLDoc construction/destruction 
 
CMap_OpenGLDoc::CMap_OpenGLDoc() 
{ 
	// TODO: add one-time construction code here 
	mouse_x=mouse_y=0; 
 
} 
 
CMap_OpenGLDoc::~CMap_OpenGLDoc() 
{ 
} 
 
BOOL CMap_OpenGLDoc::OnNewDocument() 
{ 
	if (!CDocument::OnNewDocument()) 
		return FALSE; 
 
	// TODO: add reinitialization code here 
	// (SDI documents will reuse this document) 
 
	return TRUE; 
} 
 
 
 
///////////////////////////////////////////////////////////////////////////// 
// CMap_OpenGLDoc serialization 
 
void CMap_OpenGLDoc::Serialize(CArchive& ar) 
{ 
	if (ar.IsStoring()) 
	{ 
		// TODO: add storing code here 
	} 
	else 
	{ 
		// TODO: add loading code here 
	} 
} 
 
///////////////////////////////////////////////////////////////////////////// 
// CMap_OpenGLDoc diagnostics 
 
#ifdef _DEBUG 
void CMap_OpenGLDoc::AssertValid() const 
{ 
	CDocument::AssertValid(); 
} 
 
void CMap_OpenGLDoc::Dump(CDumpContext& dc) const 
{ 
	CDocument::Dump(dc); 
} 
#endif //_DEBUG 
 
///////////////////////////////////////////////////////////////////////////// 
// CMap_OpenGLDoc commands 
 
BOOL CMap_OpenGLDoc::OnOpenDocument(LPCTSTR lpszPathName)  
{ 
	if (!CDocument::OnOpenDocument(lpszPathName)) 
		return FALSE; 
	 
	// TODO: Add your specialized creation code here 
 
	if(CMap_Tool::map_select==Map_binarydem) 
	{ 
		m_binarydem.ReadBinaryFile(lpszPathName); 
		m_binarydem.m_demColorLevels=3; 
	} 
	 
	if(CMap_Tool::map_select==Map_texttin) 
	{ 
		m_tindate.ReadFile(lpszPathName); 
		m_tindate.m_demColorLevels=3; 
	} 
 
	return TRUE; 
}