Hi Carsten, thanks for the reply...

well.. I've tried creating a dummy FC right after osgInit, but it didn't
work... heres the code in main():

   // initialize OpenSG
    OSG::osgInit( argc, argv );

    // create a dummy field container to keep track of the first field
container id.
    OSG::NodeRecPtr firstFC = OSG::Node::create();
    OSG::commitChanges();
    Application::setFirstFCId( firstFC->getId() );

then when enabling the cluster "on the fly" I use the following code (I
already have a client window which is a passive window):

    _clusterWindow = OSG::MultiDisplayWindow::create();

    // set servers (only one for testing)
    _clusterWindow->editMFServers()->push_back( "server1" );
    //_clusterWindow->editMFServers()->push_back( rightServerName.data() );

    _clusterWindow->setSize( _clientWindow->getWidth(),
_clientWindow->getHeight() );

   // copy all viewports to cluster window
    for( int i = 0; i < _viewports.size(); ++i )
    {
        OSG::Viewport* clientvp = _clientWindow->getPort( i );

        // create the viewports for the cluster just a simple one ...
        OSG::ViewportUnrecPtr vp = OSG::Viewport::create();

        vp->setBackground( clientvp->getBackground() );
        vp->setCamera( clientvp->getCamera() );
        vp->setRoot( clientvp->getRoot() );
        vp->setSize( clientvp->getLeft(), clientvp->getRight(),
                     clientvp->getTop(), clientvp->getBottom() );

        _clusterWindow->addPort( vp );
    }

    OSG::Thread::getCurrentChangeList()->commitChangesAndClear();

    OSG::Thread::getCurrentChangeList()->fillFromCurrentState(
Application::getFirstFCId() ); <<<--- the if of the first FC created right
after osgInit

    // initialize window
    _clusterWindow->init();

    render();

The message I got on the server is :

WARNING: Can't find container id:27443
WARNING: Can't find container id:27449
WARNING: Can't find container id:27455
WARNING: Can't find container id:27461
028891D8 1 0

It is always the same container ids in the message...

Using the first container ID works fine on the testDynamicClusterClient
example.. so I should work here.. Im I missing something?

Well, I've been considering using the second option wich is keep an
application change list.. but Isn't it a too inefficient approach? Because
the application changelist will get too big since we have many modifications
in the scene... Since I want to enable cluster at any time, I need to keep
merging the current change list into the application's change list and when
activating cluster I need to transmit this huge application changelist to
the servers. The change list will grow fast because we change
transformations in the scene everytime and at each time a new entry in the
change list will be added isnt?

Thanks ;)



On Sat, Feb 21, 2009 at 4:21 PM, Carsten Neumann <[email protected]>wrote:

>        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
>
------------------------------------------------------------------------------
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