rename RenderOverlay -> RenderLayer
This commit is contained in:
parent
b3f4ee444c
commit
9824aa72e5
@ -20,13 +20,13 @@ import static org.oscim.layers.tile.MapTile.STATE_READY;
|
|||||||
import org.oscim.core.MapPosition;
|
import org.oscim.core.MapPosition;
|
||||||
import org.oscim.renderer.BufferObject;
|
import org.oscim.renderer.BufferObject;
|
||||||
import org.oscim.renderer.GLRenderer;
|
import org.oscim.renderer.GLRenderer;
|
||||||
|
import org.oscim.renderer.RenderLayer;
|
||||||
import org.oscim.renderer.GLRenderer.Matrices;
|
import org.oscim.renderer.GLRenderer.Matrices;
|
||||||
import org.oscim.renderer.overlays.RenderOverlay;
|
|
||||||
import org.oscim.utils.ScanBox;
|
import org.oscim.utils.ScanBox;
|
||||||
import org.oscim.view.MapView;
|
import org.oscim.view.MapView;
|
||||||
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
public class TileRenderLayer extends RenderOverlay {
|
public class TileRenderLayer extends RenderLayer {
|
||||||
private final static String TAG = TileRenderLayer.class.getName();
|
private final static String TAG = TileRenderLayer.class.getName();
|
||||||
|
|
||||||
private final float[] mBoxCoords;
|
private final float[] mBoxCoords;
|
||||||
|
|||||||
@ -14,7 +14,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.oscim.overlay;
|
package org.oscim.overlay;
|
||||||
|
|
||||||
import org.oscim.renderer.overlays.RenderOverlay;
|
import org.oscim.renderer.RenderLayer;
|
||||||
import org.oscim.view.MapView;
|
import org.oscim.view.MapView;
|
||||||
|
|
||||||
public class GenericOverlay extends Overlay {
|
public class GenericOverlay extends Overlay {
|
||||||
@ -24,7 +24,7 @@ public class GenericOverlay extends Overlay {
|
|||||||
* @param renderer
|
* @param renderer
|
||||||
* ...
|
* ...
|
||||||
*/
|
*/
|
||||||
public GenericOverlay(MapView mapView, RenderOverlay renderer) {
|
public GenericOverlay(MapView mapView, RenderLayer renderer) {
|
||||||
super(mapView);
|
super(mapView);
|
||||||
mLayer = renderer;
|
mLayer = renderer;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,7 +31,6 @@ import org.oscim.core.MapPosition;
|
|||||||
import org.oscim.core.Tile;
|
import org.oscim.core.Tile;
|
||||||
import org.oscim.layers.tile.MapTile;
|
import org.oscim.layers.tile.MapTile;
|
||||||
import org.oscim.renderer.layer.Layers;
|
import org.oscim.renderer.layer.Layers;
|
||||||
import org.oscim.renderer.overlays.RenderOverlay;
|
|
||||||
import org.oscim.theme.IRenderTheme;
|
import org.oscim.theme.IRenderTheme;
|
||||||
import org.oscim.utils.GlUtils;
|
import org.oscim.utils.GlUtils;
|
||||||
import org.oscim.utils.Matrix4;
|
import org.oscim.utils.Matrix4;
|
||||||
@ -266,20 +265,21 @@ public class GLRenderer implements GLSurfaceView.Renderer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* update overlays */
|
/* update layers*/
|
||||||
RenderOverlay[] overlays = mMapView.getOverlayManager().getRenderLayers();
|
RenderLayer[] overlays = mMapView.getOverlayManager().getRenderLayers();
|
||||||
|
|
||||||
for (int i = 0, n = overlays.length; i < n; i++)
|
for (int i = 0, n = overlays.length; i < n; i++)
|
||||||
overlays[i].update(mMapPosition, positionChanged, tilesChanged, mMatrices);
|
overlays[i].update(mMapPosition, positionChanged, tilesChanged, mMatrices);
|
||||||
|
|
||||||
/* draw overlays */
|
/* draw layers */
|
||||||
for (int i = 0, n = overlays.length; i < n; i++) {
|
for (int i = 0, n = overlays.length; i < n; i++) {
|
||||||
RenderOverlay renderLayer = overlays[i];
|
RenderLayer renderLayer = overlays[i];
|
||||||
|
|
||||||
if (renderLayer.newData) {
|
if (renderLayer.newData) {
|
||||||
renderLayer.compile();
|
renderLayer.compile();
|
||||||
renderLayer.newData = false;
|
renderLayer.newData = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (renderLayer.isReady)
|
if (renderLayer.isReady)
|
||||||
renderLayer.render(mMapPosition, mMatrices);
|
renderLayer.render(mMapPosition, mMatrices);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,15 +12,14 @@
|
|||||||
* You should have received a copy of the GNU Lesser General Public License along with
|
* You should have received a copy of the GNU Lesser General Public License along with
|
||||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package org.oscim.renderer.overlays;
|
package org.oscim.renderer;
|
||||||
|
|
||||||
import org.oscim.core.MapPosition;
|
import org.oscim.core.MapPosition;
|
||||||
import org.oscim.core.Tile;
|
import org.oscim.core.Tile;
|
||||||
import org.oscim.renderer.GLRenderer;
|
|
||||||
import org.oscim.renderer.GLRenderer.Matrices;
|
import org.oscim.renderer.GLRenderer.Matrices;
|
||||||
import org.oscim.view.MapView;
|
import org.oscim.view.MapView;
|
||||||
|
|
||||||
public abstract class RenderOverlay {
|
public abstract class RenderLayer {
|
||||||
|
|
||||||
protected final MapView mMapView;
|
protected final MapView mMapView;
|
||||||
// keep the Position for which the Overlay is rendered
|
// keep the Position for which the Overlay is rendered
|
||||||
@ -32,7 +31,7 @@ public abstract class RenderOverlay {
|
|||||||
// flag set by GLRenderer when data is compiled
|
// flag set by GLRenderer when data is compiled
|
||||||
public boolean isReady;
|
public boolean isReady;
|
||||||
|
|
||||||
public RenderOverlay(MapView mapView) {
|
public RenderLayer(MapView mapView) {
|
||||||
mMapView = mapView;
|
mMapView = mapView;
|
||||||
mMapPosition = new MapPosition();
|
mMapPosition = new MapPosition();
|
||||||
}
|
}
|
||||||
@ -17,6 +17,7 @@ package org.oscim.renderer.overlays;
|
|||||||
import org.oscim.core.MapPosition;
|
import org.oscim.core.MapPosition;
|
||||||
import org.oscim.renderer.BufferObject;
|
import org.oscim.renderer.BufferObject;
|
||||||
import org.oscim.renderer.GLRenderer;
|
import org.oscim.renderer.GLRenderer;
|
||||||
|
import org.oscim.renderer.RenderLayer;
|
||||||
import org.oscim.renderer.GLRenderer.Matrices;
|
import org.oscim.renderer.GLRenderer.Matrices;
|
||||||
import org.oscim.renderer.GLState;
|
import org.oscim.renderer.GLState;
|
||||||
import org.oscim.renderer.layer.Layer;
|
import org.oscim.renderer.layer.Layer;
|
||||||
@ -31,7 +32,7 @@ import org.oscim.view.MapView;
|
|||||||
import android.opengl.GLES20;
|
import android.opengl.GLES20;
|
||||||
|
|
||||||
// Base class to use the Layers drawing 'API'
|
// Base class to use the Layers drawing 'API'
|
||||||
public abstract class BasicOverlay extends RenderOverlay {
|
public abstract class BasicOverlay extends RenderLayer {
|
||||||
|
|
||||||
public final Layers layers;
|
public final Layers layers;
|
||||||
|
|
||||||
|
|||||||
@ -21,6 +21,7 @@ import java.nio.FloatBuffer;
|
|||||||
import org.oscim.core.MapPosition;
|
import org.oscim.core.MapPosition;
|
||||||
import org.oscim.renderer.GLRenderer.Matrices;
|
import org.oscim.renderer.GLRenderer.Matrices;
|
||||||
import org.oscim.renderer.GLState;
|
import org.oscim.renderer.GLState;
|
||||||
|
import org.oscim.renderer.RenderLayer;
|
||||||
import org.oscim.utils.GlUtils;
|
import org.oscim.utils.GlUtils;
|
||||||
import org.oscim.view.MapView;
|
import org.oscim.view.MapView;
|
||||||
|
|
||||||
@ -33,7 +34,7 @@ import android.opengl.GLES20;
|
|||||||
* https://github.com/dalinaum/opengl-es-book-samples/tree/master/Android
|
* https://github.com/dalinaum/opengl-es-book-samples/tree/master/Android
|
||||||
* */
|
* */
|
||||||
|
|
||||||
public class CustomOverlay extends RenderOverlay {
|
public class CustomOverlay extends RenderLayer {
|
||||||
|
|
||||||
private int mProgramObject;
|
private int mProgramObject;
|
||||||
private int hVertexPosition;
|
private int hVertexPosition;
|
||||||
|
|||||||
@ -25,6 +25,7 @@ import org.oscim.layers.tile.MapTile;
|
|||||||
import org.oscim.layers.tile.TileRenderLayer;
|
import org.oscim.layers.tile.TileRenderLayer;
|
||||||
import org.oscim.layers.tile.TileSet;
|
import org.oscim.layers.tile.TileSet;
|
||||||
import org.oscim.renderer.GLRenderer;
|
import org.oscim.renderer.GLRenderer;
|
||||||
|
import org.oscim.renderer.RenderLayer;
|
||||||
import org.oscim.renderer.GLRenderer.Matrices;
|
import org.oscim.renderer.GLRenderer.Matrices;
|
||||||
import org.oscim.renderer.GLState;
|
import org.oscim.renderer.GLState;
|
||||||
import org.oscim.renderer.layer.ExtrusionLayer;
|
import org.oscim.renderer.layer.ExtrusionLayer;
|
||||||
@ -37,7 +38,7 @@ import android.util.Log;
|
|||||||
/**
|
/**
|
||||||
* @author Hannes Janetzek
|
* @author Hannes Janetzek
|
||||||
*/
|
*/
|
||||||
public class ExtrusionOverlay extends RenderOverlay {
|
public class ExtrusionOverlay extends RenderLayer {
|
||||||
private final static String TAG = ExtrusionOverlay.class.getName();
|
private final static String TAG = ExtrusionOverlay.class.getName();
|
||||||
|
|
||||||
private final TileRenderLayer mTileLayer;
|
private final TileRenderLayer mTileLayer;
|
||||||
|
|||||||
@ -15,10 +15,11 @@
|
|||||||
package org.oscim.renderer.overlays;
|
package org.oscim.renderer.overlays;
|
||||||
|
|
||||||
import org.oscim.core.MapPosition;
|
import org.oscim.core.MapPosition;
|
||||||
|
import org.oscim.renderer.RenderLayer;
|
||||||
import org.oscim.renderer.GLRenderer.Matrices;
|
import org.oscim.renderer.GLRenderer.Matrices;
|
||||||
import org.oscim.view.MapView;
|
import org.oscim.view.MapView;
|
||||||
|
|
||||||
public class ViewOverlay extends RenderOverlay {
|
public class ViewOverlay extends RenderLayer {
|
||||||
|
|
||||||
|
|
||||||
public ViewOverlay(MapView mapView) {
|
public ViewOverlay(MapView mapView) {
|
||||||
|
|||||||
@ -24,7 +24,7 @@ import org.oscim.core.PointF;
|
|||||||
import org.oscim.layers.InputLayer;
|
import org.oscim.layers.InputLayer;
|
||||||
import org.oscim.layers.Layer;
|
import org.oscim.layers.Layer;
|
||||||
import org.oscim.overlay.Overlay.Snappable;
|
import org.oscim.overlay.Overlay.Snappable;
|
||||||
import org.oscim.renderer.overlays.RenderOverlay;
|
import org.oscim.renderer.RenderLayer;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
@ -78,9 +78,9 @@ public class LayerManager extends AbstractList<Layer> implements OnGestureListen
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean mDirtyLayers;
|
private boolean mDirtyLayers;
|
||||||
private RenderOverlay[] mDrawLayers;
|
private RenderLayer[] mDrawLayers;
|
||||||
|
|
||||||
public RenderOverlay[] getRenderLayers() {
|
public RenderLayer[] getRenderLayers() {
|
||||||
if (mDirtyLayers)
|
if (mDirtyLayers)
|
||||||
updateLayers();
|
updateLayers();
|
||||||
|
|
||||||
@ -123,12 +123,12 @@ public class LayerManager extends AbstractList<Layer> implements OnGestureListen
|
|||||||
mLayers[i] = o;
|
mLayers[i] = o;
|
||||||
}
|
}
|
||||||
|
|
||||||
mDrawLayers = new RenderOverlay[numRenderLayers];
|
mDrawLayers = new RenderLayer[numRenderLayers];
|
||||||
mInputLayer = new InputLayer[numInputLayers];
|
mInputLayer = new InputLayer[numInputLayers];
|
||||||
|
|
||||||
for (int i = 0, cntR = 0, cntI = 1, n = mLayerList.size(); i < n; i++) {
|
for (int i = 0, cntR = 0, cntI = 1, n = mLayerList.size(); i < n; i++) {
|
||||||
Layer o = mLayerList.get(i);
|
Layer o = mLayerList.get(i);
|
||||||
RenderOverlay l = o.getLayer();
|
RenderLayer l = o.getLayer();
|
||||||
if (l != null)
|
if (l != null)
|
||||||
mDrawLayers[cntR++] = l;
|
mDrawLayers[cntR++] = l;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user