X-Git-Url: http://gitweb.fperrin.net/?p=GpsPrune.git;a=blobdiff_plain;f=src%2Ftim%2Fprune%2Fundo%2FUndoCorrelatePhotos.java;fp=src%2Ftim%2Fprune%2Fundo%2FUndoCorrelatePhotos.java;h=9b8e1af35acad0d823600151d27b4b04f0f5b45b;hp=0000000000000000000000000000000000000000;hb=ce6f2161b8596f7018d6a76bff79bc9e571f35fd;hpb=2d8cb72e84d5cc1089ce77baf1e34ea3ea2f8465 diff --git a/src/tim/prune/undo/UndoCorrelatePhotos.java b/src/tim/prune/undo/UndoCorrelatePhotos.java new file mode 100644 index 0000000..9b8e1af --- /dev/null +++ b/src/tim/prune/undo/UndoCorrelatePhotos.java @@ -0,0 +1,80 @@ +package tim.prune.undo; + +import tim.prune.I18nManager; +import tim.prune.data.DataPoint; +import tim.prune.data.Photo; +import tim.prune.data.TrackInfo; + +/** + * Operation to undo an auto-correlation of photos with points + */ +public class UndoCorrelatePhotos implements UndoOperation +{ + private DataPoint[] _contents = null; + private DataPoint[] _photoPoints = null; + private int _numPhotosCorrelated = -1; + + + /** + * Constructor + * @param inTrackInfo track information + */ + public UndoCorrelatePhotos(TrackInfo inTrackInfo) + { + // Copy track contents + _contents = inTrackInfo.getTrack().cloneContents(); + // Copy points associated with photos before correlation + int numPhotos = inTrackInfo.getPhotoList().getNumPhotos(); + _photoPoints = new DataPoint[numPhotos]; + for (int i=0; i