Skip to content

Commit

Permalink
refactor(#48): 🚚 Updated elevation and acepted code to be more descri…
Browse files Browse the repository at this point in the history
…ptic
  • Loading branch information
mariewah committed Oct 30, 2025
1 parent a3c4875 commit a016ed7
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 45 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
href="/src/MeasurementControl/measurementsPanel.css"
/>
<link rel="stylesheet" href="/src/AnnotationControl/annotationPanel.css" />
<link rel="stylesheet" href="src/AcceptedFiltering/threePanels.css" />
<link rel="stylesheet" href="src/Filter/filter.css" />
</head>

<body>
Expand Down
48 changes: 11 additions & 37 deletions src/AcceptedFiltering/threePanels.css → src/Filter/filter.css
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
/* ---------- Buttons (shared look) ---------- */
/* Reuse your accepted button style for all four */
#btnDoElevationControl,
#doAcceptedFiltering,
#btnTHU,
#btnTVU,
#btnTHUFilter {
#doAcceptedFiltering {
display: flex;
width: 100%;
margin: 6px 0 10px;
Expand All @@ -22,55 +19,34 @@
}

#btnDoElevationControl:hover,
#doAcceptedFiltering:hover,
#btnTHU:hover,
#btnTVU:hover,
#btnTHUFilter:hover {
#doAcceptedFiltering:hover {
background-color: #8f8f8f;
}

#btnDoElevationControl:active,
#doAcceptedFiltering:active,
#btnTHU:active,
#btnTVU:active,
#btnTHUFilter:active {
#doAcceptedFiltering:active {
transform: scale(0.97);
background-color: #a8a6a6;
}

/* Optional: “active mode” outline if you toggle a class via JS */
#btnDoElevationControl.active,
#doAcceptedFiltering.active,
#btnTHU.active,
#btnTVU.active,
#btnTHUFilter:active {
#doAcceptedFiltering.active{
outline: 2px solid #7ba8ff;
outline-offset: 1px;
}

/* THU/TVU side-by-side */
#thu_tvu_list .thu-tvu-row {
display: flex;
gap: 6px;
}
#thu_tvu_list .thu-tvu-row > button {
flex: 1 1 50%;
margin: 0;
}

/* ---------- Panels / moved containers ---------- */
/* Keep Potree’s moved subtrees neat and full-width inside our panels */
#elevation2_list [id='materials.elevation_container'],
#thu_tvu_list [id='materials.extra_container'] {
#elevation_list [id='materials.elevation_container']{
width: 100%;
box-sizing: border-box;
padding: 6px 8px; /* small breathing room since we moved it out of Appearance */
}

/* Slight spacing inside our panel lists (under the button) */
#elevation2_list,
#accepted_list_host,
#thu_tvu_list {
#elevation_list,
#accepted_list_host{
display: block;
padding: 4px 0;
}
Expand Down Expand Up @@ -101,16 +77,14 @@

/* ---------- Accordions / headers (light touch) ---------- */
/* Don’t fight jQuery-UI’s theme. Just small spacing adjustments. */
#menu_elevation2 + .pv-menu-list,
#menu_accepted + .pv-menu-list,
#menu_thu_tvu + .pv-menu-list {
#menu_elevation + .pv-menu-list,
#menu_accepted + .pv-menu-list{
padding-top: 6px;
}

/* Optional: header label color alignment with dark UI */
#menu_elevation2 span,
#menu_accepted span,
#menu_thu_tvu span {
#menu_elevation span,
#menu_accepted span {
color: #e6e6e6;
font-weight: 600;
letter-spacing: 0.2px;
Expand Down
13 changes: 8 additions & 5 deletions src/AcceptedFiltering/threePanels.js → src/Filter/filter.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
// Three Potree sidebar sections with buttons + panel bodies:
// • Elevation → moves #materials.elevation_container into our Elevation body
// • Accepted → custom UI fully defined here (no external module)

/** Two Potree sidebar sections with buttons + panel bodies:
*
* • Elevation → moves #materials.elevation_container into our Elevation body
* Used for controlling the elevation gradient with a slider and altering between different gradient schemes
* • Accepted → custom UI fully defined here (no external module)
* Used for indicating which points/surveys are accepted as the seabed and which are not
*/
const byId = (id) => document.getElementById(id)

/**
Expand Down Expand Up @@ -427,7 +430,7 @@ function attachSelfHealing(activeGetter, hooks) {
* @param {object} viewer Potree viewer (not used directly here but available to hooks)
* @param {{onActivateElevation?:Function, onActivateAccepted?:Function, selectCloudOnce?:Function, onElevationRangeChange?:Function}} hooks
*/
export function initThreePanels(viewer, hooks = {}) {
export function initFilterPanels(viewer, hooks = {}) {
// Build sections
initElevationControls(hooks)
initAcceptedControlsInline(hooks)
Expand Down
4 changes: 2 additions & 2 deletions src/potreeViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { initMiniMap } from './MiniMap/miniMap.js'
import {
initThreePanels,
toggleAcceptedLegend
} from './AcceptedFiltering/threePanels.js'
} from './Filter/filter.js'
import { ecef } from './config.js'

/**
Expand Down Expand Up @@ -90,7 +90,7 @@ export async function createPotreeViewer(
})
}

initThreePanels(viewer, {
initFilterPanels(viewer, {
onActivateElevation: () => {
const $ = window.jQuery || window.$
const slider = $ ? $('#sldHeightRange') : null
Expand Down

0 comments on commit a016ed7

Please sign in to comment.