|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.me.parabola.imgfmt.app.trergn.Subdivision
public class Subdivision
The map is divided into areas, depending on the zoom level. These are known as subdivisions. A subdivision 'belongs' to a zoom level and cannot be interpreted correctly without knowing the bitsPerCoord of the associated zoom level. Subdivisions also form a tree as subdivisions are further divided at lower levels. The subdivisions need to know their child divisions because this information is represented in the map.
Method Summary | |
---|---|
static Subdivision |
createEmptySubdivision(int number)
Create a subdivision that only contains the number. |
Polyline |
createLine(java.lang.String name,
java.lang.String ref)
|
Point |
createPoint(java.lang.String name)
|
Polygon |
createPolygon(java.lang.String name)
|
Subdivision |
createSubdivision(InternalFiles ifiles,
Area area,
Zoom zoom)
Create a subdivision at a given zoom level. |
void |
endDivision()
|
int |
getEndRgnPointer()
|
int |
getLatitude()
|
int |
getLongitude()
|
protected int |
getMask()
Get the shift mask. |
int |
getNumber()
|
int |
getResolution()
Get the resolution of this division. |
int |
getShift()
Get the shift value, that is the number of bits to left shift by for values that need to be saved shifted in the file. |
int |
getStartRgnPointer()
|
Zoom |
getZoom()
|
boolean |
hasIndPoints()
|
boolean |
hasNextLevel()
|
boolean |
hasPoints()
|
boolean |
hasPolygons()
|
boolean |
hasPolylines()
|
boolean |
needsIndPointPtr()
Needed if it exists and is not first, ie there is a points section. |
boolean |
needsPolygonPtr()
As this is last in the list it is needed if it exists and there is another section. |
boolean |
needsPolylinePtr()
Needed if it exists and is not first, ie there is a points or indexed points section. |
static Subdivision |
readSubdivision(Zoom zoom,
SubdivData subdivData)
|
int |
roundLatToLocalShifted(int absval)
Convert an absolute Lat to a local, shifted value |
int |
roundLonToLocalShifted(int absval)
Convert an absolute Lon to a local, shifted value |
void |
setHasIndPoints(boolean hasIndPoints)
|
void |
setHasPoints(boolean hasPoints)
|
void |
setHasPolygons(boolean hasPolygons)
|
void |
setHasPolylines(boolean hasPolylines)
|
void |
setLast(boolean last)
|
void |
setNumber(int n)
|
void |
setPolylineNumber(Polyline pl)
|
void |
setStartRgnPointer(int startRgnPointer)
|
void |
startDivision()
|
void |
startIndPoints()
We are starting to draw the lines. |
void |
startLines()
We are starting to draw the lines. |
void |
startPoints()
We are starting to draw the points. |
void |
startShapes()
We are starting to draw the shapes. |
static Subdivision |
topLevelSubdivision(InternalFiles ifiles,
Area area,
Zoom zoom)
This should be called only once per map to create the top level subdivision. |
java.lang.String |
toString()
|
void |
write(ImgFileWriter file)
Format this record to the file. |
void |
writeExtTypeOffsetsRecord(ImgFileWriter file)
|
void |
writeLastExtTypeOffsetsRecord(ImgFileWriter file)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public Subdivision createSubdivision(InternalFiles ifiles, Area area, Zoom zoom)
ifiles
- The RGN and LBL ifiles.area
- The (unshifted) area that the subdivision covers.zoom
- The zoom level that this division occupies.
public static Subdivision topLevelSubdivision(InternalFiles ifiles, Area area, Zoom zoom)
ifiles
- The LBL and RGN ifiles.area
- The area bounded by the map.zoom
- The zoom level which must be the highest (least detailed)
zoom in the map.
public static Subdivision createEmptySubdivision(int number)
number
- The subdivision number.
public static Subdivision readSubdivision(Zoom zoom, SubdivData subdivData)
public Zoom getZoom()
public final int getShift()
getResolution()
protected int getMask()
public final int getResolution()
public void write(ImgFileWriter file)
file
- The file to write to.public Point createPoint(java.lang.String name)
public Polyline createLine(java.lang.String name, java.lang.String ref)
public void setPolylineNumber(Polyline pl)
public Polygon createPolygon(java.lang.String name)
public void setNumber(int n)
public void setLast(boolean last)
public void setStartRgnPointer(int startRgnPointer)
public int getStartRgnPointer()
public int getEndRgnPointer()
public int getLongitude()
public int getLatitude()
public void setHasPoints(boolean hasPoints)
public void setHasIndPoints(boolean hasIndPoints)
public void setHasPolylines(boolean hasPolylines)
public void setHasPolygons(boolean hasPolygons)
public boolean hasPoints()
public boolean hasIndPoints()
public boolean hasPolylines()
public boolean hasPolygons()
public boolean needsIndPointPtr()
public boolean needsPolylinePtr()
public boolean needsPolygonPtr()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean hasNextLevel()
public void startDivision()
public void endDivision()
public void writeExtTypeOffsetsRecord(ImgFileWriter file)
public void writeLastExtTypeOffsetsRecord(ImgFileWriter file)
public int getNumber()
public void startPoints()
public void startIndPoints()
public void startLines()
public void startShapes()
public int roundLatToLocalShifted(int absval)
public int roundLonToLocalShifted(int absval)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |