Hi Wang Rui, your suggested change looks perfectly reasonable, I can't
at present think of any pitfalls with this approach.  Change now
merged and submitted to svn/trunk.

On Fri, Nov 20, 2009 at 3:13 AM, Wang Rui <[email protected]> wrote:
> Hi Robert,
>
> I've made a small fix to osgViewer/Scene.cpp, which is already attached. I
> would like to explain what I've done and why.
>
> In Scene::updateSceneGraph(), change:
>
> if (getSceneData())
> {
>         updateVisitor.setImageRequestHandler(getImagePager());
>         getSceneData()->accept(updateVisitor);
> }
> if (getDatabasePager())
> {
>         // synchronize changes required by the DatabasePager thread to the
> scene graph
>
> getDatabasePager()->updateSceneGraph((*updateVisitor.getFrameStamp()));
> }
>
> to
>
> if (getDatabasePager())
> {
>         // synchronize changes required by the DatabasePager thread to the
> scene graph
>
> getDatabasePager()->updateSceneGraph((*updateVisitor.getFrameStamp()));
> }
> if (getSceneData())
> {
>         updateVisitor.setImageRequestHandler(getImagePager());
>         getSceneData()->accept(updateVisitor);
> }
>
> That is, just swap the positions of two 'if () {...}' segments.
>
> While working on a paged terrain, I need to collect every newly allocated
> PagedLODs and make them temporarily unrenderable in the next frame,
> which are all done in a update callback. But I found that these PagedLODs
> will always be shown before collecting them, because of the unsuitable
> sequence in Scene::updateSceneGraph(). DatabasePager is synchronized AFTER
> the user updating traversal, that is, user cannot IMMEDIATELY find
> out changes made by DatabasePager.
>
> I don't know if there are other concerns that force us put the user
> traversal before updating DatabasePager. But I think it will be easier for
> users to manage the scenegraph, especially paged objects, if swap these two
> processes. What's your opinion? :)
>
> Cheers,
>
> Wang Rui
>
> _______________________________________________
> osg-submissions mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>
>
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to