示例#1
0
MemoryUnitPtr DataSource::getData( const NodeId& nodeId )
{
    if( !nodeId.isValid( ))
        return MemoryUnitPtr();

    const LODNode& lodNode = getNode( nodeId );
    if( !lodNode.isValid( ))
        return MemoryUnitPtr();

    return _impl->plugin->getData( lodNode );
}
示例#2
0
文件: NodeId.cpp 项目: chevtche/Livre
NodeIds NodeId::getParents() const
{
    NodeIds nodeIds;
    NodeId parent = getParent();

    while (parent.isValid())
    {
        nodeIds.push_back(parent);
        parent = parent.getParent();
    }

    return nodeIds;
}
    void collectLoadedTextures( const NodeId& nodeId,
                                ConstCacheMap& cacheMap ) const
    {
        NodeId current = nodeId;
        while( current.isValid( ))
        {
            const NodeId& currentNodeId = current;
            const ConstCacheObjectPtr texture = _textureCache.get( currentNodeId.getId( ));
            if( texture && texture->isLoaded( ))
            {
                cacheMap[ currentNodeId.getId() ] = texture;
                break;
            }

            current = currentNodeId.isRoot() ? NodeId() :
                                               currentNodeId.getParent();
        }
    }