コード例 #1
0
 public void Merge(TRectangle rectToMerge)
 {
     LeftTop.X     = rectToMerge.LeftTop.X < LeftTop.X ? rectToMerge.LeftTop.X : LeftTop.X;
     LeftTop.Y     = rectToMerge.LeftTop.Y < LeftTop.Y ? rectToMerge.LeftTop.Y : LeftTop.Y;
     RightBottom.X = rectToMerge.RightBottom.X > RightBottom.X ? rectToMerge.RightBottom.X : RightBottom.X;
     RightBottom.Y = rectToMerge.RightBottom.Y > RightBottom.Y ? rectToMerge.RightBottom.Y : RightBottom.Y;
 }
コード例 #2
0
 public double GetEnlargementArea(TRectangle rectToFit)
 {
     return(System.Math.Abs(rectToFit.Area - Area));
 }
コード例 #3
0
 internal RTreeNode GetMinimumEnlargementArea(TRectangle rect)
 {
     return(Children[Children.Take(Children.Count).Select((node, index) => new { node, index })
                     .OrderBy(x => x.node.Rectangle.GetEnlargementArea(rect))
                     .ThenBy(x => x.node.Rectangle.Area).First().index]);
 }