osgEarth 2.1.1
|
Public Member Functions | |
virtual bool | compile (State< GeometryContent > *state, osg::Group *attachPoint) |
ModelSymbolizer () |
Definition at line 28 of file ModelSymbolizer.
ModelSymbolizer::ModelSymbolizer | ( | ) |
Definition at line 29 of file ModelSymbolizer.cpp.
{ }
bool ModelSymbolizer::compile | ( | State< GeometryContent > * | state, |
osg::Group * | attachPoint | ||
) | [virtual] |
Creates or updates a subgraph representing the symbolized data. The Symbolizer can attach the subgraph to the attachPoint.
Definition at line 57 of file ModelSymbolizer.cpp.
{ if ( !state || !attachPoint || !state->getContent() || !state->getStyle() ) return false; const MarkerSymbol* symbol = state->getStyle()->getSymbol<MarkerSymbol>(); if (!symbol) return false; std::string model = symbol->marker().value(); if (model.empty()) return false; osg::ref_ptr<osg::Group> newSymbolized = new osg::Group; osg::Node* node = getNode(model); if (!node) return false; newSymbolized->addChild(node); attachPoint->removeChildren(0, attachPoint->getNumChildren()); attachPoint->addChild(newSymbolized.get()); return true; }