On 5/13/07, Robert Osfield <[EMAIL PROTECTED]> wrote:

Hi Serge,

On 5/12/07, Serge Lages <[EMAIL PROTECTED]> wrote:
> I would like to know if it's normal that the registry and the viewer
have
> different instances of the database pager ? With osgProducer they share
the
> same, and it was usefull to be able to retrieve the pager anywhere with
> osgDB::Registry::instance()->getDatabasePager(). In my app
> I use it to register custom PagedLOD, but it registers it to the
registry
> pager, which is not used by the viewer, so nothing is deleted... :/

osgViewer supports multiple scene graphs all paging independently,
something you can't do with a single DatabasePager instance.  The
paging naturally associated with the scene that its paging for, and it
just so happens osgViewer::Scene "has a" DatabasePager.

Each osgViewer::View also has a single osgViewer::Scene, so to get the
database pager being used for a specific view do:

   view.getScene()->getDatabasePager();

Now osgViewer::Viewer subclasses from View so you'll just need to do:

   viewer.getScene()->getDatabasePager();

Of you use CompositeViewer then you'd get the View, and then the
DatabasePager.

   viewer.getView(0)->getScene()->getDatabasePager();

If you have multiple views of the same scene in CompositeViewer then
each view will share the same Scene instance.


Hi Robert,

Ok I understand, but with these changes the registry method to get the
database pager is a bit confusing, we could add a warning or make it
deprecated to avoid these kind of problems.

--
Serge Lages
http://www.magrathea-engine.org
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to