Smrf.NodeXL.Visualization.Wpf.NodeXLControl.RebundleIncidentEdgesIfAppropriate C# (CSharp) Method

RebundleIncidentEdgesIfAppropriate() protected method

protected RebundleIncidentEdgesIfAppropriate ( IEnumerable oVertices ) : void
oVertices IEnumerable
return void
    RebundleIncidentEdgesIfAppropriate
    (
        IEnumerable<IVertex> oVertices
    )
    {
        Debug.Assert(oVertices != null);
        AssertValid();

        if (!this.ShouldBundleEdges)
        {
            return;
        }

        System.Drawing.Rectangle oLayoutRectangleMinusMargin;

        if ( !TryGetLayoutRectangleMinusMargin(
            out oLayoutRectangleMinusMargin) )
        {
            return;
        }

        // Don't rebundle the same edge twice, because rebundling takes a long
        // time.

        Dictionary<Int32, IEdge> oUniqueEdges = new Dictionary<Int32, IEdge>();

        foreach (IVertex oVertex in oVertices)
        {
            foreach (IEdge oIncidentEdge in oVertex.IncidentEdges)
            {
                oUniqueEdges[oIncidentEdge.ID] = oIncidentEdge;
            }
        }

        CreateEdgeBundler().BundleEdges(this.Graph, oUniqueEdges.Values,
            oLayoutRectangleMinusMargin);
    }
NodeXLControl