Ejemplo n.º 1
0
        /// <summary>
        /// Splits the leaf node that contains the point at the given point and returns itself (with changes, if they happened).
        /// </summary>
        /// <param name="x">The x coordinate of the point.</param>
        /// <param name="y">The y coordinate of the point.</param>
        /// <returns>Itself (with changes, if they happened).</returns>
        public override QuadTreeNode <TContent, TAverage> Split(double x, double y)
        {
            throwWhenOutsideNode(x, y);

            if (TopRight.IsInsideNode(x, y))
            {
                TopRight = TopRight.Split(x, y);
            }

            if (BottomRight.IsInsideNode(x, y))
            {
                BottomRight = BottomRight.Split(x, y);
            }

            if (BottomLeft.IsInsideNode(x, y))
            {
                BottomLeft = BottomLeft.Split(x, y);
            }

            if (TopLeft.IsInsideNode(x, y))
            {
                TopLeft = TopLeft.Split(x, y);
            }

            invalidateAverage();

            return(this);
        }
Ejemplo n.º 2
0
 public void Validate()
 {
     BottomLeft.Validate();
     TopRight.Validate();
     ValidateLatitudes();
     ValidateLongitudes();
 }
 /// <summary>
 /// Converts an object into its XML representation.
 /// </summary>
 /// <param name="writer">The <see cref="T:System.Xml.XmlWriter"/> stream to which the object is serialized. </param>
 public void WriteXml(XmlWriter writer)
 {
     writer.WriteElementString("BottomLeft", BottomLeft.ToString());
     writer.WriteElementString("BottomRight", BottomRight.ToString());
     writer.WriteElementString("TopLeft", TopLeft.ToString());
     writer.WriteElementString("TopRight", TopRight.ToString());
 }
Ejemplo n.º 4
0
            /// <summary>
            /// Removes an item from this Quadrant.
            /// Returns true if item was found and removed, false otherwise.
            /// </summary>
            public bool Remove(T item, Rect bounds)
            {
                bool removed;

                if (TopRight != null && topRightBounds.Contains(bounds))
                {
                    removed = TopRight.Remove(item, bounds);
                }
                else if (TopLeft != null && topLeftBounds.Contains(bounds))
                {
                    removed = TopLeft.Remove(item, bounds);
                }
                else if (BottomRight != null && bottomRightBounds.Contains(bounds))
                {
                    removed = BottomRight.Remove(item, bounds);
                }
                else if (BottomLeft != null && bottomLeftBounds.Contains(bounds))
                {
                    removed = BottomLeft.Remove(item, bounds);
                }
                else
                {
                    removed = ItemsInQuadrant.Remove(item);
                }

                if (removed)
                {
                    Count--;
                }
                return(removed);
            }
Ejemplo n.º 5
0
 /// <summary>
 /// Adds a new item into the Quadrant.
 /// </summary>
 public void Add(T item, Rect bounds)
 {
     if (!LastLevelQuadrant)
     {
         if (topRightBounds.Contains(bounds))
         {
             TopRight ??= new Quadrant(topRightBounds);
             TopRight.Add(item, bounds);
         }
         else if (topLeftBounds.Contains(bounds))
         {
             TopLeft ??= new Quadrant(topLeftBounds);
             TopLeft.Add(item, bounds);
         }
         else if (bottomRightBounds.Contains(bounds))
         {
             BottomRight ??= new Quadrant(bottomRightBounds);
             BottomRight.Add(item, bounds);
         }
         else if (bottomLeftBounds.Contains(bounds))
         {
             BottomLeft ??= new Quadrant(bottomLeftBounds);
             BottomLeft.Add(item, bounds);
         }
         else
         {
             ItemsInQuadrant.Add(item);
         }
     }
     else
     {
         ItemsInQuadrant.Add(item);
     }
     Count++;
 }
Ejemplo n.º 6
0
 public override int GetHashCode()
 {
     return(TopLeft.GetHashCode() ^
            TopRight.GetHashCode() ^
            BottomRight.GetHashCode() ^
            BottomLeft.GetHashCode());
 }
