-
大小: 32KB文件類(lèi)型: .rar金幣: 2下載: 0 次發(fā)布日期: 2021-06-15
- 語(yǔ)言: C/C++
- 標(biāo)簽: Cohen??Sutherland??
資源簡(jiǎn)介
本文通過(guò)一個(gè)完整的實(shí)例演示Cohen-Sutherland直線(xiàn)段裁剪算法。
參考文獻(xiàn):計(jì)算機(jī)圖形學(xué)基礎(chǔ)教程(Visual C++版)(第2版) 孔令德 編著

代碼片段和文件信息
//?Cohen_Sutherland.cpp?:?Defines?the?class?behaviors?for?the?application.
//
#include?“stdafx.h“
#include?“Cohen_Sutherland.h“
#include?“MainFrm.h“
#include?“Cohen_SutherlandDoc.h“
#include?“Cohen_SutherlandView.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#undef?THIS_FILE
static?char?THIS_FILE[]?=?__FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
//?CCohen_SutherlandApp
BEGIN_MESSAGE_MAP(CCohen_SutherlandApp?CWinApp)
//{{AFX_MSG_MAP(CCohen_SutherlandApp)
ON_COMMAND(ID_APP_ABOUT?OnAppAbout)
//?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
//?Standard?file?based?document?commands
ON_COMMAND(ID_FILE_NEW?CWinApp::OnFileNew)
ON_COMMAND(ID_FILE_OPEN?CWinApp::OnFileOpen)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
//?CCohen_SutherlandApp?construction
CCohen_SutherlandApp::CCohen_SutherlandApp()
{
//?TODO:?add?construction?code?here
//?Place?all?significant?initialization?in?InitInstance
}
/////////////////////////////////////////////////////////////////////////////
//?The?one?and?only?CCohen_SutherlandApp?object
CCohen_SutherlandApp?theApp;
/////////////////////////////////////////////////////////////////////////////
//?CCohen_SutherlandApp?initialization
BOOL?CCohen_SutherlandApp::InitInstance()
{
AfxEnableControlContainer();
//?Standard?initialization
//?If?you?are?not?using?these?features?and?wish?to?reduce?the?size
//??of?your?final?executable?you?should?remove?from?the?following
//??the?specific?initialization?routines?you?do?not?need.
#ifdef?_AFXDLL
Enable3dControls(); //?Call?this?when?using?MFC?in?a?shared?DLL
#else
Enable3dControlsStatic(); //?Call?this?when?linking?to?MFC?statically
#endif
//?Change?the?registry?key?under?which?our?settings?are?stored.
//?TODO:?You?should?modify?this?string?to?be?something?appropriate
//?such?as?the?name?of?your?company?or?organization.
SetRegistryKey(_T(“Local?AppWizard-Generated?Applications“));
LoadStdProfileSettings();??//?Load?standard?INI?file?options?(including?MRU)
//?Register?the?application‘s?document?templates.??Document?templates
//??serve?as?the?connection?between?documents?frame?windows?and?views.
CSingleDocTemplate*?pDocTemplate;
pDocTemplate?=?new?CSingleDocTemplate(
IDR_MAINframe
RUNTIME_CLASS(CCohen_SutherlandDoc)
RUNTIME_CLASS(CMainframe)???????//?main?SDI?frame?window
RUNTIME_CLASS(CCohen_SutherlandView));
AddDocTemplate(pDocTemplate);
//?Parse?command?line?for?standard?shell?commands?DDE?file?open
CCommandLineInfo?cmdInfo;
ParseCommandLine(cmdInfo);
//?Dispatch?commands?specified?on?the?command?line
if?(!ProcessShellCommand(cmdInfo))
return?FALSE;
//?The?one?and?only?window?has?been?initialized?so?show?and?update?it.
m_pMainWnd->Show
?屬性????????????大小?????日期????時(shí)間???名稱(chēng)
-----------?---------??----------?-----??----
?????文件??????26400??2014-11-05?11:21??Cohen_Sutherland\Cohen_Sutherland.aps
?????文件???????1966??2014-11-05?14:51??Cohen_Sutherland\Cohen_Sutherland.clw
?????文件???????4294??2014-11-05?11:18??Cohen_Sutherland\Cohen_Sutherland.cpp
?????文件???????4813??2014-11-05?15:00??Cohen_Sutherland\Cohen_Sutherland.dsp
?????文件????????538??2014-11-05?11:18??Cohen_Sutherland\Cohen_Sutherland.dsw
?????文件???????1466??2014-11-05?11:18??Cohen_Sutherland\Cohen_Sutherland.h
?????文件??????50176??2014-11-05?15:00??Cohen_Sutherland\Cohen_Sutherland.ncb
?????文件??????48640??2014-11-05?15:00??Cohen_Sutherland\Cohen_Sutherland.opt
?????文件???????1252??2014-11-05?14:51??Cohen_Sutherland\Cohen_Sutherland.plg
?????文件???????9149??2014-11-05?11:18??Cohen_Sutherland\Cohen_Sutherland.rc
?????文件???????1942??2014-11-05?11:18??Cohen_Sutherland\Cohen_SutherlandDoc.cpp
?????文件???????1585??2014-11-05?11:18??Cohen_Sutherland\Cohen_SutherlandDoc.h
?????文件???????4507??2014-11-05?14:50??Cohen_Sutherland\Cohen_SutherlandView.cpp
?????文件???????2034??2014-11-05?14:45??Cohen_Sutherland\Cohen_SutherlandView.h
?????文件???????1507??2014-11-05?11:18??Cohen_Sutherland\MainFrm.cpp
?????文件???????1421??2014-11-05?11:18??Cohen_Sutherland\MainFrm.h
?????文件????????539??2014-11-05?11:41??Cohen_Sutherland\P2.cpp
?????文件????????497??2014-11-05?11:41??Cohen_Sutherland\P2.h
?????文件???????4226??2014-11-05?11:18??Cohen_Sutherland\ReadMe.txt
?????文件???????1078??2014-11-05?11:18??Cohen_Sutherland\res\Cohen_Sutherland.ico
?????文件????????408??2014-11-05?11:18??Cohen_Sutherland\res\Cohen_Sutherland.rc2
?????文件???????1078??2014-11-05?11:18??Cohen_Sutherland\res\Cohen_SutherlandDoc.ico
?????文件????????504??2014-11-05?11:18??Cohen_Sutherland\Resource.h
?????文件????????218??2014-11-05?11:18??Cohen_Sutherland\StdAfx.cpp
?????文件???????1054??2014-11-05?11:18??Cohen_Sutherland\StdAfx.h
?????目錄??????????0??2014-11-05?11:18??Cohen_Sutherland\res
?????目錄??????????0??2014-11-05?15:00??Cohen_Sutherland
-----------?---------??----------?-----??----
???????????????171292????????????????????27
............此處省略0個(gè)文件信息
- 上一篇:MFC操作sqlite3需要的庫(kù)文件
- 下一篇:高斯消去法C++代碼
評(píng)論
共有 條評(píng)論