Topology
using Autodesk.DesignScript.Interfaces;
using System.Collections.Generic;
using System.Linq;
namespace Autodesk.DesignScript.Geometry
{
public class Topology : Geometry
{
internal ITopologyEntity TopologyEntity => HostImpl as ITopologyEntity;
public Vertex[] Vertices => Track(Vertex.Wrap(TopologyEntity.get_Vertices(), true));
public Edge[] Edges => Track(Edge.Wrap(TopologyEntity.get_Edges(), true));
public Face[] Faces => Track(Face.Wrap(TopologyEntity.get_Faces(), true));
internal Topology(ITopologyEntity host, bool persist)
: base(host, persist)
{
}
public override string ToString()
{
return "Topology";
}
internal static void InitType()
{
Geometry.RegisterHostType(typeof(ITopologyEntity), (IGeometryEntity host, bool persist) => new Topology(host as ITopologyEntity, persist));
}
internal static Topology Wrap(ITopologyEntity host, bool persist = true)
{
return Geometry.Wrap(host, false, null) as Topology;
}
internal static Topology[] Wrap(ITopologyEntity[] hosts, bool persist = true)
{
return (from x in hosts
select Wrap(x, persist)).ToArray();
}
internal static Topology[][] Wrap(ITopologyEntity[][] hosts, bool persist = true)
{
return (from x in hosts
select Wrap(x, persist)).ToArray();
}
internal static ITopologyEntity[][] Unwrap(Topology[][] o)
{
return (from x in o
select Unwrap(x)).ToArray();
}
internal static ITopologyEntity[] Unwrap(Topology[] o)
{
return (from x in o
select Unwrap(x)).ToArray();
}
internal static ITopologyEntity[] Unwrap(IEnumerable<Topology> o)
{
return (from x in o
select Unwrap(x)).ToArray();
}
internal static ITopologyEntity Unwrap(Topology o)
{
return o.TopologyEntity;
}
}
}