Exemplo n.º 1
0
        /***************************************************/

        private static SeatingBlock MirrorSeatingBlock(SeatingBlock original, SeatingBlockType stype)
        {
            SeatingBlock mirrored = original.DeepClone();

            mirrored.TypeOfSeatingBlock = stype;
            List <TierProfile> mirroredProfiles = new List <TierProfile>();

            //mirror the origins
            mirrored.Start.Origin.Y       = -mirrored.Start.Origin.Y;
            mirrored.Start.Direction.Y    = -mirrored.Start.Direction.Y;
            mirrored.Vomitory.Origin.Y    = -mirrored.Vomitory.Origin.Y;
            mirrored.Vomitory.Direction.Y = -mirrored.Vomitory.Direction.Y;
            mirrored.End.Origin.Y         = -mirrored.End.Origin.Y;
            mirrored.End.Direction.Y      = -mirrored.End.Direction.Y;
            //mirror the points and profile
            foreach (TierProfile profile in mirrored.Sections)
            {
                var mirroredprofile = MirrorTierYZ(profile);
                mirroredProfiles.Add(mirroredprofile);
            }
            //reverse the sections list
            mirroredProfiles.Reverse();
            mirrored.Sections = mirroredProfiles;
            //flip the start and end
            var tempstart = mirrored.Start.DeepClone();
            var tempend   = mirrored.End.DeepClone();

            mirrored.Start = tempend;
            mirrored.End   = tempstart;
            return(mirrored);
        }
Exemplo n.º 2
0
        /***************************************************/

        private static SeatingBlockType DetermineBlockToCopy(BayType current, BayType next, StadiaType bowlType, int cornerCount)
        {
            SeatingBlockType bt = SeatingBlockType.Side;

            if (bowlType == StadiaType.EightArc || bowlType == StadiaType.Orthogonal)
            {
                if (current == 0 && next == 0)
                {
                    bt = SeatingBlockType.Side;                           //side standard
                }
                if (current == BayType.End && next == BayType.End)
                {
                    bt = SeatingBlockType.End;                                               //end standard
                }
                if (current == BayType.Corner && next == BayType.Corner)
                {
                    bt = SeatingBlockType.CornerNoVom;                                                     //corner standard
                }
                //corner vom or no vom should be determined by number of seats on last row 14 either side of vomitory max
                if (current == BayType.Corner && cornerCount % 2 == 0)
                {
                    bt = SeatingBlockType.Corner;                                                   //corner vomitory standard
                }
                if (current == 0 && next == BayType.Corner)
                {
                    bt = SeatingBlockType.Transition1;                                        //side to corner transition
                }
                if (current == BayType.Corner && next == BayType.End)
                {
                    bt = SeatingBlockType.Transition2;                                                  //corner to end transition
                }
                if (current == BayType.End && next == BayType.Corner)
                {
                    bt = SeatingBlockType.Transition2mirrored;                                                  //end to corner transition
                }
                if (current == BayType.Corner && next == 0)
                {
                    bt = SeatingBlockType.Transition1mirrored;                                        //corner to sidetransition
                }
            }
            if (bowlType == StadiaType.NoCorners)
            {
                if (current == BayType.End)
                {
                    bt = SeatingBlockType.End;                        //end standard otherwise a side is returned
                }
            }
            //if bowlType is circular side is returned
            return(bt);
        }
Exemplo n.º 3
0
        /***************************************************/

        private static void SetFloorMeshes(ref TheatronGeometry theatron, List <ProfileParameters> parameters)
        {
            for (int i = 0; i < theatron.TotalTiers; i++)
            {
                for (int j = 0; j < theatron.Tiers3d[i].Generatorblocks.Count; j++)
                {
                    SeatingBlockType bt = theatron.Tiers3d[i].Generatorblocks[j].TypeOfSeatingBlock;
                    var block           = theatron.Tiers3d[i].Generatorblocks[j];
                    if (bt == SeatingBlockType.Side || bt == SeatingBlockType.Corner || bt == SeatingBlockType.End || bt == SeatingBlockType.Undefined)
                    {
                        SetBlockFloor(ref block, parameters[i]);
                    }
                    else
                    {
                        SetBlockFloorBasic(ref block);
                    }
                }
            }
        }
