osgEarth 2.1.1
Public Member Functions

osgEarth::Symbology::ModelSymbolizer Class Reference

List of all members.

Public Member Functions

virtual bool compile (State< GeometryContent > *state, osg::Group *attachPoint)
 ModelSymbolizer ()

Detailed Description

Definition at line 28 of file ModelSymbolizer.


Constructor & Destructor Documentation

ModelSymbolizer::ModelSymbolizer ( )

Definition at line 29 of file ModelSymbolizer.cpp.

{
}

Member Function Documentation

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

Here is the call graph for this function:


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