Ejemplo n.º 7
0
        /// <summary>
        /// Splits the given leaf at the given point and returns itself (with changes, if the leaf was found).
        /// </summary>
        /// <param name="leaf">The leaf supposed to be split.</param>
        /// <param name="x">The x coordinate of the point.</param>
        /// <param name="y">The y coordinate of the point.</param>
        /// <returns>Itself (with changes, if they happened).</returns>
        public override QuadTreeNode <TContent, TAverage> Split(QuadTreeNode <TContent, TAverage> leaf, double x, double y)
        {
            // Can't find a null leaf.
            if (leaf == null)
            {
                return(this);
            }

            throwWhenOutsideNode(x, y);

            if (TopRight.IsInsideNode(x, y))
            {
                TopRight = TopRight.Split(leaf, x, y);
            }

            if (BottomRight.IsInsideNode(x, y))
            {
                BottomRight = BottomRight.Split(leaf, x, y);
            }

            if (BottomLeft.IsInsideNode(x, y))
            {
                BottomLeft = BottomLeft.Split(leaf, x, y);
            }

            if (TopLeft.IsInsideNode(x, y))
            {
                TopLeft = TopLeft.Split(leaf, x, y);
            }

            invalidateAverage();

            return(this);
        }
Ejemplo n.º 8
0
        /// <summary>
        /// help method to sort units in the right subtree based on thier position in the quad
        /// </summary>
        void AddObjectToSubTrees(Agent agent)
        {
            var pos = agent.position.ToWorld();

            if (pos.X < Quad.Center.X)
            {
                if (pos.Y < Quad.Center.Y)
                {
                    BottomLeft.AddObject(agent);
                }
                else
                {
                    TopLeft.AddObject(agent);
                }
            }
            else
            {
                if (pos.Y < Quad.Center.Y)
                {
                    BottomRight.AddObject(agent);
                }
                else
                {
                    TopRight.AddObject(agent);
                }
            }
        }
Ejemplo n.º 9
0
 public void MergeFrom(PathTimeObstacle other)
 {
     if (other == null)
     {
         return;
     }
     if (other.ObstacleId.Length != 0)
     {
         ObstacleId = other.ObstacleId;
     }
     if (other.bottomLeft_ != null)
     {
         if (bottomLeft_ == null)
         {
             bottomLeft_ = new global::Apollo.Planning.PathTimePoint();
         }
         BottomLeft.MergeFrom(other.BottomLeft);
     }
     if (other.upperLeft_ != null)
     {
         if (upperLeft_ == null)
         {
             upperLeft_ = new global::Apollo.Planning.PathTimePoint();
         }
         UpperLeft.MergeFrom(other.UpperLeft);
     }
     if (other.upperRight_ != null)
     {
         if (upperRight_ == null)
         {
             upperRight_ = new global::Apollo.Planning.PathTimePoint();
         }
         UpperRight.MergeFrom(other.UpperRight);
     }
     if (other.bottomRight_ != null)
     {
         if (bottomRight_ == null)
         {
             bottomRight_ = new global::Apollo.Planning.PathTimePoint();
         }
         BottomRight.MergeFrom(other.BottomRight);
     }
     if (other.TimeLower != 0D)
     {
         TimeLower = other.TimeLower;
     }
     if (other.TimeUpper != 0D)
     {
         TimeUpper = other.TimeUpper;
     }
     if (other.PathLower != 0D)
     {
         PathLower = other.PathLower;
     }
     if (other.PathUpper != 0D)
     {
         PathUpper = other.PathUpper;
     }
 }
Ejemplo n.º 10
0
 public Vector2D[] GetRotatedRectangleCorners(Vector2D center, float rotation)
 {
     return(new[]
     {
         TopLeft.RotateAround(center, rotation), BottomLeft.RotateAround(center, rotation),
         BottomRight.RotateAround(center, rotation), TopRight.RotateAround(center, rotation)
     });
 }
Ejemplo n.º 11
0
 public override string ToString()
 {
     return
         (TopLeft.ToString() + "," +
          TopRight.ToString() + "," +
          BottomLeft.ToString() + "," +
          BottomRight.ToString());
 }
Ejemplo n.º 12
0
 public Obj16Tile FlipY()
 {
     return(new Obj16Tile(
                TopRight.FlipY(),
                TopLeft.FlipY(),
                BottomRight.FlipY(),
                BottomLeft.FlipY()));
 }
Ejemplo n.º 13
0
 public bool Equals(Obj16Tile other)
 {
     return
         (TopLeft.Equals(other.TopLeft) &&
          TopRight.Equals(other.TopRight) &&
          BottomLeft.Equals(other.BottomLeft) &&
          BottomRight.Equals(other.BottomRight));
 }
