예제 #1
0
 public WbImageData(
     RectFloat boundingRect,
     List<WbVmUtils.PlotPoint<Color>> plotPoints,
     List<WbVmUtils.PlotRectangle<Color>> filledRects,
     List<WbVmUtils.PlotRectangle<Color>> openRects,
     List<WbVmUtils.PlotLine<Color>> plotLines,
     double width,
     double height)
 {
     BoundingRect = boundingRect;
     Height = height;
     Width = width;
     PlotPoints = plotPoints;
     FilledRectangles = filledRects;
     OpenRectangles = openRects;
     PlotLines = plotLines;
 }
예제 #2
0
        public static RectFloat BoundingRect(this IEnumerable<Z2<float>> items, RectFloat startingRect)
        {
            float lx = startingRect.Left,
                ly = startingRect.Bottom,
                ux = startingRect.Right,
                uy = startingRect.Top;

            foreach (var d2 in items)
            {
                if (d2.X < lx) { lx = d2.X; }
                if (d2.Y < ly) { ly = d2.Y; }
                if (d2.X > ux) { ux = d2.X; }
                if (d2.Y > uy) { uy = d2.Y; }
            }

            return new RectFloat(
                top: uy,
                left: lx,
                bottom: ly,
                right: ux);
        }
예제 #3
0
        public void SetData(
            RectFloat boundingRect,
            double imageWidth,
            double imageHeight,
            List<WbVmUtils.PlotPoint<Color>> plotPoints,
            List<WbVmUtils.PlotLine<Color>> plotLines,
            List<WbVmUtils.PlotRectangle<Color>> filledRects,
            List<WbVmUtils.PlotRectangle<Color>> openRects
        )
        {
            WbImageVm.WbImageData = new WbImageData(
                    boundingRect: boundingRect,
                    plotPoints: plotPoints,
                    filledRects: filledRects,
                    openRects: openRects,
                    plotLines: plotLines,
                    width: imageWidth,
                    height: imageHeight
                );

            MinX = boundingRect.Left;
            MinY = boundingRect.Bottom;
            MaxX = boundingRect.Right;
            MaxY = boundingRect.Top;
        }