Sign in to follow this  
schupf

[.net] Graph system

Recommended Posts

Hello! I want to implement a graph system, which can be used by the user to created directed graphs. To have a better understand what I mean please take a look at this video: video Please jump to 1:13. In this video you can see a dark gray canvas with several rectangles. The rectangles are the nodes. Every node can be moved via drag & drop. At 1:31 the user creates some edges between nodes. My simple question: How can I implement such a graph system with C++/CLI and WinForms? Can I use some standard controls or do I have to implement everything on my own with GDI+ or System.Drawing? Thanks for any help!

Share this post


Link to post
Share on other sites
I have chosen C++/CLI + WinForms in my project for several reasons. But WHY I use WinForms doesnt matter in this thread.

I think the only way to do this is to render everything by myself:(

Share this post


Link to post
Share on other sites
Yes, you'll probably have to draw it on your own. Don't let that scare you too much though, it's not too difficult. Implement the functionality as a custom control and encapsulate the main pieces smartly and it should be easy to create and reuse in as many projects as you need it for.

Share this post


Link to post
Share on other sites
Quote:
Original post by schupf
I have chosen C++/CLI + WinForms in my project for several reasons. But WHY I use WinForms doesnt matter in this thread.

I think the only way to do this is to render everything by myself:(

The WHY could matter. If you picked it because you know it well implementing a custom control would be a breeze. If you picked it because you already have a starting base (app) you would be (more or less) stuck to WinForms.

Implementing such graphics is sometimes much easier on another platform such as WPF.

Share this post


Link to post
Share on other sites
I made one using C++, win32, and DX9 (screenshot here). I can't say it was easy to create, but it wasn't the most challenging task either. Not a definite indication of anything, but it's written in about 1300 lines of code, not counting utility DX functions and objects. But such a control is neat and useful enough to warrant the effort for me. Good luck.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this