Class BucketRenderer

java.lang.Object
org.oscim.renderer.LayerRenderer
org.oscim.renderer.BucketRenderer
Direct Known Subclasses:
AbstractVectorLayer.Renderer, BitmapRenderer, GridRenderer, LocationTextureRenderer, MarkerRenderer

public class BucketRenderer extends LayerRenderer
Base class to use the renderer.elements for drawing.

All methods that modify 'buckets' MUST be synchronized!

  • Field Details

    • log

      public static final org.slf4j.Logger log
    • mMapPosition

      protected MapPosition mMapPosition
      Use mMapPosition.copy(position) to keep the position for which the Overlay is *compiled*. NOTE: required by setMatrix utility functions to draw this layer fixed to the map
    • mFlipOnDateLine

      protected boolean mFlipOnDateLine
      Wrap around dateline
    • buckets

      public final RenderBuckets buckets
      Buckets for rendering
    • mInitialized

      protected boolean mInitialized
  • Constructor Details

    • BucketRenderer

      public BucketRenderer()
  • Method Details

    • update

      public void update(GLViewport v)
      Default implementation: Copy initial Viewport position and compile buckets.
      Specified by:
      update in class LayerRenderer
    • render

      public void render(GLViewport v)
      Render all 'buckets'
      Specified by:
      render in class LayerRenderer
    • compile

      protected void compile()
      Compile all buckets into one BufferObject. Sets renderer to be ready when successful. When no data is available (buckets.countVboSize() == 0) then BufferObject will be released and buckets will not be rendered.
    • setMatrix

      protected void setMatrix(GLViewport v, boolean project)
      Utility: Set matrices.mvp matrix relative to the difference of current MapPosition and the last updated Overlay MapPosition. Use this to 'stick' your layer to the map. Note: Vertex coordinates are assumed to be scaled by MapRenderer.COORD_SCALE (== 8).
      Parameters:
      v - GLViewport
      project - if true apply view- and projection, or just view otherwise.
    • setMatrix

      protected void setMatrix(GLViewport v, boolean project, float coordScale)
    • setMatrix

      protected void setMatrix(GLMatrix mvp, GLViewport v, boolean project, float coordScale)
    • setMatrix

      protected void setMatrix(GLViewport v)
      Utility: Set matrices.mvp matrix relative to the difference of current MapPosition and the last updated Overlay MapPosition and applies view-projection-matrix.