Пример #1
0
        private RectangleF GetNodeEditRectangle()
        {
            RectangleF rectangleF;
            float      thWidth = UCCanvas.GetThresholdWidth();

            if (this.currentNodeIndex == 0)
            {
                rectangleF = ScreenUtils.GetRectangleF(this.MultiLinePoints[0], this.MultiLinePoints[1], thWidth);
            }
            else if (this.currentNodeIndex == this.MultiLinePoints.Count - 1)
            {
                rectangleF = ScreenUtils.GetRectangleF(this.MultiLinePoints[this.MultiLinePoints.Count - 2], this.MultiLinePoints[this.MultiLinePoints.Count - 1], thWidth);
            }
            else
            {
                List <UnitPoint> temp = new List <UnitPoint>();
                temp.Add(this.MultiLinePoints[this.currentNodeIndex - 1]);
                temp.Add(this.MultiLinePoints[this.currentNodeIndex]);
                temp.Add(this.MultiLinePoints[this.currentNodeIndex + 1]);
                float maxX = (float)temp.Max <UnitPoint>(maxx => maxx.X);
                float maxY = (float)temp.Max <UnitPoint>(maxy => maxy.Y);
                float minX = (float)temp.Min <UnitPoint>(minx => minx.X);
                float minY = (float)temp.Min <UnitPoint>(miny => miny.Y);
                rectangleF = ScreenUtils.GetRectangleF(new UnitPoint(minX, minY), new UnitPoint(maxX, maxY), thWidth);
            }
            return(rectangleF);
        }
Пример #2
0
        private RectangleF GetBoundingRectangle()
        {
            float      maxX       = (float)this.hexagonPoints.Max <UnitPoint>(maxx => maxx.X);
            float      maxY       = (float)this.hexagonPoints.Max <UnitPoint>(maxy => maxy.Y);
            float      minX       = (float)this.hexagonPoints.Min <UnitPoint>(minx => minx.X);
            float      minY       = (float)this.hexagonPoints.Min <UnitPoint>(miny => miny.Y);
            RectangleF rectangleF = ScreenUtils.GetRectangleF(new UnitPoint(minX, minY), new UnitPoint(maxX, maxY), UCCanvas.GetThresholdWidth());

            return(rectangleF);
        }
Пример #3
0
        public override RectangleF GetBoundingRectangle(BoundingRectangleType rectangleType)
        {
            if (this.IsCompleteDraw || this.IsEditMode)
            {
                return(base.GetBoundingRectangle(rectangleType));
            }
            float thWidth = UCCanvas.GetThresholdWidth();

            return(ScreenUtils.GetRectangleF(this.p1, this.p2, thWidth / 2));
        }
Пример #4
0
        private RectangleF GetSelectionRectangle()
        {
            RectangleF rectangleF;
            float      maxX = (float)this.MultiLinePoints.Max <UnitPoint>(maxx => maxx.X);
            float      maxY = (float)this.MultiLinePoints.Max <UnitPoint>(maxy => maxy.Y);
            float      minX = (float)this.MultiLinePoints.Min <UnitPoint>(minx => minx.X);
            float      minY = (float)this.MultiLinePoints.Min <UnitPoint>(miny => miny.Y);

            rectangleF = ScreenUtils.GetRectangleF(new UnitPoint(minX, minY), new UnitPoint(maxX, maxY), UCCanvas.GetThresholdWidth());
            return(rectangleF);
        }
Пример #5
0
        public override RectangleF GetBoundingRectangle(BoundingRectangleType rectangleType)
        {
            float thresholdWidth = UCCanvas.GetThresholdWidth();

            if (this.arcCurrentPointType == ArcCurrentPointType.MidPoint)
            {
                return(ScreenUtils.GetRectangleF(this.startPoint, this.midPoint, thresholdWidth));
            }
            else
            {
                return(this.GetBoundingRectCommon(thresholdWidth));
            }
        }
Пример #6
0
        private RectangleF GetDrawingRectangle()
        {
            RectangleF rectangleF;

            if (this.MultiLinePoints.Count > 0)
            {
                rectangleF = ScreenUtils.GetRectangleF(this.MultiLinePoints[this.MultiLinePoints.Count - 1], this.currentPoint, UCCanvas.GetThresholdWidth());
            }
            else
            {
                rectangleF = new RectangleF();
            }
            return(rectangleF);
        }
