osgEarth 2.1.1
|
Public Member Functions | |
osgEarthFeatureModelPseudoLoader () | |
const char * | className () |
ReadResult | readNode (const std::string &uri, const Options *options) const |
Static Public Member Functions | |
static UID | registerGraph (FeatureModelGraph *graph) |
static void | unregisterGraph (UID uid) |
static FeatureModelGraph * | getGraph (UID uid) |
Definition at line 76 of file FeatureModelGraph.cpp.
osgEarthFeatureModelPseudoLoader::osgEarthFeatureModelPseudoLoader | ( | ) | [inline] |
Definition at line 78 of file FeatureModelGraph.cpp.
{ supportsExtension( "osgearth_pseudo_fmg", "Feature model pseudo-loader" ); }
const char* osgEarthFeatureModelPseudoLoader::className | ( | ) | [inline] |
Definition at line 83 of file FeatureModelGraph.cpp.
{ // override return "osgEarth Feature Model Pseudo-Loader"; }
static FeatureModelGraph* osgEarthFeatureModelPseudoLoader::getGraph | ( | UID | uid | ) | [inline, static] |
Definition at line 118 of file FeatureModelGraph.cpp.
{ Threading::ScopedReadLock lock( _fmgMutex ); std::map<UID, FeatureModelGraph*>::const_iterator i = _fmgRegistry.find( uid ); return i != _fmgRegistry.end() ? i->second : 0L; }
ReadResult osgEarthFeatureModelPseudoLoader::readNode | ( | const std::string & | uri, |
const Options * | options | ||
) | const [inline] |
Definition at line 88 of file FeatureModelGraph.cpp.
{ if ( !acceptsExtension( osgDB::getLowerCaseFileExtension(uri) ) ) return ReadResult::FILE_NOT_HANDLED; UID uid; unsigned lod, x, y; sscanf( uri.c_str(), "%u.%d_%d_%d.%*s", &uid, &lod, &x, &y ); FeatureModelGraph* graph = getGraph(uid); if ( graph ) return ReadResult( graph->load( lod, x, y, uri ) ); else return ReadResult::ERROR_IN_READING_FILE; }
static UID osgEarthFeatureModelPseudoLoader::registerGraph | ( | FeatureModelGraph * | graph | ) | [inline, static] |
Definition at line 104 of file FeatureModelGraph.cpp.
{ Threading::ScopedWriteLock lock( _fmgMutex ); UID key = ++_uid; _fmgRegistry[key] = graph; return key; }
static void osgEarthFeatureModelPseudoLoader::unregisterGraph | ( | UID | uid | ) | [inline, static] |
Definition at line 112 of file FeatureModelGraph.cpp.
{ Threading::ScopedWriteLock lock( _fmgMutex ); _fmgRegistry.erase( uid ); }