internal virtual void PrintDiagnostics() { System.Console.Out.WriteLine("Text (@" + location.GetStartLocation() + " -> " + location.GetEndLocation() + "): " + text); System.Console.Out.WriteLine("orientationMagnitude: " + location.OrientationMagnitude()); System.Console.Out.WriteLine("distPerpendicular: " + location.DistPerpendicular()); System.Console.Out.WriteLine("distParallel: " + location.DistParallelStart()); }
public virtual bool SameLine(ITextChunkLocation @as) { if (OrientationMagnitude() != @as.OrientationMagnitude()) { return(false); } int distPerpendicularDiff = DistPerpendicular() - @as.DistPerpendicular(); if (Math.Abs(distPerpendicularDiff) < 2) { return(true); } LineSegment mySegment = new LineSegment(startLocation, endLocation); LineSegment otherSegment = new LineSegment(@as.GetStartLocation(), @as.GetEndLocation()); return(Math.Abs(distPerpendicularDiff) <= DIACRITICAL_MARKS_ALLOWED_VERTICAL_DEVIATION && (mySegment.GetLength() == 0 || otherSegment.GetLength() == 0)); }
internal static bool ContainsMark(ITextChunkLocation baseLocation, ITextChunkLocation markLocation) { return(baseLocation.GetStartLocation().Get(Vector.I1) <= markLocation.GetStartLocation().Get(Vector.I1) && baseLocation.GetEndLocation().Get(Vector.I1) >= markLocation.GetEndLocation().Get(Vector.I1) && Math. Abs(baseLocation.DistPerpendicular() - markLocation.DistPerpendicular()) <= DIACRITICAL_MARKS_ALLOWED_VERTICAL_DEVIATION); }