static bool readProperties( osgDB::InputStream& is, osgVolume::CompositeProperty& prop )
{
    unsigned int size = 0; is >> size >> is.BEGIN_BRACKET;
    for ( unsigned int i=0; i<size; ++i )
    {
        osg::ref_ptr<osgVolume::Property> child = is.readObjectOfType<osgVolume::Property>();
        if ( child ) prop.addProperty( child );
    }
    is >> is.END_BRACKET;
    return true;
}
示例#2
0
static bool readProperties( osgDB::InputStream& is, osgVolume::CompositeProperty& prop )
{
    unsigned int size = 0; is >> size >> is.BEGIN_BRACKET;
    for ( unsigned int i=0; i<size; ++i )
    {
        osgVolume::Property* child = dynamic_cast<osgVolume::Property*>( is.readObject() );
        if ( child ) prop.addProperty( child );
    }
    is >> is.END_BRACKET;
    return true;
}
 virtual void apply(osgVolume::CompositeProperty& cp)
 {
     OSG_NOTICE<<"Found CompositeProperty, inserting transfer function"<<std::endl;
     if (_tfp.valid()) cp.addProperty(_tfp.get());
 }