osgEarth 2.1.1
|
Static Public Member Functions | |
static ModelSource * | create (const ModelSourceOptions &options) |
Creates TileSource instances and chains them together to create tile source "pipelines" for data access and processing.
Definition at line 137 of file ModelSource.
ModelSource * ModelSourceFactory::create | ( | const ModelSourceOptions & | options | ) | [static] |
Definition at line 72 of file ModelSource.cpp.
{ ModelSource* modelSource = 0L; if ( !options.getDriver().empty() ) { std::string driverExt = std::string(".osgearth_model_") + options.getDriver(); osg::ref_ptr<osgDB::ReaderWriter::Options> rwopts = new osgDB::ReaderWriter::Options(); rwopts->setPluginData( MODEL_SOURCE_OPTIONS_TAG, (void*)&options ); modelSource = dynamic_cast<ModelSource*>( osgDB::readObjectFile( driverExt, rwopts.get() ) ); if ( modelSource ) { //modelSource->setName( options.getName() ); OE_INFO << "Loaded ModelSource driver \"" << options.getDriver() << "\" OK" << std::endl; } else { OE_WARN << "FAIL, unable to load model source driver for \"" << options.getDriver() << "\"" << std::endl; } } else { OE_WARN << LC << "FAIL, illegal null driver specification" << std::endl; } return modelSource; }