首页 基于VC++的图形实现-简单的图形编辑程序—毕业设计论文

基于VC++的图形实现-简单的图形编辑程序—毕业设计论文

举报
开通vip

基于VC++的图形实现-简单的图形编辑程序—毕业设计论文基于VC++的图形实现-简单的图形编辑程序—毕业设计论文 毕业设计(论文) 学 院: 专 业: 班 级: 姓 名: 毕业设计题目 简单的图形编辑程序 指导教师 20XX 年 3 月 21 日 摘要 该文以计算机图形学及图像处理的理论为基础,提出了图像分析与处理的一些基本功能;文中给出了大量图形生成函数,有Windows封装的,有自定义的,突出了图形处理的编程实现。 本文还较深入的研究了WINDOWS下绘图,算法,图形的保存方法,bmp文件的转换。利用visualc++6.0开发工具实现了绘制直...

基于VC++的图形实现-简单的图形编辑程序—毕业设计论文
基于VC++的图形实现-简单的图形编辑程序—毕业 设计 领导形象设计圆作业设计ao工艺污水处理厂设计附属工程施工组织设计清扫机器人结构设计 论文 毕业设计(论文) 学 院: 专 业: 班 级: 姓 名: 毕业设计题目 简单的图形编辑程序 指导教师 20XX 年 3 月 21 日 摘要 该文以计算机图形学及图像处理的理论为基础,提出了图像分析与处理的一些基本功能;文中给出了大量图形生成函数,有Windows封装的,有自定义的,突出了图形处理的编程实现。 本文还较深入的研究了WINDOWS下绘图,算法,图形的保存方法,bmp文件的转换。利用visualc++6.0开发工具实现了绘制直线,圆弧,圆,矩形,图形的自定义文件格式保存,通过对图形算法的研究,实现了矢量图形的保存。 关键词:图形学;算法, vc++ 目 录 摘要 ...........................................................................................................................2 第一章 绪论..............................................................................................................4 1.1 项目背景 .....................................................................................................4 1.2目的和意义 ..................................................................................................4 1.3系统设计思想 ..............................................................................................4 第二章 系统原理和开发工具 ...................................................................................5 2.1 VC++概述 .....................................................................................................5 2.1.1 编辑器方面的新特性 .......................................................................5 2.1.2、编译器、连接器和调试器方面的改进 ..........................................5 2.2 windows绘图概述 ......................................................................................6 第三章 系统算法设计 ..............................................................................................8 3.1 软件结构设计 .............................................................................................8 3.2 基本图元算法 .............................................................................................8 ..............................................................................................8 3.2.1 直线类 3.2.2 方形类 ..............................................................................................9 3.2.3 圆形类 ............................................................................................ 10 3.2.4 B曲线类 ......................................................................................... 11 3.2.5 多边形类 ........................................................................................ 11 第四章 系统详细设计 ............................................................................................ 12 4.1 界面设计 ................................................................................................... 12 4.2 存储结构设计 ........................................................................................... 12 第五章 系统测试 .................................................................................................... 13 5.1 测试原则 ................................................................................................... 13 5.1.1 80—20原则.................................................................................... 13 5.1.2全程测试 ......................................................................................... 13 5.1.3测试具有免疫性 .............................................................................. 14 5.2 模块测试结果 ........................................................................................... 14 5.2.1画图测试 ......................................................................................... 14 5.2.2缩放选择测试 .................................................................................. 15 第六章 结论............................................................................................................ 15 参考文献 ................................................................................................................. 16 致 谢 ..................................................................................................................... 16 第一章 绪论 1.1 项目背景 1950年,第一台图形 示器作为美国麻省理工学院旋风l号)计算机的附件诞生了。在整个50年代,只有电子管计算机,用机器语言编程,主要应用于科学计算,为这些计算机配置的图形设备仅具有输出功能。计算机图形学处于准备和酝酿时期,开称之为:“被动式”图形学。到50年代朱期,MIT的林肯实验室在“旋风”计算机上开发SAGE空中防御体系,操作者可以用笔在屏幕上指出被确定的目标。它预示着文瓦式计算机图形学的诞生。 l962年,MIT林肯实验室的Ivail(E (Sutherland发表了1篇题为“Sketchpad:一个人机交( 通信的图形系统”的博士论文,他在论文中首次使用了计算机图形学“Computer Graphics”这个术语,证明交互计算机图形学是一个可行的、有用的研究领域,从而确定交互计算机图形学作为一个崭新的科学分支的独 地位。同在60年代早期,法国雷诺汽车公司的 工程 路基工程安全技术交底工程项目施工成本控制工程量增项单年度零星工程技术标正投影法基本原理 师Pierre Bezier发展了1套傲后人称为Bezier曲线、曲面的理论,成功地用于几何外形设计,并开发了用于汽车外形设计的UNISUI F系统。2O世纪7O年代,计算机图形学另外两个重要进展是真实感图形学和实体造型技术的产生。另外,从1973年开始,相继出现了英国剑桥大学CAD小组的Build系统、美国罗彻斯特大学的PADI T系统等实体造 系统。 1980年Whitted提出了一个光透视模型——whitted模型,并第一次给出光线跟踪算法的范例,实现whjtted模型;1984年,美国Corne~大学和日本广 岛大学的学者分别将热辐射工程中的辐射度的方法引入到计算机图形学中,用辐射度方法成功地模拟,理想漫反射表面问的多重漫反射效果;光线跟踪算法和辐射度算法的提出,标志着真实感图形的显示算法已逐渐成熟。从20世纪80年代中期以来,超大规模集成电路的发展,为图形学的飞速发展奠定了物质基础。计算机的运算能力的提高,图形处理速度的加快,使得图形学的各个研究方向得到充分发展,图形学已广泛应用于动画、科学计算可视化、CAD,CAM、影视娱乐等各个领域。 1.2目的和意义 本系统设计的目的就是要设计一个系统软件,实现基本的图形作图,并且实现对图元函数的操作主要是选择和缩放功能。通过本系统的实现,力求使得做出比画图程序功能更加强大。 1.3系统设计思想 一个方便用户使用的软件应该具备软件体积小,操作界面友好,基本功能稳定,运行速度较快,通过计算机技术及网络技术结合开发出客户端与服务器端,以便方便快捷清晰的进行数据传输,和简易通讯功能。 实用性:系统以用户需求为目标,以方便用户为原则。根据用户实际的需求情况,度身订造一套先进的局域网数据传输,从用户角度出发尽可能的方便用户使用,满足基本的用户需要,成为公司学校等通用的软件。 先进性:本设计将充分应用现有成熟的计算机技术、网络技术、软件开发技术。以VC6.0为主要开发环境,其优秀的编码体制和强大的编译器是此系统的强力支柱。 高可靠性:一个实用的系统同时必须是可靠的,本设计通过合理而先进的网络设计以及软、硬件的优化选型,可保证系统数据传输的正确性。 高安全性:在设计中,将充分利用网络软、硬件提供的各种安全措施,既可以保证用户共享资源,同时也可保证关键数据的安全性。 采用标准技术:本系统的所有设计遵循国际上现行的标准进行,以提高系统的开放性。 可维护性:系统的设计要求方便维护,包括硬件的维护,软件的维护(更改,升级等)和网络的维护。 可扩展性及灵活性:系统的设计以方便未来业务的扩展和系统扩充为目标,系统要求能够方便的升级,充分保护系统的投资。 第二章 系统原理和开发工具 2.1 VC++概述 Visual C++是当今最被广泛使用的可视化编程环境,为我们提供了一种方便、快捷的Windows 应用程序开发工具。它使用了Microsoft Windows 图形用户界面的许多先进特性和设计思想,采用了弹性可重复利用的完整的面向对象程序语言(Object-Oriented Language)、当今世界上最快的编辑器、最为领先的数据库技术。Visual C++ 6.0 是Visual C++系列的最新版本,是为Windows 98 或Windows 2000 等32 位操作系统开发应用程序用的编程工具,功能强大,界面友好,操作方便。 与Visual C++系列以前的版本相比而言,VC6.0 提供了许多新的特性,大致可以分为以下几方面。 2.1.1 编辑器方面的新特性 VC6.0 在集成开发环境的编辑器做了一些改进,以方便用户快速准确地编辑代码和资源,这些新特性主要包括: 1)自动完成语句功能:在用户编辑代码时,编辑器根据光标当前位置判断作用的类或对象,在一个下拉列表中显示相应的内容,如类的成员、函数原型、标识符定义等等。自动完成语句功能减轻了用户在输入长的类名或成员对象名时的繁 琐工作,方便了用户的使用。 2)快速宏录制:用户可以将集成开发环境中特定的连续操作定义为宏,在需要再次使用类似操作的时候只需调用已录制好的宏即可。 3)支持IE5 新控件的资源编辑器:新版本的资源编辑器支持IE5 提供的四种新控件,在资源编辑器中可以方便地将这些新控件添加到工具栏或者对话框中。 2.1.2、编译器、连接器和调试器方面的改进 VC6.0 在集成开发环境的编译器、连接器和调试器方面也做了大的改进,其目的就是使 得用户的应用程序运行起来更快、更稳定,调试起来更方便。 1) 编译器方面的改进:包括新添加的“_assume”关键字、增强对内联函数的控制、新增并更新了警告、加强了运行时刻的错误检测等内容。 2)连接器方面的改进:包括延迟加载外部支持、增添了新的连接选项和修正了外部函数的接口以减小文件尺寸等内容。 3)调试器方面的改进:包括改善了反汇编输出、改善了指针对象的显示、支持进程中的远程过程调用等内容。 2.2 windows绘图概述 Windows应用程序绘制图形时使用的是一种逻辑单位,每个逻辑单位的大小由映射模式决定, 这个逻辑单位既可以与设备单位(屏幕或打印机上的一个像素点)相同,也可以是一种物理单 位(如毫米),还可以是用户自定义的一种单位。在Windows应用程序中,只要与输出有关系,都 要使用映射模式。 当Windows应用程序在其客户区绘制图形时,必须给出在客户区的位置,其位置用x和y 两个坐标表示,x表示横坐标,y表示纵坐标。在所有的GDI绘制函数中,这些坐标使用的是一 种"逻辑单位"。当GDI函数将输出送到某个物理设备上时,Windows将逻辑坐标 转换成设备坐标(如屏幕或打印机的像素点)。逻辑坐标和设备坐标的转换是由映射模式决 定的。映射模式被储存在设备环境中。GetMapMode函数用于从设备环境得到当前的映射模 式,SetMapMode函数用于设置设备环境的映射模式。 1.逻辑坐标 逻辑坐标是独立于设备的,它与设备点的大小无关。使用逻辑单位,是实现"所见即所得"的基础。当程序员在调用一个画线的GDI函数LineTo,画出25.4mm(1英寸) 长的线时,他并不需要考虑输出的是何种设备。若设备是VGA显示器,Windows自动将其转化为96个像素点;若设备是一个300dpi的激光打印机,Windows自动将其转化为300个像素点。 2.设备坐标 Windows将GDI函数中指定的逻辑坐标映射为设备坐标,在所有的设备坐标系统中,单位以像素点为准,水平值从左到右增大,垂直值从上到下增大。 Windows中包括以下3种设备坐标,以满足各种不同需要: (1)客户区域坐标,包括应用程序的客户区域,客户区域的左上角为(0,0)。 (2)屏幕坐标,包括整个屏幕,屏幕的左上角为(0,0)。屏幕坐标用在WM_MOVE消息中(对于非子窗口)以及下面的Windows函数中:CreateWindow和MoveWindow(都对于非子窗口)、GetMessage、GetCursorPos、GetWindowRect、WindowFromPoint和SetBrushOrg中。用函数ClientToScreen和ScreenToClient可以将客户区域坐标转换成屏幕区域坐标,或反之。 (3)全窗口坐标,包括一个程序的整个窗口,包括标题条、菜单、滚动条和窗口框,窗口的左上角为(0,0)。使用GetWindowDC得到的窗口设备环境,可以将逻辑单位转换成窗口坐标。 3.逻辑坐标与设备坐标的转换方式 映射方式定义了Windows如何将GDI函数中指定的逻辑坐标映射为设备坐标。要继续讨论映射方式我们要介绍Windows有关映射模式的一些术语:我们将逻辑坐标所在的坐标系称为"窗口",将设备坐标所在的坐标系称为"视口"。 "窗口"依赖于逻辑坐标,可以是像素点、毫米或程序员想要的其他尺度。 "视口"依赖于设备坐标(像素点)。通常,视口和客户区域等同。但是,如果程序员用GetWindowDC或CreateDC获取了一个设备环境,则视口也可以指全窗口坐标或屏幕坐标。 点(0,0)是客户区域的左上角。x的值向右增加,y的值向上增加。 对于所有映射模式,Windows都用下面两个公式将窗口坐标转换成视口坐标: xViewport=(xWindow-xWinOrg)*(xViewExt/xWinExt)+xViewOrg yViewport=(yWindow-yWinOrg)*(yViewExt/yWinExt)+yViewOrg 其中,(xWindow,yWindows)是待转换的逻辑点,(xViewport,yViewport)是转换后的设备点。如果设备坐标是客户区域坐标或全窗口坐标,则Windows在画一个对象前,还必须将这些坐标转换成屏幕坐标。 这两个公式使用了分别指定窗口和视口原点的点:(xWinOrg,yWinOrg)是逻辑坐标的窗口原点;(xViewOrg,yViewOrg)是设备坐标的视口原点。在缺省的设备环境中,这两个点均设置为(0,0),但它们可以改变。此公式意味着,逻辑点(xWinOrg,yWinOrg)总被映射为设备点(xViewOrg,yViewOrg)。 Windows还能将视口(设备)坐标转换为窗口(逻辑)坐标: xWindow=(xViewport-xViewOrg)*(xWinExt/xViewExt)+xWinOrg yWindow=(yViewport-yViewOrg)*(yWinExt/yViewExt)+yWinOrg 可以使用Windows提供的两个函数DPtoLP和LPtoDP在设备坐标及逻辑坐标之间互相转换。 实际应用中,遇到一些与显示模式有关的问题。例如OLEServer中映射模式 的设置、如何减少逻辑坐标与设备坐标间相互转换的误差等。下面,笔者就讨论一下这两个 问题的解决方法。 1.映射模式的设置方法 开发应用程序时,如果直接调用SetMapMode函数将映射模式设置成度量映射方式中的一种后,在Windows95/98上程序会正常运行,但在WindowsNT上对象显示的大小比边框小。经过研究后,发现WindowsNT上使用基于逻辑英寸的映射方式。在讨论如何设置基于逻辑英寸的映射方式前,我们先介绍一下逻辑英寸的概念。 Windows在显示时以"逻辑英寸"为单位,逻辑英寸比实际的英寸要大。如果Windows程序使用实际英寸,则普通的10磅文本在显示器上就会小到几乎难以辨认,因此Windows使用放大了的"逻辑英寸"来表示文本。逻辑英寸只影响显示,而不影响打印。 使用GetDeviceCaps函数可得到当前设备的各种能力,其第一个参数nIndex指示要获取信息的类型。当nIndex为HORZSIZE和VERTSIZE时,可得到显示区域的宽度和高度;当nIndex 为HORZRES和VERTRES时,可得到每个水平和垂直方向的像素数即分辨率;当nIndex的值为LOGPIXELSX 和LOGPIXELSY时,可得到水平和垂直方向每逻辑英寸所含像素数。 在介绍了逻辑英寸的知识以后,很容易将OLEServer设置为基于逻辑英寸的映射模式。如果程序员仅仅调用SetMapMode(hdc,MM_LOENGLISH)来设置映射模式,当前的映射模式为物理英寸,而不是逻辑英寸。设置逻辑英寸必须自定义窗口和视口的范围,使 xViewExt/xWinExt =0.01逻辑英寸中水平像素的点数,当 xViewExt=LOGPIXELSX,xWinExt=100时,其比值正好满足上述要求。 以下是设置映射模式的代码。 intxLogPixPerInch=GetDeviceCaps(hdc,LOGPIXELSX); intyLogPixPerInch=GetDeviceCaps(hdc,LOGPIXELSY); SetMapMode(MM_ANISOTROPIC); SetWindowExt(100,100); SetViewportExt(xLogPixPerInch,yLogPixPerInch); 上述代码中调用SetMapMode函数将映射模式设置为自定义的,该调用必须位于SetWindowExt 和SetViewportExt调用之前,否则设置将会无效。 上述代码实际上将映射模式设置成逻辑MM_LOENGLISH,若程序员需要设置逻辑MM_LOMETRIC、MM_HIMETRIC、MM_HIENGLISH 或MM_TWIPS,只需修改上述代码中的SetWindowExt的参数,该参数实际上是每英寸所包含的各种映射模式下的单位数。根据表,中各映射模式的参数,可得到表,中每英寸所对应的各逻辑单位的个数。 例如,要设置逻辑MM_TWIPS,函数SetWindowExt中的参数为应1440。 当我们将映射模式设置成基于逻辑英寸的MM_LOMETRIC时,窗口的范围设为256,视口的范围设为96(在VGA显示器下LOGPIXELSX的值),约2.6个逻辑单位对应1个像素,这显然会造成不小的误差,它会表现在应用程序的各个方面:客户区的一个部分没有被刷新;对象之间本来没有间距,却显示出有间距;对象在屏幕的不同位置上会缩小或增大一个像素等问题。 可以采取以下两个步骤避免转换误差。(1)尽量选择窗口范围和视口范围比可以整除的映射方式,例如基于逻辑英寸的MM_TWIPS其窗口范围和视口范围比1440/96,可简化为15/1,从设备坐标转化为逻辑坐标时没有误差,从消除误差角度看,MM_TWIPS比其他几个映射模式都要好。(2)窗口范围和视口范围比不能整除时,也尽量将其简化,例如,当采用0.3900mm 中的将1个逻辑单位映射成1/64英寸的映射方式时,其窗口范围和视口范围比值为64/96,可简化为2/3。如果我们将逻辑单位的值都取为2的倍数,设备单位的值都取为3的倍数,转换后就没有精度的丢失了。 综上所述,如果我们能够根据映射模式值的特点,逻辑坐标和设备坐标都取经简化的窗口和视口范围值的倍数,则逻辑坐标和设备坐标间的转化将没有误差 第三章 系统算法设计 3.1 软件结构设计 MFC 框架中最容易被程序员和用户两者都见到的部分就是文档和视图。你在利用应用框架编写程序时的大部分工作是编写你的视图类和文档类。因此,我们有必要详细了解文档/视图结构。文档/视图结构是基于MFC 库的应用的一个重要特性。它将的实质就是将数据本身与用户对数据的观察和操作分离开来。所有的数据变化都在文档类中进行管理,同时它为视图对它的访问提供一个接口。视图调用两者间的接口来响应用户的操作,进行数据的修改,并且不断更新对文档的显示。这样就允许对同一数据可以有多个视图。 本软件使用文档视图结构,采用多文档的结构方式。 3.2 基本图元算法 3.2.1 直线类 直线类的继承结构如图:CObject->CUnit->CDline,直线类名为:CDline,主要结构如下: class CDLine:public CUnit { public: virtual void OnMouseMove(CDC*pDC,CEastDrawView*pView,CPoint point); virtual void OnLButtonDown(CDC *pDC, CEastDrawView *pView, CPoint point); virtual void DrawActive(CDC *pDC,CPoint point); virtual BOOL IsInRgn(CPoint point); virtual void ShowSelectPoint(CDC*pDC); virtual void Circumrotate(CPoint first,CPoint second); virtual int IsOnMarginPoint(CPoint point); virtual void Initial(); virtual CRgn* GetRgn(); CDLine(); virtual void DrawStatic(CDC*pDC); DECLARE_SERIAL(CDLine) }; 主要画图的算法如下: CPen m_pen; m_pen.CreatePen(m_PenStyle,m_PenWidth,m_PenColor); CPen* pen=(CPen*)pDC->SelectObject(&m_pen); COLORREF OldColor=pDC->SetBkColor(m_BackgroundColor); int OldBkMode=pDC->SetBkMode(m_BkMode); pDC->MoveTo(m_FirstPoint); pDC->LineTo(m_SecondPoint); pDC->SelectObject(pen); pDC->SetBkMode(m_BkMode); 3.2.2 方形类 class CRectangle:public CUnit { public: virtual void OnMouseMove(CDC*pDC,CEastDrawView*pView,CPoint point); virtual void OnLButtonDown(CDC *pDC, CEastDrawView *pView, CPoint point); virtual void DrawActive(CDC *pDC,CPoint point); virtual void ShowSelectPoint(CDC *pDC); virtual BOOL IsInRgn(CPoint point); virtual int IsOnMarginPoint(CPoint point); CRectangle(); virtual void Serialize(CArchive &ar); virtual void DrawStatic(CDC*pDC); DECLARE_SERIAL(CRectangle) }; 画图算法如下: CPen m_pen; CBrush m_brush; m_pen.CreatePen(m_PenStyle,m_PenWidth,m_PenColor); CPen* pen=(CPen*)pDC->SelectObject(&m_pen); LOGBRUSH brushlog; brushlog.lbColor=m_BrushColor; brushlog.lbHatch=m_BrushHatch; brushlog.lbStyle=m_BrushStyle; m_brush.CreateBrushIndirect(&brushlog); SetBrushOrg(pDC,&m_brush); CBrush*brush=(CBrush*)pDC->SelectObject(&m_brush); int OldBkMode=pDC->SetBkMode(m_BkMode); COLORREF OldColor=pDC->SetBkColor(m_BackgroundColor); pDC->Rectangle(CRect(m_FirstPoint,m_SecondPoint)); pDC->SelectObject(brush); pDC->SelectObject(pen); pDC->SetBkMode(OldBkMode); pDC->SetBkColor(OldColor); 3.2.3 圆形类 class CRound:public CUnit { DECLARE_SERIAL(CRound) public: void OnMouseMove(CDC*pDC,CEastDrawView*pView,CPoint point); virtual void OnLButtonDown(CDC *pDC, CEastDrawView *pView, CPoint point); virtual void DrawActive(CDC *pDC,CPoint point); virtual void ShowSelectPoint(CDC *pDC); virtual void Serialize(CArchive &ar); virtual int IsOnMarginPoint(CPoint point); virtual BOOL IsInRgn(CPoint point); virtual int ComputRadious(CPoint centerPoint, CPoint movingPoint); virtual void DrawStatic(CDC*pDC); CRound(); }; 3.2.4 B曲线类 class CPolyBezier:public CUnit { DECLARE_SERIAL(CPolyBezier) public: virtual void OnContextMenu(CWnd *pWnd, CPoint point); virtual void Serialize(CArchive& ar); virtual void OnMenuitemOk(CDC *pDC, CEastDrawView *pView); virtual BOOL IsInRgn(CPoint point); virtual int IsOnMarginPoint(CPoint point); void DrawMaskPoint(CDC*pDC); virtual void ShowSelectPoint(CDC*pDC); virtual void DrawStatic(CDC*pDC); virtual void OnMouseMove(CDC*pDC,CEastDrawView*pView,CPoint point); virtual void OnLButtonDown(CDC*pDC,CEastDrawView*pView,CPoint point); virtual void DrawActive(CDC *pDC,CPoint point); CPolyBezier(); CPoint*m_PointList; BOOL m_HaveDrawFirst; }; 3.2.5 多边形类 class CPolygon:public CUnit { DECLARE_SERIAL(CPolygon) public: virtual void OnMouseMove(CDC*pDC,CEastDrawView*pView,CPoint point); virtual void OnLButtonDown(CDC *pDC, CEastDrawView *pView, CPoint point); virtual void DrawActive(CDC *pDC,CPoint point); virtual void ShowSelectPoint(CDC *pDC); virtual void ExchangeDraw(CDC *pDC, CPoint point); virtual BOOL IsInRgn(CPoint point); virtual int IsOnMarginPoint(CPoint point); virtual void DrawEnd(CDC*pDC,CPoint point); CPolygon(); virtual void DrawMask(CDC*pDC,CPoint point); virtual void DrawStatic(CDC*pDC); virtual void Initial(); void Serialize(CArchive &ar); }; 第四章 系统详细设计 4.1 界面设计 4.2 存储结构设计 存储格式包括两种,一种是位图结构,一种是矢量图结构。位图结构的保存代码设计为: CEastDrawView*pView; POSITION pos=GetFirstViewPosition(); pView=(CEastDrawView*)GetNextView(pos); return pView->SaveDIB(NULL,file); 矢量图格式存储代码设计为: if (ar.IsStoring()) { ar<>this->m_TotalSize; ar>>m_CenterPoint; // TODO: add loading code here } m_DLineArray.Serialize(ar); m_CurveArray.Serialize(ar); m_RectangleArray.Serialize(ar); m_PolygonArray.Serialize(ar); m_RoundRectangleArray.Serialize(ar); m_RoundArray.Serialize(ar); m_EllipseArray.Serialize(ar); m_LiEllipseArray.Serialize(ar); m_RoundArcArray.Serialize(ar); m_PolyBezierArray.Serialize(ar); m_TextArray.Serialize(ar); m_EllipseArcArray.Serialize(ar); 第五章 系统测试 5.1 测试原则 5.1.1 80—20原则 80,的软件缺陷常常生存在软件20,的控件里。这个原则告诉我们,如果你想使软件测试有效地话,记住常常光临其“高危多发”地段 。在那里发现软件缺陷的可能性会大的多。这一原则对软件测试人员提高测试效率及缺陷发现串有着重大的意义。 5.1.2全程测试 如果单纯的将程序设计阶段后的阶段称之为软件测试的话,需求阶段和设计阶段的缺陷产生的放大效应会加大。这非常不利于保址软件质最。需求缺陷、设计缺陷也是软件缺陷,记住“软件缺陷具有生育能力”。软件测试跨越整个软件开发流程。需求验证(自检)和设计验证(白检)也可以算作软件测试的一种。软件测试应该是一个泛型概念,涵盖整个软什生命周期,这样才能确保周期的每个阶段禁得起考验软件测试是提高软件产品质量的必要条件而非充分条件,软件测试是提高产品质量最直接、最快捷的手段,但决不是一个根本于段。 5.1.3测试具有免疫性 软件缺陷与病毒一样具有可怕的”免疫性” ,测试人员对 采用的测试越多,其免疫能力就越强,寻找更多软什缺陷就更加困难。在软件测试中采用单一的方法不能高效和完全的针对所有软件缺陷, 此软件测试应该尽可能的多采用多种途径进行测试。 5.2 模块测试结果 5.2.1画图测试 5.2.2缩放选择测试 第六章 结论 通过实际使用,我们感觉这套系统的优势是: 1(具备一定的绘图功能(使我们可以很好的作图,在很大程度上掌握了工作的主动性,提高了效率; 2(方便的图形保存,,使用起来方便快捷; 3(界面设计合理,使用美观,方便。 通过毕业设计我收获不少主要是以下几个方面:一是对软件工程知识进行了系统的学习,在实践中丰富了自己,提高了自己。通过模块分析设计,系统的选择与设计,进一步加深了所学习的知识。二是对于VC编程有了一点的实践能力。通过对数据库系统的设计,提高了自己的编程能力。在VC编程有了很大的提高。三是学会了自主学习。通过不断的学习查找资料,我深深体会到学习的重要性。 同时我也感到了自身的不足,一是知识有限,需要不断的加强学习,在新技术不断涌现的今天要不断提高自身的知识水平。二是理论和实践还有一定的差距,需要在今后的工作中不断提高理论和实践的水平。 参考文献 [1] 胡晓军,邓波,高宏伟等《Visual C++高级开发范例解析》,电子工业出版社,2002 [2] David J.Kruglinski,潘爱民 译《Visual C++技术内幕》,人民邮电出版社,2004 [3] 吴文奎 《最流行图像格式实用参考手册》,电子工业出版社,1998 [4] 徐慧,《Visual C++数字图像实用工程 案例 全员育人导师制案例信息技术应用案例心得信息技术教学案例综合实践活动案例我余额宝案例 精选》,人民邮电出版社,2004 [5] 胡峪《Visual C++++编程技巧与示例》,西安电子科技大学出版,2002 [6] 袁峰《Windows图形编程》,人民邮电出版社,2004 致 谢 当这篇论文最终完成的时候,我要向给予过我热情帮助和悉心指导的老师和师兄们致以真诚的谢意。 首先,我要感谢我的导师,感谢他带给我来学习的机会,感谢他对我学术上的悉心指导,感谢他对我生活上的关怀和体贴。老师是不仅是我学业上的导师,更是生活中让我敬佩的学者、长者。给我留下深刻印象的,是他知识的渊博、治学态度的严谨、诲人不倦的学者风范,是他谦逊待人、处处关心别人的长者风度,是他勤奋忘我的工作态度、精益求精的治学作风。特别是老师做大事的风范和气度,尤其让我钦佩。 毕业设计(论文) 学 院: 专 业: 班 级: 姓 名: 毕业设计题目 简单的图形编辑程序 指导教师 20XX 年 3 月 21 日 摘要 该文以计算机图形学及图像处理的理论为基础,提出了图像分析与处理的一些基本功能;文中给出了大量图形生成函数,有Windows封装的,有自定义的,突出了图形处理的编程实现。 本文还较深入的研究了WINDOWS下绘图,算法,图形的保存方法,bmp文件的转换。利用visualc++6.0开发工具实现了绘制直线,圆弧,圆,矩形,图形的自定义文件格式保存,通过对图形算法的研究,实现了矢量图形的保存。 关键词:图形学;算法, vc++ 目 录 摘要 ...........................................................................................................................2 第一章 绪论..............................................................................................................4 1.1 项目背景 .....................................................................................................4 1.2目的和意义 ..................................................................................................4 1.3系统设计思想 ..............................................................................................4 第二章 系统原理和开发工具 ...................................................................................5 2.1 VC++概述 .....................................................................................................5 2.1.1 编辑器方面的新特性 .......................................................................5 2.1.2、编译器、连接器和调试器方面的改进 ..........................................5 2.2 windows绘图概述 ......................................................................................6 第三章 系统算法设计 ..............................................................................................8 3.1 软件结构设计 .............................................................................................8 3.2 基本图元算法 .............................................................................................8 ..............................................................................................8 3.2.1 直线类 3.2.2 方形类 ..............................................................................................9 3.2.3 圆形类 ............................................................................................ 10 3.2.4 B曲线类 ......................................................................................... 11 3.2.5 多边形类 ........................................................................................ 11 第四章 系统详细设计 ............................................................................................ 12 4.1 界面设计 ................................................................................................... 12 4.2 存储结构设计 ........................................................................................... 12 第五章 系统测试 .................................................................................................... 13 5.1 测试原则 ................................................................................................... 13 5.1.1 80—20原则.................................................................................... 13 5.1.2全程测试 ......................................................................................... 13 5.1.3测试具有免疫性 .............................................................................. 14 5.2 模块测试结果 ........................................................................................... 14 5.2.1画图测试 ......................................................................................... 14 5.2.2缩放选择测试 .................................................................................. 15 第六章 结论............................................................................................................ 15 参考文献 ................................................................................................................. 16 致 谢 ..................................................................................................................... 16 第一章 绪论 1.1 项目背景 1950年,第一台图形 示器作为美国麻省理工学院旋风l号)计算机的附件诞生了。在整个50年代,只有电子管计算机,用机器语言编程,主要应用于科学计算,为这些计算机配置的图形设备仅具有输出功能。计算机图形学处于准备和酝酿时期,开称之为:“被动式”图形学。到50年代朱期,MIT的林肯实验室在“旋风”计算机上开发SAGE空中防御体系,操作者可以用笔在屏幕上指出被确定的目标。它预示着文瓦式计算机图形学的诞生。 l962年,MIT林肯实验室的Ivail(E (Sutherland发表了1篇题为“Sketchpad:一个人机交( 通信的图形系统”的博士论文,他在论文中首次使用了计算机图形学“Computer Graphics”这个术语,证明交互计算机图形学是一个可行的、有用的研究领域,从而确定交互计算机图形学作为一个崭新的科学分支的独 地位。同在60年代早期,法国雷诺汽车公司的工程师Pierre Bezier发展了1套傲后人称为Bezier曲线、曲面的理论,成功地用于几何外形设计,并开发了用于汽车外形设计的UNISUI F系统。2O世纪7O年代,计算机图形学另外两个重要进展是真实感图形学和实体造型技术的产生。另外,从1973年开始,相继出现了英国剑桥大学CAD小组的Build系统、美国罗彻斯特大学的PADI T系统等实体造 系统。 1980年Whitted提出了一个光透视模型——whitted模型,并第一次给出光线跟踪算法的范例,实现whjtted模型;1984年,美国Corne~大学和日本广 岛大学的学者分别将热辐射工程中的辐射度的方法引入到计算机图形学中,用辐射度方法成功地模拟,理想漫反射表面问的多重漫反射效果;光线跟踪算法和辐射度算法的提出,标志着真实感图形的显示算法已逐渐成熟。从20世纪80年代中期以来,超大规模集成电路的发展,为图形学的飞速发展奠定了物质基础。计算机的运算能力的提高,图形处理速度的加快,使得图形学的各个研究方向得到充分发展,图形学已广泛应用于动画、科学计算可视化、CAD,CAM、影视娱乐等各个领域。 1.2目的和意义 本系统设计的目的就是要设计一个系统软件,实现基本的图形作图,并且实现对图元函数的操作主要是选择和缩放功能。通过本系统的实现,力求使得做出比画图程序功能更加强大。 1.3系统设计思想 一个方便用户使用的软件应该具备软件体积小,操作界面友好,基本功能稳定,运行速度较快,通过计算机技术及网络技术结合开发出客户端与服务器端,以便方便快捷清晰的进行数据传输,和简易通讯功能。 实用性:系统以用户需求为目标,以方便用户为原则。根据用户实际的需求情况,度身订造一套先进的局域网数据传输,从用户角度出发尽可能的方便用户使用,满足基本的用户需要,成为公司学校等通用的软件。 先进性:本设计将充分应用现有成熟的计算机技术、网络技术、软件开发技术。以VC6.0为主要开发环境,其优秀的编码体制和强大的编译器是此系统的强力支柱。 高可靠性:一个实用的系统同时必须是可靠的,本设计通过合理而先进的网络设计以及软、硬件的优化选型,可保证系统数据传输的正确性。 高安全性:在设计中,将充分利用网络软、硬件提供的各种安全措施,既可以保证用户共享资源,同时也可保证关键数据的安全性。 采用标准技术:本系统的所有设计遵循国际上现行的标准进行,以提高系统的开放性。 可维护性:系统的设计要求方便维护,包括硬件的维护,软件的维护(更改,升级等)和网络的维护。 可扩展性及灵活性:系统的设计以方便未来业务的扩展和系统扩充为目标,系统要求能够方便的升级,充分保护系统的投资。 第二章 系统原理和开发工具 2.1 VC++概述 Visual C++是当今最被广泛使用的可视化编程环境,为我们提供了一种方便、快捷的Windows 应用程序开发工具。它使用了Microsoft Windows 图形用户界面的许多先进特性和设计思想,采用了弹性可重复利用的完整的面向对象程序语言(Object-Oriented Language)、当今世界上最快的编辑器、最为领先的数据库技术。Visual C++ 6.0 是Visual C++系列的最新版本,是为Windows 98 或Windows 2000 等32 位操作系统开发应用程序用的编程工具,功能强大,界面友好,操作方便。 与Visual C++系列以前的版本相比而言,VC6.0 提供了许多新的特性,大致可以分为以下几方面。 2.1.1 编辑器方面的新特性 VC6.0 在集成开发环境的编辑器做了一些改进,以方便用户快速准确地编辑代码和资源,这些新特性主要包括: 1)自动完成语句功能:在用户编辑代码时,编辑器根据光标当前位置判断作用的类或对象,在一个下拉列表中显示相应的内容,如类的成员、函数原型、标识符定义等等。自动完成语句功能减轻了用户在输入长的类名或成员对象名时的繁 琐工作,方便了用户的使用。 2)快速宏录制:用户可以将集成开发环境中特定的连续操作定义为宏,在需要再次使用类似操作的时候只需调用已录制好的宏即可。 3)支持IE5 新控件的资源编辑器:新版本的资源编辑器支持IE5 提供的四种新控件,在资源编辑器中可以方便地将这些新控件添加到工具栏或者对话框中。 2.1.2、编译器、连接器和调试器方面的改进 VC6.0 在集成开发环境的编译器、连接器和调试器方面也做了大的改进,其目的就是使 得用户的应用程序运行起来更快、更稳定,调试起来更方便。 1) 编译器方面的改进:包括新添加的“_assume”关键字、增强对内联函数的控制、新增并更新了警告、加强了运行时刻的错误检测等内容。 2)连接器方面的改进:包括延迟加载外部支持、增添了新的连接选项和修正了外部函数的接口以减小文件尺寸等内容。 3)调试器方面的改进:包括改善了反汇编输出、改善了指针对象的显示、支持进程中的远程过程调用等内容。 2.2 windows绘图概述 Windows应用程序绘制图形时使用的是一种逻辑单位,每个逻辑单位的大小由映射模式决定, 这个逻辑单位既可以与设备单位(屏幕或打印机上的一个像素点)相同,也可以是一种物理单 位(如毫米),还可以是用户自定义的一种单位。在Windows应用程序中,只要与输出有关系,都 要使用映射模式。 当Windows应用程序在其客户区绘制图形时,必须给出在客户区的位置,其位置用x和y 两个坐标表示,x表示横坐标,y表示纵坐标。在所有的GDI绘制函数中,这些坐标使用的是一 种"逻辑单位"。当GDI函数将输出送到某个物理设备上时,Windows将逻辑坐标 转换成设备坐标(如屏幕或打印机的像素点)。逻辑坐标和设备坐标的转换是由映射模式决 定的。映射模式被储存在设备环境中。GetMapMode函数用于从设备环境得到当前的映射模 式,SetMapMode函数用于设置设备环境的映射模式。 1.逻辑坐标 逻辑坐标是独立于设备的,它与设备点的大小无关。使用逻辑单位,是实现"所见即所得"的基础。当程序员在调用一个画线的GDI函数LineTo,画出25.4mm(1英寸) 长的线时,他并不需要考虑输出的是何种设备。若设备是VGA显示器,Windows自动将其转化为96个像素点;若设备是一个300dpi的激光打印机,Windows自动将其转化为300个像素点。 2.设备坐标 Windows将GDI函数中指定的逻辑坐标映射为设备坐标,在所有的设备坐标系统中,单位以像素点为准,水平值从左到右增大,垂直值从上到下增大。 Windows中包括以下3种设备坐标,以满足各种不同需要: (1)客户区域坐标,包括应用程序的客户区域,客户区域的左上角为(0,0)。 (2)屏幕坐标,包括整个屏幕,屏幕的左上角为(0,0)。屏幕坐标用在WM_MOVE消息中(对于非子窗口)以及下面的Windows函数中:CreateWindow和MoveWindow(都对于非子窗口)、GetMessage、GetCursorPos、GetWindowRect、WindowFromPoint和SetBrushOrg中。用函数ClientToScreen和ScreenToClient可以将客户区域坐标转换成屏幕区域坐标,或反之。 (3)全窗口坐标,包括一个程序的整个窗口,包括标题条、菜单、滚动条和窗口框,窗口的左上角为(0,0)。使用GetWindowDC得到的窗口设备环境,可以将逻辑单位转换成窗口坐标。 3.逻辑坐标与设备坐标的转换方式 映射方式定义了Windows如何将GDI函数中指定的逻辑坐标映射为设备坐标。要继续讨论映射方式我们要介绍Windows有关映射模式的一些术语:我们将逻辑坐标所在的坐标系称为"窗口",将设备坐标所在的坐标系称为"视口"。 "窗口"依赖于逻辑坐标,可以是像素点、毫米或程序员想要的其他尺度。 "视口"依赖于设备坐标(像素点)。通常,视口和客户区域等同。但是,如果程序员用GetWindowDC或CreateDC获取了一个设备环境,则视口也可以指全窗口坐标或屏幕坐标。 点(0,0)是客户区域的左上角。x的值向右增加,y的值向上增加。 对于所有映射模式,Windows都用下面两个公式将窗口坐标转换成视口坐标: xViewport=(xWindow-xWinOrg)*(xViewExt/xWinExt)+xViewOrg yViewport=(yWindow-yWinOrg)*(yViewExt/yWinExt)+yViewOrg 其中,(xWindow,yWindows)是待转换的逻辑点,(xViewport,yViewport)是转换后的设备点。如果设备坐标是客户区域坐标或全窗口坐标,则Windows在画一个对象前,还必须将这些坐标转换成屏幕坐标。 这两个公式使用了分别指定窗口和视口原点的点:(xWinOrg,yWinOrg)是逻辑坐标的窗口原点;(xViewOrg,yViewOrg)是设备坐标的视口原点。在缺省的设备环境中,这两个点均设置为(0,0),但它们可以改变。此公式意味着,逻辑点(xWinOrg,yWinOrg)总被映射为设备点(xViewOrg,yViewOrg)。 Windows还能将视口(设备)坐标转换为窗口(逻辑)坐标: xWindow=(xViewport-xViewOrg)*(xWinExt/xViewExt)+xWinOrg yWindow=(yViewport-yViewOrg)*(yWinExt/yViewExt)+yWinOrg 可以使用Windows提供的两个函数DPtoLP和LPtoDP在设备坐标及逻辑坐标之间互相转换。 实际应用中,遇到一些与显示模式有关的问题。例如OLEServer中映射模式 的设置、如何减少逻辑坐标与设备坐标间相互转换的误差等。下面,笔者就讨论一下这两个 问题的解决方法。 1.映射模式的设置方法 开发应用程序时,如果直接调用SetMapMode函数将映射模式设置成度量映射方式中的一种后,在Windows95/98上程序会正常运行,但在WindowsNT上对象显示的大小比边框小。经过研究后,发现WindowsNT上使用基于逻辑英寸的映射方式。在讨论如何设置基于逻辑英寸的映射方式前,我们先介绍一下逻辑英寸的概念。 Windows在显示时以"逻辑英寸"为单位,逻辑英寸比实际的英寸要大。如果Windows程序使用实际英寸,则普通的10磅文本在显示器上就会小到几乎难以辨认,因此Windows使用放大了的"逻辑英寸"来表示文本。逻辑英寸只影响显示,而不影响打印。 使用GetDeviceCaps函数可得到当前设备的各种能力,其第一个参数nIndex指示要获取信息的类型。当nIndex为HORZSIZE和VERTSIZE时,可得到显示区域的宽度和高度;当nIndex 为HORZRES和VERTRES时,可得到每个水平和垂直方向的像素数即分辨率;当nIndex的值为LOGPIXELSX 和LOGPIXELSY时,可得到水平和垂直方向每逻辑英寸所含像素数。 在介绍了逻辑英寸的知识以后,很容易将OLEServer设置为基于逻辑英寸的映射模式。如果程序员仅仅调用SetMapMode(hdc,MM_LOENGLISH)来设置映射模式,当前的映射模式为物理英寸,而不是逻辑英寸。设置逻辑英寸必须自定义窗口和视口的范围,使 xViewExt/xWinExt =0.01逻辑英寸中水平像素的点数,当 xViewExt=LOGPIXELSX,xWinExt=100时,其比值正好满足上述要求。 以下是设置映射模式的代码。 intxLogPixPerInch=GetDeviceCaps(hdc,LOGPIXELSX); intyLogPixPerInch=GetDeviceCaps(hdc,LOGPIXELSY); SetMapMode(MM_ANISOTROPIC); SetWindowExt(100,100); SetViewportExt(xLogPixPerInch,yLogPixPerInch); 上述代码中调用SetMapMode函数将映射模式设置为自定义的,该调用必须位于SetWindowExt 和SetViewportExt调用之前,否则设置将会无效。 上述代码实际上将映射模式设置成逻辑MM_LOENGLISH,若程序员需要设置逻辑MM_LOMETRIC、MM_HIMETRIC、MM_HIENGLISH 或MM_TWIPS,只需修改上述代码中的SetWindowExt的参数,该参数实际上是每英寸所包含的各种映射模式下的单位数。根据表,中各映射模式的参数,可得到表,中每英寸所对应的各逻辑单位的个数。 例如,要设置逻辑MM_TWIPS,函数SetWindowExt中的参数为应1440。 当我们将映射模式设置成基于逻辑英寸的MM_LOMETRIC时,窗口的范围设为256,视口的范围设为96(在VGA显示器下LOGPIXELSX的值),约2.6个逻辑单位对应1个像素,这显然会造成不小的误差,它会表现在应用程序的各个方面:客户区的一个部分没有被刷新;对象之间本来没有间距,却显示出有间距;对象在屏幕的不同位置上会缩小或增大一个像素等问题。 可以采取以下两个步骤避免转换误差。(1)尽量选择窗口范围和视口范围比可以整除的映射方式,例如基于逻辑英寸的MM_TWIPS其窗口范围和视口范围比1440/96,可简化为15/1,从设备坐标转化为逻辑坐标时没有误差,从消除误差角度看,MM_TWIPS比其他几个映射模式都要好。(2)窗口范围和视口范围比不能整除时,也尽量将其简化,例如,当采用0.3900mm 中的将1个逻辑单位映射成1/64英寸的映射方式时,其窗口范围和视口范围比值为64/96,可简化为2/3。如果我们将逻辑单位的值都取为2的倍数,设备单位的值都取为3的倍数,转换后就没有精度的丢失了。 综上所述,如果我们能够根据映射模式值的特点,逻辑坐标和设备坐标都取经简化的窗口和视口范围值的倍数,则逻辑坐标和设备坐标间的转化将没有误差 第三章 系统算法设计 3.1 软件结构设计 MFC 框架中最容易被程序员和用户两者都见到的部分就是文档和视图。你在利用应用框架编写程序时的大部分工作是编写你的视图类和文档类。因此,我们有必要详细了解文档/视图结构。文档/视图结构是基于MFC 库的应用的一个重要特性。它将的实质就是将数据本身与用户对数据的观察和操作分离开来。所有的数据变化都在文档类中进行管理,同时它为视图对它的访问提供一个接口。视图调用两者间的接口来响应用户的操作,进行数据的修改,并且不断更新对文档的显示。这样就允许对同一数据可以有多个视图。 本软件使用文档视图结构,采用多文档的结构方式。 3.2 基本图元算法 3.2.1 直线类 直线类的继承结构如图:CObject->CUnit->CDline,直线类名为:CDline,主要结构如下: class CDLine:public CUnit { public: virtual void OnMouseMove(CDC*pDC,CEastDrawView*pView,CPoint point); virtual void OnLButtonDown(CDC *pDC, CEastDrawView *pView, CPoint point); virtual void DrawActive(CDC *pDC,CPoint point); virtual BOOL IsInRgn(CPoint point); virtual void ShowSelectPoint(CDC*pDC); virtual void Circumrotate(CPoint first,CPoint second); virtual int IsOnMarginPoint(CPoint point); virtual void Initial(); virtual CRgn* GetRgn(); CDLine(); virtual void DrawStatic(CDC*pDC); DECLARE_SERIAL(CDLine) }; 主要画图的算法如下: CPen m_pen; m_pen.CreatePen(m_PenStyle,m_PenWidth,m_PenColor); CPen* pen=(CPen*)pDC->SelectObject(&m_pen); COLORREF OldColor=pDC->SetBkColor(m_BackgroundColor); int OldBkMode=pDC->SetBkMode(m_BkMode); pDC->MoveTo(m_FirstPoint); pDC->LineTo(m_SecondPoint); pDC->SelectObject(pen); pDC->SetBkMode(m_BkMode); 3.2.2 方形类 class CRectangle:public CUnit { public: virtual void OnMouseMove(CDC*pDC,CEastDrawView*pView,CPoint point); virtual void OnLButtonDown(CDC *pDC, CEastDrawView *pView, CPoint point); virtual void DrawActive(CDC *pDC,CPoint point); virtual void ShowSelectPoint(CDC *pDC); virtual BOOL IsInRgn(CPoint point); virtual int IsOnMarginPoint(CPoint point); CRectangle(); virtual void Serialize(CArchive &ar); virtual void DrawStatic(CDC*pDC); DECLARE_SERIAL(CRectangle) }; 画图算法如下: CPen m_pen; CBrush m_brush; m_pen.CreatePen(m_PenStyle,m_PenWidth,m_PenColor); CPen* pen=(CPen*)pDC->SelectObject(&m_pen); LOGBRUSH brushlog; brushlog.lbColor=m_BrushColor; brushlog.lbHatch=m_BrushHatch; brushlog.lbStyle=m_BrushStyle; m_brush.CreateBrushIndirect(&brushlog); SetBrushOrg(pDC,&m_brush); CBrush*brush=(CBrush*)pDC->SelectObject(&m_brush); int OldBkMode=pDC->SetBkMode(m_BkMode); COLORREF OldColor=pDC->SetBkColor(m_BackgroundColor); pDC->Rectangle(CRect(m_FirstPoint,m_SecondPoint)); pDC->SelectObject(brush); pDC->SelectObject(pen); pDC->SetBkMode(OldBkMode); pDC->SetBkColor(OldColor); 3.2.3 圆形类 class CRound:public CUnit { DECLARE_SERIAL(CRound) public: void OnMouseMove(CDC*pDC,CEastDrawView*pView,CPoint point); virtual void OnLButtonDown(CDC *pDC, CEastDrawView *pView, CPoint point); virtual void DrawActive(CDC *pDC,CPoint point); virtual void ShowSelectPoint(CDC *pDC); virtual void Serialize(CArchive &ar); virtual int IsOnMarginPoint(CPoint point); virtual BOOL IsInRgn(CPoint point); virtual int ComputRadious(CPoint centerPoint, CPoint movingPoint); virtual void DrawStatic(CDC*pDC); CRound(); }; 3.2.4 B曲线类 class CPolyBezier:public CUnit { DECLARE_SERIAL(CPolyBezier) public: virtual void OnContextMenu(CWnd *pWnd, CPoint point); virtual void Serialize(CArchive& ar); virtual void OnMenuitemOk(CDC *pDC, CEastDrawView *pView); virtual BOOL IsInRgn(CPoint point); virtual int IsOnMarginPoint(CPoint point); void DrawMaskPoint(CDC*pDC); virtual void ShowSelectPoint(CDC*pDC); virtual void DrawStatic(CDC*pDC); virtual void OnMouseMove(CDC*pDC,CEastDrawView*pView,CPoint point); virtual void OnLButtonDown(CDC*pDC,CEastDrawView*pView,CPoint point); virtual void DrawActive(CDC *pDC,CPoint point); CPolyBezier(); CPoint*m_PointList; BOOL m_HaveDrawFirst; }; 3.2.5 多边形类 class CPolygon:public CUnit { DECLARE_SERIAL(CPolygon) public: virtual void OnMouseMove(CDC*pDC,CEastDrawView*pView,CPoint point); virtual void OnLButtonDown(CDC *pDC, CEastDrawView *pView, CPoint point); virtual void DrawActive(CDC *pDC,CPoint point); virtual void ShowSelectPoint(CDC *pDC); virtual void ExchangeDraw(CDC *pDC, CPoint point); virtual BOOL IsInRgn(CPoint point); virtual int IsOnMarginPoint(CPoint point); virtual void DrawEnd(CDC*pDC,CPoint point); CPolygon(); virtual void DrawMask(CDC*pDC,CPoint point); virtual void DrawStatic(CDC*pDC); virtual void Initial(); void Serialize(CArchive &ar); }; 第四章 系统详细设计 4.1 界面设计 4.2 存储结构设计 存储格式包括两种,一种是位图结构,一种是矢量图结构。位图结构的保存代码设计为: CEastDrawView*pView; POSITION pos=GetFirstViewPosition(); pView=(CEastDrawView*)GetNextView(pos); return pView->SaveDIB(NULL,file); 矢量图格式存储代码设计为: if (ar.IsStoring()) { ar<>this->m_TotalSize; ar>>m_CenterPoint; // TODO: add loading code here } m_DLineArray.Serialize(ar); m_CurveArray.Serialize(ar); m_RectangleArray.Serialize(ar); m_PolygonArray.Serialize(ar); m_RoundRectangleArray.Serialize(ar); m_RoundArray.Serialize(ar); m_EllipseArray.Serialize(ar); m_LiEllipseArray.Serialize(ar); m_RoundArcArray.Serialize(ar); m_PolyBezierArray.Serialize(ar); m_TextArray.Serialize(ar); m_EllipseArcArray.Serialize(ar); 第五章 系统测试 5.1 测试原则 5.1.1 80—20原则 80,的软件缺陷常常生存在软件20,的控件里。这个原则告诉我们,如果你想使软件测试有效地话,记住常常光临其“高危多发”地段 。在那里发现软件缺陷的可能性会大的多。这一原则对软件测试人员提高测试效率及缺陷发现串有着重大的意义。 5.1.2全程测试 如果单纯的将程序设计阶段后的阶段称之为软件测试的话,需求阶段和设计阶段的缺陷产生的放大效应会加大。这非常不利于保址软件质最。需求缺陷、设计缺陷也是软件缺陷,记住“软件缺陷具有生育能力”。软件测试跨越整个软件开发流程。需求验证(自检)和设计验证(白检)也可以算作软件测试的一种。软件测试应该是一个泛型概念,涵盖整个软什生命周期,这样才能确保周期的每个阶段禁得起考验软件测试是提高软件产品质量的必要条件而非充分条件,软件测试是提高产品质量最直接、最快捷的手段,但决不是一个根本于段。 5.1.3测试具有免疫性 软件缺陷与病毒一样具有可怕的”免疫性” ,测试人员对 采用的测试越多,其免疫能力就越强,寻找更多软什缺陷就更加困难。在软件测试中采用单一的方法不能高效和完全的针对所有软件缺陷, 此软件测试应该尽可能的多采用多种途径进行测试。 5.2 模块测试结果 5.2.1画图测试 5.2.2缩放选择测试 第六章 结论 通过实际使用,我们感觉这套系统的优势是: 1(具备一定的绘图功能(使我们可以很好的作图,在很大程度上掌握了工作的主动性,提高了效率; 2(方便的图形保存,,使用起来方便快捷; 3(界面设计合理,使用美观,方便。 通过毕业设计我收获不少主要是以下几个方面:一是对软件工程知识进行了系统的学习,在实践中丰富了自己,提高了自己。通过模块分析设计,系统的选择与设计,进一步加深了所学习的知识。二是对于VC编程有了一点的实践能力。通过对数据库系统的设计,提高了自己的编程能力。在VC编程有了很大的提高。三是学会了自主学习。通过不断的学习查找资料,我深深体会到学习的重要性。 同时我也感到了自身的不足,一是知识有限,需要不断的加强学习,在新技术不断涌现的今天要不断提高自身的知识水平。二是理论和实践还有一定的差距,需要在今后的工作中不断提高理论和实践的水平。 参考文献 [1] 胡晓军,邓波,高宏伟等《Visual C++高级开发范例解析》,电子工业出版社,2002 [2] David J.Kruglinski,潘爱民 译《Visual C++技术内幕》,人民邮电出版社,2004 [3] 吴文奎 《最流行图像格式实用参考手册》,电子工业出版社,1998 [4] 徐慧,《Visual C++数字图像实用工程案例精选》,人民邮电出版社,2004 [5] 胡峪《Visual C++++编程技巧与示例》,西安电子科技大学出版,2002 [6] 袁峰《Windows图形编程》,人民邮电出版社,2004 致 谢 当这篇论文最终完成的时候,我要向给予过我热情帮助和悉心指导的老师和师兄们致以真诚的谢意。 首先,我要感谢我的导师,感谢他带给我来学习的机会,感谢他对我学术上的悉心指导,感谢他对我生活上的关怀和体贴。老师是不仅是我学业上的导师,更是生活中让我敬佩的学者、长者。给我留下深刻印象的,是他知识的渊博、治学态度的严谨、诲人不倦的学者风范,是他谦逊待人、处处关心别人的长者风度,是他勤奋忘我的工作态度、精益求精的治学作风。特别是老师做大事的风范和气度,尤其让我钦佩。 "Are you hungry now?" "No, I am tired and lazy now; if I pursue you I will not catch you, and if I catch you-through your own slowness and clumsiness-I will not kill you, and if I kill you I will not eat you." Nicholas had begun to back away, and at the last; words, realizing that they were a signal, he turned and began to run, splashing through the shallow water. Ignacio ran after him, much helped by his longer legs, his hair flying behind his dark young face, his square teeth-each white as a bone and as big as Nicholas's thumbnail-showing like spectators who lined the railings of his lips. "Don't run, Nicholas," Dr. Island said with the voice of a wave. "It only makes him angry that you run." Nicholas did not answer, but cut to his left, up the beach and among the trunks of the palms, sprinting all the way because he had no way of knowing Ignacio was not right behind him, about to grab him by the neck. When he stopped it was in the thick jungle, among the boles of the hardwoods, where he leaned,.; out of breath, the thumping of his own heart the only' . sound in an atmosphere silent and unwaked as Earth's long, prehuman day. For a time he listened for any sound Ignacio might make searching for him; there was none. He drew a deep breath then and said, "Well, that's over," expecting Dr. Island to answer from somewhere; there was only the green hush. The light was still bright and strong and nearly, shadowless, but some interior sense told him the day, was nearly over, and he noticed that such faint shades as he could see stretched long, horizontal distortions of their objects. He felt no hunger, but he had fasted be-' fore and knew on which side of hunger he stood; he was not as strong as he had been only a day past, and by this time next day he would probably be unable to outrun Ignacio. He should, he now realized, have eaten the monkey he had killed; but his stomach revolted at the thought of the raw flesh, and he did not know how he might build a fire, although Ignacio seemed to have done so the night before. Raw fish, even if he were able to catch a fish, would be as bad, or worse, than raw monkey; he remembered his effort to open a coconut-he had failed, but it was surely not impossible. His mind was hazy as to what a coconut might contain, but there had to be an edible core, because they were eaten in books. He decided to make a wide sweep through the jungle that would bring him back to the beach well away from Ignacio; he had several times seen coconuts lying in the sand under the trees. He moved quietly, still a little afraid, trying to think of ways to open the coconut when he found it. He imagined himself standing before a large and raggedly faceted stone, holding the coconut in both hands. He raised it and smashed it down, but when it struck it was no longer a coconut but Maya's head; he heard her nose cartilage break with a distinct, rubbery snap. Her eyes, as blue as the sky above Madhya Pradesh, the sparkling blue sky of the egg, looked up at him, but he could no longer look into them, they retreated from his own, and it came to him quite suddenly that Lucifer, in falling, must have fallen up, into the fires and the coldness of space, never again to see the warm blues and browns and greens of Earth: 1 was watching Satan fall as lightning from heaven. He had heard that on tape somewhere, but he could not remember where. He had read that on Earth lightning did not come down from the clouds, but leaped up from the planetary surface toward them, never to return. "Nicholas." He listened, but did not hear his name again. Faintly water was babbling; had Dr. Island used that sound to speak to him? He walked toward it and found a little rill that threaded a way among the trees, and followed it. In a hundred steps it grew broader, slowed, and ended in a long blind pool under a dome of leaves. . Diane was sitting on moss on the side opposite him; she looked up as she saw him, and smiled. "Hello," he said. "Hello, Nicholas. I thought I heard you. I wasn't mistaken after all, was I?" "I didn't think I said anything." He tested the dark water with his foot and found that it was very cold. "You gave a little gasp, I fancy. I heard it, and I said to myself, that's Nicholas, and I called you. Then I thought I might be wrong, or that it might be Ignacio." "Ignacio was chasing me. Maybe he still is, but h think he's probably given up by now." The girl nodded, looking into the dark waters of they pool, but did not seem to have heard him. He began to work his way around to her, climbing across the snakelike roots of the crowding trees. "Why does Ignacio want to kill me, Diane?" "Sometimes he wants to kill me, too," the girl said. "But why?" "I think he's a bit frightened of us. Have you ever talked to him, Nicholas?" "Today I did a little. He told me a story about a pet fish he used to have." "Ignacio grew up all alone; did he tell you that? On= Earth. On a plantation in Brazil, way up the Amazon --Dr. Island told me." "I thought it was crowded on Earth." "The cities are crowded, and the countryside closes to the cities. But there are places where it's emptie than it used to be. Where Ignacio was, there would have been Red Indian hunters two or three hundred years ago; when he was there, there wasn't anyone,` just the machines. Now he doesn't want to be looked at, doesn't want anyone around him." Nicholas said slowly, "Dr. Island said lots of people wouldn't be sick if only there weren't other people around all the time. Remember that?" a "Only there. are other people around all the time; that's how the world is." "Not in Brazil, maybe," Nicholas said. He was trying to remember something about Brazil, but the only thing he could think of was a parrot singing in a straw hat from the comview cartoons; and then a turtle and a hedgehog that turned into armadillos for the love of God, Montressor. He said, "Why didn't he stay there?" "Did I tell you about the bird, Nicholas?" She had been not listening again. "What bird?" "I have a bird. Inside." She patted the flat stomach below her small breasts, and for a moment, Nicholas thought she had really found food. "She sits in here. She has tangled a nest in my entrails, where she sits and tears at my breath with her beak. I look healthy to you, don't I? But inside I'm hollow and rotten and turning brown, dirt and old feathers, oozing away. Her beak will break through soon." "Okay." Nicholas turned to go. "I've been drinking water here, trying to drown her. I think I've swallowed so much I couldn't stand up now if I tried, but she isn't even wet, and do you know something, Nicholas? I've found out I'm not really me, I'm her." Turning back Nicholas asked, "When was the last time you had anything to eat?" "I don't know. Two, three days ago. Ignacio gave me something." "I'm going to try to open a coconut. If I can I'll bring you back some." When he reached the beach, Nicholas turned and walked slowly back in the direction of the dead fire, this time along the rim of dampened sand between the sea and the palms. He was thinking about machines. There were hundreds of thousands, perhaps millions, of machines out beyond the belt, but few or none of the sophisticated servant robots of Earth-those were luxuries. Would Ignacio, in Brazil (whatever that was like), have had such luxuries? Nicholas thought not; those robots were almost like people, and living with them would be like living with people. Nicholas wished that he could speak Brazilian. There had been the therapy robots at St. John's; Nicholas had not liked them, and he did not think Ignacio would have liked them either. If he had liked his therapy robot he probably would not have had to be sent here. He thought of the chipped and rusted old machine that had cleaned the corridors-Maya had called it Corradora, but no one else ever called it any- F thing but Hey! It could not (or at least did not) speak, 1 and Nicholas doubted that it had emotions, except possibly a sort of love of cleanness that did not extend to its own person. "You will understand," someone was saying inside his head, "that motives of all sorts can be divided into two sorts." A doctor? A therapy robot? It did not matter. "Extrinsic and intrinsic. An extrinsic motive has always some further end in view, and that end we call an intrinsic motive. Thus when we have reduced motivation to intrinsic motivation we have reduced it to its simplest parts. Take that machine over there." What machine? "Freud would have said that it was fixated at the latter anal stage, perhaps due to the care its builders exercised in seeing that the dirt it collects is not released again. Because of its fixation it is, as you see, obsessed with cleanliness and order; compulsive sweeping and scrubbing palliate its anxieties. It is a strength of Freud's theory, and not a weakness, that it serves ` to explain many of the activities of machines as well as the acts of persons." Hello there, Corradora. And hello, Ignacio. My head, moving from side to side, must remind you of a radar scanner. My steps are measured, slow, and precise. 1 emit a scarcely audible humming as 1 walk, and my eyes are fixed, as 1 swing my head, not on you, Ignacio, but on the waves at the edge of sight, where they curve up into the sky. 1 stop ten meters short of you, and 1 stand. You go 1 follow, ten meters behind. What do 1 want? Nothing. Yes, 1 will pick up the sticks, and 1 will follow-five meters behind. "Break them, and put them on the fire. Not all of them, just a few." Yes. "Ignacio keeps the fire here burning all the time. Sometimes he takes the coals of fire from it to start others, but here, under the big palm log, he has a fire always. The rain does not strike it here. Always the fire. Do you know how he made it the first time? Reply to him!" " " No. "No, Patrdo!" " `No, Patrao.'" "Ignacio stole it from the gods, from Poseidon. Now Poseidon is dead, lying at the bottom of the water. Which is the top. Would you like to see him?" "If you wish it, Patrdo." "It will soon be dark, and that is the time to fish; do you have a spear?" "No, Patrdo." "Then Ignacio will get you one." Ignacio took a handful of the sticks and thrust the ends into the fire, blowing on them. After a moment Nicholas leaned over and blew, too, until all the sticks were blazing. "Now we must find you some bamboo, and there is some back here. Follow me." The light, still nearly shadowless, was dimming now, so that it seemed to Nicholas that they walked on insubstantial soil, though he could feel it beneath his feet. Ignacio stalked ahead, holding up the burning sticks until the fire seemed about to die, then pointing the ends down, allowing it to lick upward toward his hand and come to life again. There was a gentle wind blowing out toward the sea, carrying away the sound of the surf and bringing a damp coolness; and when they had been walking for several minutes, Nicholas heard in it a faint, dry, almost rhythmic rattle. Ignacio looked back at him and said, "The music. The big stems talking; hear it?" They found a cane a little thinner than Nicholas's wrist and piled the burning sticks around its base, then added more. When it fell, Ignacio burned through the upper end, too, making a pole about as long as Nicholas was tall, and with the edge of a seashell scraped the larger end to a point. "Now you are a fisherman," he said. Nicholas said, "Yes, Pardo," still careful not to meet his eyes. "You are hungry?" "Yes, Patrdo." "Then let me tell you something. Whatever you get is Ignacio's, you understand? And what he catches, that is his, too. But when he has eaten what he wants, what is left is yours. Come on now, and Ignacio will teach you to fish or drown you." Ignacio's own spear was buried in the sand not far from the fire; it was much bigger than the one he had made for Nicholas. With it held across his chest he went down to the water, wading until it was waist high, then swimming, not looking to see if Nicholas was following. Nicholas found that he could swim with the spear by putting all his effort into the motion of his legs, holding the spear in his left hand and stroking only occasionally with his right. "You breathe," he said softly, "and watch the spear," arid after that he had only to allow his head to lift from time to time. He had thought Ignacio would begin to look for fish as soon as they were well out from the beach, but the Brazilian continued to swim, slowly but steadily, until it seemed to Nicholas that they must be a kilometer or more from land. Suddenly, as though the lights in a room had responded to a switch, the dark sea around them became an opalescent blue. Ignacio stopped, treading water and using his spear to buoy himself. "Here," he said "Get them between yourself and the light." Open-eyed, he bent his face to the water, raised it again to breathe deeply, and dove. Nicholas followed his example, floating belly-down with open eyes. All the world of dancing glitter and dark island vanished as though he had plunged his face into a dream. Far, far below him Jupiter displayed its broad, striped disk, marred with the spreading Bright Spot where man-made silicone enzymes had stripped the hydrogen from methane for kindled fusion: a cancer and a burning infant sun. Between that sun and his eyes lay invisible a hundred thousand kilometers of space, and the temperglass shell of the satellite; hundreds of meters of illuminated water, and in it the spread body of Ignacio, dark against the light, still kicking downward, his spear a pencil line of blackness in his hand. Involuntarily Nicholas's head came up, returning to the universe of sparkling waves, aware now that what he had called "night" was only the shadow cast by Dr. Island when Jupiter and the Bright Spot slid beneath her. That shadow line, indetectable in air, now lay sharp across the water behind him. He took breath and plunged. Almost at once a fish darted somewhere below, and his left arm thrust the spear forward, but it was far out of reach. He swam after it, then saw another, larger, fish farther down and dove for that, passing Ignacio surfacing for air. The fish was too deep, and he had used up his oxygen; his lungs aching for air, he swam up, wanting to let go of his spear, then realizing at the last moment that he could, that it would only bob to the surface if he released it. His head broke water and he gasped, his heart thumping; water struck his face and he knew again, suddenly, as though they had ceased to exist while he was gone, the pulse beat pounding of the waves. Ignacio was waiting for him. He shouted, "This time you will come with Ignacio, and he will show you the dead sea god. Then we will fish." Unable to speak, Nicholas nodded. He was allowed three more breaths; then Ignacio dove and Nicholas had to follow, kicking down until the pressure sang in his ears. Then through blue water he saw, looming at the edge of the light, a huge mass of metal anchored to the temperglass hull of the satellite itself; above it, hanging lifelessly like the stem of a great vine severed from the root, a cable twice as thick as a man's body; and on the bottom, sprawled beside the mighty anchor, a legged god that might have been a dead insect save that it was at least six meters long. Ignacio turned and looked back at Nicholas to see if he understood; he did not, but he nodded, and with the strength draining from his arms, surfaced again. After Ignacio brought up the first fish, they took turns on the surface guarding their catch, and while the Bright Spot crept beneath the shelving rim of Dr. Island, they speared two more, one of them quite large. Then when Nicholas was so exhausted he could scarcely lift his arms, they made their way back to shore, and Ignacio showed him how to gut the fish with a thorn and the edge of a shell, and reclose them and pack them in mud and leaves to be roasted by the fire. After Ignacio had begun to eat the largest fish, Nicholas timidly drew out the smallest, and ate for the first time since coming to Dr. Island. Only when he had finished did he remember Diane. He did not dare to take the last fish to her, but he looked covertly at Ignacio, and began edging away from the fire. The Brazilian seemed not to have noticed him. When he was well into the shadows he stood, backed a few steps, then-slowly, as his instincts warned him-walked away, not beginning to trot until the distance between them was nearly a hundred meters. He found Diane sitting apathetic and silent at the margin of the cold pool, and had some difficulty persuading her to stand. At last he lifted her, his hands under her arms pressing against her thin ribs. Once on her feet she stood steadily enough, and followed him when he took her by the hand. He talked to her, knowing that although she gave no sign of hearing she heard him, and that the right words might wake her to response. "We went fishing-Ignacio showed me how. And he's got a fire, Diane, he got it from a kind of robot that was supposed to be fixing one of the cables that holds Dr. Island, I don't know how. Anyway, listen, we caught three big fish, and I ate one and Ignacio ate a great big one, and I don't think he'd mind if you had the other one, only say, `Yes, Patrdo,' and `No, Patrdo,' to him-he likes that, and he's only used to machines. You don't have to smile at him or anything-just look at the fire, that's what I do, just look at the fire." To Ignacio, perhaps wisely, he at first said nothing at all, leading Diane to the place where he had been sitting himself a few minutes before and placing some scraps from his fish in her lap. When she did not eat he found a sliver of the tender, roasted flesh and thrust it into her mouth. Ignacio said, "Ignacio believed that one dead," and Nicholas answered, "No, Patrdo." "There is another fish. Give it to her." Nicholas did, raking the gob of baked mud from the coals to crack with the heel of his hand, and peeling the broken and steaming fillets from the skin and bones to give to her when they had cooled enough to eat; after the fish had lain in her mouth for perhaps half a minute she began to chew and swallow, and after the third mouthful she fed herself, though without looking at either of them. :'Ignacio believed that one dead," Ignacio said again. "No, Patrao," Nicholas answered, and then added, "Like you can see, she's alive." "She is a pretty creature, with the firelight on her face-no?" "Yes, Patrao, very pretty." "But too thin." Ignacio moved around the fire until ` he was sitting almost beside Diane, then reached for the fish Nicholas had given her. Her hands closed on it, though she still did not look at him. "You see, she knows us after all," Ignacio said. "We s are not ghosts." Nicholas whispered urgently, "Let him have it." Slowly Diane's fingers relaxed, but Ignacio did not a take the fish. "I was only joking, little one," he said. 4 "And I think not such a good joke after all." Then when she did not reply, he turned away from her, his eyes reaching out across the dark, tossing water for something Nicholas could not see. "She likes you, Patrao," Nicholas said. The words were like swallowing filth, but he thought of the bird ready to tear through Diane's skin, and Maya's blood soaking in little round dots into the white cloth, and continued. "She is only shy. It is better that way." "You. What do you know?" Her head moved a fraction of a centimeter. Once he was out of sight of the fire, one part of the beach was as good to sleep on as another; he wished he had taken a piece of wood from the fire to start one of his own and tried to cover his legs with sand to keep off the cool wind, but the sand fell away whenever he moved, and his legs and his left hand moved without volition on his part. The surf, lapping at the rippled shore, said, "That was well done, Nicholas." "I can feel you move," Nicholas said. "I don't think I ever could before except when I was high up." "I doubt that you can now; my roll is less than one one-hundredth of a degree." "Yes, I can. You wanted me to do that, didn't -you? About Ignacio." "Do you know what the Harlow effect is, Nicholas?" Nicholas shook his head. "About a hundred years ago Dr. Harlow experimented with monkeys who had been raised in complete isolation-no mothers, no other monkeys at all." "Lucky monkeys." "When the monkeys were mature he put them into cages with normal ones; they fought with any that came near them, and sometimes they killed them." "Psychologists always put things in cages; did he ever think of turning them loose in the jungle instead?" "No, Nicholas, though we have . . . Aren't you going to say anything?" "I guess not." "Dr. Harlow tried, you see, to get the isolate monkeys to breed-sex is the primary social function-but they wouldn't. Whenever another monkey of either sex approached they displayed aggressiveness, which the other monkeys returned. He cured them finally by introducing immature monkeys-monkey children-in place of the mature, socialized ones. These needed the isolate adults so badly that they kept on making approaches no matter how often or how violently they were rejected, and in the end they were accepted, and the isolates socialized. It's interesting to note that the founder of Christianity seems to have had an intuitive grasp of the principle-but it was almost two thousand years before it was demonstrated scientifically." "I don't think it worked here," Nicholas said. "It was more complicated than that." "Human beings are complicated monkeys, Nicholas." "That's about the first time I ever heard you make a joke. You like not being human, don't you?" "Of course. Wouldn't you?" "I always thought I would, but now I'm not sure. You said that to help me, didn't you? I don't like that." A wave higher than the others splashed chill foam over Nicholas's legs, and for a moment he wondered if this were Dr. Island's reply. Half a minute later another wave wet him, and another, and he moved farther up the beach to avoid them. The wind was stronger, but he slept despite it, and was awakened only for a moment by a flash of light from the direction from, which he had come; he tried to guess what might have caused it, thought of Diane and Ignacio throwing the burning sticks into the air to see the arcs of fire, smiled -too sleepy now to be angry-and slept again. Morning came cold and sullen; Nicholas ran up and down the beach, rubbing himself with his hands. A thin rain, or spume (it was hard to tell which), was blowing in the wind, clouding the light to gray radiance. He wondered if Diane and Ignacio would mind if he came back now and decided to wait, then thought of fishing so that he would have something to bring ` when he came; but the sea was very cold and the waves so high they tumbled him, wrenching his bamboo spear from his hand. Ignacio found him dripping with water, sitting with his back to a palm trunk and staring out toward the lifting curve of the sea. "Hello, you," Ignacio said. "Good morning, Patrdo." Ignacio sat down. "What is your name? You told me, I think, when we first met, but I have forgotten. I am sorry." "Nicholas:" "Yes." "Patrao, I am very cold. Would it be possible for us to go to your fire?" "My name is Ignacio; call me that." Nicholas nodded, frightened. "But we cannot go to my fire, because the fire is out." "Can't you make another one, Patrao?" "You do not trust me, do you? I do not blame you. No, I cannot make another-you may use what I had, if you wish, and make one after I have gone. I came only to say good-bye." "You're leaving?" nother fire, but I don't even know what it is." Dr. Island did not answer. Nicholas got up and began to walk back to where the fire had been, thinking about Diane and wondering if she was hungry; he was hungry himself. He found her beside the dead fire. Her chest had been burned away, and lying close by, near the hole in the sand where Ignacio must have kept it hidden, was a bulky nuclear welder. The power pack was too heavy for Nicholas to lift, but he picked up the welding gun on its short cord and touched the trigger, producing a two-meter plasma discharge, which he played along the sand until Diane's body was ash. By the time he had finished the wind was whipping the palms and sending stinging rain into his eyes, but he collected a supply of wood and built another fire, bigger and bigger until it roared like a forge in the wind. "He killed her!" he shouted to the waves. "YES." Dr. Island's voice was big and wild. "You said he was better." "HE Is," howled the wind. "YOU KILLED THE MONKEY THAT WANTED TO PLAY WITH YOU, NICHOLAS-AS I BELIEVED IGNACIO WOULD EVENTUALLY KILL YOU, WHO ARE SO EASILY HATED, SO DIFFERENT FROM WHAT IT IS THOUGHT A BOY SHOULD BE. BUT KILLING THE MONKEY HELPED YOU, REMEMBER MADE YOU BETTER. IGNACIO WAS FRIGHTENED BY WOMEN; NOW HE KNOWS THAT THEY ARE REALLY VERY WEAK, AND HE HAS ACTED UPON CERTAIN FANTASIES AND FINDS THEM BITTER." "You're rocking," Nicholas said. "Am I doing that?" "YOUR THOUGHT."
本文档为【基于VC++的图形实现-简单的图形编辑程序—毕业设计论文】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
下载需要: 免费 已有0 人下载
最新资料
资料动态
专题动态
is_977556
暂无简介~
格式:doc
大小:227KB
软件:Word
页数:0
分类:工学
上传时间:2017-10-05
浏览量:18