osgEarth 2.1.1
|
Public Member Functions | |
StyleSelector (const Config &conf=Config()) | |
std::string & | name () |
const std::string & | name () const |
optional< std::string > & | styleName () |
const optional< std::string > & | styleName () const |
optional< Query > & | query () |
const optional< Query > & | query () const |
std::string | getSelectedStyleName () const |
virtual void | mergeConfig (const Config &conf) |
virtual Config | getConfig () const |
Protected Attributes | |
std::string | _name |
optional< std::string > | _styleName |
optional< Query > | _query |
A style selector lets you classify styles based on rules, such as a feature query. By default the selector selects the style with the same name as the selector, but you can override this by settings the styleName property.
Definition at line 183 of file Style.cpp.
{ mergeConfig( conf ); }
Config StyleSelector::getConfig | ( | ) | const [virtual] |
std::string StyleSelector::getSelectedStyleName | ( | ) | const |
Returns the styleClass() property, if set; otherwise returns the selector name.
Definition at line 189 of file Style.cpp.
{ return _styleName.isSet() ? *_styleName : _name; }
void StyleSelector::mergeConfig | ( | const Config & | conf | ) | [virtual] |
Definition at line 195 of file Style.cpp.
{ _name = conf.value( "name" ); conf.getIfSet( "style", _styleName ); // backwards compatibility conf.getIfSet( "class", _styleName ); conf.getObjIfSet( "query", _query ); }
const std::string& osgEarth::Symbology::StyleSelector::name | ( | ) | const [inline] |
std::string& osgEarth::Symbology::StyleSelector::name | ( | ) | [inline] |
optional<std::string>& osgEarth::Symbology::StyleSelector::styleName | ( | ) | [inline] |
const optional<std::string>& osgEarth::Symbology::StyleSelector::styleName | ( | ) | const [inline] |
Definition at line 158 of file Style.
{ return _styleName; }
std::string osgEarth::Symbology::StyleSelector::_name [protected] |
optional<Query> osgEarth::Symbology::StyleSelector::_query [protected] |
optional<std::string> osgEarth::Symbology::StyleSelector::_styleName [protected] |