private SamplePoints <double> GetSamplePoints(SMapWorkRequest sMapWorkRequest) { if (Coords.TryGetFromSCoords(sMapWorkRequest.SCoords, out Coords coords)) { double[][] xValueSections = BuildValueSections(coords.LeftBot.X, coords.RightTop.X, sMapWorkRequest.CanvasSize.Width, SECTION_WIDTH, sMapWorkRequest.Area.SectionAnchor.X, sMapWorkRequest.Area.CanvasSize.Width); double[][] yValueSections; if (!coords.IsUpsideDown) { yValueSections = BuildValueSections(coords.RightTop.Y, coords.LeftBot.Y, sMapWorkRequest.CanvasSize.Height, SECTION_HEIGHT, sMapWorkRequest.Area.SectionAnchor.Y, sMapWorkRequest.Area.CanvasSize.Height); } else { yValueSections = BuildValueSections(coords.LeftBot.Y, coords.RightTop.Y, sMapWorkRequest.CanvasSize.Height, SECTION_HEIGHT, sMapWorkRequest.Area.SectionAnchor.Y, sMapWorkRequest.Area.CanvasSize.Height); } return(new SamplePoints <double>(xValueSections, yValueSections)); } else { throw new ArgumentException("Cannot parse the SCoords into a Coords value."); } }
public bool RequiresQuadPrecision() { if (Coords.TryGetFromSCoords(SCoords, out Coords coords)) { if (!HasPrecision(GetSamplePointDiff(coords.LeftBot.X, coords.RightTop.X, CanvasSize.Width)) || !HasPrecision(GetSamplePointDiff(coords.LeftBot.Y, coords.RightTop.Y, CanvasSize.Height))) { return(true); } else { return(false); } } else { // Cannot parse the values -- invalid string values. Debug.WriteLine("Cannot parse the SCoords value."); return(false); } }