osgEarth 2.1.1
|
Static Public Member Functions | |
static LabelSource * | create (const LabelSourceOptions &options=LabelSourceOptions()) |
Definition at line 101 of file LabelSource.
LabelSource * LabelSourceFactory::create | ( | const LabelSourceOptions & | options = LabelSourceOptions() | ) | [static] |
Definition at line 57 of file LabelSource.cpp.
{ LabelSource* labelSource = 0L; if ( !options.getDriver().empty() ) { std::string driverExt = std::string(".osgearth_label_") + options.getDriver(); osg::ref_ptr<osgDB::ReaderWriter::Options> rwopts = new osgDB::ReaderWriter::Options(); rwopts->setPluginData( LABEL_SOURCE_OPTIONS_TAG, (void*)&options ); labelSource = dynamic_cast<LabelSource*>( osgDB::readObjectFile( driverExt, rwopts.get() ) ); if ( labelSource ) { //modelSource->setName( options.getName() ); OE_INFO << "Loaded LabelSource driver \"" << options.getDriver() << "\" OK" << std::endl; } else { OE_WARN << "FAIL, unable to load label source driver for \"" << options.getDriver() << "\"" << std::endl; } } else { OE_WARN << LC << "FAIL, illegal null driver specification" << std::endl; } return labelSource; }