Exemplo n.º 1
0
        /// <param name="direction">accepting params: {R, L, B, T}</param>
        /// <returns>If leaked = True</returns>
        public static bool inflationLoop(inflateDirection direction, myRectangle obl, List <double[]> linesListDouble, double inflate, double initilaArea, double maxInflateArea)
        {
            if (direction == inflateDirection.R)
            {
                while (!obl.inflateRightWillCross(linesListDouble, inflate))
                {
                    obl.inflateRigth(inflate);
                    if (obl.obsah > maxInflateArea)
                    {
                        return(true);
                    }
                }
            }
            if (direction == inflateDirection.L)
            {
                while (!obl.inflateLeftWillCross(linesListDouble, inflate))
                {
                    obl.inflateLeft(inflate);
                    if (obl.obsah > maxInflateArea)
                    {
                        return(true);
                    }
                }
            }
            if (direction == inflateDirection.B)
            {
                while (!obl.inflateBottomWillCross(linesListDouble, inflate))
                {
                    obl.inflateBottom(inflate);
                    if (obl.obsah > maxInflateArea)
                    {
                        return(true);
                    }
                }
            }
            if (direction == inflateDirection.T)
            {
                while (!obl.inflateTopWillCross(linesListDouble, inflate))
                {
                    obl.inflateTop(inflate);
                    if (obl.obsah > maxInflateArea)
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
Exemplo n.º 2
0
        /// <param name="direction">accepting params: {R, L, B, T}</param>
        /// <returns>If leaked = True</returns>
        public static bool inflationLoop(inflateDirection direction, myRectangle obl, List<double[]> linesListDouble, double inflate, double initilaArea,double maxInflateArea)
        {
            if (direction==inflateDirection.R) {
                while (!obl.inflateRightWillCross(linesListDouble,inflate)) {
                    obl.inflateRigth(inflate);
                    if (obl.obsah>maxInflateArea) {
                        return true;
                    }
                }
            }
            if (direction==inflateDirection.L) {
                while (!obl.inflateLeftWillCross(linesListDouble,inflate)) {
                    obl.inflateLeft(inflate);
                    if (obl.obsah>maxInflateArea) {
                        return true;
                    }
                }
            }
            if (direction==inflateDirection.B) {
                while (!obl.inflateBottomWillCross(linesListDouble,inflate)) {
                    obl.inflateBottom(inflate);
                    if (obl.obsah>maxInflateArea) {
                        return true;
                    }
                }
            }
            if (direction==inflateDirection.T) {
                while (!obl.inflateTopWillCross(linesListDouble,inflate)) {
                    obl.inflateTop(inflate);
                    if (obl.obsah>maxInflateArea) {
                        return true;
                    }
                }
            }

            return false;
        }