Ejemplo n.º 14
0
 /// <inheritdoc />
 public override int GetHashCode()
 => GetHashCodeHelper.CalculateHashCode(TopLeft.GetHashCode(),
                                        TopMiddle.GetHashCode(),
                                        TopRight.GetHashCode(),
                                        MiddleLeft.GetHashCode(),
                                        MiddleRight.GetHashCode(),
                                        BottomLeft.GetHashCode(),
                                        BottomMiddle.GetHashCode(),
                                        BottomRight.GetHashCode());
Ejemplo n.º 15
0
        /// <summary>
        ///     Creates a new quad by rotate all 4 vertices clockwise about the specified center point
        /// </summary>
        /// <param name="degrees">Angle to rotate clockwise (degrees)</param>
        /// <param name="centerX">X coordinate of point about which to rotate</param>
        /// <param name="centerY">Y coordinate of point about which to rotate</param>
        /// <returns>Returns the rotate quad</returns>
        public Quad Rotate(double degrees, double centerX, double centerY)
        {
            var newBottomLeft  = BottomLeft.Rotate(degrees, centerX, centerY);
            var newTopLeft     = TopLeft.Rotate(degrees, centerX, centerY);
            var newTopRight    = TopRight.Rotate(degrees, centerX, centerY);
            var newBottomRight = BottomRight.Rotate(degrees, centerX, centerY);

            return(new Quad(newBottomLeft, newTopLeft, newTopRight, newBottomRight));
        }
Ejemplo n.º 16
0
 public override int GetHashCode()
 {
     unchecked {
         int hashCode = TopLeft.GetHashCode();
         hashCode = (hashCode * 397) ^ TopRight.GetHashCode();
         hashCode = (hashCode * 397) ^ BottomLeft.GetHashCode();
         hashCode = (hashCode * 397) ^ BottomRight.GetHashCode();
         return(hashCode);
     }
 }
