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

📄 bsampledoc.cpp

📁 附件程序是一个B样条程序的图形文件
💻 CPP
字号:
// BSampleDoc.cpp : implementation of the CBSampleDoc class
//

#include "stdafx.h"
#include "BSample.h"

#include "BSampleDoc.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CBSampleDoc

IMPLEMENT_DYNCREATE(CBSampleDoc, CDocument)

BEGIN_MESSAGE_MAP(CBSampleDoc, CDocument)
	//{{AFX_MSG_MAP(CBSampleDoc)
		// 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()

/////////////////////////////////////////////////////////////////////////////
// CBSampleDoc construction/destruction

CBSampleDoc::CBSampleDoc()
{
	// TODO: add one-time construction code here

	//XD++ Library add lines.
	m_pDataModel = new CExtDataModel;


}

CBSampleDoc::~CBSampleDoc()
{
	//XD++ Library add lines.
	if(m_pDataModel != NULL)
	{
		delete m_pDataModel;
	}

}

BOOL CBSampleDoc::OnNewDocument()
{
	if (!CDocument::OnNewDocument())
		return FALSE;

	// TODO: add reinitialization code here
	// (SDI documents will reuse this document)

	return TRUE;
}



/////////////////////////////////////////////////////////////////////////////
// CBSampleDoc serialization

void CBSampleDoc::Serialize(CArchive& ar)
{
	if (ar.IsStoring())
	{
		// TODO: add storing code here
		//XD++ Library add lines.	
		m_pDataModel->Serialize(ar);
	}
	else
	{
		// TODO: add loading code here
		//XD++ Library add lines.	
		m_pDataModel->Serialize(ar);
	}
}


//XD++ Library add lines.
void CBSampleDoc::SetTitle(LPCTSTR lpszTitle)
{
	m_pDataModel->SetDocTitle(lpszTitle);
	CDocument::SetTitle(lpszTitle);
}

void CBSampleDoc::DeleteContents() 
{
	// TODO: Add your specialized code here and/or call the base class
	m_pDataModel->ResetContent();
	CDocument::DeleteContents();
}

//added override
BOOL CBSampleDoc::OnSaveDocument(LPCTSTR lpszPathName) 
{
	if (!CDocument::OnSaveDocument(lpszPathName))
	{
		return FALSE;
	}
	m_pDataModel->SetClean();		// Tells the command history that the document is "clean" at this point
	SetModifiedFlag(FALSE);
	return TRUE;
}

//added override (optional as long as you never call this member)
void CBSampleDoc::SetModifiedFlag(BOOL b)
{
	// Do nothing
	m_pDataModel->SetModifiedFlag(b);
}

//added override
BOOL CBSampleDoc::IsModified()
{
	return m_pDataModel->IsModified();
}

BOOL CBSampleDoc::OnOpenDocument(LPCTSTR lpszPathName) 
{
	if(!CDocument::OnOpenDocument(lpszPathName))
	{
		return FALSE;
	}
	return TRUE;
}

/////////////////////////////////////////////////////////////////////////////
// CBSampleDoc diagnostics

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

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

/////////////////////////////////////////////////////////////////////////////
// CBSampleDoc commands

⌨️ 快捷键说明

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