コード例 #1
0
static bool writeLayers( osgDB::OutputStream& os, const osgVolume::CompositeLayer& layer )
{
    unsigned int size = layer.getNumLayers();
    os << size << os.BEGIN_BRACKET << std::endl;
    for ( unsigned int i=0; i<size; ++i )
    {
        os << layer.getLayer(i);
    }
    os << os.END_BRACKET << std::endl;
    return true;
}
コード例 #2
0
static bool readLayers( osgDB::InputStream& is, osgVolume::CompositeLayer& layer )
{
    unsigned int size = 0; is >> size >> is.BEGIN_BRACKET;
    for ( unsigned int i=0; i<size; ++i )
    {
        osgVolume::Layer* child = dynamic_cast<osgVolume::Layer*>( is.readObject() );
        if ( child ) layer.addLayer( child );
    }
    is >> is.END_BRACKET;
    return true;
}
コード例 #3
0
ファイル: CompositeLayer.cpp プロジェクト: yueying/osg
static bool readLayers( osgDB::InputStream& is, osgVolume::CompositeLayer& layer )
{
    unsigned int size = 0; is >> size >> is.BEGIN_BRACKET;
    for ( unsigned int i=0; i<size; ++i )
    {
        osg::ref_ptr<osgVolume::Layer> child = is.readObjectOfType<osgVolume::Layer>();
        if ( child ) layer.addLayer( child );
    }
    is >> is.END_BRACKET;
    return true;
}
コード例 #4
0
static bool checkLayers( const osgVolume::CompositeLayer& layer )
{
    return layer.getNumLayers()>0;
}