コード例 #1
0
 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()
     });
 }
コード例 #2
0
ファイル: Polygon2.cs プロジェクト: aarondandy/vertesaur
        /// <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);
        }
コード例 #3
0
 /// <summary>
 /// Calculates a minimum bounding rectangle for this line string.
 /// </summary>
 /// <returns>A minimum bounding rectangle.</returns>
 public Mbr GetMbr()
 {
     return(Mbr.Create(this));
 }