Fractured Foundations

Node Graph Hitting Milestones

by Andrew on Jul.01, 2009, under Uncategorized

Today was spent early on debugging the STL vector replacement I wrote.  Originally I had thought it quite clever with a double linked list that stored extra nodes off the tail,  so it didn’t have to always create and delete elements as they were used.  It turned out a simple thing like reordering head and tail pointers can be quite complex when handled in various ways at different points.  I’d end up fixing an issue in a stack style function and realise the issue went unfixed in a queue type function.  However after walking through it all and nailing down some of the lose ends it’s up and working and actually doing it’s job in some areas.  For example my mesh loading library has a few objects that stores of thousands of faces but uses a swap buffer that is cleared after each use.  With some of the list entries stored off for later use this means the swap buffer only actually allocates the highest number of  verticies used by a face.  I’m sure the STL vector class does this too so not amazing per se but it’s nice to have written my own just to see if I can and how it’s done.  No fun using something someone made for you if you don’t know how it works.

So actual progress on the project was also achieved.  I’ve got a simpler and hopefully more solid implementation of the nodes in place.  One of the biggest issues I think I’m going to face is figuring out how to balance the data types of inputs and outputs.  I want to be able to set it up so that I can explicitly make sure I’m passing a input data type to a node and that it will be outputting a specific type that can then be used.  The current system in place is quite lenient in that it’s up to the implementation to define the storage medium.  The interface only defines a method to retrieve an integer value to represent a mnemonic value for it’s type and the a get and set method that return and take pointers of type void, respectively.  It’s not the most impressive interface nor do i think it’s very professional. I had tried a templated version and extremely overloaded version but the former is a tough nut to crack with an application running through interfaces and the later got very messy and wouldn’t have supported data types beyond what I supported.  The reason I want this kind of flexibility is the fact that there are so many different data types to deal with and so many are going to be defined by the intended use. Things like a mesh of spatial Vectors that are manipulated to create a terrain aren’t even as simple as I had hoped, a company might use mere bytes to represent the data where others might use full blown double precision floating point values.  String types may vary accross libraries, where I use a lot of STL strings others might have their own custom built ones.  At the end of the day I want to support as much as possible and inhibit as little possible.  I think I’ll be looking into this a fair bit but I’d like to find a soloution that can leave it fairly flexible without requiring me to code handlers for every possible permiation of data structures.

So, on to a slightly more successful part of the day. I got the UI running with the new node structures as well as getting in the base frame work for handling the different types.

Colour Coordinated Node Types

Colour Coordinated Node Types

Now when a node module is loaded and registers the UI creates a new GUI for it and adds the availabel nodes to the lists.  These can then be selected and placed by the user.

Organised Nodes. Tabbing for Modules and Lists for Node Types

Organised Nodes. Tabbing for Modules and Lists for Node Types

While placement, selection and movement are all in place the connection creater is still in need of some work.

Input and Output System becomes a colourful messy graph

Input and Output System becomes a colourful messy graph

Tomorrows task will be to get the outputs listed on the node elements, setup the connections so you can only drag connections from an output to a valid input(ensuring inputs only have 1 link) and I would like to make a rudamentry pass at running the graph.

Other areas I’ll be keeping in mind or having a think about will be a properties editor for nodes so that I can use the GUI to edit the values inside generator and output nodes.  I also plan on having a think about how to load and store pre built graphs, as well as the possibility of some real time preview windows or nodes.


Leave a Reply

You must be logged in to post a comment.

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...

    Archives

    All entries, chronologically...