資源簡介
通過c++實現圖形學多邊形裁剪,簡單有效。

代碼片段和文件信息
//?MainFrm.cpp?:?implementation?of?the?CMainframe?class
//
#include?“stdafx.h“
#include?“Polygoncut.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
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
????.......??????2511??2004-04-14?20:06??Polygon
????.......??????1581??2004-04-14?20:06??Polygon
????.......?????28032??2004-04-26?17:35??Polygon
????.......??????1997??2004-04-26?17:35??Polygon
????.......??????4281??2004-04-14?20:06??Polygon
????.......??????4639??2004-04-14?20:06??Polygon
????.......???????545??2004-04-14?20:06??Polygon
????.......??????1400??2004-04-14?20:06??Polygon
?????文件?????123904??2005-03-25?09:47??Polygon
?????文件???????1982??2005-03-25?09:42??Polygon
????.......?????10887??2004-04-22?13:57??Polygon
????.......??????1822??2004-04-14?20:06??Polygon
????.......??????1519??2004-04-14?20:06??Polygon
????.......?????12900??2004-06-10?22:34??Polygon
????.......??????4407??2004-04-14?20:06??Polygon
????.......???????785??2004-04-21?15:44??Polygon
????.......???????212??2004-04-14?20:06??Polygon
????.......??????1054??2004-04-14?20:06??Polygon
????.......??????3365??2004-04-26?23:15??Polygon
????.......??????1078??2004-04-14?20:06??Polygon
????.......???????402??2004-04-14?20:06??Polygon
????.......??????1078??2004-04-14?20:06??Polygon
????.......???????630??2004-04-21?15:44??Polygon
?????目錄??????????0??2004-07-10?09:45??Polygon
?????文件??????81920??2005-03-25?09:47??Polygon
?????目錄??????????0??2004-07-10?09:45??Polygon
-----------?---------??----------?-----??----
???????????????293149????????????????????27
評論
共有 條評論