Smrf.NodeXL.Visualization.Wpf.EdgeDrawer.TryGetVertexInformation C# (CSharp) Method

TryGetVertexInformation() protected method

protected TryGetVertexInformation ( IVertex oVertex1, IVertex oVertex2, VertexDrawingHistory &oVertex1DrawingHistory, VertexDrawingHistory &oVertex2DrawingHistory, Point &oEdgeEndpoint1, Point &oEdgeEndpoint2 ) : System.Boolean
oVertex1 IVertex
oVertex2 IVertex
oVertex1DrawingHistory VertexDrawingHistory
oVertex2DrawingHistory VertexDrawingHistory
oEdgeEndpoint1 Point
oEdgeEndpoint2 Point
return System.Boolean
    TryGetVertexInformation
    (
        IVertex oVertex1,
        IVertex oVertex2,
        out VertexDrawingHistory oVertex1DrawingHistory,
        out VertexDrawingHistory oVertex2DrawingHistory,
        out Point oEdgeEndpoint1,
        out Point oEdgeEndpoint2
    )
    {
        Debug.Assert(oVertex1 != null);
        Debug.Assert(oVertex2 != null);
        AssertValid();

        oVertex1DrawingHistory = oVertex2DrawingHistory = null;
        oEdgeEndpoint1 = oEdgeEndpoint2 = new Point();

        // Retrieve the information about how the vertices were drawn.

        if (
            !TryGetVertexDrawingHistory(oVertex1, out oVertex1DrawingHistory)
            ||
            !TryGetVertexDrawingHistory(oVertex2, out oVertex2DrawingHistory)
            )
        {
            // One of the edge's vertices is hidden.

            return (false);
        }

        // The drawing histories determine the edge endpoints.  For example, if
        // oVertex1 was drawn as a circle, then oVertex1DrawingHistory is a
        // CircleVertexDrawingHistory that knows to put its endpoint on the
        // circle itself and not at the circle's center.

        oVertex1DrawingHistory.GetEdgeEndpoint(
            oVertex2DrawingHistory.VertexLocation, out oEdgeEndpoint1);

        oVertex2DrawingHistory.GetEdgeEndpoint(
            oVertex1DrawingHistory.VertexLocation, out oEdgeEndpoint2);

        return (true);
    }