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);
}