source: experimental/distortionNG/ReaderWriterDist.h @ 367

Last change on this file since 367 was 367, checked in by Torben Dannhauer, 12 years ago

Dist-Plugin compiles, but not yet tested

File size: 1.5 KB
Line 
1#pragma once
2
3
4
5#include <osg/Notify>
6#include <osgDB/FileNameUtils>
7#include <osgDB/FileUtils>
8#include <osgDB/Registry>
9#include <osgDB/ReadFile>
10#include <osgDB/WriteFile>
11#include <stdlib.h>
12
13
14class ReaderWriterDist : public osgDB::ReaderWriter
15{
16public:
17        ReaderWriterDist();
18
19        virtual const char* className() const { return "distortion set loader"; };
20        Options* prepareReading( ReadResult& result, std::string& fileName, std::ios::openmode& mode, const Options* options ) const;
21        Options* prepareWriting( WriteResult& result, const std::string& fileName, std::ios::openmode& mode, const Options* options ) const;
22        virtual ReadResult readObject( const std::string& file, const osgDB::ReaderWriter::Options* options) const;     // passes the call to the stream function
23        virtual ReadResult readObject( std::istream& fin, const osgDB::ReaderWriter::Options* options ) const;  // passes the call to the readwriter defined in the ctor
24    virtual WriteResult writeObject( const osg::Object& object, const std::string& fileName, const osgDB::ReaderWriter::Options* options ) const;       // passes the call to the stream function
25    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
26
27
28private:
29        std::string extensionToAdd;
30
31        osg::ref_ptr<osgDB::Options> readOptions;
32        osg::ref_ptr<osgDB::Options> writeOptions;
33        osg::ref_ptr<osgDB::ReaderWriter> rw;
34};
Note: See TracBrowser for help on using the repository browser.