This commit is contained in:
m-schuetz 2018-02-09 17:24:45 +01:00
parent 6bad6ca5b4
commit 3adfa8fb07
28 changed files with 386 additions and 21 deletions

24
examples/examples.json Normal file
View File

@ -0,0 +1,24 @@
{
"examples": [
{"thumb": "thumbnails/animation_paths.png", "label": "Animations", "url": "animation_paths.html"},
{"thumb": "thumbnails/annotation_hierarchy.png", "label": "Hierarchical Annotations", "url": "annotation_hierarchy.html"},
{"thumb": "thumbnails/annotations.png", "label": "Annotations", "url": "annotations.html"},
{"thumb": "thumbnails/cesium_ca13.png", "label": "Cesium CA13", "url": "cesium_ca13.html"},
{"thumb": "thumbnails/cesium_sorvilier.png", "label": "Cesium Sorvilier", "url": "cesium_sorvilier.html"},
{"thumb": "thumbnails/clipping_volume.png", "label": "Clipping Volume", "url": "clipping_volume.html"},
{"thumb": "thumbnails/custom_sidebar_section.png", "label": "Custom Sidebar Section", "url": "custom_sidebar_section.html"},
{"thumb": "thumbnails/elevation_profile.png", "label": "Elevation Profile", "url": "elevation_profile.html"},
{"thumb": "thumbnails/embedded_iframe.png", "label": "Embedded Iframe", "url": "embedded_iframe.html"},
{"thumb": "thumbnails/gradient_colors.png", "label": "Gradient Colors", "url": "gradient_colors.html"},
{"thumb": "thumbnails/heidentor.png", "label": "Heidentor", "url": "heidentor.html"},
{"thumb": "thumbnails/light_animated.png", "label": "Animated Light", "url": "light_animated.html"},
{"thumb": "thumbnails/light_ca13.png", "label": "Light CA13", "url": "light_ca13.html"},
{"thumb": "thumbnails/lines.png", "label": "Lines", "url": "lines.html"},
{"thumb": "thumbnails/lion.png", "label": "Lion", "url": "lion.html"},
{"thumb": "thumbnails/lion_las.png", "label": "Lion LAS", "url": "lion_las.html"},
{"thumb": "thumbnails/lion_las.png", "label": "Lion LAZ", "url": "lion_las.html"},
{"thumb": "thumbnails/measurements.png", "label": "Measurements", "url": "measurements.html"},
{"thumb": "thumbnails/multiple_point_clouds.png", "label": "Multiple Point Clouds", "url": "multiple_point_clouds.html"},
{"thumb": "thumbnails/shapefiles.png", "label": "Shapefiles", "url": "shapefiles.html"},
{"thumb": "thumbnails/viewer.png", "label": "Basic Viewer", "url": "viewer.html"}
]}

View File

