資源簡介
一種快速構建Delaunay三角網的算法,該算法結合逐點插入算法和分治算法,具有建網速度快,耗費空間小的優點。采用多級自適應網格劃分點集,對葉子網格內的點采用改進了的逐點插入算法生成了三角網,子三角網間利用分治算法的思想進行合并。經實踐驗證,算法復雜度與點數幾乎成線性關系。

代碼片段和文件信息
//?MainFrm.cpp?:?implementation?of?the?CMainframe?class
//
#include?“stdafx.h“
#include?“tin2.h“
#include?“MainFrm.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#undef?THIS_FILE
static?char?THIS_FILE[]?=?__FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
//?CMainframe
IMPLEMENT_DYNCREATE(CMainframe?CframeWnd)
BEGIN_MESSAGE_MAP(CMainframe?CframeWnd)
//{{AFX_MSG_MAP(CMainframe)
//?NOTE?-?the?ClassWizard?will?add?and?remove?mapping?macros?here.
//????DO?NOT?EDIT?what?you?see?in?these?blocks?of?generated?code?!
ON_WM_CREATE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
static?UINT?indicators[]?=
{
ID_SEPARATOR???????????//?status?line?indicator
ID_INDICATOR_CAPS
ID_INDICATOR_NUM
ID_INDICATOR_SCRL
};
/////////////////////////////////////////////////////////////////////////////
//?CMainframe?construction/destruction
CMainframe::CMainframe()
{
//?TODO:?add?member?initialization?code?here
}
CMainframe::~CMainframe()
{
}
int?CMainframe::OnCreate(LPCREATESTRUCT?lpCreateStruct)
{
if?(CframeWnd::OnCreate(lpCreateStruct)?==?-1)
return?-1;
if?(!m_wndToolBar.CreateEx(this?TBstyle_FLAT?WS_CHILD?|?WS_VISIBLE?|?CBRS_TOP
|?CBRS_GRIPPER?|?CBRS_TOOLTIPS?|?CBRS_FLYBY?|?CBRS_SIZE_DYNAMIC)?||
!m_wndToolBar.LoadToolBar(IDR_MAINframe))
{
TRACE0(“Failed?to?create?toolbar\n“);
return?-1;??????//?fail?to?create
}
if?(!m_wndStatusBar.Create(this)?||
!m_wndStatusBar.SetIndicators(indicators
??sizeof(indicators)/sizeof(UINT)))
{
TRACE0(“Failed?to?create?status?bar\n“);
return?-1;??????//?fail?to?create
}
//?TODO:?Delete?these?three?lines?if?you?don‘t?want?the?toolbar?to
//??be?dockable
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
return?0;
}
BOOL?CMainframe::PreCreateWindow(CREATESTRUCT&?cs)
{
if(?!CframeWnd::PreCreateWindow(cs)?)
return?FALSE;
//?TODO:?Modify?the?Window?class?or?styles?here?by?modifying
//??the?CREATESTRUCT?cs
return?TRUE;
}
/////////////////////////////////////////////////////////////////////////////
//?CMainframe?diagnostics
#ifdef?_DEBUG
void?CMainframe::AssertValid()?const
{
CframeWnd::AssertValid();
}
void?CMainframe::Dump(CDumpContext&?dc)?const
{
CframeWnd::Dump(dc);
}
#endif?//_DEBUG
/////////////////////////////////////////////////////////////////////////////
//?CMainframe?message?handlers
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????2505??2003-10-29?14:15??delauney三角網\MainFrm.cpp
?????文件???????1581??2003-10-29?14:15??delauney三角網\MainFrm.h
?????文件???????4263??2003-10-29?14:15??delauney三角網\ReadMe.txt
?????文件????????779??2003-10-29?14:35??delauney三角網\Resource.h
?????文件????????206??2003-10-29?14:15??delauney三角網\StdAfx.cpp
?????文件???????1054??2003-10-29?14:15??delauney三角網\StdAfx.h
?????文件??????28980??2008-06-05?23:29??delauney三角網\tin2.aps
?????文件???????2313??2008-06-09?22:40??delauney三角網\tin2.clw
?????文件???????4173??2003-10-29?14:15??delauney三角網\tin2.cpp
?????文件???????5123??2005-12-25?12:31??delauney三角網\tin2.dsp
?????文件????????533??2003-10-29?14:15??delauney三角網\tin2.dsw
?????文件???????1334??2003-10-29?14:15??delauney三角網\tin2.h
?????文件?????443392??2008-06-09?22:41??delauney三角網\tin2.ncb
?????文件??????58880??2008-06-09?22:40??delauney三角網\tin2.opt
?????文件????????242??2008-06-06?11:06??delauney三角網\tin2.plg
?????文件??????11833??2005-12-25?12:03??delauney三角網\tin2.rc
?????文件???????1702??2003-10-29?14:15??delauney三角網\tin2Doc.cpp
?????文件???????1453??2003-10-29?14:15??delauney三角網\tin2Doc.h
?????文件???????3037??2005-12-25?12:55??delauney三角網\tin2View.cpp
?????文件???????1887??2005-12-25?11:29??delauney三角網\tin2View.h
?????文件????????746??2003-10-29?15:10??delauney三角網\T_line.cpp
?????文件????????582??2003-10-29?15:10??delauney三角網\T_line.h
?????文件????????552??2003-10-29?14:17??delauney三角網\T_point.cpp
?????文件????????534??2003-10-29?14:17??delauney三角網\T_point.h
?????文件??????11252??2005-12-25?12:48??delauney三角網\T_TIN.cpp
?????文件????????972??2005-12-25?12:29??delauney三角網\T_TIN.h
?????文件????????544??2003-10-29?14:18??delauney三角網\T_tri.cpp
?????文件????????515??2003-10-29?14:18??delauney三角網\T_tri.h
????..A.SH.??????6656??2006-07-15?22:27??delauney三角網\res\Thumbs.db
?????文件???????1078??2003-10-29?14:15??delauney三角網\res\tin2.ico
............此處省略25個文件信息
- 上一篇:MFC ListControl使用
- 下一篇:C/C++使用遺傳算法解決車輛路徑問題
評論
共有 條評論