Exemplo n.º 4
0
        /***************************************************/


        private static void CopyGeneratorBlocks(ref TheatronGeometry theatron, TheatronPlan bp, StadiaType stadiatype)
        {
            for (int i = 0; i < theatron.TotalTiers; i++)
            {
                BayType current, next;
                int cornerCount = -1;
                for (int j = 0; j < bp.SectionOrigins.Count; j++)
                {
                    current = bp.StructBayType[j];
                    if (j == bp.SectionOrigins.Count - 1)
                    {
                        next = bp.StructBayType[0];
                    }
                    else
                    {
                        next = bp.StructBayType[j + 1];
                    }
                    if (stadiatype == StadiaType.NoCorners && current != next)
                    {
                        continue;                                                       //no corner bowl corner position
                    }
                    SeatingBlockType bt = DetermineBlockToCopy(current, next, stadiatype, cornerCount);

                    if (current == BayType.Corner)
                    {
                        cornerCount++;
                    }
                    else
                    {
                        cornerCount = -1;
                    }

                    SeatingBlock blockToCopy = theatron.Tiers3d[i].Generatorblocks.Find(b => b.TypeOfSeatingBlock == bt).DeepClone();
                    double angle             = Geometry.Query.Angle(blockToCopy.Start.Direction, bp.SectionOrigins[j].Direction, Plane.XY);
                    SeatingBlock copy        = TransformSeatingBlock(blockToCopy, blockToCopy.Start.Origin, bp.SectionOrigins[j].Origin, angle);
                    theatron.Tiers3d[i].TierBlocks.Add(copy);
                    theatron.Audience.Add(copy.Audience);
                }
            }
        }
Exemplo n.º 5
0
        /***************************************************/
        private static void SetGeneratorblocks(ref TheatronGeometry theatronGeom, TheatronFullProfile fullprofile, TheatronPlan theatronPlan, StadiaType stadiatype, List <ProfileParameters> profileParameters)
        {
            //this defines the geometry of the seating blocks from which all others are created

            TierProfile tierToMap;

            for (int i = 0; i < theatronGeom.TotalTiers; i++)
            {
                tierToMap = fullprofile.BaseTierProfiles[i];
                theatronGeom.Tiers3d.Add(new Tier());
                var SectionBlock = GetBlockStartIndexes(theatronPlan, stadiatype);
                foreach (var pair in SectionBlock)
                {
                    int index = pair.Key;
                    SeatingBlockType blockType = pair.Value;

                    var block = SeatingBlock(theatronPlan.SectionOrigins[index], theatronPlan.VomitoryOrigins[index],
                                             theatronPlan.SectionOrigins[index + 1], blockType, profileParameters[i].SeatWidth, profileParameters[i].VomitoryParameters.VomitoryWidth);

                    theatronGeom.Tiers3d[i].Generatorblocks.Add(block);
                    if (block.TypeOfSeatingBlock == SeatingBlockType.Transition1 || block.TypeOfSeatingBlock == SeatingBlockType.Transition2)
                    {
                        //cannot use vomitory location to define profile scaling
                        SetTransitionProfiles(ref block, tierToMap, fullprofile.FullProfileOrigin, theatronPlan.VomitoryOrigins[index - 1], theatronPlan.VomitoryOrigins[index + 1]);
                    }
                    else
                    {
                        SetBlockProfiles(ref block, tierToMap, fullprofile.FullProfileOrigin);
                    }
                }
                if (stadiatype == StadiaType.EightArc || stadiatype == StadiaType.Orthogonal)
                {
                    SetOtherBlockTypes(ref theatronGeom, i, fullprofile);//only needed for radial and othogonal
                }
            }
        }
Exemplo n.º 6
0
        public static SeatingBlock SeatingBlock(ProfileOrigin start, ProfileOrigin vom, ProfileOrigin end, SeatingBlockType t, double seatWidth, double aisleWidth)
        {
            return(new SeatingBlock
            {
                Start = start,

                Vomitory = vom,

                End = end,

                SeatWidth = seatWidth,

                TypeOfSeatingBlock = t,

                AisleWidth = aisleWidth,

                FrontRow = Geometry.Create.Line(start.Origin, end.Origin),
            });
        }
Exemplo n.º 7
0
        public static SeatingBlock SeatingBlock(ProfileOrigin start, ProfileOrigin vom, ProfileOrigin end, SeatingBlockType t, double seatWidth, double aisleWidth)
        {
            if (start == null)
            {
                BH.Engine.Reflection.Compute.RecordError("Cannot create a seating block with a null starting profile origin.");
                return(null);
            }

            if (end == null)
            {
                BH.Engine.Reflection.Compute.RecordError("Cannot create a seating block with a null ending profile origin.");
                return(null);
            }

            return(new SeatingBlock
            {
                Start = start,
                Vomitory = vom,
                End = end,
                SeatWidth = seatWidth,
                TypeOfSeatingBlock = t,
                AisleWidth = aisleWidth,
                FrontRow = Geometry.Create.Line(start.Origin, end.Origin),
            });
        }