<html><head></head><body>Hi Robert,<br>
<br>
Thank you for your answer. That certainly cleared up how to make my loader work with a native file system directory. My code now works as expected!<br>
<br>
I do have some questions about osg and virtual file systems, though. I noticed in the osg source code some files relating to zip and archive support which sounds great. Given the ReaderWriter interface has a read method which accepts an fstream it seems pretty straight forward that any ReaderWriter implementation implementing fstream methods will just work even if the file is in a zip file. That's fantastic, but it does leave me wondering what is the standard way for me to implement my ReaderWriter which requires the ability to look at a directory and read multiple files from that directory such that my ReaderWriter will "just work" even if the directory is virtual, like in a zip file?<br>
<br>
Again, thank you kindly for any help you or anyone else may be able to provide.<br>
<br>
Aaron<br><br><div class="gmail_quote">On July 15, 2015 3:26:26 AM EDT, Robert Osfield <robert.osfield@gmail.com> wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div dir="ltr"><div><div><div><div>Hi Aaron,<br /><br /></div>The ReaderWriter mechanism is built around the Chain-Of-Responsibility pattern so it's actually up to the ReaderWriter implementation to decide what files it can handle, you don't even need an file extension, or for the filename to even be an actual file or path name - this allows one to implement various psuedo loaders that various different things such as pre-processing of loaded models or paging. <br /><br /></div>The only place that the extensions are stricktly checked is when initially loading the plugins - if no plugin that has already been loaded can handle a particle read*File() request then osgDB::Registry checks the extension and loads the plugin associated with that plugin. In the case of psuedo plugin the filename won't be mapping directly to a file system file so the one either pre-loads these plugins, or append a .myplugin to filename and then strip the ".myplugin" inside the the
ReaderWriter. The .rot, .trans, .scale, .curl, .gdal plugins are all examples of plugins that use this approach.<br /><br /></div>In your case I'd recommend supporting both these approproaches - support the dummy extension that maps to your plugin name as well as support usage without the extension.<br /><br /></div>Robert.<br /><div><div><div><br /><br /></div></div></div></div><div class="gmail_extra"><br /><div class="gmail_quote">On 15 July 2015 at 00:01, Aaron Andersen <span dir="ltr"><<a href="mailto:aaron@fosslib.net" target="_blank">aaron@fosslib.net</a>></span> wrote:<br /><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I will preface this by saying I'm quite new to open scene graph, so if I'm missing something obvious please forgive me.<br />
<br />
I have a node/scene format I would like to implement in open scene graph. The data for the format is encapsulated in multiple files within a directory, not within a single file.<br />
<br />
How can I make a reader writer for a directory as opposed to a file? The ReaderWriter api is geared toward files (supportedExtension) and this is leaving me a little confused.<br />
<br />
Any help or guidance would be greatly appreciated.<br />
<br />
Thank you,<br />
Aaron<br />_______________________________________________<br />
osg-users mailing list<br />
<a href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.openscenegraph.org</a><br />
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br />
<br /></blockquote></div><br /></div>
<p style="margin-top: 2.5em; margin-bottom: 1em; border-bottom: 1px solid #000"></p><pre class="k9mail"><hr /><br />osg-users mailing list<br />osg-users@lists.openscenegraph.org<br /><a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br /></pre></blockquote></div></body></html>