Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/NodeGraph.cpp
NodeConnection* NodeGraph::FindConnection(const QPoint& mousePos)
    {
        // for all nodes in the graph
        for (const GraphNodeByModelIndex::value_type& indexAndGraphNode : m_graphNodeByModelIndex)
        {
            GraphNode* graphNode = indexAndGraphNode.second.get();

            // iterate over all connections
            const size_t numConnections = graphNode->GetNumConnections();
            for (size_t c = 0; c < numConnections; ++c)
            {
                NodeConnection* connection  = graphNode->GetConnection(c);
                if (connection->CheckIfIsCloseTo(mousePos))
                {
                    return connection;
                }
            }
        }

        // failure, there is no connection at the given mouse position
        return nullptr;
    }
// find the connection at the given mouse position
find the connection at the given mouse position
find the connection at the given mouse position
NodeConnection* NodeGraph::FindConnection(const QPoint& mousePos)
    {
        for (const GraphNodeByModelIndex::value_type& indexAndGraphNode : m_graphNodeByModelIndex)
        {
            GraphNode* graphNode = indexAndGraphNode.second.get();
            const size_t numConnections = graphNode->GetNumConnections();
            for (size_t c = 0; c < numConnections; ++c)
            {
                NodeConnection* connection  = graphNode->GetConnection(c);
                if (connection->CheckIfIsCloseTo(mousePos))
                {
                    return connection;
                }
            }
        }
        return nullptr;
    }
NodeConnection * NodeGraph :: FindConnection ( const QPoint & mousePos ) { for ( const GraphNodeByModelIndex :: value_type & indexAndGraphNode : m_graphNodeByModelIndex ) { GraphNode * graphNode = indexAndGraphNode . second . get ( ) ; const size_t numConnections = graphNode -> GetNumConnections ( ) ; for ( size_t c = 0 ; c < numConnections ; ++ c ) { NodeConnection * connection = graphNode -> GetConnection ( c ) ; if ( connection -> CheckIfIsCloseTo ( mousePos ) ) { return connection ; } } } return nullptr ; }
find the connection at the given mouse position
find the connection at the given mouse position
// for all nodes in the graph // iterate over all connections // failure, there is no connection at the given mouse position