Пример #1
0
        public Room(int number, int offset, int widthMainPlate)
        {
            Number         = number;
            WidthMainPlate = widthMainPlate;

            Floor = new ColumnPlate(Number);
            Floor.ColumnOffset   = offset;
            Floor.WidthMainPlate = widthMainPlate;

            Ceiling = new ColumnBack(Number);
            Ceiling.ColumnOffset   = offset;
            Ceiling.WidthMainPlate = widthMainPlate;
            Ceiling.CeilingOffsett = widthMainPlate;
        }
Пример #2
0
        /// <summary>
        /// Проверка вместимости потолка
        /// </summary>
        /// <param name="plate"></param>
        /// <returns></returns>
        private bool CeilingCapacityCheck(RandomlyPlate plate, out int typeSurface)
        {
            typeSurface = 2;
            bool search = true; //Поиск.

            if (Ceiling.Plates.Count == 0)
            {
                plate.YOffset = Ceiling.CeilingOffsett - plate.Height;
                plate.XOffset = Ceiling.ColumnOffset - plate.Width;
                ColumnPlate.TransferCoordinates(ref plate);

                foreach (var item in Floor.Plates)
                {
                    if (Helper.GetIntersectionPlate(plate.ContourPoints, item.ContourPoints))
                    {
                        typeSurface = 0;
                        search      = false;
                        break;
                    }
                }

                plate.YOffset = -(Ceiling.CeilingOffsett - plate.Height);
                plate.XOffset = -(Ceiling.ColumnOffset - plate.Width);
                ColumnPlate.TransferCoordinates(ref plate);
            }
            else
            {
                var delta = Ceiling.Rapprochement(plate);//величина сближения

                foreach (var item in Floor.Plates)
                {
                    if (Helper.GetIntersectionPlate(plate.ContourPoints, item.ContourPoints))
                    {
                        typeSurface = 0;
                        search      = false;
                        break;
                    }
                }

                plate.YOffset = -(Ceiling.CeilingOffsett - Ceiling.HeightColumn - plate.Height + delta);
                plate.XOffset = -(Ceiling.ColumnOffset - plate.Width);
                ColumnPlate.TransferCoordinates(ref plate);
            }

            return(search);
        }
Пример #3
0
        public override void Add(ref RandomlyPlate plate)
        {
            if (heightColumn == 0)
            {
                plate.YOffset = CeilingOffsett - plate.Height;
                plate.XOffset = ColumnOffset - plate.Width;
                ColumnPlate.TransferCoordinates(ref plate);

                Plates.Add(plate);
                heightColumn += plate.Height;
                Fullness      = heightColumn / (double)WidthMainPlate;
            }
            else
            {
                var delta = Rapprochement(ref plate);
                heightColumn = (heightColumn + plate.Height - delta);
                Plates.Add(plate);
                Fullness = heightColumn / (double)WidthMainPlate;
            }
        }