private AllPointsCacheData CalculateAllPointsCacheData() { Contract.Ensures(Contract.Result <AllPointsCacheData>() != null); Contract.Ensures(_pointList.Count <= 0 || Contract.Result <AllPointsCacheData>().CalculatedMbr != null); return(new AllPointsCacheData { CalculatedMbr = Mbr.Create(_pointList), AreaSumValue = CalculateAreaSumValue() }); }
/// <summary> /// Calculates a minimum bounding rectangle for this polygon. /// </summary> /// <returns>A minimum bounding rectangle.</returns> public Mbr GetMbr() { Contract.Ensures(Count != 0 || Contract.Result <Mbr>() == null); Mbr mbr = null; for (var i = 0; i < Count; i++) { Contract.Assume(this[i] != null); var thisMbr = this[i].GetMbr(); mbr = mbr == null ? thisMbr : mbr.Encompass(thisMbr); } return(mbr); }
/// <summary> /// Calculates a minimum bounding rectangle for this line string. /// </summary> /// <returns>A minimum bounding rectangle.</returns> public Mbr GetMbr() { return(Mbr.Create(this)); }