LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-14-2011, 11:20 AM   #1
paradox_mgh21
LQ Newbie
 
Registered: Oct 2011
Posts: 12

Rep: Reputation: Disabled
Node Based Programming


How to write node based program?
such as database management systems or nuke compositing in movie editing program that work with nodes.
i want to write a programs that need to works with nodes and connect one to another and change position of node on screen.
if can do this with wui(javascript,jquery,...) is better for me , but in (c++,java,...) i want to know how do this.
sorry about my english!!!
 
Old 10-14-2011, 01:12 PM   #2
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
If you define a "node" as an object with some data content and a set of links to other nodes, all you need to do is define the methods to use the data and to change the node connections.

Look at the STL container class templates, particularly the associative and multi-map class templates for the common "node" definitions. (The obvious partial ordering would be linked-from and linked-to. The SLT is should be available from your distribution's repository.)
 
1 members found this post helpful.
Old 10-14-2011, 05:03 PM   #3
paradox_mgh21
LQ Newbie
 
Registered: Oct 2011
Posts: 12

Original Poster
Rep: Reputation: Disabled
Smile I need something other!

thanks about your answer but i need to write a programs something like nuke compositor and database management systems that users of my programs use graphical nodes to drag&drop them connect them to each other and so on.
 
Old 10-14-2011, 05:09 PM   #4
paradox_mgh21
LQ Newbie
 
Registered: Oct 2011
Posts: 12

Original Poster
Rep: Reputation: Disabled
examples :
http://arborjs.org/
http://www.cs.umd.edu/hcil/graphvis/
i want my program get users ability to add node,delete node,connect nodes to each other and ...etc.
 
Old 10-14-2011, 08:26 PM   #5
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
As far as I can see, all you need to do is create a class that defines a node with members like node.location, node.connection_list and node.contents, and then define a set of function that modify the location, contents, and connections in response to your users actions or commands, and how the "node" is displayed.

The implementation of all of that should, I hope, be obvious. The STL templates make the node class definition quite easy to do, and the graphics tool kits (QT, etc.) make the graphics programming fairly easy.

The only hard part should be planning exactly what you want in your nodes and what you want your users to be able to accomplish with those nodes. One you've done that, the rest should be standard coding.

<edit>
After I posted the above, I looked at your second reference, which - after a little digging - led to this site, where you can find open-source software for 2D interactive node manipulation. You could look at that code to see how they did it. Re-coding it in C++ would probably be fairly easy.
</edit>

Last edited by PTrenholme; 10-14-2011 at 08:47 PM.
 
1 members found this post helpful.
Old 10-15-2011, 02:28 AM   #6
paradox_mgh21
LQ Newbie
 
Registered: Oct 2011
Posts: 12

Original Poster
Rep: Reputation: Disabled
thank you! this is that i want!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mysqld node of mysql cluster system not connecting to management node coal-fire-ice Linux - Server 1 07-27-2015 08:33 AM
[SOLVED] KSH script behaving differently on an HACMP cluster node (prod) & a single node (UAT) mufy Programming 5 01-03-2011 02:08 AM
How long a node failover and another node take over resources on HA cluster? levinhha Linux - Server 2 10-28-2010 09:13 PM
How to make a DRBD node start itself as a primary node automatically? pyruby Linux - Newbie 1 01-29-2010 12:41 PM
trouble making a [simple] templated node-based stack nadroj Programming 4 02-14-2006 05:52 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration