osgEarth 2.1.1
Static Public Member Functions

osgEarth::Features::LabelSourceFactory Class Reference

List of all members.

Static Public Member Functions

static LabelSourcecreate (const LabelSourceOptions &options=LabelSourceOptions())

Detailed Description

Definition at line 101 of file LabelSource.


Member Function Documentation

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;
}

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines