TSplineTopology
using Autodesk.DesignScript.Interfaces;
using Autodesk.DesignScript.Runtime;
using System.Collections.Generic;
using System.Linq;
namespace Autodesk.DesignScript.Geometry.TSpline
{
    public class TSplineTopology : Topology
    {
        internal ITSplineTopologyEntity TSplineTopologyEntity => HostImpl as ITSplineTopologyEntity;
        [IsVisibleInDynamoLibrary(false)]
        public new TSplineVertex[] Vertices {
            get {
                return Track(TSplineVertex.Wrap(TSplineTopologyEntity.get_Vertices(), true));
            }
        }
        [IsVisibleInDynamoLibrary(false)]
        public new TSplineEdge[] Edges {
            get {
                return Track(TSplineEdge.Wrap(TSplineTopologyEntity.get_Edges(), true));
            }
        }
        [IsVisibleInDynamoLibrary(false)]
        public new TSplineFace[] Faces {
            get {
                return Track(TSplineFace.Wrap(TSplineTopologyEntity.get_Faces(), true));
            }
        }
        public TSplineVertex[] RegularVertices => Track(TSplineVertex.Wrap(TSplineTopologyEntity.get_RegularVertices(), true));
        public TSplineVertex[] StarPointVertices => Track(TSplineVertex.Wrap(TSplineTopologyEntity.get_StarPointVertices(), true));
        public TSplineVertex[] TPointVertices => Track(TSplineVertex.Wrap(TSplineTopologyEntity.get_TPointVertices(), true));
        public TSplineVertex[] NonManifoldVertices => Track(TSplineVertex.Wrap(TSplineTopologyEntity.get_NonManifoldVertices(), true));
        public TSplineVertex[] BorderVertices => Track(TSplineVertex.Wrap(TSplineTopologyEntity.get_BorderVertices(), true));
        public TSplineVertex[] InnerVertices => Track(TSplineVertex.Wrap(TSplineTopologyEntity.get_InnerVertices(), true));
        public TSplineEdge[] NonManifoldEdges => Track(TSplineEdge.Wrap(TSplineTopologyEntity.get_NonManifoldEdges(), true));
        public TSplineEdge[] BorderEdges => Track(TSplineEdge.Wrap(TSplineTopologyEntity.get_BorderEdges(), true));
        public TSplineEdge[] InnerEdges => Track(TSplineEdge.Wrap(TSplineTopologyEntity.get_InnerEdges(), true));
        public TSplineFace[] RegularFaces => Track(TSplineFace.Wrap(TSplineTopologyEntity.get_RegularFaces(), true));
        public TSplineFace[] NGonFaces => Track(TSplineFace.Wrap(TSplineTopologyEntity.get_NGonFaces(), true));
        public TSplineFace[] BorderFaces => Track(TSplineFace.Wrap(TSplineTopologyEntity.get_BorderFaces(), true));
        public TSplineFace[] InnerFaces => Track(TSplineFace.Wrap(TSplineTopologyEntity.get_InnerFaces(), true));
        public int VerticesCount => TSplineTopologyEntity.get_VerticesCount();
        public int EdgesCount => TSplineTopologyEntity.get_EdgesCount();
        public int FacesCount => TSplineTopologyEntity.get_FacesCount();
        internal TSplineTopology(ITSplineTopologyEntity host, bool persist)
            : base(host, persist)
        {
        }
        public override string ToString()
        {
            return "TSplineTopology(VerticesCount = " + VerticesCount + ", EdgesCount = " + EdgesCount + ", FacesCount = " + FacesCount + ")";
        }
        internal new static void InitType()
        {
            Geometry.RegisterHostType(typeof(ITSplineTopologyEntity), (IGeometryEntity host, bool persist) => new TSplineTopology(host as ITSplineTopologyEntity, persist));
        }
        internal static TSplineTopology Wrap(ITSplineTopologyEntity host, bool persist = true)
        {
            return Geometry.Wrap(host, false, null) as TSplineTopology;
        }
        internal static TSplineTopology[] Wrap(ITSplineTopologyEntity[] hosts, bool persist = true)
        {
            return (from x in hosts
            select Wrap(x, persist)).ToArray();
        }
        internal static TSplineTopology[][] Wrap(ITSplineTopologyEntity[][] hosts, bool persist = true)
        {
            return (from x in hosts
            select Wrap(x, persist)).ToArray();
        }
        internal static ITSplineTopologyEntity[][] Unwrap(TSplineTopology[][] o)
        {
            return (from x in o
            select Unwrap(x)).ToArray();
        }
        internal static ITSplineTopologyEntity[] Unwrap(TSplineTopology[] o)
        {
            return (from x in o
            select Unwrap(x)).ToArray();
        }
        internal static ITSplineTopologyEntity[] Unwrap(IEnumerable<TSplineTopology> o)
        {
            return (from x in o
            select Unwrap(x)).ToArray();
        }
        internal static ITSplineTopologyEntity Unwrap(TSplineTopology o)
        {
            return o.TSplineTopologyEntity;
        }
        [MultiReturn(new string[] {
            "all",
            "regular",
            "tPoints",
            "starPoints",
            "nonManifold",
            "border",
            "inner"
        })]
        public Dictionary<string, TSplineVertex[]> DecomposedVertices()
        {
            Dictionary<string, TSplineVertex[]> dictionary = new Dictionary<string, TSplineVertex[]>();
            foreach (KeyValuePair<string, ITSplineVertexEntity[]> item in TSplineTopologyEntity.DecomposedVertices()) {
                dictionary[item.Key] = Track(TSplineVertex.Wrap(item.Value, true));
            }
            return dictionary;
        }
        [MultiReturn(new string[] {
            "all",
            "nonManifold",
            "border",
            "inner"
        })]
        public Dictionary<string, TSplineEdge[]> DecomposedEdges()
        {
            Dictionary<string, TSplineEdge[]> dictionary = new Dictionary<string, TSplineEdge[]>();
            foreach (KeyValuePair<string, ITSplineEdgeEntity[]> item in TSplineTopologyEntity.DecomposedEdges()) {
                dictionary[item.Key] = Track(TSplineEdge.Wrap(item.Value, true));
            }
            return dictionary;
        }
        [MultiReturn(new string[] {
            "all",
            "regular",
            "nGons",
            "border",
            "inner"
        })]
        public Dictionary<string, TSplineFace[]> DecomposedFaces()
        {
            Dictionary<string, TSplineFace[]> dictionary = new Dictionary<string, TSplineFace[]>();
            foreach (KeyValuePair<string, ITSplineFaceEntity[]> item in TSplineTopologyEntity.DecomposedFaces()) {
                dictionary[item.Key] = Track(TSplineFace.Wrap(item.Value, true));
            }
            return dictionary;
        }
        public TSplineVertex VertexByIndex(int index)
        {
            return Track(TSplineVertex.Wrap(TSplineTopologyEntity.VertexByIndex(index), true));
        }
        public TSplineEdge EdgeByIndex(int index)
        {
            return Track(TSplineEdge.Wrap(TSplineTopologyEntity.EdgeByIndex(index), true));
        }
        public TSplineFace FaceByIndex(int index)
        {
            return Track(TSplineFace.Wrap(TSplineTopologyEntity.FaceByIndex(index), true));
        }
    }
}