2006-07-18 23:21:48 +08:00
|
|
|
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
2003-01-22 00:45:36 +08:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
2001-10-04 23:12:57 +08:00
|
|
|
|
2001-09-20 05:08:56 +08:00
|
|
|
#ifndef OSGDB_INPUT
|
|
|
|
#define OSGDB_INPUT 1
|
|
|
|
|
|
|
|
#include <osg/Image>
|
|
|
|
#include <osg/Node>
|
|
|
|
#include <osg/Drawable>
|
|
|
|
#include <osg/StateAttribute>
|
|
|
|
|
|
|
|
#include <osgDB/FieldReaderIterator>
|
2004-10-06 17:31:34 +08:00
|
|
|
#include <osgDB/ReaderWriter>
|
2001-09-20 05:08:56 +08:00
|
|
|
|
|
|
|
#include <map>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
namespace osgDB {
|
|
|
|
|
2003-07-22 02:36:47 +08:00
|
|
|
struct basic_type_wrapper;
|
|
|
|
|
2001-09-20 05:08:56 +08:00
|
|
|
/** Class for managing the reading of ASCII .osg files.*/
|
|
|
|
class OSGDB_EXPORT Input : public FieldReaderIterator
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
Input();
|
|
|
|
virtual ~Input();
|
2004-10-06 17:31:34 +08:00
|
|
|
|
|
|
|
void setOptions(const ReaderWriter::Options* options) { _options = options; }
|
|
|
|
const ReaderWriter::Options* getOptions() const { return _options.get(); }
|
2001-09-20 05:08:56 +08:00
|
|
|
|
|
|
|
virtual osg::Object* readObjectOfType(const osg::Object& compObj);
|
2003-07-22 02:36:47 +08:00
|
|
|
virtual osg::Object* readObjectOfType(const basic_type_wrapper &btw);
|
2001-09-20 05:08:56 +08:00
|
|
|
|
|
|
|
virtual osg::Object* readObject();
|
|
|
|
virtual osg::Image* readImage();
|
|
|
|
virtual osg::Drawable* readDrawable();
|
|
|
|
virtual osg::StateAttribute* readStateAttribute();
|
2005-04-18 20:34:28 +08:00
|
|
|
virtual osg::Uniform* readUniform();
|
2001-09-20 05:08:56 +08:00
|
|
|
virtual osg::Node* readNode();
|
|
|
|
|
|
|
|
virtual osg::Object* readObject(const std::string& fileName);
|
|
|
|
virtual osg::Image* readImage(const std::string& fileName);
|
|
|
|
virtual osg::Node* readNode(const std::string& fileName);
|
|
|
|
|
|
|
|
virtual osg::Object* getObjectForUniqueID(const std::string& uniqueID);
|
|
|
|
virtual void regisiterUniqueIDForObject(const std::string& uniqueID,osg::Object* obj);
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
2003-03-11 00:40:26 +08:00
|
|
|
typedef std::map< std::string, osg::ref_ptr<osg::Object> > UniqueIDToObjectMapping;
|
2001-09-20 05:08:56 +08:00
|
|
|
UniqueIDToObjectMapping _uniqueIDToObjectMap;
|
2004-10-06 17:31:34 +08:00
|
|
|
|
|
|
|
osg::ref_ptr<const ReaderWriter::Options> _options;
|
2001-09-20 05:08:56 +08:00
|
|
|
|
|
|
|
};
|
|
|
|
|
2002-02-03 20:33:41 +08:00
|
|
|
}
|
2001-09-20 05:08:56 +08:00
|
|
|
|
|
|
|
#endif // __SG_INPUT_H
|