examples
24
examples/examples.json
Normal 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"}
|
||||
]}
|
||||
@ -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
@ -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
@ -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>
|
||||
|
||||
BIN
examples/thumbnails/animation_paths.png
Normal file
|
After Width: | Height: | Size: 61 KiB |
BIN
examples/thumbnails/annotation_hierarchy.png
Normal file
|
After Width: | Height: | Size: 86 KiB |
BIN
examples/thumbnails/annotations.png
Normal file
|
After Width: | Height: | Size: 73 KiB |
BIN
examples/thumbnails/cesium_ca13.png
Normal file
|
After Width: | Height: | Size: 90 KiB |
BIN
examples/thumbnails/cesium_sorvilier.png
Normal file
|
After Width: | Height: | Size: 64 KiB |
BIN
examples/thumbnails/clipping_volume.png
Normal file
|
After Width: | Height: | Size: 65 KiB |
BIN
examples/thumbnails/custom_sidebar_section.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
examples/thumbnails/elevation_profile.png
Normal file
|
After Width: | Height: | Size: 98 KiB |
BIN
examples/thumbnails/embedded_iframe.png
Normal file
|
After Width: | Height: | Size: 35 KiB |
BIN
examples/thumbnails/gradient_colors.png
Normal file
|
After Width: | Height: | Size: 87 KiB |
BIN
examples/thumbnails/heidentor.png
Normal file
|
After Width: | Height: | Size: 85 KiB |
BIN
examples/thumbnails/light_animated.png
Normal file
|
After Width: | Height: | Size: 67 KiB |
BIN
examples/thumbnails/light_ca13.png
Normal file
|
After Width: | Height: | Size: 129 KiB |
BIN
examples/thumbnails/lines.png
Normal file
|
After Width: | Height: | Size: 104 KiB |
BIN
examples/thumbnails/lion.png
Normal file
|
After Width: | Height: | Size: 84 KiB |
BIN
examples/thumbnails/lion_las.png
Normal file
|
After Width: | Height: | Size: 104 KiB |
BIN
examples/thumbnails/measurements.png
Normal file
|
After Width: | Height: | Size: 116 KiB |
BIN
examples/thumbnails/meshes.png
Normal file
|
After Width: | Height: | Size: 105 KiB |
BIN
examples/thumbnails/multiple_point_clouds.png
Normal file
|
After Width: | Height: | Size: 97 KiB |
BIN
examples/thumbnails/shapefiles.png
Normal file
|
After Width: | Height: | Size: 122 KiB |
BIN
examples/thumbnails/viewer.png
Normal file
|
After Width: | Height: | Size: 64 KiB |
90
gulpfile.js
@ -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`);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@ -241,6 +241,8 @@ initSidebar = (viewer) => {
|
||||
}else{
|
||||
tree.jstree('uncheck_node', nodeID);
|
||||
}
|
||||
|
||||
console.log("create node");
|
||||
|
||||
return nodeID;
|
||||
}
|
||||
|
||||
@ -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();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||