DynamoVisualProgramming.ZeroTouchLibrary by Autodesk

<PackageReference Include="DynamoVisualProgramming.ZeroTouchLibrary" Version="4.1.0-beta3040" />

 BoundingBox

using Autodesk.DesignScript.Interfaces; using Autodesk.DesignScript.Runtime; using System; using System.Collections.Generic; using System.Linq; namespace Autodesk.DesignScript.Geometry { public class BoundingBox : DesignScriptEntity { internal IBoundingBoxEntity BoundingBoxEntity => HostImpl as IBoundingBoxEntity; public Point MinPoint => Point.Wrap(BoundingBoxEntity.get_MinPoint()); public Point MaxPoint => Point.Wrap(BoundingBoxEntity.get_MaxPoint()); public CoordinateSystem ContextCoordinateSystem => CoordinateSystem.Wrap(BoundingBoxEntity.get_ContextCoordinateSystem()); internal BoundingBox(IBoundingBoxEntity host) : base(host) { } public override string ToString() { return "BoundingBox(MinPoint = " + MinPoint?.ToString() + ", MaxPoint = " + MaxPoint?.ToString() + ")"; } protected override bool Equals(DesignScriptEntity other) { if (base.Equals(other)) return true; BoundingBox boundingBox = other as BoundingBox; if (boundingBox == null) return false; if (boundingBox.MinPoint.Equals(MinPoint)) return boundingBox.MaxPoint.Equals(MaxPoint); return false; } protected override int ComputeHashCode() { int num = 17; num = num * 23 + MinPoint.GetHashCode(); return num * 23 + MaxPoint.GetHashCode(); } internal static BoundingBox Wrap(IBoundingBoxEntity host) { if (host == null) return null; return new BoundingBox(host); } internal static BoundingBox[] Wrap(IBoundingBoxEntity[] hosts) { return (from x in hosts select Wrap(x)).ToArray(); } internal static BoundingBox[][] Wrap(IBoundingBoxEntity[][] hosts) { return (from x in hosts select Wrap(x)).ToArray(); } internal static IBoundingBoxEntity[][] Unwrap(BoundingBox[][] o) { return (from x in o select Unwrap(x)).ToArray(); } internal static IBoundingBoxEntity[] Unwrap(BoundingBox[] o) { return (from x in o select Unwrap(x)).ToArray(); } internal static IBoundingBoxEntity[] Unwrap(IEnumerable<BoundingBox> o) { return (from x in o select Unwrap(x)).ToArray(); } internal static IBoundingBoxEntity Unwrap(BoundingBox o) { return o.BoundingBoxEntity; } [SupressImportIntoVM] [Obsolete("This method is deprecated and will be removed in a future version of Dynamo. Use BoundingBox.ByGeometry(IGeometryEntity[] geom) instead.")] public static BoundingBox ByGeometry(Geometry geom) { return Wrap(HostFactory.Factory.BoundingBoxByGeometry(Geometry.Unwrap(geom))); } public static BoundingBox ByGeometry(IEnumerable<Geometry> geom) { return Wrap(HostFactory.Factory.BoundingBoxByGeometry(Geometry.Unwrap(geom))); } public static BoundingBox ByMinimumVolume(IEnumerable<Geometry> geom) { return Wrap(HostFactory.Factory.BoundingBoxByMinimumVolume(Geometry.Unwrap(geom))); } [IsVisibleInDynamoLibrary(false)] public static BoundingBox ByGeometryCoordinateSystem(Geometry geom, [DefaultArgument("Autodesk.DesignScript.Geometry.CoordinateSystem.ByOrigin(0, 0, 0)")] CoordinateSystem cs) { return Wrap(HostFactory.Factory.BoundingBoxByGeometryCoordinateSystem(Geometry.Unwrap(geom), CoordinateSystem.Unwrap(cs))); } [IsVisibleInDynamoLibrary(false)] public static BoundingBox ByGeometryCoordinateSystem(IEnumerable<Geometry> geom, [DefaultArgument("Autodesk.DesignScript.Geometry.CoordinateSystem.ByOrigin(0, 0, 0)")] CoordinateSystem cs) { return Wrap(HostFactory.Factory.BoundingBoxByGeometryCoordinateSystem(Geometry.Unwrap(geom), CoordinateSystem.Unwrap(cs))); } public static BoundingBox ByCorners([DefaultArgument("Autodesk.DesignScript.Geometry.Point.ByCoordinates(0, 0, 0)")] Point min, [DefaultArgument("Autodesk.DesignScript.Geometry.Point.ByCoordinates(1, 1, 1)")] Point max) { return Wrap(HostFactory.Factory.BoundingBoxByCorners(Point.Unwrap(min), Point.Unwrap(max))); } [IsVisibleInDynamoLibrary(false)] public static BoundingBox ByCornersCoordinateSystem([DefaultArgument("Autodesk.DesignScript.Geometry.Point.ByCoordinates(0, 0, 0)")] Point min, [DefaultArgument("Autodesk.DesignScript.Geometry.Point.ByCoordinates(1, 1, 1)")] Point max, [DefaultArgument("Autodesk.DesignScript.Geometry.CoordinateSystem.ByOrigin(0, 0, 0)")] CoordinateSystem cs) { return Wrap(HostFactory.Factory.BoundingBoxByCornersCoordinateSystem(Point.Unwrap(min), Point.Unwrap(max), CoordinateSystem.Unwrap(cs))); } public BoundingBox Intersection(BoundingBox other) { return Wrap(BoundingBoxEntity.Intersection(Unwrap(other))); } public bool Intersects(BoundingBox other) { return BoundingBoxEntity.Intersects(Unwrap(other)); } public bool IsEmpty() { return BoundingBoxEntity.IsEmpty(); } public bool Contains(Point point) { return BoundingBoxEntity.Contains(Point.Unwrap(point)); } public Cuboid ToCuboid() { return Cuboid.Wrap(BoundingBoxEntity.ToCuboid()); } public PolySurface ToPolySurface() { return PolySurface.Wrap(BoundingBoxEntity.ToPolySurface()); } [SupressImportIntoVM] public static BoundingBox FromJson(string json) { return Wrap(HostFactory.Factory.BoundingBoxFromJson(json, DesignScriptEntity.scaleFactor)); } [SupressImportIntoVM] public string ToJson() { return HostImpl.ToJson(DesignScriptEntity.scaleFactor); } } }