Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/NodeGraph.cpp
QRect NodeGraph::CalcRectFromGraph() const
    {
        QRect result;

        // for all nodes
        for (const AZStd::pair<QPersistentModelIndex, AZStd::unique_ptr<GraphNode> >& modelIndexAndGraphNode : m_graphNodeByModelIndex)
        {
            GraphNode* graphNode = modelIndexAndGraphNode.second.get();

            // add the rect
            result |= graphNode->GetRect();

            // for all connections
            const size_t numConnections = graphNode->GetNumConnections();
            for (size_t c = 0; c < numConnections; ++c)
            {
                result |= graphNode->GetConnection(c)->CalcRect();
            }
        }

        return result;
    }
// calculate the rect from the entire graph
calculate the rect from the entire graph
calculate the rect from the entire graph
QRect NodeGraph::CalcRectFromGraph() const
    {
        QRect result;
        for (const AZStd::pair<QPersistentModelIndex, AZStd::unique_ptr<GraphNode> >& modelIndexAndGraphNode : m_graphNodeByModelIndex)
        {
            GraphNode* graphNode = modelIndexAndGraphNode.second.get();
            result |= graphNode->GetRect();
            const size_t numConnections = graphNode->GetNumConnections();
            for (size_t c = 0; c < numConnections; ++c)
            {
                result |= graphNode->GetConnection(c)->CalcRect();
            }
        }
        return result;
    }
QRect NodeGraph :: CalcRectFromGraph ( ) const { QRect result ; for ( const AZStd :: pair < QPersistentModelIndex , AZStd :: unique_ptr < GraphNode > > & modelIndexAndGraphNode : m_graphNodeByModelIndex ) { GraphNode * graphNode = modelIndexAndGraphNode . second . get ( ) ; result |= graphNode -> GetRect ( ) ; const size_t numConnections = graphNode -> GetNumConnections ( ) ; for ( size_t c = 0 ; c < numConnections ; ++ c ) { result |= graphNode -> GetConnection ( c ) -> CalcRect ( ) ; } } return result ; }
calculate the rect from the entire graph
calculate the rect from the entire graph
// for all nodes // add the rect // for all connections