Ejemplo n.º 17
0
 /// <summary>
 /// Returns a hash code for the specified object
 /// </summary>
 /// <returns>A hash code for the specified object</returns>
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (BottomLeft != null ? BottomLeft.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (TopLeft != null ? TopLeft.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (TopRight != null ? TopRight.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (BottomRight != null ? BottomRight.GetHashCode() : 0);
         return(hashCode);
     }
 }
Ejemplo n.º 18
0
 public void RangeScanQuads(WorldPosition position, double range, List <Agent> buffer)
 {
     if (new Quad(position, range).Intersect(Quad))
     {
         buffer.AddRange(Agents);
         TopRight?.RangeScanQuads(position, range, buffer);
         TopLeft?.RangeScanQuads(position, range, buffer);
         BottomRight?.RangeScanQuads(position, range, buffer);
         BottomLeft?.RangeScanQuads(position, range, buffer);
     }
 }
Ejemplo n.º 19
0
        public bool ProcessFormMessage(ref Message message)
        {
            if (!AllowToResize || message.Msg != WM_NCHITTEST)
            {
                return(false);
            }

            int x      = (int)(message.LParam.ToInt64() & 0xFFFF);
            int y      = (int)(message.LParam.ToInt64() >> 16);
            var cursor = TargetForm.PointToClient(new Point(x, y));

            if (TopLeft.Contains(cursor))
            {
                message.Result = (IntPtr)HTTOPLEFT;
                return(true);
            }
            else if (TopRight.Contains(cursor))
            {
                message.Result = (IntPtr)HTTOPRIGHT;
                return(true);
            }
            else if (BottomLeft.Contains(cursor))
            {
                message.Result = (IntPtr)HTBOTTOMLEFT;
                return(true);
            }
            else if (BottomRight.Contains(cursor))
            {
                message.Result = (IntPtr)HTBOTTOMRIGHT;
                return(true);
            }
            else if (Top.Contains(cursor))
            {
                message.Result = (IntPtr)HTTOP;
                return(true);
            }
            else if (Left.Contains(cursor))
            {
                message.Result = (IntPtr)HTLEFT;
                return(true);
            }
            else if (Right.Contains(cursor))
            {
                message.Result = (IntPtr)HTRIGHT;
                return(true);
            }
            else if (Bottom.Contains(cursor))
            {
                message.Result = (IntPtr)HTBOTTOM;
                return(true);
            }

            return(false);
        }
Ejemplo n.º 20
0
 /// <summary>
 /// Destroy this <see cref="Texture2D"/>.
 /// </summary>
 public void Dispose()
 {
     TopLeft.Dispose();
     TopCenter.Dispose();
     TopRight.Dispose();
     MiddleLeft.Dispose();
     MiddleCenter.Dispose();
     MiddleRight.Dispose();
     BottomLeft.Dispose();
     BottomCenter.Dispose();
     BottomRight.Dispose();
 }
Ejemplo n.º 21
0
        public void SetZHeight(Vector3 startHeight, Vector3 endHeight)
        {
            float percent;

            if (this.TopLeft.Filled)
            {
                percent = GenerationUtility.PercentBetween(startHeight, endHeight, TopLeft.Position);
                TopLeft.SetZ(Vector3.Lerp(startHeight, endHeight, percent).z);
            }

            if (this.TopRight.Filled)
            {
                percent = GenerationUtility.PercentBetween(startHeight, endHeight, TopRight.Position);
                TopRight.SetZ(Vector3.Lerp(startHeight, endHeight, percent).z);
            }

            if (this.BottomLeft.Filled)
            {
                percent = GenerationUtility.PercentBetween(startHeight, endHeight, BottomLeft.Position);
                BottomLeft.SetZ(Vector3.Lerp(startHeight, endHeight, percent).z);
            }

            if (this.BottomRight.Filled)
            {
                percent = GenerationUtility.PercentBetween(startHeight, endHeight, BottomRight.Position);
                BottomRight.SetZ(Vector3.Lerp(startHeight, endHeight, percent).z);
            }

            if (this.Top.Filled)
            {
                percent = GenerationUtility.PercentBetween(startHeight, endHeight, Top.Position);
                Top.SetZ(Vector3.Lerp(startHeight, endHeight, percent).z);
            }

            if (this.Left.Filled)
            {
                percent = GenerationUtility.PercentBetween(startHeight, endHeight, Left.Position);
                Left.SetZ(Vector3.Lerp(startHeight, endHeight, percent).z);
            }

            if (this.Right.Filled)
            {
                percent = GenerationUtility.PercentBetween(startHeight, endHeight, Right.Position);
                Right.SetZ(Vector3.Lerp(startHeight, endHeight, percent).z);
            }

            if (this.Bottom.Filled)
            {
                percent = GenerationUtility.PercentBetween(startHeight, endHeight, Bottom.Position);
                Bottom.SetZ(Vector3.Lerp(startHeight, endHeight, percent).z);
            }
        }
Ejemplo n.º 22
0
        public override UIElement OnMouseAction(MouseActionEventArgs mouse)
        {
            UIElement intercept = base.OnMouseAction(mouse);

            if (intercept == null && FrameDimensions.Contains(mouse.Position))
            {
                intercept = this;

                if (ResizeableByUser && mouse.Button == MouseButton.Left && mouse.Action == MouseAction.Pressed)
                {
                    if (TopLeft.Contains(mouse.Position))
                    {
                        EdgeCaught = Edge.TopLeft;
                    }
                    else if (Top.Contains(mouse.Position))
                    {
                        EdgeCaught = Edge.Top;
                    }
                    else if (TopRight.Contains(mouse.Position))
                    {
                        EdgeCaught = Edge.TopRight;
                    }
                    else if (MiddleLeft.Contains(mouse.Position))
                    {
                        EdgeCaught = Edge.Left;
                    }
                    else if (MiddleRight.Contains(mouse.Position))
                    {
                        EdgeCaught = Edge.Right;
                    }
                    else if (BottomLeft.Contains(mouse.Position))
                    {
                        EdgeCaught = Edge.BottomLeft;
                    }
                    else if (Bottom.Contains(mouse.Position))
                    {
                        EdgeCaught = Edge.Bottom;
                    }
                    else if (BottomRight.Contains(mouse.Position))
                    {
                        EdgeCaught = Edge.BottomRight;
                    }
                }
            }

            if (mouse.Button == MouseButton.Left && mouse.Action == MouseAction.Released)
            {
                EdgeCaught = Edge.None;
            }

            return(intercept);
        }
Ejemplo n.º 23
0
 public bool Equals(FourCorners <TValue> other)
 {
     if (this == other)
     {
         return(true);
     }
     if (other == null)
     {
         return(false);
     }
     return(BottomLeft.Equals(other.BottomLeft) && BottomRight.Equals(other.BottomRight) &&
            TopLeft.Equals(other.TopLeft) && TopRight.Equals(other.TopRight));
 }
Ejemplo n.º 24
0
        protected override void WndProc(ref Message message)
        {
            base.WndProc(ref message);


            if (message.Msg == 0x84) // WM_NCHITTEST
            {
                var cursor = this.PointToClient(Cursor.Position);

                if (TopLeft.Contains(cursor))
                {
                    message.Result = (IntPtr)HTTOPLEFT;
                }
                else if (TopRight.Contains(cursor))
                {
                    message.Result = (IntPtr)HTTOPRIGHT;
                }
                else if (BottomLeft.Contains(cursor))
                {
                    message.Result = (IntPtr)HTBOTTOMLEFT;
                }
                else if (BottomRight.Contains(cursor))
                {
                    message.Result = (IntPtr)HTBOTTOMRIGHT;
                }

                else if (Top.Contains(cursor))
                {
                    message.Result = (IntPtr)HTTOP;
                }
                else if (Left.Contains(cursor))
                {
                    message.Result = (IntPtr)HTLEFT;
                }
                else if (Right.Contains(cursor))
                {
                    message.Result = (IntPtr)HTRIGHT;
                }
                else if (Bottom.Contains(cursor))
                {
                    message.Result = (IntPtr)HTBOTTOM;
                }
                else
                {
                    message.Result = (IntPtr)(HT_CAPTION);
                }
            }
        }
Ejemplo n.º 25
0
        protected override void WndProc(ref Message message)
        {
            base.WndProc(ref message);

            if (message.Msg == WM_NCHITTEST && CanResize && WindowState == FormWindowState.Normal)
            {
                int x = message.LParam.ToInt32() & 0xffff;
                int y = (int)((message.LParam.ToInt32() & 0xffff0000) >> 16);

                Point cursor = PointToClient(new Point(x, y));

                //  var cursor = this.PointToClient(Cursor.Position);

                if (TopLeft.Contains(cursor))
                {
                    message.Result = (IntPtr)HTTOPLEFT;
                }
                else if (TopRight.Contains(cursor))
                {
                    message.Result = (IntPtr)HTTOPRIGHT;
                }
                else if (BottomLeft.Contains(cursor))
                {
                    message.Result = (IntPtr)HTBOTTOMLEFT;
                }
                else if (BottomRight.Contains(cursor))
                {
                    message.Result = (IntPtr)HTBOTTOMRIGHT;
                }

                else if (Top.Contains(cursor))
                {
                    message.Result = (IntPtr)HTTOP;
                }
                else if (Left.Contains(cursor))
                {
                    message.Result = (IntPtr)HTLEFT;
                }
                else if (Right.Contains(cursor))
                {
                    message.Result = (IntPtr)HTRIGHT;
                }
                else if (Bottom.Contains(cursor))
                {
                    message.Result = (IntPtr)HTBOTTOM;
                }
            }
        }
Ejemplo n.º 26
0
        public bool Equals(Square other)
        {
            //Check whether the compared object is null.
            if (ReferenceEquals(other, null))
            {
                return(false);
            }

            //Check whether the compared object references the same data.
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            //Check whether the products' properties are equal.
            return(BottomLeft.Equals(other.BottomLeft) && TopRight.Equals(other.TopRight));
        }
        public override bool IsPointInTile(double lat, double lng)
        {
            if (Level == 0)
            {
                return(true);
            }

            if (Level == 1)
            {
                if ((lng >= 0 && lng <= 90) && (tileX == 0 && tileY == 1))
                {
                    return(true);
                }
                if ((lng > 90 && lng <= 180) && (tileX == 1 && tileY == 1))
                {
                    return(true);
                }
                if ((lng < 0 && lng >= -90) && (tileX == 0 && tileY == 0))
                {
                    return(true);
                }
                if ((lng < -90 && lng >= -180) && (tileX == 1 && tileY == 0))
                {
                    return(true);
                }
                return(false);
            }

            if (!this.DemReady || this.DemData == null)
            {
                return(false);
            }

            Vector3d testPoint = Coordinates.GeoTo3dDouble(-lat, lng);
            bool     top       = IsLeftOfHalfSpace(TopLeft.Copy(), TopRight.Copy(), testPoint);
            bool     right     = IsLeftOfHalfSpace(TopRight.Copy(), BottomRight.Copy(), testPoint);
            bool     bottom    = IsLeftOfHalfSpace(BottomRight.Copy(), BottomLeft.Copy(), testPoint);
            bool     left      = IsLeftOfHalfSpace(BottomLeft.Copy(), TopLeft.Copy(), testPoint);

            if (top && right && bottom && left)
            {
                // showSelected = true;
                return(true);
            }
            return(false);;
        }
Ejemplo n.º 28
0
        public bool Insert(QuadTreeItem <T> item)
        {
            if (UseFuzzyBoundaries)
            {
                if (!Bounds.Intersects(item.Bounds))
                {
                    return(false);
                }
            }
            else
            {
                if (!Bounds.Contains(item.Bounds))
                {
                    return(false);
                }
            }

            if (Items.Count >= Threshold)
            {
                if (!IsDivided)
                {
                    Subdivide();
                }

                if (TopLeft.Insert(item) ||
                    TopRight.Insert(item) ||
                    BottomLeft.Insert(item) ||
                    BottomRight.Insert(item))
                {
                    return(true);
                }
            }
            else
            {
                Items.Add(item);
                return(true);
            }

            if (AllowOverflow)
            {
                Items.Add(item);
                return(true);
            }

            return(false);
        }
Ejemplo n.º 29
0
        /// <summary>
        /// Return true if there are any nodes in this Quadrant that intersect the given bounds.
        /// </summary>
        /// <param name="bounds">The bounds to test</param>
        /// <returns>boolean</returns>
        public Boolean HasIntersectingNodes(RectangleF bounds)
        {
            if (bounds.IsEmpty)
            {
                return(false);
            }
            Single w = Bounds.Width / 2;
            Single h = Bounds.Height / 2;

            // assumption that the Rect struct is almost as fast as doing the operations
            // manually since Rect is a value type.

            RectangleF topLeft     = new RectangleF(Bounds.Left, Bounds.Top, w, h);
            RectangleF topRight    = new RectangleF(Bounds.Left + w, Bounds.Top, w, h);
            RectangleF bottomLeft  = new RectangleF(Bounds.Left, Bounds.Top + h, w, h);
            RectangleF bottomRight = new RectangleF(Bounds.Left + w, Bounds.Top + h, w, h);

            Boolean found = false;

            // See if any child quadrants completely contain this node.
            if (topLeft.IntersectsWith(bounds) && TopLeft != null)
            {
                found = TopLeft.HasIntersectingNodes(bounds);
            }

            if (!found && topRight.IntersectsWith(bounds) && TopRight != null)
            {
                found = TopRight.HasIntersectingNodes(bounds);
            }

            if (!found && bottomLeft.IntersectsWith(bounds) && BottomLeft != null)
            {
                found = BottomLeft.HasIntersectingNodes(bounds);
            }

            if (!found && bottomRight.IntersectsWith(bounds) && BottomRight != null)
            {
                found = BottomRight.HasIntersectingNodes(bounds);
            }
            if (!found)
            {
                found = HasIntersectingNodes(Nodes, bounds);
            }
            return(found);
        }
Ejemplo n.º 30
0
        public void Redraw()
        {
            if (_cropTool.Height <= 0 && _cropTool.Width <= 0)
            {
                ShowThumbs(false);
                return;
            }

            BottomMiddle.Redraw(_cropTool.TopLeftX + _cropTool.Width / 2, _cropTool.TopLeftY + _cropTool.Height);
            LeftMiddle.Redraw(_cropTool.TopLeftX, _cropTool.TopLeftY + _cropTool.Height / 2);
            TopMiddle.Redraw(_cropTool.TopLeftX + _cropTool.Width / 2, _cropTool.TopLeftY);
            RightMiddle.Redraw(_cropTool.TopLeftX + _cropTool.Width, _cropTool.TopLeftY + _cropTool.Height / 2);
            TopLeft.Redraw(_cropTool.TopLeftX, _cropTool.TopLeftY);
            TopRight.Redraw(_cropTool.TopLeftX + _cropTool.Width, _cropTool.TopLeftY);
            BottomLeft.Redraw(_cropTool.TopLeftX, _cropTool.TopLeftY + _cropTool.Height);
            BottomRight.Redraw(_cropTool.TopLeftX + _cropTool.Width, _cropTool.TopLeftY + _cropTool.Height);
            ShowThumbs(true);
        }