X-Git-Url: http://gitweb.fperrin.net/?p=GpsPrune.git;a=blobdiff_plain;f=src%2Ftim%2Fprune%2Fundo%2FUndoLookupSrtm.java;fp=src%2Ftim%2Fprune%2Fundo%2FUndoLookupSrtm.java;h=d028b82a568a98da8c7b46ea8d7539f767c891c1;hp=0000000000000000000000000000000000000000;hb=ce6f2161b8596f7018d6a76bff79bc9e571f35fd;hpb=2d8cb72e84d5cc1089ce77baf1e34ea3ea2f8465 diff --git a/src/tim/prune/undo/UndoLookupSrtm.java b/src/tim/prune/undo/UndoLookupSrtm.java new file mode 100644 index 0000000..d028b82 --- /dev/null +++ b/src/tim/prune/undo/UndoLookupSrtm.java @@ -0,0 +1,77 @@ +package tim.prune.undo; + +import tim.prune.I18nManager; +import tim.prune.UpdateMessageBroker; +import tim.prune.data.DataPoint; +import tim.prune.data.Field; +import tim.prune.data.Track; +import tim.prune.data.TrackInfo; + +/** + * Undo lookup of altitudes from SRTM data + */ +public class UndoLookupSrtm implements UndoOperation +{ + /** DataPoint objects which didn't have altitudes before */ + private DataPoint[] _points; + /** Altitude strings if present */ + private String[] _altitudes; + + + /** + * Constructor + * @param inTrackInfo track info object + */ + public UndoLookupSrtm(TrackInfo inTrackInfo) + { + Track track = inTrackInfo.getTrack(); + int numPoints = track.getNumPoints(); + // Make arrays of points and altitudes + _points = new DataPoint[numPoints]; + _altitudes = new String[numPoints]; + for (int i=0; i