osgEarth 2.1.1
Public Member Functions | Protected Attributes

osgEarth::Symbology::StyleSelector Class Reference

Collaboration diagram for osgEarth::Symbology::StyleSelector:

List of all members.

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

Detailed Description

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 145 of file Style.


Constructor & Destructor Documentation

StyleSelector::StyleSelector ( const Config conf = Config())

Definition at line 183 of file Style.cpp.

{
    mergeConfig( conf );
}

Member Function Documentation

Config StyleSelector::getConfig ( ) const [virtual]

Definition at line 204 of file Style.cpp.

{
    Config conf( "selector" );
    conf.add( "name", _name );
    conf.addIfSet( "class", _styleName );
    conf.addObjIfSet( "query", _query );
    return conf;
}

Here is the call graph for this function:

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

Here is the caller graph for this function:

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

Here is the call graph for this function:

const std::string& osgEarth::Symbology::StyleSelector::name ( ) const [inline]

Definition at line 154 of file Style.

{ return _name; }
std::string& osgEarth::Symbology::StyleSelector::name ( ) [inline]

Name of this style class.

Definition at line 153 of file Style.

{ return _name; }
optional<Query>& osgEarth::Symbology::StyleSelector::query ( ) [inline]

Expression/spatial filter used to select items to which the style will apply

Definition at line 161 of file Style.

{ return _query; }

Here is the caller graph for this function:

const optional<Query>& osgEarth::Symbology::StyleSelector::query ( ) const [inline]

Definition at line 162 of file Style.

{ return _query; }
optional<std::string>& osgEarth::Symbology::StyleSelector::styleName ( ) [inline]

Name of the style to select

Definition at line 157 of file Style.

{ return _styleName; }
const optional<std::string>& osgEarth::Symbology::StyleSelector::styleName ( ) const [inline]

Definition at line 158 of file Style.

{ return _styleName; }

Member Data Documentation

Definition at line 172 of file Style.

Definition at line 174 of file Style.

Definition at line 173 of file Style.


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