X-Git-Url: http://gitweb.fperrin.net/?a=blobdiff_plain;f=tim%2Fprune%2Fthreedee%2FImageDefinition.java;fp=tim%2Fprune%2Fthreedee%2FImageDefinition.java;h=a456f374d0c18499fd5c0c8a32101d5ea57949cc;hb=326f489e36aa7f235bc19409a57bf4955cd50f24;hp=0000000000000000000000000000000000000000;hpb=8c8868ae29b3252f02e094c02307384cf61ba667;p=GpsPrune.git diff --git a/tim/prune/threedee/ImageDefinition.java b/tim/prune/threedee/ImageDefinition.java new file mode 100644 index 0000000..a456f37 --- /dev/null +++ b/tim/prune/threedee/ImageDefinition.java @@ -0,0 +1,66 @@ +package tim.prune.threedee; + +/** + * Holds the definition of the image to use + * (whether or not to use an image, and the source index and zoom) + */ +public class ImageDefinition +{ + private boolean _useImage = false; + private int _sourceIndex = 0; + private int _zoom = 0; + + + /** + * Empty constructor specifying no image + */ + public ImageDefinition() + { + this(false, 0, 0); + } + + /** + * Constructor + * @param inUse true to use an image + * @param inSourceIndex index of map source + * @param inZoom zoom level + */ + public ImageDefinition(boolean inUse, int inSourceIndex, int inZoom) + { + setUseImage(inUse, inSourceIndex, inZoom); + } + + /** + * Set the parameters + * @param inUse true to use an image + * @param inSourceIndex index of map source + * @param inZoom zoom level + */ + public void setUseImage(boolean inUse, int inSourceIndex, int inZoom) + { + _useImage = inUse; + _sourceIndex = inSourceIndex; + _zoom = inZoom; + } + + /** + * @return true if image should be used, false otherwise + */ + public boolean getUseImage() { + return _useImage && _sourceIndex >= 0 && _zoom > 2; + } + + /** + * @return source index + */ + public int getSourceIndex() { + return _sourceIndex; + } + + /** + * @return zoom level + */ + public int getZoom() { + return _zoom; + } +}