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

📄 tin2view.cpp

📁 tin的生成,速度非常快.TIN10000point只用1分36秒
💻 CPP
字号:
// tin2View.cpp : implementation of the CTin2View class
//

#include "stdafx.h"
#include "tin2.h"

#include "tin2Doc.h"
#include "tin2View.h"

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

/////////////////////////////////////////////////////////////////////////////
// CTin2View

IMPLEMENT_DYNCREATE(CTin2View, CView)

BEGIN_MESSAGE_MAP(CTin2View, CView)
	//{{AFX_MSG_MAP(CTin2View)
	ON_COMMAND(ID_CreatePoint, OnCreatePoint)
	ON_COMMAND(ID_drawPoint, OndrawPoint)
	ON_COMMAND(ID_createTin, OncreateTin)
	ON_COMMAND(ID_drawTin, OndrawTin)
	//}}AFX_MSG_MAP
	// Standard printing commands
	ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CTin2View construction/destruction

CTin2View::CTin2View()
{
	// TODO: add construction code here
	point=false;
 ok=false;

}

CTin2View::~CTin2View()
{
}

BOOL CTin2View::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CTin2View drawing

void CTin2View::OnDraw(CDC* pDC)
{
	CTin2Doc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	// TODO: add draw code for native data here
	if(point==true)
	{
		tin.drawPoint(pDC);
	}

	if(ok==true)
	{
		tin.draw(pDC);
	}
}

/////////////////////////////////////////////////////////////////////////////
// CTin2View printing

BOOL CTin2View::OnPreparePrinting(CPrintInfo* pInfo)
{
	// default preparation
	return DoPreparePrinting(pInfo);
}

void CTin2View::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add extra initialization before printing
}

void CTin2View::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add cleanup after printing
}

/////////////////////////////////////////////////////////////////////////////
// CTin2View diagnostics

#ifdef _DEBUG
void CTin2View::AssertValid() const
{
	CView::AssertValid();
}

void CTin2View::Dump(CDumpContext& dc) const
{
	CView::Dump(dc);
}

CTin2Doc* CTin2View::GetDocument() // non-debug version is inline
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CTin2Doc)));
	return (CTin2Doc*)m_pDocument;
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CTin2View message handlers

void CTin2View::OnCreatePoint() 
{
	// TODO: Add your command handler code here
	tin.createpoint(10000);
}

void CTin2View::OndrawPoint() 
{
	// TODO: Add your command handler code here
	CClientDC dc(this);
	point=!point;
	this->OnDraw(&dc);
	
}

void CTin2View::OncreateTin() 
{
	// TODO: Add your command handler code here
	tin.createTin();
	
}

void CTin2View::OndrawTin() 
{
	// TODO: Add your command handler code here
	CClientDC dc(this);
	ok=!ok;
	this->OnDraw(&dc);
	
}

⌨️ 快捷键说明

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