private static Profile MatchProfileWithOverride(Line line, Profile defaultProfile, Overrides overrides) { var selectedProfile = defaultProfile; if (overrides != null) { var o = overrides.Profile.FirstOrDefault(ov => { var seg = (Line)ov.Identity.Curve; return(seg.Start.IsAlmostEqualTo(line.Start) && seg.End.IsAlmostEqualTo(line.End)); }); if (o != null) { var profileName = Enum.GetName(typeof(ProfileValueProfileName), o.Value.ProfileName); selectedProfile = WideFlangeProfileServer.Instance.GetProfileByName(profileName); } } return(selectedProfile); }
public TrussBridgeInputs(Line @path, double @width, double @height, double @endElevation, IList <Vector3> @abutmentLocations, Overrides @overrides, string bucketName, string uploadsBucket, Dictionary <string, string> modelInputKeys, string gltfKey, string elementsKey, string ifcKey) : base(bucketName, uploadsBucket, modelInputKeys, gltfKey, elementsKey, ifcKey) { var validator = Validator.Instance.GetFirstValidatorForType <TrussBridgeInputs>(); if (validator != null) { validator.PreConstruct(new object[] { @path, @width, @height, @endElevation, @abutmentLocations, @overrides }); } this.Path = @path; this.Width = @width; this.Height = @height; this.EndElevation = @endElevation; this.AbutmentLocations = @abutmentLocations; this.Overrides = @overrides; if (validator != null) { validator.PostConstruct(this); } }