| | |
| | | { |
| | | int angle = (raw[18] << 16 & 0xffff0000); |
| | | |
| | | angle += raw[19] & 0x0000ffff; |
| | | angle |= raw[19] & 0x0000ffff; |
| | | |
| | | return Utility.ConverIntToRotation(angle); |
| | | return Utility.converIntToRotation(angle); |
| | | } |
| | | |
| | | public void setStartAngle(double value) |
| | | { |
| | | int angle = Utility.ConverRotatioToInt(value); |
| | | int angle = Utility.converRotatioToInt(value); |
| | | |
| | | raw[18] = (short) (angle >>> 16 & 0x0000ffff); |
| | | raw[19] = (short) (angle & 0x0000ffff); |
| | |
| | | { |
| | | int angle = (raw[20] << 16 & 0xffff0000); |
| | | |
| | | angle += raw[21] & 0x0000ffff; |
| | | angle |= raw[21] & 0x0000ffff; |
| | | |
| | | return Utility.ConverIntToRotation(angle); |
| | | return Utility.converIntToRotation(angle); |
| | | } |
| | | |
| | | public void setSweepAngle(double value) |
| | | { |
| | | int angle = Utility.ConverRotatioToInt(value); |
| | | int angle = Utility.converRotatioToInt(value); |
| | | |
| | | raw[20] = (short) (angle >> 16 & 0x0000ffff); |
| | | raw[21] = (short) (angle & 0x0000ffff); |
| | |
| | | |
| | | System.arraycopy(raw, 22, primary, 0, 4); |
| | | |
| | | return Utility.DGNToIEEEDouble(primary) / 1000.0; |
| | | return Utility.convertDGNToIEEEDouble(primary) / 1000.0; |
| | | } |
| | | |
| | | public void setPrimary(double value) |
| | | { |
| | | double temp = value * 1000.0; |
| | | short[] primary = Utility.IEEEDoubleToDGN(temp); |
| | | short[] primary = Utility.convertIEEEDoubleToDGN(temp); |
| | | |
| | | System.arraycopy(primary, 0, raw, 22, 4); |
| | | } |
| | |
| | | |
| | | System.arraycopy(raw, 26, secondary, 0, 4); |
| | | |
| | | return Utility.DGNToIEEEDouble(secondary) / 1000.0; |
| | | return Utility.convertDGNToIEEEDouble(secondary) / 1000.0; |
| | | } |
| | | |
| | | public void setSecondary(double value) |
| | | { |
| | | double temp = value * 1000.0; |
| | | short[] secondary = Utility.IEEEDoubleToDGN(temp); |
| | | short[] secondary = Utility.convertIEEEDoubleToDGN(temp); |
| | | |
| | | System.arraycopy(secondary, 0, raw, 26, 4); |
| | | } |
| | |
| | | { |
| | | int rotation = (raw[30] << 16 & 0xffff0000); |
| | | |
| | | rotation += raw[31] & 0x0000ffff; |
| | | rotation |= raw[31] & 0x0000ffff; |
| | | |
| | | return Utility.ConverIntToRotation(rotation); |
| | | return Utility.converIntToRotation(rotation); |
| | | } |
| | | |
| | | public void setRotationAngle(double value) |
| | | { |
| | | int angle = Utility.ConverRotatioToInt(value); |
| | | int angle = Utility.converRotatioToInt(value); |
| | | |
| | | raw[30] = (short) (angle >> 16 & 0x0000ffff); |
| | | raw[31] = (short) (angle & 0x0000ffff); |
| | |
| | | |
| | | System.arraycopy(raw, 32, x, 0, 4); |
| | | |
| | | double dx = Utility.ConverUnitToCoord((int) Utility.DGNToIEEEDouble(x)); |
| | | double dx = Utility.converUnitToCoord((int) Utility.convertDGNToIEEEDouble(x)); |
| | | short[] y = new short[4]; |
| | | |
| | | System.arraycopy(raw, 36, y, 0, 4); |
| | | |
| | | double dy = Utility.ConverUnitToCoord((int) Utility.DGNToIEEEDouble(y)); |
| | | double dy = Utility.converUnitToCoord((int) Utility.convertDGNToIEEEDouble(y)); |
| | | |
| | | return new Coordinate(dx, dy); |
| | | } |
| | | |
| | | public void setOrigin(Coordinate value) |
| | | { |
| | | double temp = Utility.ConverCoordToUnit(value.x); |
| | | short[] x = Utility.IEEEDoubleToDGN(temp); |
| | | double temp = Utility.converCoordToUnit(value.x); |
| | | short[] x = Utility.convertIEEEDoubleToDGN(temp); |
| | | |
| | | System.arraycopy(x, 0, raw, 32, 4); |
| | | temp = Utility.ConverCoordToUnit(value.y); |
| | | temp = Utility.converCoordToUnit(value.y); |
| | | |
| | | short[] y = Utility.IEEEDoubleToDGN(temp); |
| | | short[] y = Utility.convertIEEEDoubleToDGN(temp); |
| | | |
| | | System.arraycopy(y, 0, raw, 36, 4); |
| | | } |
| | |
| | | private Coordinate[] convertToLineString(int pts) |
| | | { |
| | | Coordinate[] result = new Coordinate[pts]; |
| | | double beta = -getRotationAngle() / 180 * Math.PI; |
| | | double beta = Utility.converRotationToRadian(-getRotationAngle()); |
| | | double sinbeta = Math.sin(beta); |
| | | double cosbeta = Math.cos(beta); |
| | | double startAngle = getStartAngle(); |
| | |
| | | if (i < pts) |
| | | { |
| | | Coordinate pt = new Coordinate(); |
| | | double alpha = current / 180 * Math.PI; |
| | | double alpha = Utility.converRotationToRadian(current); |
| | | double sinalpha = Math.sin(alpha); |
| | | double cosalpha = Math.cos(alpha); |
| | | pt.x = getOrigin().x + (getPrimary() * cosalpha * cosbeta - |