- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
Chapter 13Graphics classes.ppt
Color matrix (16*16) More examples and graphics classes in the book (chapter 13) * Stroustrup/Programming Next lecture What is class Shape? Introduction to object-oriented programming * Stroustrup/Programming Chapter 13Graphics classes Bjarne Stroustrup /Programming Abstract Chapter 12 demonstrated how to create simple windows and display basic shapes: rectangle, circle, triangle, and ellipse. It showed how to manipulate such shapes: change colors and line style, add text, etc. Chapter 13 shows how these shapes and operations are implemented, and shows a few more examples. In Chapter 12, we were basically tool users; here we become tool builders. * Stroustrup/Programming Overview Graphing Model Code organization Interface classes Point Line Lines Grid Open Polylines Closed Polylines Color Text Unnamed objects * Stroustrup/Programming Display model Objects (such as graphs) are “attached to” (“placed in”) a window. The “display engine” invokes display commands (such as “draw line from x to y”) for the objects in a window Objects such as Rectangle add vectors of lines to the window to draw * Open_polyline Rectangle “window” Display Engine attach() attach() draw() draw() draw() Stroustrup/Programming Code organization * // Graphing interface: struct Shape { … }; … // window interface: class Window {…}; … FLTK headers Graph code Window code FLTK code chapter12.cpp: Window.h: Window.cpp: #include Graph.h #include Window.h int main() { … } Graph.cpp: Graph.h: struct Point { … }; // GUI interface: struct In_box { … }; … GUI code GUI.cpp: GUI.h: Point.h: Stroustrup/Programming Source files Header File that contains interface information (declarations) #include in user and implementer .cpp (“code file” / “implementation file”) File that contains code implementing interfaces defined in headers and/or uses such interfaces #includes headers Read the Graph.h header And later the Graph.cpp implementation file Don’t read the Window.h header or the Window.cpp implementatio
您可能关注的文档
- 226有效教学内涵.ppt
- 2导数的几何意义.ppt
- 3. b p m f.ppt
- 4–.ppt
- 46-320-01Tests and Measurements.ppt
- 518人力银行.ppt
- 7-Segment Display and Count by 16.ppt
- 7.4 利用轴对称设计图案.ppt
- A 16-Bit Invertible Architecture for H.26L.ppt
- A birthday party.ppt
- Chapter 13Ideal Transformers.ppt
- Chapter 13Magnetically Coupled Circuits.ppt
- CHAPTER 13Monopoly.PPT
- Chapter 13Moving West.ppt
- Chapter 13Network Security.ppt
- Chapter 13Pediatric Hearing Loss.ppt
- Chapter 13Personality.ppt
- CHAPTER 13POLITICS AND THE ECONOMY.ppt
- Chapter 13Schizophrenic Disorders.ppt
- Chapter 13Software Testing Strategies.ppt
最近下载
- 2025年高级工程师职称考试题库.pdf VIP
- 《风资源测量与评估》课程教学大纲.doc VIP
- 【薪酬报告】2021年光伏支架行业薪酬分析调查报告.docx VIP
- 高速公路零碳服务区评价技术指南.docx VIP
- 2025年中考试题汇编--简单机械.doc VIP
- 文档(完整word版)期间核查作业指导书介绍c.docx
- 《行业会计比较》(第六版)黄启国 行业会计比较课件首页.ppt VIP
- Unit 1 Starting Out+Understanding Ideas 课件 外研版(2024)英语七年级上册.pptx VIP
- 基金应知应会考试试卷含答案.doc
- 中外建筑史PPT课件.ppt VIP
文档评论(0)