We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this questionCan you tell me where I can see a s开发者_运维问答ome opensource project (only project on C++ language), which is simple graphic editor, сontaining following primitive (for example): an ellipse, a rectangle, a line. And desirable, that to be able to group this primitive in one primitive (for example, Word Grouping -> Group). Composite pattern use is desirable in this project. I want to see how to organize classes, but more serious for me is to see how organize grouping operation.
I searched for it on codeproject.com codeproject.com, codeplex.com, but not found this.
I have already some source http://pastebin.com/xe4JF5PW
But in my opinion, this code is dirty and ugly. Therefore, I want to see some opensource project for example. Thanks!
In the GoF book "Design Patterns : Elements of Reusable Object-Oriented Software", there is a Case-Study that shows how to employ the patterns. They namely describe the way to use the Composite design pattern for graphical purpose. (Using Glyphs, a glyphs being a graphical component).
They base their case-study on a real text/graphical editor called Lexi.
Unluckily for you, the code is in DELPHI, not C++. But the code is here: LEXI.
However, it is explained among the thourough explanations of the Gang of Four book. You should take a look at the book if the site explanations aren't clear enough.
Inkscape might be what your searching for, it is a popular open source vector graphics editor written (mostly) in c++.
https://code.edge.launchpad.net/~inkscape.dev
精彩评论