001// License: GPL. For details, see LICENSE file.
002package org.openstreetmap.josm.data.gpx;
003
004/**
005 * Image direction / position modification settings used by {@link GpxImageCorrelationSettings}.
006 * @since 18061
007 */
008public class GpxImageDirectionPositionSettings {
009
010    private final boolean setImageDirection;
011    private final double imageDirectionAngleOffset;
012    private final boolean setGpxTrackDirection;
013    private final double shiftImageX;
014    private final double shiftImageY;
015    private final double elevationShift;
016
017    /**
018     * Constructs a new {@code GpxImageDirectionPositionSettings}.
019     * @param setImageDirection determines if image direction must be set towards the next GPX waypoint
020     * @param imageDirectionAngleOffset direction angle offset in degrees
021     * @param setGpxTrackDirection determines if image course direction must be set
022     * @param shiftImageX image shift on X axis relative to the direction in meters
023     * @param shiftImageY image shift on Y axis relative to the direction in meters
024     * @param elevationShift image elevation shift in meters
025     * @since 19387 @setGpsTrackDirection was added
026     */
027    public GpxImageDirectionPositionSettings(
028            boolean setImageDirection, double imageDirectionAngleOffset, boolean setGpxTrackDirection, 
029            double shiftImageX, double shiftImageY, double elevationShift) {
030        this.setImageDirection = setImageDirection;
031        this.imageDirectionAngleOffset = imageDirectionAngleOffset;
032        this.setGpxTrackDirection = setGpxTrackDirection;
033        this.shiftImageX = shiftImageX;
034        this.shiftImageY = shiftImageY;
035        this.elevationShift = elevationShift;
036    }
037
038    /**
039     * Determines if image direction must be set towards the next GPX waypoint
040     * @return {@code true} if image direction must be set towards the next GPX waypoint
041     */
042    public boolean isSetImageDirection() {
043        return setImageDirection;
044    }
045
046    /**
047     * Returns direction angle offset in degrees
048     * @return direction angle offset in degrees
049     */
050    public double getImageDirectionAngleOffset() {
051        return imageDirectionAngleOffset;
052    }
053
054    /**
055     * Determines if GPS course direction must be set. Angle value is from the gpx trace.
056     * @return {@code true} if image GPS course must be set
057     * @since 19387
058     */
059    public boolean isSetGpxTrackDirection() {
060        return setGpxTrackDirection;
061    }
062
063    /**
064     * Returns image shift on X axis relative to the direction in meters
065     * @return image shift on X axis relative to the direction in meters
066     */
067    public double getShiftImageX() {
068        return shiftImageX;
069    }
070
071    /**
072     * Returns image shift on Y axis relative to the direction in meters
073     * @return image shift on Y axis relative to the direction in meters
074     */
075    public double getShiftImageY() {
076        return shiftImageY;
077    }
078
079    /**
080     * Returns image elevation shift in meters
081     * @return image elevation shift in meters
082     */
083    public double getElevationShift() {
084        return elevationShift;
085    }
086
087    @Override
088    public String toString() {
089        return "[setImageDirection=" + setImageDirection
090                + ", imageDirectionAngleOffset=" + imageDirectionAngleOffset
091                + ", setImageGpxTrackDirection=" + setGpxTrackDirection
092                + ", shiftImageX=" + shiftImageX
093                + ", shiftImageY=" + shiftImageY
094                + ", elevationShift=" + elevationShift + ']';
095    }
096}