//////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// Determine if a point is to the left of this edge when facing from the start vertex to the end /// vertex. /// </summary> /// <remarks> Darrellp, 2/18/2011. </remarks> /// <param name="pt"> Point to check out. </param> /// <returns> true if it succeeds, false if it fails. </returns> //////////////////////////////////////////////////////////////////////////////////////////////////// public bool FLeftOf(Vector pt) { // We should never have a start vertex at infinity // // Fortune.ProcessRay(), which creates the vertices at infinity, specifically makes sure that // this never happens (except with edges at infinity which are really placeholders for the // winged edge structure and have no position at all. They aren't processed here (and if they // were, it would be a problem). While this is a touch Fortune specific, there's no reason not to // insist on it in the general case. // If the end vtx is at infinity, convert it to a real point var pt1 = VtxStart.Pt; var pt2 = VtxEnd.FAtInfinity ? VtxEnd.ConvertToReal(pt1, 10) : VtxEnd.Pt; // Do the geometry on pt1 and pt2 return(Geometry2D.FLeft(pt1, pt2, pt)); }
// In the tree, left is "above", right is "below" internal override bool ShouldTravelLeft(T x, T y) { // We want to go left if we're above - i.e., to the left of the line travelling // from left to right. return(Geometry2D.FLeft(_leftEnd, _rightEnd, new Vector(x, y))); }