Hi Marcus,
Marcus Lindblom wrote:
> Hi Cristoph,
>
> I should probably go ahead and send you the code that I have on the
> cache stuff, since it seems as you are doing something quite similar.
> Will just have to check with the powers that be. That is, if you don't
> mind depending on boost-serialization/iostreams/filesystem. Anyhow, it
> might be good inspirational read if you manage to get through it. :).
>
> Caching to a local mirror, is sort-of what I do today anyway, so those
> things might be useful. I also perform a hash-calculation, so you could
> probably use that by only fetching the hash remote and see if it
> matches, before using the local copy. My cache-class keeps a map of all
> cached (in your case local) files and their hash-values, so it should be
> easy to convert into something more useful.
>
> On loading from remote, some sort of datasource / content-provider is
> necessary. I don't know how to access this in the best way, as there are
> some conflicts:
>
> - Protocols (http/file/ftp)
> - Archives (zip/rar)
> - Data 'layers': (gzip/bzip2/encryption)
> - Different 'mount' points, esp. within the file protocol. (i.e. what
> the PathHandler does but in a more general fashion)
> - Relative paths in general (i.e. vrml's imagetexture links)
>
> Nothing new, but it needs adressing if a system for this is to be robust.
>
> Oh, and my opinion is that the SceneFileHandler-classes need very little
> change, if any. (Currently, I have a special case for vrml, since I need
> to hash linked textures as well). I think it ought to be possible to
> work around that by using some boost::iostream-adaptor in the custom
> ImageReadCallback-function and compute the hash-value as the files are
> requested & read.
>
> I don't know what plans you guys have made though. But I love to discuss
> this, as I've been (at least mentally) struggling with the proper way of
> handling it for some time.
>
>
Let me give an example with the OBJSceneFileType. It reads an .mtl-File
(given in the OBJ file) by opening a new ifstream
and puts each material found into a map. See
Int32 OBJSceneFileType::readMTL ( const Char8 *fileName,
std::map<std::string,
SimpleTexturedMaterialPtr> & mtlMap )
Reading a remote scene also must read the resources from the remote site.
For the local mirror function information about the resource files is
necessary.
> Btw, what do you mean by OpenSG nodes not being serializable into .osb?
>
When serialization is not implemented, for legacy nodes, then it is not
written to .osb
And it does not work with clustering, but that is another story..
Does not happen with VRML and other SceneFileTypes handling geometry as
OSG::Geometry.
Regards,
Christoph
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users