public static LongitudinalReinforcement LongitudinalReinforcement(ILayout2D rebarLayout, double diameter, double startLocation = 0, double endLocation = 1, IMaterialFragment material = null) { CheckEndLocations(ref startLocation, ref endLocation); return(new LongitudinalReinforcement { RebarLayout = rebarLayout, Diameter = diameter, Material = material ?? Query.Default(MaterialType.Rebar), StartLocation = startLocation, EndLocation = endLocation, }); }
public static bool IsNull(this ILayout2D layout, string msg = "", [CallerMemberName] string methodName = "") { if (layout == null) { if (string.IsNullOrEmpty(methodName)) { methodName = "Method"; } Reflection.Compute.RecordError($"Cannot evaluate {methodName} because the Layout2D failed a null check. {msg}"); return(true); } return(false); }
public static LongitudinalReinforcement LongitudinalReinforcement(ILayout2D rebarLayout, double diameter, double startLocation = 0, double endLocation = 1, IMaterialFragment material = null) { if (rebarLayout.IsNull()) { return(null); } else if (diameter < Tolerance.Distance) { Reflection.Compute.RecordError("The diameter is less than the tolerance. Please check your inputs."); return(null); } CheckEndLocations(ref startLocation, ref endLocation); return(new LongitudinalReinforcement { RebarLayout = rebarLayout, Diameter = diameter, Material = material ?? Query.Default(MaterialType.Rebar), StartLocation = startLocation, EndLocation = endLocation, }); }
public static List <Point> PointLayout(this ILayout2D layout2D, ICurve hostRegionCurve, IEnumerable <ICurve> openingCurves = null) { return(IPointLayout(layout2D, new List <ICurve> { hostRegionCurve }, openingCurves)); }
/***************************************************/ /**** Private Methods - Fallback ****/ /***************************************************/ private static List <Point> PointLayout(this ILayout2D layout2D, IEnumerable <ICurve> hostRegionCurves, IEnumerable <ICurve> openingCurves = null) { Reflection.Compute.RecordError("PointLayout for " + layout2D.GetType().Name + " is not implemented."); return(new List <Point>()); }
public static List <Point> IPointLayout(this ILayout2D layout2D, IEnumerable <ICurve> hostRegionCurves, IEnumerable <ICurve> openingCurves = null) { return(PointLayout(layout2D as dynamic, hostRegionCurves, openingCurves)); }
/***************************************************/ private static int LayoutCount(ILayout2D layout) { Engine.Reflection.Compute.RecordError("Could not extract number of points from layout of type " + layout.GetType().Name); return(0); }