//public static Slb.Ocean.Petrel.DomainObject.PillarGrid.Zone GetZone(Index3 cellIndex, List<Slb.Ocean.Petrel.DomainObject.PillarGrid.Zone> Zones)//List<Slb.Ocean.Petrel.DomainObject.PillarGrid.Zone> TopZone)
        //{
        //    foreach (Slb.Ocean.Petrel.DomainObject.PillarGrid.Zone zone in Zones)
        //    {
        //        if (cellIndex.K > zone.BaseK && cellIndex.K)
        //       {
        //       }
        //    }
        //}
        public static Point3[] GetCornerSet(CellSide SideOfCell, Grid gridInContext, Index3 CellIndex)
        {
            CellCorner[] CellCorners = new CellCorner[4];
            Point3[] CellCornerPoints = new Point3[4];

            switch (SideOfCell)
            {
                case CellSide.Up:
                    CellCorners[0] = CellCorner.TopNorthWest; CellCorners[1] = CellCorner.TopNorthEast; CellCorners[2] = CellCorner.TopSouthWest;
                    CellCorners[3] = CellCorner.TopSouthEast;
                    CellCornerPoints = gridInContext.GetCellCorners(CellIndex, CellCorners);

                    break;

                case CellSide.East:
                    CellCorners[0] = CellCorner.TopSouthEast; CellCorners[1] = CellCorner.TopNorthEast; CellCorners[2] = CellCorner.BaseSouthEast;
                    CellCorners[3] = CellCorner.BaseNorthEast;
                    CellCornerPoints = gridInContext.GetCellCorners(CellIndex, CellCorners);

                    break;

                case CellSide.West:

                    CellCorners[0] = CellCorner.TopSouthWest; CellCorners[1] = CellCorner.TopNorthWest; CellCorners[2] = CellCorner.BaseSouthWest;
                    CellCorners[3] = CellCorner.BaseNorthWest;
                    CellCornerPoints = gridInContext.GetCellCorners(CellIndex, CellCorners);

                    break;

                case CellSide.South:
                    CellCorners[0] = CellCorner.TopSouthWest; CellCorners[1] = CellCorner.TopSouthEast; CellCorners[2] = CellCorner.BaseSouthWest;
                    CellCorners[3] = CellCorner.BaseSouthEast;
                    CellCornerPoints = gridInContext.GetCellCorners(CellIndex, CellCorners);

                    break;

                case CellSide.North:

                    CellCorners[0] = CellCorner.TopNorthWest; CellCorners[1] = CellCorner.TopNorthEast; CellCorners[2] = CellCorner.BaseNorthWest;
                    CellCorners[3] = CellCorner.BaseNorthEast;
                    CellCornerPoints = gridInContext.GetCellCorners(CellIndex, CellCorners);

                    break;

                case CellSide.Down:

                    CellCorners[0] = CellCorner.BaseNorthWest; CellCorners[1] = CellCorner.BaseNorthEast; CellCorners[2] = CellCorner.BaseSouthWest;
                    CellCorners[3] = CellCorner.BaseSouthEast;
                    CellCornerPoints = gridInContext.GetCellCorners(CellIndex, CellCorners);

                    break;
                default:

                    CellCornerPoints = null;
                    break;
            }

            return CellCornerPoints;
        }