Hi Tom,

a little addition...

Carsten Neumann wrote:
> Since the verbosity of the begin/endEditCP calls is indeed quite 
> annoying we actually got rid of them for OpenSG 2, there is only the 
> equivalent of endEditCP (now called commitChanges) which updates derived 
> values after you have completed a number of related changes.

Just to make it clear: you only have to call commitChanges() after you're done 
with your changes, so usually not very often (it's a little more complicated 
than that, but that's the basic idea).

> that is more or less what OpenSG 2 does. Initially it was thought to be 
> too expensive to perform this recording on each call to a mutating 
> function. Internal changes in 2 now reduce this cost so that the 
> convenience of not having to call begin/endEditCP outweighs the 
> performance impact.

The main problem with the basic approach are loops like this:

for (int i = 0; i < normals->size(); ++i)
        normals->setValue(i, normals->getValue(i).normalize())

For thread sync we need to store all changes that happen in a ChangeList. 
Calling setValue() a million times with either creating a ChangeList entry or 
at 
least checking whether an entry already exists is going to be prohibitively 
expensive.

The solution that was done for 2 is to have read-only and read-write iterators, 
and only do an entry when a read-write iterator is created. That removes the 
problem, and we can get rid of the explicit begin/endEdits.


Bottom line: if you're looking into OpenSG right now, start looking at 2. It's 
still in development, but definitely usable (there are a few groups using it 
productively for a while already).


Hope it helps

        Dirk

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to