-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
532 lines (468 loc) · 21.8 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="description" content="Nuvola di punti dell'Arsenale di Piacenza">
<meta name="author" content="Federica Gaspari">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<title>Arsenale di Piacenza</title>
<link rel="stylesheet" type="text/css" href="./libs/potree/potree.css">
<link rel="stylesheet" type="text/css" href="./libs/jquery-ui/jquery-ui.min.css">
<link rel="stylesheet" type="text/css" href="./libs/openlayers3/ol.css">
<link rel="stylesheet" type="text/css" href="./libs/spectrum/spectrum.css">
<link rel="stylesheet" type="text/css" href="./libs/jstree/themes/mixed/style.css">
<link rel="stylesheet" type="text/css" href="./libs/font-awesome/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="./libs/font-awesome/font-awesome.css">
<!-- Custom styles for this template -->
<link rel="stylesheet" type="text/css" href="./assets/css/style.css">
<style>
/*Scrollbar for hotspot controls*/
::-webkit-scrollbar {
width: 9px;
}
::-webkit-scrollbar-button {
width: 8px;
height: 2px;
}
::-webkit-scrollbar-track {
background: black;
border: thin solid black;
box-shadow: 0px 0px 3px black inset;
border-radius: 12px;
}
::-webkit-scrollbar-thumb {
background: #565656;
border: thin solid #565656;
border-radius: 12px;
}
::-webkit-scrollbar-thumb:hover {
background: #7d7d7d;
}
</style>
</head>
<body>
<script src="./libs/jquery/jquery-3.1.1.min.js"></script>
<script src="./libs/spectrum/spectrum.js"></script>
<script src="./libs/perfect-scrollbar/js/perfect-scrollbar.jquery.js"></script>
<script src="./libs/jquery-ui/jquery-ui.min.js"></script>
<script src="./libs/three.js/build/three.min.js"></script>
<script src="./libs/other/BinaryHeap.js"></script>
<script src="./libs/tween/tween.min.js"></script>
<script src="./libs/d3/d3.js"></script>
<script src="./libs/proj4/proj4.js"></script>
<script src="./libs/openlayers3/ol.js"></script>
<script src="./libs/i18next/i18next.js"></script>
<script src="./libs/jstree/jstree.js"></script>
<script src="./libs/potree/potree.js"></script>
<script src="./libs/plasio/js/laslaz.js"></script>
<!-- custom js script-->
<script src="./assets/js/main.js"></script>
<div class="potree_container" style="position: absolute; width: 100%; height: 100%; left: 0px; top: 0px; ">
<div id="potree_render_area"> </div>
<div id="potree_sidebar_container"> </div>
<!--Control Icons-->
<img id="camera_icon" onclick="" src="./assets/camera.svg" title="Activate Images" />
<img id="refresh_icon" onclick="refreshButton()" src="./assets/refresh.svg" title="Refresh Page" />
<img id="question_icon" onclick="" src="./assets/question.svg" title="Tutorial" />
<img id="fullscreen_icon" onclick="toggleFullScreen()" src="./assets/fullscreen.svg" title="Fullscreen" />
<!-- Navigation Instructions -->
<div id="nav_panel" class="navPanel w3-center w3-animate-opacity">
<div class="navPanel-content">
<div class="intrinsic-container intrinsic-container-16x9">
<img class="nav_img" src="./assets/anno-img/navigation3d.png" />
</div>
</div>
</div>
<!--Annotations Panels-->
<!--Old Piacenza plastico-->
<div id="anno1" class="navPanel w3-center w3-animate-opacity">
<div class="navPanel-content">
<div class="intrinsic-container intrinsic-container-16x9">
<img class="anno_img" src="./assets/anno-img/piacenza-plastico.jpg" />
</div>
</div>
</div>
<!--Old Piacenza plastico-->
<div id="anno2" class="navPanel w3-center w3-animate-opacity">
<div class="navPanel-content">
<div class="intrinsic-container intrinsic-container-16x9">
<img class="anno_img" src="./assets/anno-img/piacenza-map.jpg" />
</div>
</div>
</div>
<!--Armor 1-->
<div id="anno3" class="navPanel w3-center w3-animate-opacity">
<div class="navPanel-content">
<div class="intrinsic-container intrinsic-container-16x9">
<img class="anno_img" src="./assets/anno-img/armor1.jpg" /><br>
<p>Armatura da campo fine sec. XV</p>
</div>
</div>
</div>
<!--Armor 2-->
<div id="anno4" class="navPanel w3-center w3-animate-opacity">
<div class="navPanel-content">
<div class="intrinsic-container intrinsic-container-16x9">
<img class="anno_img" src="./assets/anno-img/armor2.jpg" />
</div>
</div>
</div>
<!--Armor 3-->
<div id="anno5" class="navPanel w3-center w3-animate-opacity">
<div class="navPanel-content">
<div class="intrinsic-container intrinsic-container-16x9">
<img class="anno_img" src="./assets/anno-img/armor3.jpg" />
</div>
</div>
</div>
<!--Plastico castello-->
<div id="anno6" class="navPanel w3-center w3-animate-opacity">
<div class="navPanel-content">
<div class="intrinsic-container intrinsic-container-16x9">
<img class="anno_img" src="./assets/anno-img/castello-plastico.jpg" />
</div>
</div>
</div>
<!--Plastico castello-->
<div id="anno7" class="navPanel w3-center w3-animate-opacity">
<div class="navPanel-content">
<div class="intrinsic-container intrinsic-container-16x9">
<img class="anno_img" src="./assets/anno-img/sotterranei.jpg" />
</div>
</div>
</div>
<!--Paolo III print-->
<div id="anno8" class="navPanel w3-center w3-animate-opacity">
<div class="navPanel-content">
<div class="intrinsic-container intrinsic-container-16x9">
<img class="anno_img" src="./assets/anno-img/paoloIII.jpg" />
</div>
</div>
</div>
<!--Pier Luigi Farnese print-->
<div id="anno9" class="navPanel w3-center w3-animate-opacity">
<div class="navPanel-content">
<div class="intrinsic-container intrinsic-container-16x9">
<img class="anno_img" src="./assets/anno-img/pierluigifarnese.jpg" />
</div>
</div>
</div>
<!--Slideshow bastione San Giovanni-->
<div id="anno10" class="navPanel w3-center w3-animate-opacity">
<!--<div class="navPanel-content">-->
<!---<div class="intrinsic-container intrinsic-container-16x9">-->
<div class="slideshow-container">
<div class="mySlides fade">
<div class="numbertext">1 / 3</div>
<div class="photo-slide">
<img src="./assets/anno-img/sangiovanni01.jpg" style="display: inline-block; width:70%; border-radius: 15px; margin: auto;">
</div>
<div class="text">Indoor entrance</div>
</div>
<div class="mySlides fade">
<div class="numbertext">2 / 3</div>
<div class="photo-slide">
<img src="./assets/anno-img/sangiovanni02.jpg" style="width:70%; border-radius: 15px; margin: auto;">
</div>
<div class="text">Indoor right wing</div>
</div>
<div class="mySlides fade">
<div class="numbertext">3 / 3</div>
<div class="photo-slide">
<img src="./assets/anno-img/sangiovanni03.jpg" style="width:70%; border-radius: 15px; margin: auto;">
</div>
<div class="text">Indoor casamatta</div>
</div>
<a class="prev" onclick="plusSlides(-1)">❮</a>
<a class="next" onclick="plusSlides(1)">❯</a>
<a class="closing" onclick="closeSlides()"><b>X</b></a>
</div>
<br>
<div style="text-align:center">
<span class="dot" onclick="currentSlide(1)"></span>
<span class="dot" onclick="currentSlide(2)"></span>
<span class="dot" onclick="currentSlide(3)"></span>
</div>
<!---</div>-->
<!--</div>-->
</div>
<script>
function closeSlides() {
$("#anno10").fadeOut();
//reset opacity of parent page
parentWin = window.parent;
var sidebar = parentWin.document.getElementById('split-container');
sidebar.style.opacity = "1";
}
let slideIndex = 1;
showSlides(slideIndex);
function plusSlides(n) {
showSlides(slideIndex += n);
}
function currentSlide(n) {
showSlides(slideIndex = n);
}
function showSlides(n) {
let i;
let slides = document.getElementsByClassName("mySlides");
let dots = document.getElementsByClassName("dot");
if (n > slides.length) { slideIndex = 1 }
if (n < 1) { slideIndex = slides.length }
for (i = 0; i < slides.length; i++) {
slides[i].style.display = "none";
}
for (i = 0; i < dots.length; i++) {
dots[i].className = dots[i].className.replace(" active", "");
}
slides[slideIndex - 1].style.display = "block";
dots[slideIndex - 1].className += " active";
}
</script>
<!--Hotspots Dropup-->
<div class="controls">
<div class="hotspot-controls">
<div id="prev" data-title="Previous Annotation" data-action="prev-annotation">
<div id="prevDiv"><img id="prevIcon" src="libs/potree/resources/icons/arrow_left.svg" /></div>
</div>
<div id="hotspots" class="hotspot-name" data-action="toggle-annotation-list"><b
id="hotspotName">Explore</b></div>
<div id="next" data-title="Next Annotation" data-action="next-annotation">
<div id="nextDiv"><img id="nextIcon" src="libs/potree/resources/icons/arrow_right.svg" /></div>
</div>
<div id="lists" class="list hotspots-list visible">
<ul class="js-scrollable">
<li id="li1" class="link"><a data-hotspot-target="0" title="Bastione San Giovanni">Bastione San
Giovanni</a></li>
<li id="li2" class="link"><a data-hotspot-target="1" title="Bastione San Benedetto">Bastione San
Benedetto </a></li>
<li id="li3" class="link"><a data-hotspot-target="2" title="Bastione San Giacomo">Bastione San
Giacomo</a></li>
<li id="li4" class="link"><a data-hotspot-target="3"
title="Bastione San Giacomo (Indoor)">Bastione San Giacomo (Indoor)</a></li>
</ul>
</div>
</div>
</div>
</div>
<script src="assets/js/loadpointclouds.js"></script>
<script src="assets/js/loadanimations.js"></script>
<script src="assets/js/loadannotations.js"></script>
<script src="assets/js/loadphotos.js"></script>
<script type="module">
var src = document.referrer;
var srcSplit = src.split("?");
var hotSpot = parseFloat(srcSplit[1]); //0 for San Giovanni, 1 for San Benedetto, 2 for San Giacomo, 3 for Indoor
/* Opening Transitions
*****************************************************/
//San Giovanni
if (hotSpot == 0) {
setTimeout(function () {
scenears.annotations.children[1].moveHere(scenears.camera);
}, 1500);
}
//San Benedetto
else if (hotSpot == 1) {
setTimeout(function () {
scenears.annotations.children[0].moveHere(scenears.camera);
}, 1500);
}
//San Giacomo
else if (hotSpot == 2) {
setTimeout(function () {
scenears.annotations.children[2].moveHere(scenears.camera);
}, 2000);
}
//San Giacomo Indoor
else if (hotSpot == 3) {
setTimeout(function () {
event.stopPropagation();
viewer.setScene(indoor);
scenears.annotations.children[3].moveHere(scenears.camera);
}, 2000);
}
/* Hotspots Control Dropup*/
$("#hotspots").click(function () {
$("#lists").toggle();
});
//Functions to show and hide annotations' descriptions
function showDescription(annotationNum) {
var descriptions = document.getElementsByClassName("annotation-description");
var description = descriptions[annotationNum];
description.style.display = "block";
}
function hideDescription(annotationNum) {
var descriptions = document.getElementsByClassName("annotation-description");
var description = descriptions[annotationNum];
description.style.display = "none";
}
//Functions for each annotation
function item1() {
changeHotspotName("San Giovanni");
scenears.annotations.children[1].moveHere(scenears.camera);
showDescription(1);
hideDescription(4);
scenears.annotations.children[0].visible = true;
scenears.annotations.children[1].visible = true;
scenears.annotations.children[2].visible = true;
scenears.annotations.children[3].visible = false;
scenears.annotations.children[4].visible = false;
scenears.annotations.children[5].visible = false;
scenears.annotations.children[6].visible = false;
scenears.annotations.children[7].visible = false;
scenears.annotations.children[8].visible = false;
scenears.annotations.children[9].visible = false;
scenears.annotations.children[10].visible = false;
scenears.annotations.children[11].visible = false;
scenears.annotations.children[12].visible = false;
scenears.annotations.children[13].visible = false;
scenears.annotations.children[14].visible = false;
scenears.annotations.children[15].visible = false;
scenears.annotations.children[16].visible = false;
}
function item2() {
changeHotspotName("San Benedetto");
scenears.annotations.children[0].moveHere(scenears.camera);
hideDescription(1);
hideDescription(4);
scenears.annotations.children[0].visible = true;
scenears.annotations.children[1].visible = true;
scenears.annotations.children[2].visible = true;
scenears.annotations.children[3].visible = false;
scenears.annotations.children[4].visible = false;
scenears.annotations.children[5].visible = false;
scenears.annotations.children[6].visible = false;
scenears.annotations.children[7].visible = false;
scenears.annotations.children[8].visible = false;
scenears.annotations.children[9].visible = false;
scenears.annotations.children[10].visible = false;
scenears.annotations.children[11].visible = false;
scenears.annotations.children[12].visible = false;
scenears.annotations.children[13].visible = false;
scenears.annotations.children[14].visible = false;
scenears.annotations.children[15].visible = false;
scenears.annotations.children[16].visible = false;
}
function item3() {
changeHotspotName("San Giacomo");
scenears.annotations.children[2].moveHere(scenears.camera);
hideDescription(1);
hideDescription(4);
scenears.annotations.children[0].visible = true;
scenears.annotations.children[1].visible = true;
scenears.annotations.children[2].visible = true;
scenears.annotations.children[3].visible = false;
scenears.annotations.children[4].visible = false;
scenears.annotations.children[5].visible = false;
scenears.annotations.children[6].visible = false;
scenears.annotations.children[7].visible = false;
scenears.annotations.children[8].visible = false;
scenears.annotations.children[9].visible = false;
scenears.annotations.children[10].visible = false;
scenears.annotations.children[11].visible = false;
scenears.annotations.children[12].visible = false;
scenears.annotations.children[13].visible = false;
scenears.annotations.children[14].visible = false;
scenears.annotations.children[15].visible = false;
scenears.annotations.children[16].visible = false;
}
function item4() {
changeHotspotName("Indoor");
scenears.annotations.children[3].moveHere(scenears.camera);
showDescription(4);
hideDescription(1);
scenears.annotations.children[0].visible = false;
scenears.annotations.children[1].visible = false;
scenears.annotations.children[2].visible = false;
scenears.annotations.children[3].visible = true;
scenears.annotations.children[4].visible = true;
scenears.annotations.children[5].visible = true;
scenears.annotations.children[6].visible = true;
scenears.annotations.children[7].visible = true;
scenears.annotations.children[8].visible = false;
scenears.annotations.children[9].visible = false;
scenears.annotations.children[10].visible = false;
scenears.annotations.children[11].visible = false;
scenears.annotations.children[12].visible = false;
scenears.annotations.children[13].visible = false;
scenears.annotations.children[14].visible = false;
scenears.annotations.children[15].visible = true;
scenears.annotations.children[16].visible = true;
}
//Hotspot Dropup's Click Selection
$("#li1").click(function () {
item1();
});
$("#li2").click(function () {
item2();
});
$("#li3").click(function () {
item3();
});
$("#li4").click(function () {
item4();
});
//Hotspot Dropup's Prev/Next Selection
const functions = [];
functions.push(item1);
functions.push(item2);
functions.push(item3);
functions.push(item4);
const length = functions.length;
const getNextIdx = (idx = 0, length, direction) => {
switch (direction) {
case 'next': return (idx + 1) % length;
case 'prev': return (idx == 0) && length - 1 || idx - 1;
default: return idx;
}
}
let idx; // idx is undefined, so getNewScene will take 0 as default
const getNewScene = (direction) => {
idx = getNextIdx(idx, length, direction);
var sceneFunction = functions[idx];
return sceneFunction();
}
$("#prev").click(function () {
getNewScene('prev');
});
$("#next").click(function () {
getNewScene('next');
});
//Temp solution to hide list when a hotspot is selected
function hideList(listItem) {
var openLink = document.getElementById(listItem);
openLink.addEventListener('click', clickHandler, false);
function clickHandler() {
var submenu = document.getElementById('lists');
submenu.style.display = 'none';
}
}
hideList('li1');
hideList('li2');
hideList('li3');
hideList('li4');
/* Navigation Controls Image
*****************************************************/
$("#question_icon").click(function () {
$("#nav_panel").fadeIn();
//Applying opacity to parent page
parentWin = window.parent;
var sidebar = parentWin.document.getElementById('split-container');
sidebar.style.opacity = "0.5";
});
var navPanel = document.getElementById('nav_panel');
navPanel.addEventListener('click', function () {
$("#nav_panel").fadeOut();
//reset opacity of parent page
parentWin = window.parent;
var sidebar = parentWin.document.getElementById('split-container');
sidebar.style.opacity = "1";
});
$("#camera_icon").click(function () {
console.log('Hai cliccato sulla camera');
viewer.scene.orientedImages[0].visible = !viewer.scene.orientedImages[0].visible;
viewer.scene.orientedImages[1].visible = !viewer.scene.orientedImages[1].visible;
viewer.scene.orientedImages[2].visible = !viewer.scene.orientedImages[2].visible;
});
</script>
</body>
</html>