コード例 #1
0
 static RectangleD()
 {
     Empty = new RectangleD();
 }
コード例 #2
0
 /// <summary>Determines if the rectangular region represented by rect is entirely contained within this <see cref="T:System.Drawing.RectangleD"></see> structure.</summary>
 /// <returns>This method returns true if the rectangular region represented by rect is entirely contained within the rectangular region represented by this <see cref="T:System.Drawing.RectangleD"></see>; otherwise false.</returns>
 /// <param name="rect">The <see cref="T:System.Drawing.RectangleD"></see> to test. </param>
 /// <filterpriority>1</filterpriority>
 public bool Contains(RectangleD rect)
 {
     return((((this.X <= rect.X) && ((rect.X + rect.Width) <= (this.X + this.Width))) && (this.Y <= rect.Y)) && ((rect.Y + rect.Height) <= (this.Y + this.Height)));
 }
コード例 #3
0
 /// <summary>Determines if this rectangle intersects with rect.</summary>
 /// <returns>This method returns true if there is any intersection.</returns>
 /// <param name="rect">The rectangle to test. </param>
 /// <filterpriority>1</filterpriority>
 public bool IntersectsWith(RectangleD rect)
 {
     return((((rect.X < (this.X + this.Width)) && (this.X < (rect.X + rect.Width))) && (rect.Y < (this.Y + this.Height))) && (this.Y < (rect.Y + rect.Height)));
 }
コード例 #4
0
ファイル: RectangleD.cs プロジェクト: lishxi/_SharpMap
 /// <summary>Creates the smallest possible third rectangle that can contain both of two rectangles that form a union.</summary>
 /// <returns>A third <see cref="T:System.Drawing.RectangleD"></see> structure that contains both of the two rectangles that form the union.</returns>
 /// <param name="a">A rectangle to union. </param>
 /// <param name="b">A rectangle to union. </param>
 /// <filterpriority>1</filterpriority>
 public static RectangleD Union(RectangleD a, RectangleD b)
 {
     double x = Math.Min(a.X, b.X);
     double num2 = Math.Max((double)(a.X + a.Width), (double)(b.X + b.Width));
     double y = Math.Min(a.Y, b.Y);
     double num4 = Math.Max((double)(a.Y + a.Height), (double)(b.Y + b.Height));
     return new RectangleD(x, y, num2 - x, num4 - y);
 }
コード例 #5
0
ファイル: RectangleD.cs プロジェクト: lishxi/_SharpMap
 static RectangleD()
 {
     Empty = new RectangleD();
 }
コード例 #6
0
ファイル: RectangleD.cs プロジェクト: lishxi/_SharpMap
 /// <summary>Determines if this rectangle intersects with rect.</summary>
 /// <returns>This method returns true if there is any intersection.</returns>
 /// <param name="rect">The rectangle to test. </param>
 /// <filterpriority>1</filterpriority>
 public bool IntersectsWith(RectangleD rect)
 {
     return ((((rect.X < (this.X + this.Width)) && (this.X < (rect.X + rect.Width))) && (rect.Y < (this.Y + this.Height))) && (this.Y < (rect.Y + rect.Height)));
 }
コード例 #7
0
ファイル: RectangleD.cs プロジェクト: lishxi/_SharpMap
 /// <summary>Returns a <see cref="T:System.Drawing.RectangleD"></see> structure that represents the intersection of two rectangles. If there is no intersection, and empty <see cref="T:System.Drawing.RectangleD"></see> is returned.</summary>
 /// <returns>A third <see cref="T:System.Drawing.RectangleD"></see> structure the size of which represents the overlapped area of the two specified rectangles.</returns>
 /// <param name="a">A rectangle to intersect. </param>
 /// <param name="b">A rectangle to intersect. </param>
 /// <filterpriority>1</filterpriority>
 public static RectangleD Intersect(RectangleD a, RectangleD b)
 {
     double x = Math.Max(a.X, b.X);
     double num2 = Math.Min((double)(a.X + a.Width), (double)(b.X + b.Width));
     double y = Math.Max(a.Y, b.Y);
     double num4 = Math.Min((double)(a.Y + a.Height), (double)(b.Y + b.Height));
     if ((num2 >= x) && (num4 >= y))
     {
         return new RectangleD(x, y, num2 - x, num4 - y);
     }
     return Empty;
 }
コード例 #8
0
ファイル: RectangleD.cs プロジェクト: lishxi/_SharpMap
 /// <summary>Replaces this <see cref="T:System.Drawing.RectangleD"></see> structure with the intersection of itself and the specified <see cref="T:System.Drawing.RectangleD"></see> structure.</summary>
 /// <returns>This method does not return a value.</returns>
 /// <param name="rect">The rectangle to intersect. </param>
 /// <filterpriority>1</filterpriority>
 public void Intersect(RectangleD rect)
 {
     RectangleD ef = Intersect(rect, this);
     this.X = ef.X;
     this.Y = ef.Y;
     this.Width = ef.Width;
     this.Height = ef.Height;
 }
コード例 #9
0
ファイル: RectangleD.cs プロジェクト: lishxi/_SharpMap
 /// <summary>Creates and returns an inflated copy of the specified <see cref="T:System.Drawing.RectangleD"></see> structure. The copy is inflated by the specified amount. The original rectangle remains unmodified.</summary>
 /// <returns>The inflated <see cref="T:System.Drawing.RectangleD"></see>.</returns>
 /// <param name="rect">The <see cref="T:System.Drawing.RectangleD"></see> to be copied. This rectangle is not modified. </param>
 /// <param name="y">The amount to inflate the copy of the rectangle vertically. </param>
 /// <param name="x">The amount to inflate the copy of the rectangle horizontally. </param>
 /// <filterpriority>1</filterpriority>
 public static RectangleD Inflate(RectangleD rect, double x, double y)
 {
     RectangleD ef = rect;
     ef.Inflate(x, y);
     return ef;
 }
コード例 #10
0
ファイル: RectangleD.cs プロジェクト: lishxi/_SharpMap
 /// <summary>Determines if the rectangular region represented by rect is entirely contained within this <see cref="T:System.Drawing.RectangleD"></see> structure.</summary>
 /// <returns>This method returns true if the rectangular region represented by rect is entirely contained within the rectangular region represented by this <see cref="T:System.Drawing.RectangleD"></see>; otherwise false.</returns>
 /// <param name="rect">The <see cref="T:System.Drawing.RectangleD"></see> to test. </param>
 /// <filterpriority>1</filterpriority>
 public bool Contains(RectangleD rect)
 {
     return ((((this.X <= rect.X) && ((rect.X + rect.Width) <= (this.X + this.Width))) && (this.Y <= rect.Y)) && ((rect.Y + rect.Height) <= (this.Y + this.Height)));
 }