[osg-users] DatabasePager - how to modify data during loading
Sebastian Messerschmidt
sebastian.messerschmidt at gmx.de
Thu May 28 00:22:11 PDT 2015
Hi Mike,
you can add an
osgDB::Registry::ReadFileCallback
and implement the readImage member function.
For registering it to the registry use:
osgDB::Registry::instance()->setReadFileCallback(myCloneReadFileCallback);
This will be triggered by the database-pager when loading the image.
It won't help you with the destination-problem however.
Cheers
Sebastian
> Hi all!
>
> I am finishing up some work which involves modifying nodes as they are
> loaded via the database pager - I want to edit the data after it is
> loaded, but before it is added to the scenegraph. I also need to know
> the destination (future parent) node in the scenegraph where the
> edited node will be located.
>
> It looks to me like a suitable location for this work is pretty much
> in the middle of DatabaseThread::run - after the node is loaded via
> readNode (), but before it is added to the file cache. All the data I
> need appears to be held in the DatabaseRequest object.
>
> Is there another (simpler?) way of inserting my code into the loading
> process?
>
> If the middle of the run method is the best location, would a patch to
> allow a optional callback function to be called be considered?
>
> best wishes
>
> Mike
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20150528/678ddba0/attachment-0003.htm>
More information about the osg-users
mailing list