#include #include #include #include #include // _databasePath static bool checkDatabasePath( const osg::PagedLOD& node ) { return true; } static bool readDatabasePath( osgDB::InputStream& is, osg::PagedLOD& node ) { bool hasPath; is >> hasPath; if ( !hasPath ) { if ( is.getOptions() && !is.getOptions()->getDatabasePathList().empty() ) { const std::string& optionPath = is.getOptions()->getDatabasePathList().front(); if ( !optionPath.empty() ) node.setDatabasePath( optionPath ); } } else { std::string path; is.readWrappedString( path ); node.setDatabasePath( path ); } return true; } static bool writeDatabasePath( osgDB::OutputStream& os, const osg::PagedLOD& node ) { os << (!node.getDatabasePath().empty()); if ( !node.getDatabasePath().empty() ) os.writeWrappedString( node.getDatabasePath() ); os << std::endl; return true; } // _perRangeDataList static bool checkRangeDataList( const osg::PagedLOD& node ) { return node.getNumFileNames()>0; } static bool readRangeDataList( osgDB::InputStream& is, osg::PagedLOD& node ) { unsigned int size = 0; is >> size >> osgDB::BEGIN_BRACKET; for ( unsigned int i=0; i> osgDB::END_BRACKET; size = 0; is >> osgDB::PROPERTY("PriorityList") >> size >> osgDB::BEGIN_BRACKET; for ( unsigned int i=0; i> offset >> scale; node.setPriorityOffset( i, offset ); node.setPriorityScale( i, scale ); } is >> osgDB::END_BRACKET; return true; } static bool writeRangeDataList( osgDB::OutputStream& os, const osg::PagedLOD& node ) { unsigned int size = node.getNumFileNames(); os << size << osgDB::BEGIN_BRACKET << std::endl; for ( unsigned int i=0; i0; } static bool readChildren( osgDB::InputStream& is, osg::PagedLOD& node ) { unsigned int size = 0; is >> size >> osgDB::BEGIN_BRACKET; for ( unsigned int i=0; i( is.readObject() ); if ( child ) node.addChild( child ); } is >> osgDB::END_BRACKET; return true; } static bool writeChildren( osgDB::OutputStream& os, const osg::PagedLOD& node ) { unsigned int size=node.getNumFileNames(), dynamicLoadedSize=0; for ( unsigned int i=0; i0 ) { os << osgDB::BEGIN_BRACKET << std::endl; for ( unsigned int i=0; i