public override Point Parse(byte[] recordContent, ReadIntDelegate readInt, ReadDoubleDelegate readDouble)
        {
            int    shapeType = readInt(recordContent, 0, true);
            double x         = readDouble(recordContent, 4, true);
            double y         = readDouble(recordContent, 12, true);

            return(new Point(x, y));
        }
Exemple #2
0
        public override PointZ Parse(byte[] recordContent, ReadIntDelegate readInt, ReadDoubleDelegate readDouble)
        {
            var x = readDouble(recordContent, 4, true);
            var y = readDouble(recordContent, 12, true);
            var z = readDouble(recordContent, 20, true);

            //var m = readDouble(recordContent, 28, true);
            return(new PointZ(x, y, z, 0));
        }
Exemple #3
0
        public override Polyline Parse(byte[] recordContent, ReadIntDelegate readInt, ReadDoubleDelegate readDouble)
        {
            //PolyLine
            //{
            //                Double[4] Box // Bounding Box
            //                Integer NumParts // Number of Parts
            //                Integer NumPoints // Total Number of Points
            //                Integer[NumParts] Parts // Index to First Point in Part
            //                Point[NumPoints] Points // Points for All Parts
            //}
            int shapeType = readInt(recordContent, 0, true);

            double Xmin = readDouble(recordContent, 4, true);
            double Ymin = readDouble(recordContent, 12, true);
            double Xmax = readDouble(recordContent, 20, true);
            double Ymax = readDouble(recordContent, 28, true);

            int numParts  = readInt(recordContent, 36, true);
            int numPoints = readInt(recordContent, 40, true);

            int[]   parts  = new int[numParts];
            Point[] points = new Point[numPoints];

            for (int iParts = 0; iParts < numParts; iParts++)
            {
                parts[iParts] = readInt(recordContent, 44 + 4 * iParts, true);
            }

            int startPointIndex = 44 + numParts * 4;

            for (int iPoints = 0; iPoints < numPoints; iPoints++)
            {
                points[iPoints] = new Point(readDouble(recordContent, startPointIndex + 16 * iPoints, true),
                                            readDouble(recordContent, startPointIndex + 16 * iPoints + 8, true));
            }
            return(new Polyline()
            {
                Xmin = Xmin,
                Xmax = Xmax,
                NumParts = numParts,
                NumPoints = numPoints,
                Parts = parts,
                Points = points,
                Ymax = Ymax,
                Ymin = Ymin
            });
        }
