Skip to content

Merge Dev to Main after Sprint 1 #27

Merged
merged 54 commits into from
Oct 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
5f45df7
feat(#9): add cesium globe
adriahso Sep 20, 2025
305ec8b
refactor(#9): restructure index.html for cleaner project setup
adriahso Sep 20, 2025
bd4c0cc
style(#9): clean up and format code
adriahso Sep 20, 2025
7372c13
feat(#10): :sparkles: coordinates possible to see on scene
kleinc Sep 22, 2025
f5ce5f5
feat(#5): :sparkles: Add menu sections for measurements
gautegf Sep 24, 2025
6f4ed05
fix(#5): :bug: better display of distance measurement
gautegf Sep 24, 2025
acd5f4b
refactor(#5): :recycle: move styling from index file to measurements …
gautegf Sep 24, 2025
251b333
feat(#9): limit zoom out
adriahso Sep 25, 2025
fefe11b
fix(#9): hide globe when camera is below surface
adriahso Sep 26, 2025
1b3a9d8
fix(#9): hide globe when pivot is blockd by curvature
adriahso Sep 27, 2025
5767ca1
style(#9): prettier formatting
adriahso Sep 27, 2025
07a8eff
feat(#7): :sparkles: Created "Evelation Control" section with belongi…
mariewah Sep 29, 2025
2f4ec32
refactor(#7): :truck: Moved paths for evelation control in index.html
mariewah Sep 29, 2025
60aedc0
refactor(#9): change background name from None to Globe
adriahso Sep 29, 2025
4c69a04
fix(#9): fix url and spelling mistake in config
adriahso Sep 29, 2025
c405e67
feat(#10): :sparkles: Made the text clearer, added a box for elevatio…
kleinc Sep 29, 2025
3d6ec5e
docs(#10): :memo: Added function documentation
kleinc Sep 29, 2025
2b66727
refactor(#7): :recycle: Updated code for consistensy in the sidebar s…
mariewah Sep 29, 2025
75c5b43
feat(#5): :sparkles: Display measurements in a sorted list, and move …
gautegf Oct 1, 2025
03e8495
style(#5): :art: ran format
gautegf Oct 1, 2025
5a328f8
refactor(#7): :fire: Remove link to css not in use
mariewah Oct 1, 2025
9861b48
Merge pull request #20 from TDT4290-group-4/7-elevation-range-control
mariewah Oct 1, 2025
37c660f
Merge branch 'dev' into 5-click-point-to-view-attribute-us6
gautegf Oct 1, 2025
d028b7e
refactor(#5): :recycle: Small cleanup
gautegf Oct 1, 2025
6644426
feat(#5): :sparkles: Moved some files, added some styling and features
gautegf Oct 1, 2025
d882dc2
refactor(#9): change coordinate system to EPSG:4978
adriahso Oct 4, 2025
5ae9409
Merge branch 'dev' into 9-coastline-overlay
adriahso Oct 4, 2025
b19d495
fix(#9): hide globe when directly above pivot
adriahso Oct 4, 2025
7a471e0
fix(#9): fix gradients for new coordinate system
adriahso Oct 4, 2025
1e7b214
refactor(#9): remove unnecessary code and add comments
adriahso Oct 4, 2025
c3bfa54
refactor(#9): change elevationControl handling
adriahso Oct 4, 2025
4f44bf3
style(#5): :lipstick: Move inline styling to the linked css file, and…
gautegf Oct 4, 2025
e1175ca
refactor(#5): :recycle: Made a helper function to reduce redundancy
gautegf Oct 4, 2025
e575fbf
fix(#5): :bug: fixed issues where the title for displayed data was no…
gautegf Oct 4, 2025
2b8f6b6
docs(#9): add some explanatory comments
adriahso Oct 5, 2025
66aa934
chore(#9): remove old potree background image
adriahso Oct 5, 2025
fd23c74
refactor(#10): Changed to new coordinate system, generalized code
kleinc Oct 5, 2025
22e2c24
fix(#5): :bug: Fix UI title displays and some style changes
gautegf Oct 5, 2025
3fd1d98
style(#5): :lipstick: Added a title above the tools
gautegf Oct 5, 2025
33c96be
ran format
gautegf Oct 5, 2025
cbe01f8
refactor(#10): moved init function to main
kleinc Oct 6, 2025
c32efa6
Merge pull request #22 from TDT4290-group-4/9-coastline-overlay
adriahso Oct 6, 2025
0b5b038
refactor(#10): Added more decimals to lat/lon and elevation target
kleinc Oct 6, 2025
9ed3eec
Merge branch 'dev' of git.ntnu.no:TDT4290-group-4/MolloyExplorer into…
kleinc Oct 6, 2025
74016ea
refactor(#10): Fix merge conflict and apply new changes
kleinc Oct 6, 2025
b24f3aa
refactor(#10): Refactored code according to comments
kleinc Oct 6, 2025
56fa67c
Merge pull request #23 from TDT4290-group-4/10-show-coordinates-on-sc…
kleinc Oct 6, 2025
7bc12dd
fix(#5): :bug: Rounded coordinates to one decimal so that they are di…
gautegf Oct 6, 2025
7f6d2a8
ran format
gautegf Oct 6, 2025
985abe1
Merge branch 'dev' into 5-click-point-to-view-attribute-us6
gautegf Oct 6, 2025
5fb1a1f
refactor(#5): :recycle: fix some confilcts with dev
gautegf Oct 6, 2025
f04fabb
ran format
gautegf Oct 6, 2025
7af1807
refactor(#5): :recycle: Small cleanup
gautegf Oct 6, 2025
8d36734
Merge pull request #21 from TDT4290-group-4/5-click-point-to-view-att…
gautegf Oct 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Molloy Explorer is a 3D seabed visualization tool built with **Potree**. It allo

### Add point cloud data

Place the point cloud data (in Potree format) in `public/pointclouds/data_converted`.
Place the point cloud data (in Potree format with EPSG:4978 coordinates) in `public/pointclouds/data_converted`.

**Note:** Point cloud files should not be committed to Git.

Expand Down
75 changes: 33 additions & 42 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,21 @@
type="text/css"
href="/libs/jstree/themes/mixed/style.css"
/>
<link rel="stylesheet" type="text/css" href="src/style.css" />
<link
rel="stylesheet"
type="text/css"
href="src/coordinateShowing/coordinateShowing.css"
/>
<link
rel="stylesheet"
type="text/css"
href="/libs/Cesium/Widgets/CesiumWidget/CesiumWidget.css"
/>
<link
rel="stylesheet"
href="/src/MeasurementControl/measurementsPanel.css"
/>
</head>

<body>
Expand All @@ -39,54 +54,30 @@
<script src="/build/potree/potree.js"></script>
<script src="/libs/plasio/js/laslaz.js"></script>
<script src="/libs/three.js/build/three.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.7.6/proj4.js"></script>
<script src="/libs/Cesium/Cesium.js"></script>

<div
class="potree_container"
style="position: absolute; width: 100%; height: 100%; left: 0px; top: 0px"
style="
position: absolute;
width: 100%;
height: 100%;
left: 0px;
top: 0px;
background-color: black;
"
>
<div
id="potree_render_area"
style="
background-image: url('/build/potree/resources/images/background.jpg');
"
></div>
<div id="potree_render_area">
<div id="cesiumContainer"></div>
<div id="canvasContainer">
<canvas id="elevationCanvas" width="200" height="30"></canvas>
<canvas id="posCanvas" width="200" height="30"></canvas>
</div>
</div>
<div id="potree_sidebar_container"></div>
</div>

<script type="module">
window.viewer = new Potree.Viewer(
document.getElementById('potree_render_area')
)

viewer.setEDLEnabled(true)
viewer.setFOV(60)
viewer.setPointBudget(5_000_000)
viewer.loadSettingsFromURL()

viewer.setDescription('Molloy Explorer')

viewer.loadGUI(() => {
viewer.setLanguage('en')
$('#menu_appearance').next().show()
$('#menu_tools').next().show()
$('#menu_scene').next().show()
$('#menu_filters').next().show()
viewer.toggleSidebar()
})

let url = './pointclouds/data_converted/metadata.json'
Potree.loadPointCloud(url).then((e) => {
let pointcloud = e.pointcloud
let material = pointcloud.material

material.pointSizeType = Potree.PointSizeType.ADAPTIVE
material.shape = Potree.PointShape.CIRCLE
material.activeAttributeName = 'elevation'
material.gradient = Potree.Gradients['RAINBOW']

viewer.scene.addPointCloud(pointcloud)
viewer.fitToScreen()
})
</script>
<script type="module" src="src/main.js"></script>
</body>
</html>
113 changes: 113 additions & 0 deletions src/ElevationControl/elevationControl.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
//Cerating a customized section "Elevation Control"
window.createElevationPanel = function createElevationPanel(viewer) {
const container = document.getElementById('elevation_list')
let targetContainer = container
if (!targetContainer) {
// Create a new accordion section for Elevation Control
const menu = document.getElementById('potree_menu')
if (menu) {
const header = document.createElement('h3')
header.id = 'menu_elevation'
header.innerHTML = '<span>Elevation Control</span>'
const panel = document.createElement('div')
panel.className = 'pv-menu-list'
panel.innerHTML = '<div id="elevation_list" class="auto"></div>'
const about = document.getElementById('menu_appearance')
if (about) {
menu.insertBefore(panel, about)
menu.insertBefore(header, panel)
} else {
menu.appendChild(header)
menu.appendChild(panel)
}
// Activate accordion behavior if jQuery UI accordion already initialized
if ($(menu).accordion) {
try {
$(menu).accordion('refresh')
} catch (e) {}
}
// Toggle on header click if not managed by accordion refresh
header.addEventListener(
'click',
() =>
(panel.style.display = panel.style.display === 'none' ? '' : 'none')
)
targetContainer = panel.querySelector('#elevation_list')
}
}
}

//Select the fist pointcloud in the sidebar so that the Elevation section is built
function autoSelectFirstPointCloud() {
const cloudIcon = document.querySelector(
'#scene_objects i.jstree-themeicon-custom'
)
if (cloudIcon) {
cloudIcon.dispatchEvent(new MouseEvent('click', { bubbles: true }))
return true
}
return false
}

//(re)connect the elevation labels to the slider after the container is moved (was not handled by default)
function rebindElevationLabel() {
const slider = window.jQuery ? window.jQuery('#sldHeightRange') : null
const label = document.getElementById('lblHeightRange')
if (!slider || !slider.length || !label) return

const update = () => {
const low = slider.slider('values', 0)
const high = slider.slider('values', 1)
label.textContent = `${low.toFixed(2)} to ${high.toFixed(2)}`
}

// Adjust slider limits
slider.slider({
min: -10000,
max: 0,
values: [-10000, 0]
})

//clear any old namespaced handlers and attach fresh ones
slider.off('slide.custom slidestop.custom change.custom')
slider.on('slide.custom', update)
slider.on('slidestop.custom change.custom', update)
update()
}

//Move the elevation range section to the customised "Elevation Control" section
function moveElevationContainer() {
const target = document.getElementById('elevation_list')
const elevationContainer = document.querySelector(
'#materials\\.elevation_container'
)
if (!elevationContainer) return false
target.appendChild(elevationContainer)
rebindElevationLabel()
return true
}

//initiate and orchestrate all funcitons to render the Evelation control section of the sidebar propperly
export function initElevationControls(viewer) {
//Creates the section
createElevationPanel(viewer)

//Only move the ElevationContainer if the source container to exist
const menu =
document.getElementById('potree_menu') ||
document.getElementById('menu') ||
document.body
const observer = new MutationObserver(() => {
const found = document.querySelector('#materials\\.elevation_container')
if (found) {
observer.disconnect()
//Move and rebind once it exists
const ok = moveElevationContainer()
if (!ok) console.warn('[Elevation] moveElevationContainer failed')
}
})
observer.observe(menu, { childList: true, subtree: true })

//Trigger Potree to build Materials UI by selecting the first point cloud (if nothing selected yet)
autoSelectFirstPointCloud()
}
Loading