create eclipse configuration with gradle
This commit is contained in:
10
vtm-gdx-html/src/main/webapp/WEB-INF/web.xml
Normal file
10
vtm-gdx-html/src/main/webapp/WEB-INF/web.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://java.sun.com/xml/ns/javaee"
|
||||
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
|
||||
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">
|
||||
<!-- TODO: Add <servlet> tags for each servlet here. -->
|
||||
<!-- TODO: Add <servlet-mapping> tags for each <servlet> here. -->
|
||||
<!-- TODO: Optionally add a <welcome-file-list> tag to display a welcome file. -->
|
||||
</web-app>
|
||||
164
vtm-gdx-html/src/main/webapp/index.html
Normal file
164
vtm-gdx-html/src/main/webapp/index.html
Normal file
@@ -0,0 +1,164 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>vtm-gdx</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
|
||||
<!-- pixel and dpi are way too simple concepts for web devs, lets also have css-pixels! -->
|
||||
<!-- http://www.html5rocks.com/de/mobile/touch/ -->
|
||||
<!-- http://www.quirksmode.org/mobile/viewports.html -->
|
||||
<!-- http://www.quirksmode.org/blog/archives/2012/07/more_about_devi.html -->
|
||||
<!-- devicePixelRatio: http://coding.smashingmagazine.com/2012/08/20/towards-retina-web/ -->
|
||||
<meta name="viewport"
|
||||
content="width=device-width, initial-scale=1, user-scalable=no">
|
||||
|
||||
<style>
|
||||
.header {
|
||||
background-color: #ddd;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
html, body {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
margin: 0 0 0 0;
|
||||
font-family: Arial, "MS Trebuchet", sans-serif;
|
||||
}
|
||||
|
||||
#gdx-canvas {
|
||||
cursor: default;
|
||||
outline: none;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
#credits {
|
||||
position: absolute;
|
||||
bottom: 0.2em;
|
||||
right: 0.2em;
|
||||
z-index: 20000;
|
||||
color: white;
|
||||
background-color: #000;
|
||||
opacity: 0.5;
|
||||
padding: 0.2em 0.5em 0.2em 0.5em;
|
||||
-moz-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
font-size: 11px;
|
||||
}
|
||||
#credits a {
|
||||
color: white;
|
||||
text-decoration: none;
|
||||
font-variant: small-caps;
|
||||
}
|
||||
#search {
|
||||
z-index: 20000;
|
||||
position: absolute;
|
||||
top: 0.5em;
|
||||
left: 0.5em;
|
||||
background-color: rgba(0,0,0,0.8);
|
||||
-moz-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
visibility: hidden;
|
||||
}
|
||||
#listContainer{
|
||||
color: #FFFFFF;
|
||||
}
|
||||
#nameFieldContainer, .gwt-TextBox {
|
||||
width: 250px;
|
||||
}
|
||||
|
||||
/* Turn on a 16x16 scrollbar */
|
||||
::-webkit-scrollbar {
|
||||
width: 10px;
|
||||
height: 0px;
|
||||
}
|
||||
|
||||
/* Turn on single button up on top, and down on bottom */
|
||||
::-webkit-scrollbar-button:start:decrement, ::-webkit-scrollbar-button:end:increment {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* Turn off the down area up on top, and up area on bottom */
|
||||
::-webkit-scrollbar-button:vertical:start:increment, ::-webkit-scrollbar-button:vertical:end:decrement {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Place The scroll down button at the bottom */
|
||||
::-webkit-scrollbar-button:end:increment {
|
||||
/*background-image: url(images/scroll_cntrl_dwn.png);*/
|
||||
}
|
||||
|
||||
/* Place The scroll up button at the up */
|
||||
::-webkit-scrollbar-button:start:decrement {
|
||||
/*background-image: url(images/scroll_cntrl_up.png);*/
|
||||
}
|
||||
|
||||
/* Top area above thumb and below up button */
|
||||
::-webkit-scrollbar-track-piece:vertical:start {
|
||||
/*background-image: url(images/scroll_gutter_top.png), url(images/scroll_gutter_mid.png);
|
||||
background-repeat: no-repeat, repeat-y;*/
|
||||
}
|
||||
|
||||
/* Bottom area below thumb and down button */
|
||||
::-webkit-scrollbar-track-piece:vertical:end {
|
||||
/*background-image: url(images/scroll_gutter_btm.png), url(images/scroll_gutter_mid.png);
|
||||
background-repeat: no-repeat, repeat-y;
|
||||
background-position: bottom left, 0 0;*/
|
||||
}
|
||||
|
||||
/* The thumb itself */
|
||||
::-webkit-scrollbar-thumb:vertical {
|
||||
height: 56px;
|
||||
width: 12px;
|
||||
/* -webkit-border-image: url(images/scroll_thumb.png) 8 0 8 0 stretch stretch;*/
|
||||
background-color: #DDDDDD;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
var mapconfig = {
|
||||
tilesource : "oscimap4",
|
||||
tileurl : "http://opensciencemap.org/re",
|
||||
zoom : 2,
|
||||
latitude : 0.0,
|
||||
longitude : 0.0
|
||||
}
|
||||
//background : "naturalearth"
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<script type="text/javascript" src="js/_tessellate.js"></script>
|
||||
<script type="text/javascript" src="js/tessellate.js"></script>
|
||||
|
||||
<script type="text/javascript"
|
||||
src="org.oscim.gdx.GwtDefinition/org.oscim.gdx.GwtDefinition.nocache.js"></script>
|
||||
|
||||
<div id="credits">
|
||||
<a href="https://github.com/hjanetzek/vtm">Source</a>
|
||||
| map data © <a href="http://www.openstreemap.org">OpenStreetMap</a> contributors
|
||||
| <a href="http://www.opensciencemap.org">OpenScienceMap</a>
|
||||
</div>
|
||||
|
||||
<div id="search">
|
||||
<table align="center">
|
||||
<tr>
|
||||
<td id="nameFieldContainer">
|
||||
<td id="sendButtonContainer">
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" id="listContainer">
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
37
vtm-gdx-html/src/main/webapp/js/LICENSE
Normal file
37
vtm-gdx-html/src/main/webapp/js/LICENSE
Normal file
@@ -0,0 +1,37 @@
|
||||
Copyright notice and license for the libtess files (all source files besides
|
||||
tessellate.[ch] and main.c):
|
||||
|
||||
SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
|
||||
Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the "Software"),
|
||||
to deal in the Software without restriction, including without limitation
|
||||
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
and/or sell copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice including the dates of first publication and
|
||||
either this permission notice or a reference to
|
||||
http://oss.sgi.com/projects/FreeB/
|
||||
shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
||||
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
Except as contained in this notice, the name of Silicon Graphics, Inc.
|
||||
shall not be used in advertising or otherwise to promote the sale, use or
|
||||
other dealings in this Software without prior written authorization from
|
||||
Silicon Graphics, Inc.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Copyright notice for the other files:
|
||||
|
||||
SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
|
||||
Copyright (C) 2013 AT&T Intellectual Property. All Rights Reserved.
|
||||
18
vtm-gdx-html/src/main/webapp/js/README.md
Normal file
18
vtm-gdx-html/src/main/webapp/js/README.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# A minimal, self-contained port of SGI's GLU libtess
|
||||
|
||||
Polygon tessellation is a major pain in the neck. Have you ever tried
|
||||
writing fast and robust code for it? libtess is, to my knowledge, the
|
||||
only GPL-compatible, liberally-licensed, high-quality polygon
|
||||
triangulator out there.
|
||||
|
||||
This repository includes a self-contained function (tessellate, in
|
||||
tessellate.c) that you can call to triangulate a polygon that is
|
||||
potentially self-intersecting, with holes, or with duplicate
|
||||
vertices. Simple examples of calling the tessellate function directly
|
||||
are located in main.c.
|
||||
|
||||
More interestingly, this repository also includes an
|
||||
Emscripten-compiled module, _tessellate.js, and a Javascript-friendly
|
||||
wrapper, in tessellate.js. Simple examples are available under
|
||||
index.html.
|
||||
|
||||
95
vtm-gdx-html/src/main/webapp/js/_tessellate.js
Normal file
95
vtm-gdx-html/src/main/webapp/js/_tessellate.js
Normal file
File diff suppressed because one or more lines are too long
107
vtm-gdx-html/src/main/webapp/js/tessellate.js
Normal file
107
vtm-gdx-html/src/main/webapp/js/tessellate.js
Normal file
@@ -0,0 +1,107 @@
|
||||
tessellate = (function() {
|
||||
|
||||
Module.TOTAL_MEMORY = 1024 * 1024;
|
||||
|
||||
var c_tessellate = Module.cwrap('tessellate', 'void', [ 'number', 'number',
|
||||
'number', 'number', 'number', 'number' ]);
|
||||
|
||||
// special tessellator for extrusion layer - only returns triangle indices
|
||||
var tessellate = function(vertices, v_start, v_end, boundaries, b_start,
|
||||
b_end, mode) {
|
||||
var i;
|
||||
|
||||
var v_len = (v_end - v_start);
|
||||
var b_len = (b_end - b_start);
|
||||
|
||||
var p = Module._malloc(v_len * 8);
|
||||
|
||||
for (i = 0; i < v_len; ++i)
|
||||
Module.setValue(p + i * 8, vertices[v_start + i], 'double');
|
||||
|
||||
var contours = Module._malloc((b_len + 1) * 4);
|
||||
|
||||
// pointer to first contour
|
||||
Module.setValue(contours + 0, p + 0, 'i32');
|
||||
var offset = p;
|
||||
|
||||
// pointer to further contours + end
|
||||
for (i = 0; i < b_len; ++i) {
|
||||
offset += 8 * boundaries[b_start + i];
|
||||
Module.setValue(contours + 4 * (i + 1), offset, 'i32');
|
||||
}
|
||||
|
||||
var ppcoordinates_out = Module._malloc(4);
|
||||
var pptris_out = Module._malloc(4);
|
||||
var pnverts = Module._malloc(4);
|
||||
var pntris = Module._malloc(4);
|
||||
|
||||
c_tessellate(ppcoordinates_out, pnverts, pptris_out, pntris, contours,
|
||||
contours + 4 * (b_len + 1));
|
||||
|
||||
var pcoordinates_out = Module.getValue(ppcoordinates_out, 'i32');
|
||||
var ptris_out = Module.getValue(pptris_out, 'i32');
|
||||
|
||||
var nverts = Module.getValue(pnverts, 'i32');
|
||||
var ntris = Module.getValue(pntris, 'i32');
|
||||
|
||||
var result_triangles = null;
|
||||
var result_vertices = null;
|
||||
|
||||
if (mode){
|
||||
result_triangles = new Int32Array(ntris * 3);
|
||||
for (i = 0; i < 3 * ntris; ++i)
|
||||
result_triangles[i] = Module.getValue(ptris_out + i * 4, 'i32');
|
||||
|
||||
result_vertices = new Float32Array(nverts * 2);
|
||||
for (i = 0; i < 2 * nverts; ++i)
|
||||
result_vertices[i] = Module.getValue(pcoordinates_out + i * 8, 'double');
|
||||
|
||||
} else {
|
||||
if (nverts * 2 == v_len) {
|
||||
result_triangles = new Int32Array(ntris * 3);
|
||||
|
||||
for (i = 0; i < 3 * ntris; ++i) {
|
||||
result_triangles[i] = Module.getValue(ptris_out + i * 4, 'i32') * 2;
|
||||
}
|
||||
// when a ring has an odd number of points one (or rather two)
|
||||
// additional vertices will be added. so the following rings
|
||||
// needs extra offset...
|
||||
var start = 0;
|
||||
for ( var j = 0, m = b_len - 1; j < m; j++) {
|
||||
start += boundaries[b_start + j];
|
||||
|
||||
// even number of points?
|
||||
if (!((boundaries[b_start + j] >> 1) & 1))
|
||||
continue;
|
||||
|
||||
for ( var n = ntris * 3, tri = 0; tri < n; tri++)
|
||||
if (result_triangles[tri] >= start)
|
||||
result_triangles[tri] += 2;
|
||||
|
||||
start += 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Module._free(pnverts);
|
||||
Module._free(pntris);
|
||||
|
||||
Module._free(ppcoordinates_out);
|
||||
Module._free(pcoordinates_out);
|
||||
|
||||
Module._free(pptris_out);
|
||||
Module._free(ptris_out);
|
||||
|
||||
Module._free(p);
|
||||
Module._free(contours);
|
||||
|
||||
if (mode)
|
||||
return { vertices: result_vertices, triangles: result_triangles };
|
||||
else
|
||||
return result_triangles;
|
||||
|
||||
};
|
||||
|
||||
return tessellate;
|
||||
|
||||
})();
|
||||
@@ -2,7 +2,7 @@
|
||||
<module>
|
||||
<entry-point class="org.oscim.gdx.client.GwtLauncher" />
|
||||
<inherits name="com.google.gwt.xml.XML" />
|
||||
<inherits name="org.slf4j.Slf4j" />
|
||||
<inherits name="ru.finam.slf4jgwt.logging.gwt.Logging"/>
|
||||
|
||||
<set-property name='gwt.logging.enabled' value='TRUE' />
|
||||
<set-property name='gwt.logging.consoleHandler' value='ENABLED' />
|
||||
@@ -13,13 +13,18 @@
|
||||
<inherits name="GdxMap" />
|
||||
<inherits name="com.badlogic.gdx.backends.gdx_backends_gwt" />
|
||||
<inherits name="com.google.gwt.user.theme.chrome.Chrome" />
|
||||
|
||||
|
||||
<!-- super dev mode -->
|
||||
<add-linker name="xsiframe"/>
|
||||
<set-configuration-property name='xsiframe.failIfScriptTag' value='FALSE'/>
|
||||
<set-configuration-property name="devModeRedirectEnabled" value="true"/>
|
||||
|
||||
<super-source path="emu" />
|
||||
|
||||
<set-configuration-property name="gdx.assetpath" value="../vtm/assets" />
|
||||
|
||||
<!-- for gradle build -->
|
||||
<set-configuration-property name="gdx.assetoutputpath" value="build/gwt/draftOut" />
|
||||
|
||||
<set-property name="user.agent" value="safari"/>
|
||||
</module>
|
||||
|
||||
Reference in New Issue
Block a user