X-Git-Url: https://gitweb.fperrin.net/?p=GpsPrune.git;a=blobdiff_plain;f=tim%2Fprune%2Fcorrelate%2FPointMediaPair.java;fp=tim%2Fprune%2Fcorrelate%2FPointPair.java;h=1ea83078dab88188be12befdb2df8be750e397c5;hp=9b27ff927503f372164a7ba50f803086cda55f95;hb=f35b6d628f68e3b5ef19965ad8988d0dd1eb8efa;hpb=3745d70b1427bb8ac1a085e47cbdc566936784e1 diff --git a/tim/prune/correlate/PointPair.java b/tim/prune/correlate/PointMediaPair.java similarity index 63% rename from tim/prune/correlate/PointPair.java rename to tim/prune/correlate/PointMediaPair.java index 9b27ff9..1ea8307 100644 --- a/tim/prune/correlate/PointPair.java +++ b/tim/prune/correlate/PointMediaPair.java @@ -1,15 +1,14 @@ package tim.prune.correlate; import tim.prune.data.DataPoint; -import tim.prune.data.Photo; +import tim.prune.data.MediaFile; /** - * Class to hold a pair of points - * used to hold the result of correlation of a photo + * Class to hold a pair of points used to hold the result of correlation */ -public class PointPair +public class PointMediaPair { - private Photo _photo = null; + private MediaFile _media = null; private DataPoint _pointBefore = null; private DataPoint _pointAfter = null; private long _secondsBefore = 1L; @@ -18,14 +17,12 @@ public class PointPair /** * Constructor - * @param inPhoto Photo object + * @param inMedia media object */ - public PointPair(Photo inPhoto) - { - _photo = inPhoto; + public PointMediaPair(MediaFile inMedia) { + _media = inMedia; } - /** * Add a point to the pair * @param inPoint data point @@ -36,10 +33,10 @@ public class PointPair // Check if point is closest point before if (inSeconds <= 0) { - // point stamp is before photo stamp + // point stamp is before media stamp if (inSeconds > _secondsBefore || _secondsBefore > 0L) { - // point stamp is nearer to photo + // point stamp is nearer to media _pointBefore = inPoint; _secondsBefore = inSeconds; } @@ -47,10 +44,10 @@ public class PointPair // Check if point is closest point after if (inSeconds >= 0) { - // point stamp is after photo stamp + // point stamp is after media stamp if (inSeconds < _secondsAfter || _secondsAfter < 0L) { - // point stamp is nearer to photo + // point stamp is nearer to media _pointAfter = inPoint; _secondsAfter = inSeconds; } @@ -59,50 +56,44 @@ public class PointPair /** - * @return Photo object + * @return Media object */ - public Photo getPhoto() - { - return _photo; + public MediaFile getMedia() { + return _media; } /** - * @return the closest point before the photo + * @return the closest point before the media */ - public DataPoint getPointBefore() - { + public DataPoint getPointBefore() { return _pointBefore; } /** - * @return number of seconds between photo and subsequent point + * @return number of seconds between media and subsequent point */ - public long getSecondsBefore() - { + public long getSecondsBefore() { return _secondsBefore; } /** - * @return the closest point after the photo + * @return the closest point after the media */ - public DataPoint getPointAfter() - { + public DataPoint getPointAfter() { return _pointAfter; } /** - * @return number of seconds between previous point and photo + * @return number of seconds between previous point and media */ - public long getSecondsAfter() - { + public long getSecondsAfter() { return _secondsAfter; } /** * @return true if both points found */ - public boolean isValid() - { + public boolean isValid() { return getPointBefore() != null && getPointAfter() != null; } @@ -118,13 +109,12 @@ public class PointPair /** * @return the number of seconds to the nearest point */ - public long getMinSeconds() - { + public long getMinSeconds() { return Math.min(_secondsAfter, -_secondsBefore); } /** - * @return angle from photo to nearest point in radians + * @return angle from media to nearest point in radians */ public double getMinRadians() {