On Mon, Aug 11, 2008 at 6:03 PM, Serge Lages <[EMAIL PROTECTED]> wrote:
> On Mon, Aug 11, 2008 at 5:47 PM, Botorabi <[EMAIL PROTECTED]> wrote: > >> hi Serge, >> >> thanks for your hints. >> >> >Have you looked to osgDB::Registry::setReadFileCallback ? >> >> unfortunately, osgDB::Registry::setReadFileCallback does not the job. it >> passes the file name down to the loading mechanism chain, i.e. the actual >> file access is still managed in individual plugins using istream. >> >> >This way you can even pass to the OSG plugin a custom std::stream which >> can read into your pack system. >> >> well, i fear this won't work as well, as plugins expect a file name, no >> stream object. >> >> > Did you see this method from the ReaderWriter interface : > > virtual ReadResult readNode(std::istream& /*fin*/,const Options* =NULL) > const; > > In your plugin, you'll just need to get the wanted plugin thanks to the > registry (getReaderWriterForExtension or something like that) and then call > this method to read your object with your custom std::stream. I am using > this method to be able to read data from SQL databases like PGSql or SQLite. > > But be aware that not all the plugins implement this method (but with the > main ones like OSG or IVE it just works fine). > > I forgot to mention, you can also have a demonstration of this method into the CURL plugin, as it dowloads the data from the network and then send the streams to the plugins to create the nodes. -- Serge Lages http://www.tharsis-software.com
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

