/// <summary> /// Creates Levels within the subgrade and ongrade Envelopes. /// </summary> /// <param name="stdHeight">Desired height for repeating Levels.</param> /// <param name="grdHeight">Desired height for first Level above grade.</param> private void GradeLevels(double stdHeight, double grdHeight) { var envelopes = Envelopes.Where(e => e.Elevation >= 0.0).ToList(); if (envelopes.Count() == 0) { return; } var envelope = envelopes.First(); var subs = Envelopes.Where(e => e.Elevation < 0.0).ToList(); if (subs.Count() == 0) // if no subgrade levels created, add the first Level. { MakeLevel(envelope, envelope.Elevation); } if (envelope.Height >= grdHeight + (stdHeight * 2)) { // Temporary Envelope to populate levels above the lobby. envelope = new Envelope(envelope.Profile, grdHeight, envelope.Height - grdHeight, Vector3.ZAxis, 0.0, new Transform(0.0, 0.0, grdHeight), null, null, false, Guid.NewGuid(), ""); MakeLevels(envelope, stdHeight, true, true); } else { MakeLevel(envelope, envelope.Height); } Levels = Levels.OrderBy(l => l.Elevation).ToList(); LevelPerimeters = LevelPerimeters.OrderBy(l => l.Elevation).ToList(); }
/// <summary> /// Creates Levels within the subgrade Envelopes. /// </summary> /// <param name="stdHeight">Desired height for repeating Levels.</param> /// <param name="grdHeight">Desired height for first Level above grade.</param> private void SubGradeLevels(double stdHeight) { // Add subgrade Levels. var subs = Envelopes.Where(e => e.Elevation < 0.0).ToList(); foreach (var env in subs) { MakeLevels(env, stdHeight, true, true); } Levels = Levels.OrderBy(l => l.Elevation).ToList(); LevelPerimeters = LevelPerimeters.OrderBy(l => l.Elevation).ToList(); }
/// <summary> /// Creates levels in the highest Envelope, including a higher mechanical Level below the top of the Envelope. /// </summary> /// <param name="stdHeight">Desired height for repeating Levels.</param> /// <param name="pntHeight">Desired height for mechanical Levels</param> private void HighLevels(double stdHeight, double pntHeight) { if (Envelopes.Where(e => e.Elevation >= 0.0).ToList().Count() < 2) { return; } // Add penthouse level and roof level to highest Envelope. var envelope = Envelopes.Last(); var bldgHeight = envelope.Elevation + envelope.Height; MakeLevel(envelope, bldgHeight); // Create temporary envelope to populate the region beneath the penthouse level. envelope = new Envelope(envelope.Profile.Perimeter, envelope.Elevation, envelope.Height - pntHeight, Vector3.ZAxis, 0.0, envelope.Transform, null, envelope.Representation, false, Guid.NewGuid(), ""); MakeLevels(envelope, stdHeight, false, true); Levels = Levels.OrderBy(l => l.Elevation).ToList(); LevelPerimeters = LevelPerimeters.OrderBy(l => l.Elevation).ToList(); }
/// <summary> /// Creates Levels within the subgrade and ongrade Envelopes. /// </summary> /// <param name="stdHeights">The list of desired height for repeating Levels.</param> private void GradeLevels(IList <double> stdHeights) { var envelopes = Envelopes.Where(e => e.Elevation >= 0.0).ToList(); if (envelopes.Count() == 0) { return; } var envelope = envelopes.First(); var subs = Envelopes.Where(e => e.Elevation < 0.0).ToList(); if (subs.Count() == 0) // if no subgrade levels created, add the first Level. { MakeLevel(envelope, envelope.Elevation); } double elevation = 0; // Populate explicity defined levels foreach (double height in stdHeights) { elevation = elevation + height; MakeLevel(envelope, elevation); } // Populate the rest of the levels if (envelope.Height >= elevation) { // Temporary Envelope to populate levels above the explicity defined levels. envelope = new Envelope(envelope.Profile, elevation, envelope.Height - elevation, Vector3.ZAxis, 0.0, new Transform(0.0, 0.0, elevation), null, null, false, Guid.NewGuid(), ""); MakeLevels(envelope, stdHeights.Last(), false, true); } else { MakeLevel(envelope, envelope.Height); } Levels = Levels.OrderBy(l => l.Elevation).ToList(); LevelPerimeters = LevelPerimeters.OrderBy(l => l.Elevation).ToList(); }
/// <summary> /// Creates Levels in middle-height Envelopes. /// </summary> /// <param name="stdHeight">Desired height for repeating Levels.</param> private void MidLevels(double stdHeight) { if (Envelopes.Where(e => e.Elevation >= 0.0).ToList().Count() < 3) { return; } // Remove completed Levels from Envelope list. var envelopes = new List <Envelope>(); envelopes.AddRange(Envelopes.Where(e => e.Elevation >= 0.0).Skip(1).ToList()); envelopes = envelopes.SkipLast(1).ToList(); // Add standard height Levels. foreach (var envelope in envelopes) { //Skip the last level so we don't get redundant levels at the top of one envelope and the bottom of the next. MakeLevels(envelope, stdHeight, false, true); } Levels = Levels.OrderBy(l => l.Elevation).ToList(); LevelPerimeters = LevelPerimeters.OrderBy(l => l.Elevation).ToList(); }