@ -153,6 +153,8 @@
{
viewer.onGUILoaded(() => {
console.log("adding to gui");
// Add entries to object list in sidebar
let tree = $(`#jstree_scene`);
let parentNode = "other";

75
examples/page.html Normal file
View File

@ -0,0 +1,75 @@
<html>
<head>
<style>
.thumb{
background-size: 128px 128px;
width: 128px;
height: 128px;
border-radius: 5px;
border: 2px solid black;
box-shadow: 3px 3px 3px 0px #555;
margin: 3px;
float: left;
}
.thumb-label{
font-size: large;
text-align: center;
font-weight: bold;
color: #FFF;
text-shadow:black 0 0 5px, black 0 0 5px, black 0 0 5px, black 0 0 5px, black 0 0 5px, black 0 0 5px;
height: 100%;
}
</style>
</head>
<body>
<script src="../libs/jquery/jquery-3.1.1.min.js"></script>
<div id="thumb_container" style="max-width: 1000px; margin: auto; margin-top: 50px;"></div>
<script>
let examples = [
{thumb: "./thumbnails/animation_paths.png", label: "Animations", url: "./animation_paths.html"},
{thumb: "./thumbnails/annotation_hierarchy.png", label: "Hierarchical Annotations", url: "./annotation_hierarchy.html"},
{thumb: "./thumbnails/annotations.png", label: "Annotations", url: "./annotations.html"},
{thumb: "./thumbnails/cesium_ca13.png", label: "Cesium CA13", url: "./cesium_ca13.html"},
{thumb: "./thumbnails/cesium_sorvilier.png", label: "Cesium Sorvilier", url: "./cesium_sorvilier.html"},
{thumb: "./thumbnails/clipping_volume.png", label: "Clipping Volume", url: "./clipping_volume.html"},
{thumb: "./thumbnails/custom_sidebar_section.png", label: "Custom Sidebar Section", url: "./custom_sidebar_section.html"},
{thumb: "./thumbnails/elevation_profile.png", label: "Elevation Profile", url: "./elevation_profile.html"},
{thumb: "./thumbnails/embedded_iframe.png", label: "Embedded Iframe", url: "./embedded_iframe.html"},
{thumb: "./thumbnails/gradient_colors.png", label: "Gradient Colors", url: "./gradient_colors.html"},
{thumb: "./thumbnails/heidentor.png", label: "Heidentor", url: "./heidentor.html"},
{thumb: "./thumbnails/light_animated.png", label: "Animated Light", url: "./light_animated.html"},
{thumb: "./thumbnails/light_ca13.png", label: "Light CA13", url: "./light_ca13.html"},
{thumb: "./thumbnails/lines.png", label: "Lines", url: "./lines.html"},
{thumb: "./thumbnails/lion.png", label: "Lion", url: "./lion.html"},
{thumb: "./thumbnails/lion_las.png", label: "Lion LAS", url: "./lion_las.html"},
{thumb: "./thumbnails/lion_las.png", label: "Lion LAZ", url: "./lion_las.html"},
{thumb: "./thumbnails/measurements.png", label: "Measurements", url: "./measurements.html"},
{thumb: "./thumbnails/multiple_point_clouds.png", label: "Multiple Point Clouds", url: "./multiple_point_clouds.html"},
{thumb: "./thumbnails/shapefiles.png", label: "Shapefiles", url: "./shapefiles.html"},
{thumb: "./thumbnails/viewer.png", label: "Basic Viewer", url: "./viewer.html"},
];
for(let example of examples){
let element = $(`
<a href="${example.url}" target="_blank">
<div class="thumb" style="background-image: url('${example.thumb}'); ">
<div class="thumb-label">${example.label}</div>
</div>
</a>`);
$("#thumb_container").append(element);
}
</script>
</body>
</html>

170
examples/pagetest.html Normal file
View File

@ -0,0 +1,170 @@
<html>
<head>
<style>
.thumb{
background-size: 128px 128px;
width: 128px;
height: 128px;
border-radius: 5px;
border: 2px solid black;
box-shadow: 3px 3px 3px 0px #555;
margin: 3px;
float: left;
}
.thumb-label{
font-size: large;
text-align: center;
font-weight: bold;
color: #FFF;
text-shadow:black 0 0 5px, black 0 0 5px, black 0 0 5px, black 0 0 5px, black 0 0 5px, black 0 0 5px;
height: 100%;
}
</style>
</head>
<body>
<div id="thumb_container" style="max-width: 1000px; margin: auto; margin-top: 50px;">
<a href="animation_paths.html" target="_blank">
<div class="thumb" style="background-image: url('thumbnails/animation_paths.png'); ">
<div class="thumb-label">Animations</div>
</div>
</a>
<a href="annotation_hierarchy.html" target="_blank">
<div class="thumb" style="background-image: url('thumbnails/annotation_hierarchy.png'); ">
<div class="thumb-label">Hierarchical Annotations</div>
</div>
</a>
<a href="annotations.html" target="_blank">
<div class="thumb" style="background-image: url('thumbnails/annotations.png'); ">
<div class="thumb-label">Annotations</div>
</div>
</a>
<a href="cesium_ca13.html" target="_blank">
<div class="thumb" style="background-image: url('thumbnails/cesium_ca13.png'); ">
<div class="thumb-label">Cesium CA13</div>
</div>
</a>
<a href="cesium_sorvilier.html" target="_blank">
<div class="thumb" style="background-image: url('thumbnails/cesium_sorvilier.png'); ">
<div class="thumb-label">Cesium Sorvilier</div>
</div>
</a>
<a href="clipping_volume.html" target="_blank">
<div class="thumb" style="background-image: url('thumbnails/clipping_volume.png'); ">
<div class="thumb-label">Clipping Volume</div>
</div>
</a>
<a href="custom_sidebar_section.html" target="_blank">
<div class="thumb" style="background-image: url('thumbnails/custom_sidebar_section.png'); ">
<div class="thumb-label">Custom Sidebar Section</div>
</div>
</a>
<a href="elevation_profile.html" target="_blank">
<div class="thumb" style="background-image: url('thumbnails/elevation_profile.png'); ">
<div class="thumb-label">Elevation Profile</div>
</div>
</a>
<a href="embedded_iframe.html" target="_blank">
<div class="thumb" style="background-image: url('thumbnails/embedded_iframe.png'); ">
<div class="thumb-label">Embedded Iframe</div>
</div>
</a>
<a href="gradient_colors.html" target="_blank">
<div class="thumb" style="background-image: url('thumbnails/gradient_colors.png'); ">
<div class="thumb-label">Gradient Colors</div>
</div>
</a>
<a href="heidentor.html" target="_blank">
<div class="thumb" style="background-image: url('thumbnails/heidentor.png'); ">
<div class="thumb-label">Heidentor</div>
</div>
</a>
<a href="light_animated.html" target="_blank">
<div class="thumb" style="background-image: url('thumbnails/light_animated.png'); ">
<div class="thumb-label">Animated Light</div>
</div>
</a>
<a href="light_ca13.html" target="_blank">
<div class="thumb" style="background-image: url('thumbnails/light_ca13.png'); ">
<div class="thumb-label">Light CA13</div>
</div>
</a>
<a href="lines.html" target="_blank">
<div class="thumb" style="background-image: url('thumbnails/lines.png'); ">
<div class="thumb-label">Lines</div>
</div>
</a>
<a href="lion.html" target="_blank">
<div class="thumb" style="background-image: url('thumbnails/lion.png'); ">
<div class="thumb-label">Lion</div>
</div>
</a>
<a href="lion_las.html" target="_blank">
<div class="thumb" style="background-image: url('thumbnails/lion_las.png'); ">
<div class="thumb-label">Lion LAS</div>
</div>
</a>
<a href="lion_las.html" target="_blank">
<div class="thumb" style="background-image: url('thumbnails/lion_las.png'); ">
<div class="thumb-label">Lion LAZ</div>
</div>
</a>
<a href="measurements.html" target="_blank">
<div class="thumb" style="background-image: url('thumbnails/measurements.png'); ">
<div class="thumb-label">Measurements</div>
</div>
</a>
<a href="multiple_point_clouds.html" target="_blank">
<div class="thumb" style="background-image: url('thumbnails/multiple_point_clouds.png'); ">
<div class="thumb-label">Multiple Point Clouds</div>
</div>
</a>
<a href="shapefiles.html" target="_blank">
<div class="thumb" style="background-image: url('thumbnails/shapefiles.png'); ">
<div class="thumb-label">Shapefiles</div>
</div>
</a>
<a href="viewer.html" target="_blank">
<div class="thumb" style="background-image: url('thumbnails/viewer.png'); ">
<div class="thumb-label">Basic Viewer</div>
</div>
</a>
</div>
<div>
<a href="arena4d.html">arena4d.html</a><br>
<a href="ca13.html">ca13.html</a><br>
<a href="ca13_feature_test.html">ca13_feature_test.html</a><br>
<a href="entwine_greyhound.html">entwine_greyhound.html</a><br>
<a href="examples.json">examples.json</a><br>
<a href="lasmap.html">lasmap.html</a><br>
<a href="light.html">light.html</a><br>
<a href="lion_laz.html">lion_laz.html</a><br>
<a href="meshes.html">meshes.html</a><br>
<a href="morro_bay_shp">morro_bay_shp</a><br>
<a href="multiple_pointclouds.html">multiple_pointclouds.html</a><br>
<a href="page.html">page.html</a><br>
<a href="pagetest.html">pagetest.html</a><br>
<a href="sorvilier_feature_test.html">sorvilier_feature_test.html</a><br>
<a href="thumbnails">thumbnails</a><br>
</div>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

View File

@ -169,7 +169,7 @@ gulp.task("shaders", function(){
.pipe(gulp.dest('build/shaders'));
});
gulp.task("scripts", ['workers','shaders', "icons_viewer"], function(){
gulp.task("scripts", ['workers','shaders', "icons_viewer", "examples_page"], function(){
gulp.src(paths.potree)
.pipe(concat('potree.js'))
.pipe(size({showFiles: true}))
@ -200,6 +200,93 @@ gulp.task('webserver', function() {
server = connect.server({port: 1234});
});
gulp.task('examples_page', function() {
let settings = JSON.parse(fs.readFileSync("examples/examples.json", 'utf8'));
let files = fs.readdirSync("./examples");
let thumbCode = ``;
let urls = settings.examples.map(e => e.url);
let unhandled = [];
for(let file of files){
let isHandled = false;
for(let url of urls){
if(file.indexOf(url) !== -1){
isHandled = true;
}
}
if(!isHandled){
unhandled.push(file);
}
}
for(let example of settings.examples){
thumbCode += `<a href="${example.url}" target="_blank">
<div class="thumb" style="background-image: url('${example.thumb}'); ">
<div class="thumb-label">${example.label}</div>
</div>
</a>
`;
}
let unhandledCode = ``;
for(let file of unhandled){
unhandledCode += `
<a href="${file}">${file}</a><br>
`;
}
let page = `
<html>
<head>
<style>
.thumb{
background-size: 128px 128px;
width: 128px;
height: 128px;
border-radius: 5px;
border: 2px solid black;
box-shadow: 3px 3px 3px 0px #555;
margin: 3px;
float: left;
}
.thumb-label{
font-size: large;
text-align: center;
font-weight: bold;
color: #FFF;
text-shadow:black 0 0 5px, black 0 0 5px, black 0 0 5px, black 0 0 5px, black 0 0 5px, black 0 0 5px;
height: 100%;
}
</style>
</head>
<body>
<div id="thumb_container" style="max-width: 1000px; margin: auto; margin-top: 50px;">
${thumbCode}
</div>
<div>
${unhandledCode}
</div>
</body>
</html>
`;
fs.writeFile(`examples/pagetest.html`, page, (err) => {
if(err){
console.log(err);
}else{
console.log(`examples/pagetest.html`);
}
});
});
gulp.task('icons_viewer', function() {
let iconsPath = "resources/icons";
@ -255,7 +342,6 @@ gulp.task('icons_viewer', function() {
}else{
console.log(`created ${iconsPath}/index.html`);
}
});
});

View File

@ -241,6 +241,8 @@ initSidebar = (viewer) => {
}else{
tree.jstree('uncheck_node', nodeID);
}
console.log("create node");
return nodeID;
}

View File

@ -897,32 +897,38 @@ Potree.Viewer = class PotreeViewer extends THREE.EventDispatcher{
$(() => {
initSidebar(this);
});
let elProfile = $('<div>').load(new URL(Potree.scriptPath + '/profile.html').href, () => {
$(document.body).append(elProfile.children());
this.profileWindow = new Potree.ProfileWindow(this);
this.profileWindowController = new Potree.ProfileWindowController(this);
$('#profile_window').draggable({
handle: $('#profile_titlebar'),
containment: $(document.body)
});
$('#profile_window').resizable({
containment: $(document.body),
handles: 'n, e, s, w'
});
if (callback) {
$(callback);
}
this.guiLoaded = true;
let elProfile = $('<div>').load(new URL(Potree.scriptPath + '/profile.html').href, () => {
$(document.body).append(elProfile.children());
this.profileWindow = new Potree.ProfileWindow(this);
this.profileWindowController = new Potree.ProfileWindowController(this);
$('#profile_window').draggable({
handle: $('#profile_titlebar'),
containment: $(document.body)
});
$('#profile_window').resizable({
containment: $(document.body),
handles: 'n, e, s, w'
});
});
$(() => {
this.guiLoaded = true;
console.log("gui loaded");
for(let task of this.guiLoadTasks){
task();
}
});
for(let task of this.guiLoadTasks){
task();
}
});
});
}