Function hasLoop

Synopsis

#include <Source/Falcor/Utils/Algorithm/DirectedGraphTraversal.h>

static bool hasLoop(const DirectedGraph::SharedPtr pGraph, uint32_t rootNode)

Description

No description yet.

Source

Lines 151-163 in Source/Falcor/Utils/Algorithm/DirectedGraphTraversal.h.

static bool hasLoop(const DirectedGraph::SharedPtr pGraph, uint32_t rootNode)
{
    DirectedGraphDfsTraversal dfs(pGraph, rootNode);
    // Skip the first node since it's the root
    uint32_t n = dfs.traverse();
    while (n != DirectedGraph::kInvalidID)
    {
        n = dfs.traverse();
        if (n == rootNode) return true;
    }
    return false;
}





Add Discussion as Guest

Log in