Hello Pablo,

Pablo Carneiro Elias wrote:
> I'm trying to make my application connect dynamically to cluster 
> servers, rendering locally at the same time... just like OpenSG 
> testDynamicClusterClient example does.. in this example you use this call:
> 
> OSG::Thread::getCurrentChangeList()->fillFromCurrentState( _first_fc );
> 
> which, as far as I can understand is for sinchronizing the new cluster 
> window... The _first_fc value contains the id value of the client window 
> (_client_wnd->getId()).
> 
> _first_fc must be the id of the first FC created in the application?

yes. The prototypes for each container are stored in the 
FieldContainerFactory as well and since they are registered dynamically 
the system needs help to find where the "real" containers begin.

> Isnt there an option do make dynamic cluster connection to work? I'm not 
> totally sure how is the first FC created in my app... isnt there a 
> method to get the first FC ?

only the application knows what the first FC is. You could try creating 
a dummy FC right after osgInit and store its id.
Another alternative is to make sure you keep a ChangeList around that 
has all information to restore the current state. That means before you 
clear the CL of the current thread you merge it to an application held 
CL. Then instead of the above fillFromCurrentState you could just merge 
that CL into the current thread's:

OSG::Thread::getCurrentChangeList()->merge(appStateChangeList);

> I've tried simple getting the client 
> window id bu it doesn work.. the servers print MANY of messages like this:
> 
> WARNING: Can't find container id:<some number>
> 
> The connection is performed, but the server window get black...

there are probably FCs created before the window and those do not get 
transmitted again.
One last thing you could also try is using a simple program that is 
linked against the exact same set of OpenSG libs to get the id of the 
first application container from there and then just use it as a 
constant in your real app. This is a fragile solution though as it will 
break as soon as a new container type is added to a lib or you add 
another library to your app.

        Cheers,
                Carsten


------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to