package uk.ac.leeds.ccg.shapefile; import java.io.*; import cmp.LEDataStream.*; /** * Wrapper for a Shapefile arc. */ public class ShapeArcM implements ShapefileShape,Serializable { protected double[] box = new double[4]; protected int numParts; protected int numPoints; protected int[] parts; protected ShapePoint[] points; protected double[] mRange = new double[2]; protected double[] mArray = null; protected ShapeArcM(){}//For use by ShapePolygon public ShapeArcM(LEDataInputStream file) throws IOException{ file.setLittleEndianMode(true); int shapeType = file.readInt(); for(int i = 0;i<4;i++){ box[i] = file.readDouble(); } numParts = file.readInt(); numPoints = file.readInt(); parts = new int[numParts]; points = new ShapePoint[numPoints]; mArray = new double[numPoints]; for(int i = 0;i * a non-existent part returns null (would you prefer an exception?) * @param part id of part,[first is 0] */ public ShapePoint[] getPartPoints(int part){ if(part>numParts-1){return null;} int start,finish,length; start = parts[part]; if(part == numParts-1){finish = numPoints;} else { finish=parts[part+1]; } length = finish-start; ShapePoint[] partPoints = new ShapePoint[length]; for(int i =0;i