PanelSurface
using Autodesk.DesignScript.Interfaces;
using Autodesk.DesignScript.Runtime;
using System.Collections.Generic;
using System.Linq;
namespace Autodesk.DesignScript.Geometry
{
    public class PanelSurface : DesignScriptEntity
    {
        internal IPanelSurfaceEntity PanelSurfaceEntity => HostImpl as IPanelSurfaceEntity;
        public int NumVertices => PanelSurfaceEntity.get_NumVertices();
        public int NumPanels => PanelSurfaceEntity.get_NumPanels();
        internal PanelSurface(IPanelSurfaceEntity host, bool persist)
            : base(host, persist)
        {
        }
        public override string ToString()
        {
            string[] obj = new string[5] {
                "PanelSurface(NumVertices = ",
                null,
                null,
                null,
                null
            };
            int num = NumVertices;
            obj[1] = num.ToString();
            obj[2] = ", NumPanels = ";
            num = NumPanels;
            obj[3] = num.ToString();
            obj[4] = ")";
            return string.Concat(obj);
        }
        internal static PanelSurface Wrap(IPanelSurfaceEntity host, bool persist = true)
        {
            if (host == null)
                return null;
            return new PanelSurface(host, persist);
        }
        internal static PanelSurface[] Wrap(IPanelSurfaceEntity[] hosts, bool persist = true)
        {
            return (from x in hosts
            select Wrap(x, persist)).ToArray();
        }
        internal static PanelSurface[][] Wrap(IPanelSurfaceEntity[][] hosts, bool persist = true)
        {
            return (from x in hosts
            select Wrap(x, persist)).ToArray();
        }
        internal static IPanelSurfaceEntity[][] Unwrap(PanelSurface[][] o)
        {
            return (from x in o
            select Unwrap(x)).ToArray();
        }
        internal static IPanelSurfaceEntity[] Unwrap(PanelSurface[] o)
        {
            return (from x in o
            select Unwrap(x)).ToArray();
        }
        internal static IPanelSurfaceEntity[] Unwrap(IEnumerable<PanelSurface> o)
        {
            return (from x in o
            select Unwrap(x)).ToArray();
        }
        internal static IPanelSurfaceEntity Unwrap(PanelSurface o)
        {
            return o.PanelSurfaceEntity;
        }
        public static PanelSurface ByQuads(Surface surface, int numU, int numV, PanelSurfaceBoundaryCondition boundaryCondition = PanelSurfaceBoundaryCondition.Keep)
        {
            return Wrap(HostFactory.Factory.PanelSurfaceByQuads(Surface.Unwrap(surface), numU, numV, boundaryCondition), true);
        }
        public static PanelSurface ByCrossSplitSquares(Surface surface, int numU, int numV, PanelSurfaceBoundaryCondition boundaryCondition = PanelSurfaceBoundaryCondition.Keep)
        {
            return Wrap(HostFactory.Factory.PanelSurfaceByCrossSplitSquares(Surface.Unwrap(surface), numU, numV, boundaryCondition), true);
        }
        public static PanelSurface ByDiagonallySplitSquares(Surface surface, int numU, int numV, bool alternativeDiagonal = false, PanelSurfaceBoundaryCondition boundaryCondition = PanelSurfaceBoundaryCondition.Keep)
        {
            return Wrap(HostFactory.Factory.PanelSurfaceByDiagonallySplitSquares(Surface.Unwrap(surface), numU, numV, alternativeDiagonal, boundaryCondition), true);
        }
        public static PanelSurface ByDiamonds(Surface surface, int numU, int numV, PanelSurfaceBoundaryCondition boundaryCondition = PanelSurfaceBoundaryCondition.Keep)
        {
            return Wrap(HostFactory.Factory.PanelSurfaceByDiamonds(Surface.Unwrap(surface), numU, numV, boundaryCondition), true);
        }
        public static PanelSurface BySplitDiamonds(Surface surface, int numU, int numV, bool splitHorizontally = false, PanelSurfaceBoundaryCondition boundaryCondition = PanelSurfaceBoundaryCondition.Keep)
        {
            return Wrap(HostFactory.Factory.PanelSurfaceBySplitDiamonds(Surface.Unwrap(surface), numU, numV, splitHorizontally, boundaryCondition), true);
        }
        public static PanelSurface ByParallelograms(Surface surface, int numU, int numV, double shearFactor, bool alignWithUAxis = false, PanelSurfaceBoundaryCondition boundaryCondition = PanelSurfaceBoundaryCondition.Keep)
        {
            return Wrap(HostFactory.Factory.PanelSurfaceByParallelograms(Surface.Unwrap(surface), numU, numV, shearFactor, alignWithUAxis, boundaryCondition), true);
        }
        public static PanelSurface ByStaggeredQuads(Surface surface, int numU, int numV, bool staggerVertically = false, double displacementFactor = 0.5, PanelSurfaceBoundaryCondition boundaryCondition = PanelSurfaceBoundaryCondition.Keep)
        {
            return Wrap(HostFactory.Factory.PanelSurfaceByStaggeredQuads(Surface.Unwrap(surface), numU, numV, staggerVertically, displacementFactor, boundaryCondition), true);
        }
        public static PanelSurface ByHexagons(Surface surface, int numU, int numV, PanelSurfaceBoundaryCondition boundaryCondition = PanelSurfaceBoundaryCondition.Keep)
        {
            return Wrap(HostFactory.Factory.PanelSurfaceByHexagons(Surface.Unwrap(surface), numU, numV, boundaryCondition), true);
        }
        public static PanelSurface ByRhombiTriHexagonals(Surface surface, int numU, int numV, PanelSurfaceBoundaryCondition boundaryCondition = PanelSurfaceBoundaryCondition.Keep)
        {
            return Wrap(HostFactory.Factory.PanelSurfaceByRhombiTriHexagonals(Surface.Unwrap(surface), numU, numV, boundaryCondition), true);
        }
        public static PanelSurface ByCustomOrthogonalLattice(Surface surface, int numU, int numV, double uDisplacement, double vDisplacement, UV[][] tileUVs, PanelSurfaceBoundaryCondition boundaryCondition = PanelSurfaceBoundaryCondition.Keep)
        {
            return Wrap(HostFactory.Factory.PanelSurfaceByCustomOrthogonalLattice(Surface.Unwrap(surface), numU, numV, uDisplacement, vDisplacement, UV.Unwrap(tileUVs), boundaryCondition), true);
        }
        public PanelSurface SetTransform([DefaultArgument("1.0")] double scale, [DefaultArgument("0.0")] double uOffset, [DefaultArgument("0.0")] double vOffset, [DefaultArgument("0.0")] double rotation, [DefaultArgument("Autodesk.DesignScript.Geometry.Point.ByCoordinates(0, 0, 0)")] Point rotationPoint)
        {
            return Wrap(PanelSurfaceEntity.SetTransform(scale, uOffset, vOffset, rotation, Point.Unwrap(rotationPoint)), true);
        }
        [AllowRankReduction]
        public int[] GetNumPanelVertices([DefaultArgument("null")] int[] panelIndices)
        {
            return PanelSurfaceEntity.GetNumPanelVertices(panelIndices);
        }
        public Vertex GetVertex(int vertexIndex)
        {
            return Vertex.Wrap(PanelSurfaceEntity.GetVertex(vertexIndex), true);
        }
        public Point GetPoint(int vertexIndex)
        {
            return Point.Wrap(PanelSurfaceEntity.GetPoint(vertexIndex), true);
        }
        public int GetVertexIndex(int panelIndex, int vertexNumber)
        {
            return PanelSurfaceEntity.GetVertexIndex(panelIndex, vertexNumber);
        }
        [AllowRankReduction]
        public Vertex[][] GetPanelVertices([DefaultArgument("null")] int[] panelIndices)
        {
            return Vertex.Wrap(PanelSurfaceEntity.GetPanelVertices(panelIndices), true);
        }
        [AllowRankReduction]
        public Point[][] GetPanelPoints([DefaultArgument("null")] int[] panelIndices)
        {
            return Point.Wrap(PanelSurfaceEntity.GetPanelPoints(panelIndices), true);
        }
        [AllowRankReduction]
        public Polygon[] GetPanelPolygon([DefaultArgument("null")] int[] panelIndices)
        {
            return Polygon.Wrap(PanelSurfaceEntity.GetPanelPolygon(panelIndices), true);
        }
    }
}
            