#pragma once #include #include #include #include #include #include #include class ReaderWriterDist : public osgDB::ReaderWriter { public: ReaderWriterDist(); virtual const char* className() const { return "distortion set loader"; }; Options* prepareReading( ReadResult& result, std::string& fileName, std::ios::openmode& mode, const Options* options ) const; Options* prepareWriting( WriteResult& result, const std::string& fileName, std::ios::openmode& mode, const Options* options ) const; virtual ReadResult readObject( const std::string& file, const osgDB::ReaderWriter::Options* options) const; // passes the call to the stream function virtual ReadResult readObject( std::istream& fin, const osgDB::ReaderWriter::Options* options ) const; // passes the call to the readwriter defined in the ctor virtual WriteResult writeObject( const osg::Object& object, const std::string& fileName, const osgDB::ReaderWriter::Options* options ) const; // passes the call to the stream function virtual WriteResult writeObject( const osg::Object& object, std::ostream& fout, const osgDB::ReaderWriter::Options* options ) const; // passes the call to the readwriter defined in the ctor private: std::string extensionToAdd; osg::ref_ptr readOptions; osg::ref_ptr writeOptions; osg::ref_ptr rw; };