<div dir="ltr"><div><div><div><div><div>Thanks Sebastian!<br><br></div>The ReadFileCallback is how I'm doing it now: we take an observer_ptr of nodes loaded in the RFC, then in the main thread before rendering we can see if the node is still valid and if is inserted in the scenegraph. If we can find it, then we can perform the edit. <br></div><br></div>The problem is that since the node is already inserted, we either have to block rendering whilst we do the edit (which can take hundreds of ms per node), or edit in the background whilst rendering either the unedited node (which looks wrong), or no node at all (looks just as wrong! :-) <br><br></div><div>There also a problem in that the pager compiles objects before insertion - but this operation is a waste for objects which we will immediately edit.<br></div><div><br></div><div>The more I think about it the more sure I am that the DatabaseThread is the right place to do it, but exactly how to best insert ourselves into the process is harder to know!<br></div><div><br></div>best wishes<br><br></div>Mike<br><div><div><div><div><div><div><div><div><div><div><div><br><div class="gmail_quote"><div dir="ltr">On Thu, 28 May 2015 at 09:22 Sebastian Messerschmidt <<a href="mailto:sebastian.messerschmidt@gmx.de">sebastian.messerschmidt@gmx.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<div>Hi Mike, <br>
<br>
you can add an <br>
 osgDB::Registry::ReadFileCallback<br>
and implement the readImage member function.<br>
For registering it to the registry use:<br>
osgDB::Registry::instance()->setReadFileCallback(myCloneReadFileCallback);<br>
<br>
This will be triggered by the database-pager when loading the
image. <br>
It won't help you with the destination-problem however. <br>
<br>
Cheers<br>
Sebastian <br>
<br>
</div>
<blockquote type="cite"></blockquote></div><div bgcolor="#FFFFFF" text="#000000"><blockquote type="cite">
<div dir="ltr">
<div>
<div>Hi all!<br>
<br>
</div>
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. <br>
<br>
</div>
<div>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. <br>
<br>
</div>
<div>Is there another (simpler?) way of inserting my code into
the loading process?<br>
<br>
</div>
<div>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? <br>
<br>
</div>
<div>best wishes<br>
<br>
</div>
<div>Mike <br>
</div>
</div>
<br>
<fieldset></fieldset>
<br>
</blockquote></div><div bgcolor="#FFFFFF" text="#000000"><blockquote type="cite"><pre>_______________________________________________
osg-users mailing list
<a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.openscenegraph.org</a>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a>
</pre>
</blockquote>
<br>
</div>
_______________________________________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
</blockquote></div></div></div></div></div></div></div></div></div></div></div></div></div>