Hi,
I've got a requirement to ship certain 3rd party model data only in an
encrypted format. So I wrote my own loader that does the encryption/
decryption but uses the IVE loader for everything. This works except for
files that reference other files. The master file is encrypted, but the
referenced files are saved out as .ive's.
Ideally all I would have to do is subclass ReaderWriterIVE and override
the following stream methods:
virtual osgDB::ReaderWriter::ReadResult readObject(std::istream& fin,
const osgDB::ReaderWriter::Options* options) const;
virtual osgDB::ReaderWriter::ReadResult readImage(std::istream& fin,
const osgDB::ReaderWriter::Options* options) const;
virtual osgDB::ReaderWriter::ReadResult readNode(std::istream& fin,
const osgDB::ReaderWriter::Options* options) const;
virtual osgDB::ReaderWriter::WriteResult writeObject(const
osg::Object& object,
std::ostream& fout, const osgDB::ReaderWriter::Options* options)
const;
virtual osgDB::ReaderWriter::WriteResult writeImage(const osg::Image&
image,
std::ostream& fout, const osgDB::ReaderWriter::Options* options)
const;
virtual osgDB::ReaderWriter::WriteResult writeNode(const osg::Node& node,
std::ostream& fout, const osgDB::ReaderWriter::Options* options)
const;
For writing I could get the raw data from the ive loader encrypt it and
write it out. For reading I could decrypt the data, then pass the
unencrypted data up to the ive loader for use.
There is one fatal flaw... I can't subclass the ReaderWriterIVE plugin. :(
1) Has anyone besides me ever wanted to derive from a file loader? Would
it make sense to keep the logic in a lib with headers, then have another
library that is just the plugin?
2) Is there some other mechanism in OSG that will let me do this?
Thanks,
Brett
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org