osgEarth 2.1.1
Static Public Member Functions

osgEarth::ModelSourceFactory Class Reference

List of all members.

Static Public Member Functions

static ModelSourcecreate (const ModelSourceOptions &options)

Detailed Description

Creates TileSource instances and chains them together to create tile source "pipelines" for data access and processing.

Definition at line 137 of file ModelSource.


Member Function Documentation

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

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