コード例 #1
0
ファイル: GeoBounds.cs プロジェクト: 237rxd/maptiledownloader
 ////////////////////////////////////////////////////////////////////////////
 //--------------------------------- REVISIONS ------------------------------
 // Date       Name                 Tracking #         Description
 // ---------  -------------------  -------------      ----------------------
 // 18JUN2009  James Shen                 	          Initial Creation
 ////////////////////////////////////////////////////////////////////////////
 /**
  * Intersects the pair of specified source <code>GeoBounds</code>
  * objects and puts the result into the specified destination
  * <code>GeoBounds</code> object.  One of the source rectangles
  * can also be the destination to avoid creating a third GeoBounds
  * object, but in this case the original points of this source
  * rectangle will be overwritten by this method.
  * @param src1 the first of a pair of <code>GeoBounds</code>
  * objects to be intersected with each other
  * @param src2 the second of a pair of <code>GeoBounds</code>
  * objects to be intersected with each other
  * @param dest the <code>GeoBounds</code> that holds the
  * results of the intersection of <code>src1</code> and
  * <code>src2</code>
  */
 public static void Intersect(GeoBounds src1,
         GeoBounds src2,
         GeoBounds dest)
 {
     double x1 = Math.Max(src1.GetMinX(), src2.GetMinX());
     double y1 = Math.Max(src1.GetMinY(), src2.GetMinY());
     double x2 = Math.Min(src1.GetMaxX(), src2.GetMaxX());
     double y2 = Math.Min(src1.GetMaxY(), src2.GetMaxY());
     dest.SetFrame(x1, y1, x2 - x1, y2 - y1);
 }