Skip to content
This repository has been archived by the owner on Apr 27, 2024. It is now read-only.

Commit

Permalink
playground tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hjanetzek committed Sep 19, 2014
1 parent 0c54d5d commit 8b66396
Show file tree
Hide file tree
Showing 18 changed files with 212 additions and 219 deletions.
4 changes: 4 additions & 0 deletions vtm-desktop/src/org/oscim/gdx/GdxMapApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import org.oscim.tiling.TileSource;
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
import org.oscim.utils.FastMath;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.badlogic.gdx.backends.jglfw.JglfwApplication;
import com.badlogic.gdx.backends.jglfw.JglfwApplicationConfiguration;
Expand All @@ -31,6 +33,8 @@

public class GdxMapApp extends GdxMap {

public static final Logger log = LoggerFactory.getLogger(GdxMapApp.class);

static class GdxGL20Wrapper extends JglfwGL20 implements GL20 {

}
Expand Down
4 changes: 2 additions & 2 deletions vtm-playground/src/org/oscim/test/HairLineTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ static class Renderer extends BucketRenderer {
.build());

@Override
protected boolean setup() {
public boolean setup() {
//ll.roundCap = true;
return super.setup();
}

@Override
protected void update(GLViewport v) {
public void update(GLViewport v) {
if (!init) {
mMapPosition.copy(v.pos);
init = true;
Expand Down
2 changes: 1 addition & 1 deletion vtm-playground/src/org/oscim/test/LineRenderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public synchronized void clear() {
}

@Override
protected synchronized void update(GLViewport v) {
public synchronized void update(GLViewport v) {

if (mMapPosition.scale == 0)
mMapPosition.copy(v.pos);
Expand Down
18 changes: 9 additions & 9 deletions vtm-playground/src/org/oscim/test/LineTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ protected void createLayers() {
boolean init;

LineBucket ll = buckets.addLineBucket(0,
new LineStyle(Color.fade(Color.CYAN, 0.5f), 1.5f));
new LineStyle(Color.fade(Color.CYAN, 0.5f), 1.5f));

GeometryBuffer g = new GeometryBuffer(10, 1);

@Override
protected void update(GLViewport v) {
public void update(GLViewport v) {
if (!init) {
mMapPosition.copy(v.pos);
init = true;
Expand Down Expand Up @@ -82,13 +82,13 @@ protected void update(GLViewport v) {
buckets.clear();
buckets.set(ll);
g.clear();
for (int i = 0; i < 60; i++) {
g.startLine();
g.addPoint(-1, 0);
g.addPoint(0, 0);
g.addPoint((float) Math.cos(Math.toRadians(angle)),
(float) Math.sin(Math.toRadians(angle)));
}
//for (int i = 0; i < 60; i++) {
g.startLine();
g.addPoint(-1, 0);
g.addPoint(0, 0);
g.addPoint((float) Math.cos(Math.toRadians(angle)),
(float) Math.sin(Math.toRadians(angle)));
//}

g.scale(100, 100);

Expand Down
19 changes: 8 additions & 11 deletions vtm-playground/src/org/oscim/test/MapTest.java
Original file line number Diff line number Diff line change
@@ -1,29 +1,26 @@
package org.oscim.test;

import org.oscim.gdx.GdxMap;
import org.oscim.gdx.GdxMapApp;
import org.oscim.layers.tile.buildings.BuildingLayer;
import org.oscim.layers.tile.vector.VectorTileLayer;
import org.oscim.layers.tile.vector.labeling.LabelLayer;
import org.oscim.map.Map;
import org.oscim.theme.VtmThemes;
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class MapTest extends GdxMap {

final Logger log = LoggerFactory.getLogger(MeshTest.class);
public class MapTest extends GdxMapApp {

@Override
public void createLayers() {
Map map = getMap();

VectorTileLayer l = mMap.setBaseMap(new OSciMap4TileSource());
mMap.setTheme(VtmThemes.DEFAULT);
mMap.layers().add(new BuildingLayer(mMap, l));
mMap.layers().add(new LabelLayer(mMap, l));
VectorTileLayer l = map.setBaseMap(new OSciMap4TileSource());

mMap.setMapPosition(53.08, 8.82, 1 << 17);
map.layers().add(new BuildingLayer(map, l));
map.layers().add(new LabelLayer(map, l));

map.setTheme(VtmThemes.DEFAULT);
map.setMapPosition(53.075, 8.808, 1 << 17);
}

public static void main(String[] args) {
Expand Down
47 changes: 0 additions & 47 deletions vtm-playground/src/org/oscim/test/MeshTest.java

This file was deleted.

36 changes: 36 additions & 0 deletions vtm-playground/src/org/oscim/test/S3DBLayerTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package org.oscim.test;

import org.oscim.gdx.GdxMapApp;
import org.oscim.layers.tile.bitmap.BitmapTileLayer;
import org.oscim.layers.tile.buildings.S3DBLayer;
import org.oscim.tiling.TileSource;
import org.oscim.tiling.source.bitmap.DefaultSources;
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;

public class S3DBLayerTest extends GdxMapApp {

@Override
public void createLayers() {

//VectorTileLayer l = mMap.setBaseMap(new OSciMap4TileSource());
//mMap.setTheme(VtmThemes.DEFAULT);

mMap.setBaseMap(new BitmapTileLayer(mMap, DefaultSources.STAMEN_TONER.build()));

TileSource ts = OSciMap4TileSource
.builder()
.url("http://opensciencemap.org/tiles/s3db")
.build();

S3DBLayer tl = new S3DBLayer(mMap, ts);
mMap.layers().add(tl);

mMap.setMapPosition(53.08, 8.82, 1 << 17);

}

public static void main(String[] args) {
init();
run(new S3DBLayerTest(), null, 400);
}
}
70 changes: 0 additions & 70 deletions vtm-playground/src/org/oscim/test/TessellatorTest.java

This file was deleted.

2 changes: 1 addition & 1 deletion vtm-playground/src/org/oscim/test/ThemeBuilderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

public class ThemeBuilderTest extends GdxMap {

final Logger log = LoggerFactory.getLogger(MeshTest.class);
final Logger log = LoggerFactory.getLogger(S3DBLayerTest.class);

static class MyTheme extends ThemeBuilder {
public MyTheme() {
Expand Down
Loading

0 comments on commit 8b66396

Please sign in to comment.