osgEarth 2.1.1
|
Public Member Functions | |
BuildTextFilter (const Style &style=Style()) | |
const Style & | getStyle () |
void | setStyle (const Style &s) |
osg::Node * | push (FeatureList &input, FilterContext &context) |
Protected Attributes | |
osg::ref_ptr< osg::Geode > | _geode |
Style | _style |
Builds text labels from a stream of input features.
Definition at line 37 of file BuildTextFilter.
Definition at line 31 of file BuildTextFilter.cpp.
: _style( style ) { //nop }
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; }
void osgEarth::Features::BuildTextFilter::setStyle | ( | const Style & | s | ) | [inline] |
Definition at line 44 of file BuildTextFilter.
{ _style = s; }
osg::ref_ptr<osg::Geode> osgEarth::Features::BuildTextFilter::_geode [protected] |
Definition at line 50 of file BuildTextFilter.
Style osgEarth::Features::BuildTextFilter::_style [protected] |
Definition at line 51 of file BuildTextFilter.