osgEarth 2.1.1
Public Member Functions | Protected Attributes

osgEarth::Features::BuildTextFilter Class Reference

Inheritance diagram for osgEarth::Features::BuildTextFilter:
Collaboration diagram for osgEarth::Features::BuildTextFilter:

List of all members.

Public Member Functions

 BuildTextFilter (const Style &style=Style())
const StylegetStyle ()
void setStyle (const Style &s)
osg::Node * push (FeatureList &input, FilterContext &context)

Protected Attributes

osg::ref_ptr< osg::Geode > _geode
Style _style

Detailed Description

Builds text labels from a stream of input features.

Definition at line 37 of file BuildTextFilter.


Constructor & Destructor Documentation

BuildTextFilter::BuildTextFilter ( const Style style = Style())

Definition at line 31 of file BuildTextFilter.cpp.

                                                     :
_style( style )
{
    //nop
}

Member Function Documentation

const Style& osgEarth::Features::BuildTextFilter::getStyle ( ) [inline]

The style to apply to feature geometry

Definition at line 43 of file BuildTextFilter.

{ return _style; }
osg::Node * BuildTextFilter::push ( FeatureList input,
FilterContext context 
) [virtual]

Pushes a list of features through the filter.

Implements osgEarth::Features::FeaturesToNodeFilter.

Definition at line 38 of file BuildTextFilter.cpp.

{
    osg::Node* result = 0L;

    const TextSymbol* text = _style.get<TextSymbol>();
    if ( !text )
    {
        OE_WARN << LC << "Insufficient symbology (no TextSymbol)" << std::endl;
        return 0L;
    }

    // if a provider is set, load the plugin and create the node.
    if ( !text->provider()->empty() && !text->provider().isSetTo("legacy") )
    {
        LabelSourceOptions options;
        options.setDriver( *text->provider() );
        osg::ref_ptr<LabelSource> source = LabelSourceFactory::create( options );
        if ( source.valid() )
        {
            result = source->createNode( input, text, context );
        }
        else
        {
            OE_WARN << LC << "FAIL, unable to load label provider \"" << (*text->provider()) << "\"" << std::endl;
            return 0L;
        }
    }

    else // legacy behavior... will be deprecated.
    {
        BuildTextOperator op;
        result = op( input, text, context );
    }

    return result;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void osgEarth::Features::BuildTextFilter::setStyle ( const Style s) [inline]

Definition at line 44 of file BuildTextFilter.

{ _style = s; }

Member Data Documentation

osg::ref_ptr<osg::Geode> osgEarth::Features::BuildTextFilter::_geode [protected]

Definition at line 50 of file BuildTextFilter.

Definition at line 51 of file BuildTextFilter.


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