osgEarth 2.1.1
|
Public Member Functions | |
Style (const std::string &name="") | |
Style (const Config &conf) | |
Style (const Style &rhs) | |
const std::string & | getName () const |
void | setName (const std::string &value) |
Style | combineWith (const Style &rhs) const |
bool | empty () const |
void | addSymbol (Symbol *symbol) |
bool | removeSymbol (Symbol *symbol) |
template<typename T > | |
T * | getSymbol () |
template<typename T > | |
T * | get () |
template<typename T > | |
const T * | getSymbol () const |
template<typename T > | |
const T * | get () const |
template<typename T > | |
T * | getOrCreateSymbol () |
template<typename T > | |
T * | getOrCreate () |
virtual Config | getConfig (bool keepOrigType=true) const |
void | mergeConfig (const Config &conf) |
void | fromCSS (const std::string &css) |
Protected Attributes | |
std::string | _name |
SymbolList | _symbols |
std::string | _origType |
std::string | _origData |
optional< URI > | _uri |
Style is an unordered collection of Symbols that describes how to render geometry and other objects.
osgEarth::Symbology::Style::Style | ( | const std::string & | name = "" | ) |
Constructs a new, empty style.
Style::Style | ( | const Config & | conf | ) |
Constructs a style by deserializing it from a Config.
Definition at line 65 of file Style.cpp.
{ mergeConfig( conf ); }
Style::Style | ( | const Style & | rhs | ) |
void Style::addSymbol | ( | Symbol * | symbol | ) |
Starts with this style, merges in all the symbols from the other style, and returns a new style
Definition at line 71 of file Style.cpp.
{ // start by deep-cloning this style. Config conf = getConfig( false ); Style newStyle( conf ); // next, merge in the symbology from the other style. newStyle.mergeConfig( rhs.getConfig(false) ); if ( !this->empty() && !rhs.empty() ) newStyle.setName( _name + ":" + rhs.getName() ); else if ( !this->empty() && rhs.empty() ) newStyle.setName( _name ); else if ( this->empty() && !rhs.empty() ) newStyle.setName( rhs.getName() ); else newStyle.setName( _name ); return newStyle; }
bool osgEarth::Symbology::Style::empty | ( | ) | const [inline] |
void osgEarth::Symbology::Style::fromCSS | ( | const std::string & | css | ) |
T* osgEarth::Symbology::Style::get | ( | ) | [inline] |
const T* osgEarth::Symbology::Style::get | ( | ) | const [inline] |
virtual Config osgEarth::Symbology::Style::getConfig | ( | bool | keepOrigType = true | ) | const [virtual] |
Serializes this object into a Config.
const std::string& osgEarth::Symbology::Style::getName | ( | ) | const [inline] |
T* osgEarth::Symbology::Style::getOrCreate | ( | ) | [inline] |
T* osgEarth::Symbology::Style::getOrCreateSymbol | ( | ) | [inline] |
const T* osgEarth::Symbology::Style::getSymbol | ( | ) | const [inline] |
T* osgEarth::Symbology::Style::getSymbol | ( | ) | [inline] |
void osgEarth::Symbology::Style::mergeConfig | ( | const Config & | conf | ) |
bool Style::removeSymbol | ( | Symbol * | symbol | ) |
void osgEarth::Symbology::Style::setName | ( | const std::string & | value | ) | [inline] |
std::string osgEarth::Symbology::Style::_name [protected] |
SymbolList osgEarth::Symbology::Style::_symbols [protected] |