Smrf.NodeXL.Visualization.Wpf.TriangleVertexDrawingHistory.GetSelfLoopEndpoint C# (CSharp) Method

GetSelfLoopEndpoint() public method

public GetSelfLoopEndpoint ( RectangleEdge farthestGraphRectangleEdge ) : Point
farthestGraphRectangleEdge RectangleEdge
return Point
    GetSelfLoopEndpoint
    (
        RectangleEdge farthestGraphRectangleEdge
    )
    {
        AssertValid();

        // Return a point at one of the triangle's corners.

        Point oVertexLocation = this.VertexLocation;
        Double dVertexX = oVertexLocation.X;
        Double dVertexY = oVertexLocation.Y;

        Double dX = dVertexX;
        Double dY = dVertexY + m_dHalfWidth * WpfGraphicsUtil.Tangent30Degrees;

        switch (farthestGraphRectangleEdge)
        {
            case RectangleEdge.Top:

                dY = dVertexY - m_dHalfWidth / WpfGraphicsUtil.Cosine30Degrees;
                break;

            case RectangleEdge.Left:

                dX -= m_dHalfWidth;
                break;

            case RectangleEdge.Right:

                dX += m_dHalfWidth;
                break;

            case RectangleEdge.Bottom:

                break;

            default:

                Debug.Assert(false);
                break;
        }

        return ( new Point(dX, dY) );
    }