1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
3 * This library is open source and may be redistributed and/or modified under
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version. The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * OpenSceneGraph Public License for more details.
14#ifndef OSGDB_CALLBACKS
15#define OSGDB_CALLBACKS 1
17#include <osgDB/AuthenticationMap>
18#include <osgDB/ReaderWriter>
19#include <osgDB/FileCache>
27/** list of directories to search through which searching for files. */
28typedef std::deque<std::string> FilePathList;
39class OSGDB_EXPORT FindFileCallback : public virtual osg::Referenced
43 virtual std::string findDataFile(const std::string& filename, const Options* options, CaseSensitivity caseSensitivity);
45 virtual std::string findLibraryFile(const std::string& filename, const Options* options, CaseSensitivity caseSensitivity);
48 virtual ~FindFileCallback() {}
52class OSGDB_EXPORT ReadFileCallback : public virtual osg::Referenced
56 virtual ReaderWriter::ReadResult openArchive(const std::string& filename,ReaderWriter::ArchiveStatus status, unsigned int indexBlockSizeHint, const Options* useObjectCache);
58 virtual ReaderWriter::ReadResult readObject(const std::string& filename, const Options* options);
60 virtual ReaderWriter::ReadResult readImage(const std::string& filename, const Options* options);
62 virtual ReaderWriter::ReadResult readHeightField(const std::string& filename, const Options* options);
64 virtual ReaderWriter::ReadResult readNode(const std::string& filename, const Options* options);
66 virtual ReaderWriter::ReadResult readShader(const std::string& filename, const Options* options);
68 virtual ReaderWriter::ReadResult readScript(const std::string& filename, const Options* options);
71 virtual ~ReadFileCallback() {}
74class OSGDB_EXPORT WriteFileCallback : public virtual osg::Referenced
78 virtual ReaderWriter::WriteResult writeObject(const osg::Object& obj, const std::string& fileName,const Options* options);
80 virtual ReaderWriter::WriteResult writeImage(const osg::Image& obj, const std::string& fileName,const Options* options);
82 virtual ReaderWriter::WriteResult writeHeightField(const osg::HeightField& obj, const std::string& fileName,const Options* options);
84 virtual ReaderWriter::WriteResult writeNode(const osg::Node& obj, const std::string& fileName,const Options* options);
86 virtual ReaderWriter::WriteResult writeShader(const osg::Shader& obj, const std::string& fileName,const Options* options);
88 virtual ReaderWriter::WriteResult writeScript(const osg::Script& obj, const std::string& fileName,const Options* options);
91 virtual ~WriteFileCallback() {}
94class OSGDB_EXPORT FileLocationCallback : public virtual osg::Referenced
104 virtual Location fileLocation(const std::string& filename, const Options* options) = 0;
106 virtual bool useFileCache() const = 0;
109 virtual ~FileLocationCallback() {}
114#endif // OSGDB_OPTIONS