uk.me.parabola.imgfmt.app.trergn
Class Polyline
java.lang.Object
uk.me.parabola.imgfmt.app.trergn.MapObject
uk.me.parabola.imgfmt.app.trergn.Polyline
- Direct Known Subclasses:
- Polygon
public class Polyline
- extends MapObject
Represents a multi-segment line. Eg for a road. As with all map objects
it can only exist as part of a subdivision.
Writing these out is particularly tricky as deltas between points are packed
into the smallest number of bits possible.
I am not trying to make the smallest map, so it will not be totally optimum.
- Author:
- Steve Ratcliffe
Methods inherited from class uk.me.parabola.imgfmt.app.trergn.MapObject |
addRefLabel, getDeltaLong, getExtTypeExtraBytes, getLabel, getNumber, getRefLabels, getSubdiv, getType, hasExtendedType, hasExtendedType, setDeltaLat, setDeltaLong, setExtTypeAttributes, setLabel, setLatitude, setLongitude, setNumber, setSubdiv, setType, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Polyline
public Polyline(Subdivision div)
write
public void write(ImgFileWriter file)
- Format and write the contents of the object to the given
file.
- Specified by:
write
in class MapObject
- Parameters:
file
- A reference to the file that should be written to.
write
public void write(java.io.OutputStream stream)
throws java.io.IOException
- Specified by:
write
in class MapObject
- Throws:
java.io.IOException
addCoord
public void addCoord(Coord co)
setDirection
public void setDirection(boolean direction)
isRoad
public boolean isRoad()
roadHasInternalNodes
public boolean roadHasInternalNodes()
setLastSegment
public void setLastSegment(boolean last)
isLastSegment
public boolean isLastSegment()
setRoadDef
public void setRoadDef(RoadDef rd)
sharesNodeWith
public boolean sharesNodeWith(Polyline other)