<div dir="ltr"><div>Hi Jeremy,<br><br></div><div>The FileCache::isFileAppropriateForFileCache(..) method is virtual so you can subclass from FileCache override this method and than construct your own FIleCache and attach it to the osgDB::Registry by doing:<br><br></div><div>   osgDB::Registry::instance()->setFileCache(new MyFileCache);<br></div><div><br></div><div>Robert.<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 11 December 2015 at 02:10, Jeremy <span dir="ltr"><<a href="mailto:jswigart@gmail.com" target="_blank">jswigart@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I have a large data set that is on a network that my application pulls small sections of. I want to use the file cache to build local caches of only the content the application needs without needing to clone the entire tree.<div><br></div><div>When i register a file cache with my prototype application(which is currently just a slightly hacked osgViewer). I then proceed to load up my content using the network mapped paths(on windows, this amounts to a bunch of calls to \\somecomputer\somepath\whatever.flt for the terrain tiles, and then that in turn will pull in external references etc. </div><div><br></div><div>The problem I'm having is that the file cache doesn't cache all these files like I would prefer it to. After a bit of debugging, the FileCache::isFileAppropriateForFileCache returns false because the url isn't prefixed with the known protocols(ftp, http, etc). As a quick workaround I made this function return true always to see if it would cache, and the next place that failed was when it tried to write out the cached file, since a network URL sent through createCacheFileName doesn't produce a valid file path.</div><div><br></div><div>This is probably something I can get working with local modifications but I would like to ask that the developers consider some additional FileCache options so that one can tell it to cache all files, and not just the ones it deems to be "appropriate", which appears to be limited to remote url paths.The standalone osgfilecache application I think has the right idea with caching everything, but I'm wanted to avoid the need to run a preprocessing step. It appears as well that even if I created and populated the cache myself externally, the case(HANDLE_NON_HTTP): in the pager still only checks the cache given the success of the isFileAppropriateForFileCache.</div><div><br></div><div>Perhaps it's also reasonable for this check to identify network URLs as viable candidates too?</div></div>
<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>