osgDB/Callbacks
Go to the documentation of this file.
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#ifndef OSGDB_CALLBACKS
#define OSGDB_CALLBACKS 1
#include <osgDB/AuthenticationMap>
#include <osgDB/ReaderWriter>
#include <osgDB/FileCache>
#include <deque>
#include <list>
#include <iosfwd>
namespace osgDB {
typedef std::deque<std::string> FilePathList;
enum CaseSensitivity
{
CASE_SENSITIVE,
CASE_INSENSITIVE
};
// forward declare
class Options;
class OSGDB_EXPORT FindFileCallback : public virtual osg::Referenced
{
public:
virtual std::string findDataFile(const std::string& filename, const Options* options, CaseSensitivity caseSensitivity);
virtual std::string findLibraryFile(const std::string& filename, const Options* options, CaseSensitivity caseSensitivity);
protected:
virtual ~FindFileCallback() {}
};
class OSGDB_EXPORT ReadFileCallback : public virtual osg::Referenced
{
public:
virtual ReaderWriter::ReadResult openArchive(const std::string& filename,ReaderWriter::ArchiveStatus status, unsigned int indexBlockSizeHint, const Options* useObjectCache);
virtual ReaderWriter::ReadResult readObject(const std::string& filename, const Options* options);
virtual ReaderWriter::ReadResult readImage(const std::string& filename, const Options* options);
virtual ReaderWriter::ReadResult readHeightField(const std::string& filename, const Options* options);
virtual ReaderWriter::ReadResult readNode(const std::string& filename, const Options* options);
virtual ReaderWriter::ReadResult readShader(const std::string& filename, const Options* options);
virtual ReaderWriter::ReadResult readScript(const std::string& filename, const Options* options);
protected:
virtual ~ReadFileCallback() {}
};
class OSGDB_EXPORT WriteFileCallback : public virtual osg::Referenced
{
public:
virtual ReaderWriter::WriteResult writeObject(const osg::Object& obj, const std::string& fileName,const Options* options);
virtual ReaderWriter::WriteResult writeImage(const osg::Image& obj, const std::string& fileName,const Options* options);
virtual ReaderWriter::WriteResult writeHeightField(const osg::HeightField& obj, const std::string& fileName,const Options* options);
virtual ReaderWriter::WriteResult writeNode(const osg::Node& obj, const std::string& fileName,const Options* options);
virtual ReaderWriter::WriteResult writeShader(const osg::Shader& obj, const std::string& fileName,const Options* options);
virtual ReaderWriter::WriteResult writeScript(const osg::Script& obj, const std::string& fileName,const Options* options);
protected:
virtual ~WriteFileCallback() {}
};
class OSGDB_EXPORT FileLocationCallback : public virtual osg::Referenced
{
public:
enum Location
{
LOCAL_FILE,
REMOTE_FILE
};
virtual Location fileLocation(const std::string& filename, const Options* options) = 0;
virtual bool useFileCache() const = 0;
protected:
virtual ~FileLocationCallback() {}
};
}
#endif // OSGDB_OPTIONS
AuthenticationMap
FileCache
ReaderWriter
osgDB::FileLocationCallback
Definition osgDB/Callbacks:95
osgDB::FileLocationCallback::Location
Location
Definition osgDB/Callbacks:99
osgDB::FileLocationCallback::REMOTE_FILE
@ REMOTE_FILE
Definition osgDB/Callbacks:101
osgDB::FileLocationCallback::LOCAL_FILE
@ LOCAL_FILE
Definition osgDB/Callbacks:100
osgDB::FileLocationCallback::useFileCache
virtual bool useFileCache() const =0
osgDB::FileLocationCallback::fileLocation
virtual Location fileLocation(const std::string &filename, const Options *options)=0
osgDB::FileLocationCallback::~FileLocationCallback
virtual ~FileLocationCallback()
Definition osgDB/Callbacks:109
osgDB::FindFileCallback
Definition osgDB/Callbacks:40
osgDB::FindFileCallback::~FindFileCallback
virtual ~FindFileCallback()
Definition osgDB/Callbacks:48
osgDB::FindFileCallback::findDataFile
virtual std::string findDataFile(const std::string &filename, const Options *options, CaseSensitivity caseSensitivity)
osgDB::FindFileCallback::findLibraryFile
virtual std::string findLibraryFile(const std::string &filename, const Options *options, CaseSensitivity caseSensitivity)
osgDB::Options
Definition Options:30
osgDB::ReadFileCallback
Definition osgDB/Callbacks:53
osgDB::ReadFileCallback::~ReadFileCallback
virtual ~ReadFileCallback()
Definition osgDB/Callbacks:71
osgDB::ReadFileCallback::readHeightField
virtual ReaderWriter::ReadResult readHeightField(const std::string &filename, const Options *options)
osgDB::ReadFileCallback::openArchive
virtual ReaderWriter::ReadResult openArchive(const std::string &filename, ReaderWriter::ArchiveStatus status, unsigned int indexBlockSizeHint, const Options *useObjectCache)
osgDB::ReadFileCallback::readShader
virtual ReaderWriter::ReadResult readShader(const std::string &filename, const Options *options)
osgDB::ReadFileCallback::readImage
virtual ReaderWriter::ReadResult readImage(const std::string &filename, const Options *options)
osgDB::ReadFileCallback::readObject
virtual ReaderWriter::ReadResult readObject(const std::string &filename, const Options *options)
osgDB::ReadFileCallback::readNode
virtual ReaderWriter::ReadResult readNode(const std::string &filename, const Options *options)
osgDB::ReadFileCallback::readScript
virtual ReaderWriter::ReadResult readScript(const std::string &filename, const Options *options)
osgDB::ReaderWriter::ReadResult
Definition ReaderWriter:109
osgDB::ReaderWriter::WriteResult
Definition ReaderWriter:184
osgDB::ReaderWriter::ArchiveStatus
ArchiveStatus
Definition ReaderWriter:221
osgDB::WriteFileCallback
Definition osgDB/Callbacks:75
osgDB::WriteFileCallback::writeHeightField
virtual ReaderWriter::WriteResult writeHeightField(const osg::HeightField &obj, const std::string &fileName, const Options *options)
osgDB::WriteFileCallback::writeScript
virtual ReaderWriter::WriteResult writeScript(const osg::Script &obj, const std::string &fileName, const Options *options)
osgDB::WriteFileCallback::~WriteFileCallback
virtual ~WriteFileCallback()
Definition osgDB/Callbacks:91
osgDB::WriteFileCallback::writeImage
virtual ReaderWriter::WriteResult writeImage(const osg::Image &obj, const std::string &fileName, const Options *options)
osgDB::WriteFileCallback::writeNode
virtual ReaderWriter::WriteResult writeNode(const osg::Node &obj, const std::string &fileName, const Options *options)
osgDB::WriteFileCallback::writeShader
virtual ReaderWriter::WriteResult writeShader(const osg::Shader &obj, const std::string &fileName, const Options *options)
osgDB::WriteFileCallback::writeObject
virtual ReaderWriter::WriteResult writeObject(const osg::Object &obj, const std::string &fileName, const Options *options)
osg::HeightField
Definition Shape:483
osg::Image
Definition Image:179
osg::Node
Definition Node:72
osg::Object
Definition Object:61
osg::Referenced
Definition Referenced:44
osg::Script
Definition osg/ScriptEngine:30
osg::Shader
Definition Shader:89
osgDB
Definition Archive:24
osgDB::FilePathList
std::deque< std::string > FilePathList
Definition osgDB/Callbacks:28
osgDB::CaseSensitivity
CaseSensitivity
Definition osgDB/Callbacks:31
osgDB::CASE_INSENSITIVE
@ CASE_INSENSITIVE
Definition osgDB/Callbacks:33
osgDB::CASE_SENSITIVE
@ CASE_SENSITIVE
Definition osgDB/Callbacks:32
OSGDB_EXPORT
#define OSGDB_EXPORT
Definition osgDB/Export:39