Package org.oscim.renderer.bucket
Class RenderBuckets
java.lang.Object
org.oscim.utils.pool.Inlist<MapTile.TileData>
org.oscim.layers.tile.MapTile.TileData
org.oscim.renderer.bucket.RenderBuckets
This class is primarily intended for rendering the vector elements of a
MapTile. It can be used for other purposes as well but some optimizations
(and limitations) probably wont make sense in different contexts.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.oscim.utils.pool.Inlist
Inlist.List<T extends Inlist<?>> -
Field Summary
FieldsModifier and TypeFieldDescriptionint[]To not need to switch VertexAttribPointer positions all the time: 1.static final intstatic final intNumber of vertices to fill a tile (represented by a quad).VBO holds all vertex data to draw lines and polygons after compilation.static final int[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddCircleBucket(int level, CircleStyle style) addHairLineBucket(int level, LineStyle style) addLineBucket(int level, LineStyle style) add the LineBucket for a level with a given Line style.addMeshBucket(int level, AreaStyle style) addPolygonBucket(int level, AreaStyle style) voidbind()voidclear()cleanup only when buckets are not used by tile or bucket anymore!voidcleanup only when buckets are not used by tile or bucket anymore!booleancompile(boolean addFill) Compile different types of buckets in oneVBO.protected voiddispose()get()getCircleBucket(int level) Get or add the CircleBucket for a level.getHairLineBucket(int level) Get or add the TexLineBucket for a level.getLineBucket(int level) Get or add the LineBucket for a level.getLineTexBucket(int level) Get or add the TexLineBucket for a level.getMeshBucket(int level) Get or add the MeshBucket for a level.getPolygonBucket(int level) Get or add the PolygonBucket for a level.static voidvoidprepare()voidset(RenderBucket buckets) Set new bucket items and clear previous.voidsetFrom(RenderBuckets buckets) Methods inherited from class org.oscim.layers.tile.MapTile.TileData
nextMethods inherited from class org.oscim.utils.pool.Inlist
appendItem, appendList, get, last, prependRelative, push, remove, size
-
Field Details
-
VERTEX_CNT
public static final int[] VERTEX_CNT -
SHORT_BYTES
public static final int SHORT_BYTES- See Also:
-
TILE_FILL_VERTICES
public static final int TILE_FILL_VERTICESNumber of vertices to fill a tile (represented by a quad).- See Also:
-
vbo
VBO holds all vertex data to draw lines and polygons after compilation. Layout: 16 bytes fill coordinates (TILE_FILL_VERTICES*SHORT_BYTES* coordsPerVertex), n bytes polygon vertices, m bytes lines vertices ... -
ibo
-
offset
public int[] offsetTo not need to switch VertexAttribPointer positions all the time: 1. polygons are packed in VBO at offset 0 2. lines afterwards at lineOffset 3. other buckets keep their byte offset in offset
-
-
Constructor Details
-
RenderBuckets
public RenderBuckets()
-
-
Method Details
-
addLineBucket
add the LineBucket for a level with a given Line style. Levels are ordered from bottom (0) to top -
addPolygonBucket
-
addMeshBucket
-
addHairLineBucket
-
addCircleBucket
-
getLineBucket
Get or add the LineBucket for a level. Levels are ordered from bottom (0) to top -
getMeshBucket
Get or add the MeshBucket for a level. Levels are ordered from bottom (0) to top -
getPolygonBucket
Get or add the PolygonBucket for a level. Levels are ordered from bottom (0) to top -
getLineTexBucket
Get or add the TexLineBucket for a level. Levels are ordered from bottom (0) to top -
getHairLineBucket
Get or add the TexLineBucket for a level. Levels are ordered from bottom (0) to top -
getCircleBucket
Get or add the CircleBucket for a level. Levels are ordered from bottom (0) to top -
set
Set new bucket items and clear previous. -
get
- Returns:
- internal linked list of RenderBucket items
-
setFrom
-
clear
public void clear()cleanup only when buckets are not used by tile or bucket anymore! -
clearBuckets
public void clearBuckets()cleanup only when buckets are not used by tile or bucket anymore! -
dispose
protected void dispose()- Specified by:
disposein classMapTile.TileData
-
prepare
public void prepare() -
bind
public void bind() -
compile
public boolean compile(boolean addFill) Compile different types of buckets in oneVBO.- Parameters:
addFill- fill tile (add4vertices).- Returns:
- true if compilation succeeded.
-
initRenderer
public static void initRenderer()
-