Exemple #4
0
        public override Polygon Parse(byte[] recordContent, ReadIntDelegate readInt, ReadDoubleDelegate readDouble)
        {
            int shapeType = readInt(recordContent, 0, true);

            double Xmin = readDouble(recordContent, 4, true);
            double Ymin = readDouble(recordContent, 12, true);
            double Xmax = readDouble(recordContent, 20, true);
            double Ymax = readDouble(recordContent, 28, true);

            int numParts  = readInt(recordContent, 36, true);
            int numPoints = readInt(recordContent, 40, true);

            int[]   parts  = new int[numParts];
            Point[] points = new Point[numPoints];

            for (int iParts = 0; iParts < numParts; iParts++)
            {
                parts[iParts] = readInt(recordContent, 44 + 4 * iParts, true);
            }

            int startPointIndex = 44 + numParts * 4;

            for (int iPoints = 0; iPoints < numPoints; iPoints++)
            {
                points[iPoints] = new Point(readDouble(recordContent, startPointIndex + 16 * iPoints, true),
                                            readDouble(recordContent, startPointIndex + 16 * iPoints + 8, true));
            }
            return(new Polygon()
            {
                Xmin = Xmin,
                Xmax = Xmax,
                NumParts = numParts,
                NumPoints = numPoints,
                Parts = parts,
                Points = points,
                Ymax = Ymax,
                Ymin = Ymin
            });
        }
        public override PolygonZ Parse(byte[] recordContent, ReadIntDelegate readInt, ReadDoubleDelegate readDouble)
        {
            //PolygonZ
            //{
            //                Double[4] Box // Bounding Box
            //                Integer NumParts // Number of Parts
            //                Integer NumPoints // Total Number of Points
            //                Integer[NumParts] Parts // Index to First Point in Part
            //                Point[NumPoints] Points // Points for All Parts
            //                Double[2] Z Range // Bounding Z Range
            //                Double[NumPoints] Z Array // Z Values for All Points
            //                Double[2] M Range // Bounding Measure Range
            //                Double[NumPoints] M Array // Measures
            //}
            int shapeType = readInt(recordContent, 0, true);

            double Xmin, Ymin, Xmax, Ymax;//Bounding box
            int    numParts, numPoints;

            Xmin = readDouble(recordContent, 4, true);
            Ymin = readDouble(recordContent, 12, true);
            Xmax = readDouble(recordContent, 20, true);
            Ymax = readDouble(recordContent, 28, true);

            numParts  = readInt(recordContent, 36, true);
            numPoints = readInt(recordContent, 40, true);

            int[] partsArray = new int[numParts];
            for (int iParts = 0; iParts < numParts; iParts++)
            {
                int indexPart = 44 + iParts * 4;
                partsArray[iParts] = readInt(recordContent, indexPart, true);
            }

            Point[] pointsArray = new Point[numPoints];
            int     startPoints = 44 + (4 * numParts);

            for (int iPoints = 0; iPoints < numPoints; iPoints++)
            {
                int indexPoint = startPoints + iPoints * 16;
                pointsArray[iPoints] = new Point(
                    readDouble(recordContent, indexPoint, true),
                    readDouble(recordContent, indexPoint + 8, true));
            }

            int    startZmin = startPoints + 16 * numPoints;
            double Zmin      = readDouble(recordContent, startZmin, true);
            double Zmax      = readDouble(recordContent, startZmin + 8, true);

            double[] Zarray      = new double[numPoints];
            int      startZArray = startZmin + 16;

            for (int iZarray = 0; iZarray < numPoints; iZarray++)
            {
                int indexZ = startZArray + iZarray * 8;
                Zarray[iZarray] = readDouble(recordContent, indexZ, true);
            }

            int startMmin = startZArray + 8 * numPoints;
            //double Mmin = readDouble(recordContent, startMmin, true);
            //double Mmax = readDouble(recordContent, startMmin + 8, true);
            double Mmin = 0;
            double Mmax = 0;

            double[] Marray      = new double[numPoints];
            int      startMarray = startMmin + 16;
            //for(int iMarray = 0; iMarray < numPoints; iMarray++)
            //{
            //    int indexM = startMarray + iMarray * 8;
            //    Marray[iMarray] = readDouble(recordContent, indexM, true);
            //}

            int currentIndex = startMarray + 8 * numPoints;

            return(new PolygonZ(Xmin, Xmax,
                                Ymin, Ymax,
                                numParts, numPoints,
                                partsArray, pointsArray,
                                Zmin, Zmax,
                                Zarray,
                                Mmin, Mmax,
                                Marray));
        }
 public abstract T Parse(byte[] recordContent, ReadIntDelegate readInt, ReadDoubleDelegate readDouble);
        public override PolylineZ Parse(byte[] recordContent, ReadIntDelegate readInt, ReadDoubleDelegate readDouble)
        {
            //PolyLine
            //{
            //                Double[4] Box // Bounding Box
            //                Integer NumParts // Number of Parts
            //                Integer NumPoints // Total Number of Points
            //                Integer[NumParts] Parts // Index to First Point in Part
            //                Point[NumPoints] Points // Points for All Parts
            //                Double[2] Z Range // Bounding Z Range
            //                Double[NumPoints] Z Array // Z Values for All Points
            //                Double[2] M Range // Bounding Measure Range
            //                Double[NumPoints] M Array // Measures
            //}
            int shapeType = readInt(recordContent, 0, true);

            double Xmin = readDouble(recordContent, 4, true);
            double Ymin = readDouble(recordContent, 12, true);
            double Xmax = readDouble(recordContent, 20, true);
            double Ymax = readDouble(recordContent, 28, true);

            int numParts  = readInt(recordContent, 36, true);
            int numPoints = readInt(recordContent, 40, true);

            int[]   parts  = new int[numParts];
            Point[] points = new Point[numPoints];

            for (int iParts = 0; iParts < numParts; iParts++)
            {
                parts[iParts] = readInt(recordContent, 44 + 4 * iParts, true);
            }

            int startPointIndex = 44 + numParts * 4;

            for (int iPoints = 0; iPoints < numPoints; iPoints++)
            {
                points[iPoints] = new Point(readDouble(recordContent, startPointIndex + 16 * iPoints, true),
                                            readDouble(recordContent, startPointIndex + 16 * iPoints + 8, true));
            }

            int    startZBoundIndex = startPointIndex + numPoints * 16;
            double Zmin             = readDouble(recordContent, startZBoundIndex, true);
            double Zmax             = readDouble(recordContent, startZBoundIndex + 8, true);

            double[] ZArray = new double[numPoints];
            for (int iPoint = 0; iPoint < numPoints; iPoint++)
            {
                ZArray[iPoint] = readDouble(recordContent, startZBoundIndex + 16 + iPoint * 8, true);
            }

            int    startMBoundIndex = startZBoundIndex + 16 + numPoints * 8;
            double Mmin             = readDouble(recordContent, startMBoundIndex, true);
            double Mmax             = readDouble(recordContent, startMBoundIndex + 8, true);

            double[] MArray = new double[numPoints];
            for (int iPoint = 0; iPoint < numPoints; iPoint++)
            {
                MArray[iPoint] = readDouble(recordContent, startMBoundIndex + 16 + iPoint * 8, true);
            }

            return(new PolylineZ()
            {
                Xmin = Xmin,
                Xmax = Xmax,
                NumParts = numParts,
                NumPoints = numPoints,
                Parts = parts,
                Points = points,
                Ymax = Ymax,
                Ymin = Ymin,
                Zmin = Zmin,
                Zmax = Zmax,
                Mmin = Mmin,
                Mmax = Mmax,
                ZArray = ZArray,
                MArray = MArray
            });
        }