Пример #7
0
        public override RectangleF GetBoundingRectangle(BoundingRectangleType rectangleType)
        {
            if (this.IsCompleteDraw || this.IsEditMode)
            {
                return(base.GetBoundingRectangle(rectangleType));
            }
            float thWidth = UCCanvas.GetThresholdWidth();
            float maxX    = (float)this.Points.Max <UnitPointBulge>(x => x.Point.X);
            float maxY    = (float)this.Points.Max <UnitPointBulge>(x => x.Point.Y);
            float minX    = (float)this.Points.Min <UnitPointBulge>(x => x.Point.X);
            float minY    = (float)this.Points.Min <UnitPointBulge>(x => x.Point.Y);

            return(ScreenUtils.GetRectangleF(new UnitPoint(minX, minY), new UnitPoint(maxX, maxY), thWidth / 2));
        }
Пример #8
0
        public override RectangleF GetBoundingRectangle(BoundingRectangleType rectangleType)
        {
            if (this.IsEditMode || this.IsCompleteDraw)
            {
                return(base.GetBoundingRectangle(rectangleType));
            }
            float thWidth = UCCanvas.GetThresholdWidth();
            float maxX    = (float)this.Points.Max <UnitPointBulge>(x => x.Point.X);
            float maxY    = (float)this.Points.Max <UnitPointBulge>(x => x.Point.Y);
            float minX    = (float)this.Points.Min <UnitPointBulge>(x => x.Point.X);
            float minY    = (float)this.Points.Min <UnitPointBulge>(x => x.Point.Y);

            if (this.CurrentPoint == MultiSegementLineCurrentPoint.EndPoint)
            {
                maxX = maxX > this.p3.X ? maxX : (float)p3.X;
                maxY = maxY > this.p3.Y ? maxY : (float)p3.Y;
                minX = minX < this.p3.X ? minX : (float)p3.X;
                minY = minY < this.p3.Y ? minY : (float)p3.Y;
            }
            return(ScreenUtils.GetRectangleF(new UnitPoint(minX, minY), new UnitPoint(maxX, maxY), thWidth / 2));
        }
Пример #9
0
 private RectangleF GetBoundingRectangle()
 {
     return(ScreenUtils.GetRectangleF(this.P1, this.P2, UCCanvas.GetThresholdWidth()));
 }
Пример #10
0
        private RectangleF GetBoundingRectangle()
        {
            RectangleF rectangleF = ScreenUtils.GetRectangleF(LeftTopPoint, RightBottomPoint, UCCanvas.GetThresholdWidth());

            return(rectangleF);
        }
Пример #11
0
        public RectangleF GetBoundingRectangle(BoundingRectangleType rectangleType)
        {
            float thWidth = UCCanvas.GetThresholdWidth();

            return(ScreenUtils.GetRectangleF(this.p1, this.p2, thWidth / 2));
        }
Пример #12
0
 private void MouseMoveSetBridge(MouseEventArgs e)
 {
     if (!this.bridgeStart.IsEmpty)
     {
         UnitPoint mousePoint     = this.GetMousePoint();
         Rectangle invalidaterect = ScreenUtils.ConvertRectangle(ScreenUtils.ToScreenNormalized(this.canvasWrapper, ScreenUtils.GetRectangleF(this.bridgeStart, this.bridgeEnd, UCCanvas.GetThresholdWidth() / 2)));
         invalidaterect.Inflate(2, 2);
         RepaintStatic(invalidaterect);
         this.bridgeEnd = mousePoint;
         CanvasWrapper canvasWrapper = new CanvasWrapper(this, Graphics.FromHwnd(this.Handle), this.ClientRectangle);
         Pen           pen           = new Pen(Color.Bisque, 1)
         {
             DashStyle   = DashStyle.Custom,
             DashPattern = new float[2] {
                 2, 3
             }
         };
         canvasWrapper.DrawLine(canvasWrapper, pen, this.bridgeStart, this.bridgeEnd);
         canvasWrapper.Graphics.Dispose();
         canvasWrapper.Dispose();
     }
 }