Graphic editor opensource project example on c++ underlying composite pattern [closed] - c++

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
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 question
Can you tell me where I can see a some 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

Related

Policy based design in a real world open source project [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
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 question
Can anybody point me to an open source C++ project(preferably not a lib), where policy based design is extensively used?
Well, I suppose that any C++ application using the STL containers (parameterized by an Allocator and, sometimes, a Comparator) extensively use Policy-Based design. It's been a corner stone of the STL even seen it saw the light at SGI.
The obvious one by Alexandrescu: Loki
It's being actively developed.
any project that is using boost :-) http://www.boost.org/community/generic_programming.html#policy
if you mean initiating policy-based objects, than it would be a lot of projects that use boost. For example, http://programmingexamples.net/wiki/CPP/Boost/BGL/DijkstraDirected
or you can look at big projects on github https://github.com/search?q=%23include+%3Cboost%2Fgraph%2Fgraph_traits.hpp%3E&type=Code&ref=searchresults
if you mean defining policy-based object, than most of the use cases would be libraries. The reason for that is that if somethings needs a lot of customization and can be generalized, it becomes a library (even if for internal use). If you just writing a straightforward program that doesn't need customization of objects and poly-morphism, than it wouldn't use much of policy-based design.
for those, you can also search on github, trying out some common policy-based syntaxes.
In my scientific work, I use boost's odeint library that relies on policies. When I code, i start with a specialized hamiltonian, than I generalize it with policies and it basically becomes a library that I use in many other projects.

Suggest tool to convert cpp code to UML class diagram [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
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 question
I want to propose some class interface changes in my project. I feel that changes would be best explained using UML class diagrams.
My project code base is in C++ (RHEL).
Could you please tell me any open source/free tool that works on linux (ubuntu gnome - so preferably gtk app) and can help me to generate the class diagrams given the class declaration for the same.
Thanks,
Amey
As I know Umbrello supports reverse engineering for C++
You can use doxygen:
http://www.doxygen.org
This is not exactly UML but doxygen let you: "visualize the relations between the various elements by means of include dependency graphs, inheritance diagrams, and collaboration diagrams, which are all generated automatically." This is probably what you are looking for.
I have used Dia before. With it you can create many different kinds of diagrams in addition to UML modelling.
Check the Dia Homepage. Take a look at examples and demo.
And yes it is open source and GTK+ based.
This demo is close to what you may want to do.

What C/C++ library to use for HTML DOM building/changing? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
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 2 years ago.
Improve this question
I am using perl module HTML::DOM (link to CPAN) for building HTML DOM tree from HTML code and then changing it using standard DOM's removeAttribute, removeChild, innerHTML, createElement and so on.
But, I have found out it's really, really slow and eating too much memory (it's fully in perl, anyway). So, I thought that there will be some C/C++ library that does it faster and more efficiently (because it happens in every browser that have JavaScript support).
So far, I have not found anything. Maybe I am searching wrong?
edit: I will add. I would like it if it worked similarly to linked Perl module - by that, I really mean so I could use directly HTML's innerHTML, className, idName... Is it posible, or will I need to use general XML parser and then write these by myself?
edit2: OK, the slowness of the Perl module was actually my fault entirely. However, since I already asked, the question still stands :)
libgdome is a library adding a DOM implementation on top of libxml2.
Many of the faster higher-level language modules for this purpose (such as, in the Python world, lxml) tend to be built directly on libxml2, doing the DOM bits themselves.

What are some small, fast and lightweight open source applications (µTorrent -esque)? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
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 question
Possible duplicate
What is the best open source example of a lightweight
Windows Application?
µTorrent is a small bit-torrent client, a really small one. It doesn't come with an installer, just a exe, you drop in your PATH somewhere. It's super lightweight and yet feature rich. Plus it is the work of one man. It's also closed-source.
Many people have been curious about how it has been written, and there are hints here and there about a custom library etc. But the question is, are there any programs with attributes like µTorrent that are available with source code--attributes like speed, small size, awesomeness.
Possible related question (/questions/9603/what-is-some-great-source-code-to-read), but think smaller than something like the Linux kernel.
Clarification: I don't want examples of bit-torrent source code, but anything which is used by tons of people (validation of awesomeness) and also fast, small and awesome!
I think you should take a look at Notepad++ if you want to see a feature-rich low-consumption of power software :)
Netcat
It's the program that started all of the curiousity behind networks and how things WORK.
Everyone's looked at this source code.
rTorrent is a lightweight, feature-rich, console-only open-source torrent client.
I like Frhed, a simple open-source Windows hex editor.
FRESHMEAT is a great place to start. There are lots of small open source programs available that you can study.
Examples:
XML-RPC specification.C implementation for Python. Its easy to learn and its fun.
Heapq [\Lib\heapq.py] , xml-rpc [\Lib\xmlrpc] and lots of other codes in Python library are very well written.

Any good advice on using emacs for C++ project? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
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 6 years ago.
Improve this question
I'm looking for a good article on using emacs as C/C++ IDE.
Something like Steve Yegge's "Effective emacs".
No specific article, really, but I've found EmacsWiki to be full of useful information. Consider checking out these entries:
CPlusPlus as a starting point for many C++-related articles, and
CppTemplate to define a template that can give you a good skeleton when you start new files
I've recently stumbled upon this article which is quite good.
EDIT: Yep the link is no longer valid. It seems like they've changed their url recently and it doesn't redirect properly. Hopefully it will be back soon. Anyway the article was called "Benjamin Rutt's Emacs C development tips". I managed to find a copy here.
I'm planning to write such article in near future, but you can now take my configuration of Cedet + Emacs, that helps me to effectively edit C++ sources.
If you'll have questions, you could ask me directly
Be aware that Emacs' C++ mode is based on only regular expressions, not a grammar. Hence, the syntax highlighting is not based strictly on the syntax of the language itself, but rather is largely based on commonplace formatting. The Emacs syntax highlighting of C++ often makes mistakes.
The problem is not limited to syntax hightlighting. The same defective design applies to the automatic formatting. All this said, I have been using only Emacs for all of my editing of C++ source code for over 20 years, since the cfront days. (I usually turn off electric key bindings, because of Emacs' defective regex-based design. Regexes do not have enough expressive power to describe the C++ syntax accurately.
I recommend ggtags and irony-mode. Other then that you may want to use helm-ag to search ("grep") for strings in your codebase.