| | |
| | | } |
| | | |
| | | return new Envelope(converUnitToCoord((int) range.getMinX()), converUnitToCoord((int) range.getMaxX()), |
| | | converUnitToCoord((int) range.getMinY()), converUnitToCoord((int) range.getMaxY())); |
| | | converUnitToCoord((int) range.getMinY()), converUnitToCoord((int) range.getMaxY())); |
| | | } |
| | | |
| | | public static Envelope converCoordToUnit(Envelope range) |
| | |
| | | } |
| | | |
| | | return new Envelope(converCoordToUnit(range.getMinX()), converCoordToUnit(range.getMaxX()), |
| | | converCoordToUnit(range.getMinY()), converCoordToUnit(range.getMaxY())); |
| | | converCoordToUnit(range.getMinY()), converCoordToUnit(range.getMaxY())); |
| | | } |
| | | |
| | | public static long convertDGNToRAWIEEEDouble(byte[] org) |
| | |
| | | |
| | | int[] tmp = new int[2]; |
| | | |
| | | tmp[0] = buf.getInt(); |
| | | tmp[1] = buf.getInt(); |
| | | tmp[0] = buf.getInt(); |
| | | tmp[1] = buf.getInt(); |
| | | |
| | | int exponent; |
| | | int exponent; |
| | | |
| | | int sign = (tmp[0] & 0x80000000); |
| | | int sign = (tmp[0] & 0x80000000); |
| | | exponent = (tmp[0] >>> 23) & 0x000000ff; |
| | | |
| | | if (exponent != 0) |
| | |
| | | } |
| | | |
| | | int rndbits = tmp[1] & 0x00000007; |
| | | tmp[1] = tmp[1] >>> 3; |
| | | tmp[1] = (tmp[1] & 0x1fffffff) | (tmp[0] << 29); |
| | | tmp[1] = tmp[1] >>> 3; |
| | | tmp[1] = (tmp[1] & 0x1fffffff) | (tmp[0] << 29); |
| | | |
| | | if (rndbits != 0) |
| | | { |
| | |
| | | buf.get(tmpRaw); |
| | | buf.position(0); |
| | | buf.order(ByteOrder.LITTLE_ENDIAN); |
| | | for (int i = tmpRaw.length; i > 0 ; i--) |
| | | for (int i = tmpRaw.length; i > 0; i--) |
| | | { |
| | | buf.put(tmpRaw[i-1]); |
| | | buf.put(tmpRaw[i - 1]); |
| | | } |
| | | buf.position(0); |
| | | long result = buf.getLong(); |
| | |
| | | |
| | | // uint[] tmp = new int[ 2 ]; |
| | | // ushort[] des = new short[ 4 ]; |
| | | int[] tmp = new int[2]; |
| | | int[] tmp = new int[2]; |
| | | short[] des = new short[4]; |
| | | int sign; |
| | | int exponent; |
| | | int sign; |
| | | int exponent; |
| | | |
| | | tmp[0] = (int) ((newVal >>> 32)); |
| | | tmp[1] = (int) (newVal); |
| | | |
| | | // sign = ( int ) ( ( uint ) tmp[ 0 ] & 0x80000000 ); |
| | | sign = tmp[0] & 0x80000000; |
| | | sign = tmp[0] & 0x80000000; |
| | | exponent = (tmp[0] >>> 20) & 0x07ff; |
| | | |
| | | if (exponent != 0) |
| | |
| | | |
| | | public static double getLength(double x1, double y1, double x2, double y2) |
| | | { |
| | | double dx = x1 - x2; |
| | | double dy = y1 - y2; |
| | | double dx = x1 - x2; |
| | | double dy = y1 - y2; |
| | | |
| | | return Math.sqrt(Math.pow(dx, 2) + Math.pow(dy, 2)); |
| | | } |