15 #ifndef OSGDB_INPUTSTREAM
16 #define OSGDB_INPUTSTREAM
30 #include <osg/BoundingBox>
31 #include <osg/BoundingSphere>
33 #include <osg/PrimitiveSet>
34 #include <osgDB/ReaderWriter>
35 #include <osgDB/StreamOperator>
36 #include <osgDB/Options>
48 for (
unsigned int i=0; i<fields.size(); ++i )
66 typedef std::map< unsigned int, osg::ref_ptr<osg::Array> >
ArrayMap;
67 typedef std::map< unsigned int, osg::ref_ptr<osg::Object> >
IdentifierMap;
80 void setFileVersion(
const std::string& d,
int v ) { _domainVersionMap[d] = v; }
81 int getFileVersion(
const std::string& d=std::string() )
const;
83 bool isBinary()
const {
return _in->isBinary(); }
150 { ptr =
static_cast<T*
>(readObject());
return *
this; }
153 bool matchString(
const std::string& str ) {
return _in->matchString(str); }
156 void readCharArray(
char* s,
unsigned int size ) { _in->readCharArray(s, size); }
157 void readComponentArray(
char* s,
unsigned int numElements,
unsigned int numComponentsPerElements,
unsigned int componentSizeInBytes) { _in->readComponentArray( s, numElements, numComponentsPerElements, componentSizeInBytes); }
160 unsigned int readSize() {
unsigned int size; *
this>>size;
return size; }
171 T* ptr =
dynamic_cast<T*
>(obj.
get());
172 if (ptr) { obj.
release();
return ptr; }
179 osg::Object* readObjectFields(
const std::string& className,
unsigned int id,
osg::Object* existingObj=0);
190 void readSchema( std::istream& fin );
194 inline void throwException(
const std::string& msg );
203 inline void checkStream();
204 void setWrapperSchema(
const std::string& name,
const std::string& properties );
207 void readArrayImplementation( T* a,
unsigned int numComponentsPerElements,
unsigned int componentSizeInBytes );
237 if (
_in->isFailed() )
A plane class. It can be used to represent an infinite plane.
std::istream & operator>>(std::istream &input, Vec2f &vec)
void readImage(const osg::Image *image, O &operation)