-
大小: 32KB文件类型: .rar金币: 2下载: 0 次发布日期: 2021-06-15
- 语言: C/C++
- 标签: Cohen Sutherland
资源简介
本文通过一个完整的实例演示Cohen-Sutherland直线段裁剪算法。
参考文献:计算机图形学基础教程(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 属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 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个文件信息
- 上一篇:MFC操作sqlite3需要的库文件
- 下一篇:高斯消去法C++代码
相关资源
- 交互式计算机图形学 第六版 OpenGL源代
- 计算机图形学走样反走样时钟
- 西北工业大学软件学院计算机图形学
- 计算机图形学实验源代码中南民族大
- 绘制任意斜率的直线段
- 计算机图形学简单CAD系统
- 计算机图形学多边形种子填充算法
- 计算机图形学 消隐
- 计算机图形学作业,中点算法画椭圆
- MFC中点圆的生成算法
- 改进的有效边表算法--计算机图形学
- 最好的CS游戏opengl、C++实现
- 计算机图形学 清华大学教材 及 vc++
- 孔令德的计算机图形学实验及课程设
- 计算机图形学大作业参考代码(VC版)
- 计算机图形学 图形变换 C++ MFC
- 用visual C++ 6.0编写的计算机图形的一些
- 计算机图形学简单多边形裁剪程序
- 计算机图形学 大作业 多功能图形学程
- MFC多边形画法--计算机图形学
- 计算机图形学 visual c++ 6.0 实时动画有
- 计算机图形学 visual c++ 6.0 三维变换有
- 计算机图形学基于opengl图形变换源代
- 计算机图形学大作业简易绘图板mfc
- 计算机图形学OPENGL 动画代码
- 计算机图形学画线、画圆、种子填充
- vc6.0实现的计算机图形学各种算法源代
- VC++的MFC计算机图形学点线多边形裁剪
- 计算机图形学源代码
- 计算机图形学作品vc++
川公网安备 51152502000135号
评论
共有 条评论