Files
dwg-dxf-viewer-sample/src/ui/progress.ts
T
kimminsungandClaude Opus 4.8 a71790070d feat: multi-format 3D viewer with large-file OBJ streaming, Z-up, projection/outline UI
Three.js viewer supporting glb/gltf/obj/fbx/dae/ifc/ply via both server (SSR)
and drag&drop (CSR) paths.

- Streaming OBJ parser (src/viewer/objStream.ts) for files past the V8 max
  string length (>~1GB text) that OBJLoader can't handle; indexed geometry,
  per-vertex color from MTL Kd, float64 recenter baked in.
- In-viewer float64 recenter (objRecenter.ts) for huge CAD/survey coordinates
  (~1e8) so float32 vertex buffers keep precision (no cracked faces).
- Z-up right-handed world; Y-up formats rotated on load.
- OBJ+MTL+texture drag&drop (LoadingManager URL-modifier maps dropped images).
- OrbitControls ground-plane panning (road/rail alignment workflow).
- UI: Zoom Fit, perspective/orthographic toggle, feature-edge outline.
- DoubleSide for CAD OBJ; PLY mesh + point-cloud support.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 13:54:46 +09:00

39 lines
1.2 KiB
TypeScript

/**
* Minimal progress-bar helper for the load lifecycle.
*
* The #progress container holds a single inner .bar element whose width is
* driven as a percentage. show/hide just toggle the `hidden` class so CSS
* controls visibility (see src/style.css). Kept dependency-free so both the
* dropzone wiring and ThreeDViewer.loadServerAsset can use it.
*/
/**
* Reveal the progress container by removing the `hidden` class.
* `el` is the #progress element.
*/
export function showProgress(el: HTMLElement): void {
el.classList.remove("hidden");
}
/**
* Hide the progress container by adding the `hidden` class.
*/
export function hideProgress(el: HTMLElement): void {
el.classList.add("hidden");
}
/**
* Set the inner `.bar` width to `percent` (clamped to 0..100).
* `el` is the #progress element; its first `.bar` descendant is resized.
*/
export function setProgress(el: HTMLElement, percent: number): void {
const clamped = Math.max(0, Math.min(100, percent));
const bar = el.querySelector<HTMLElement>(".bar");
if (bar) bar.style.width = `${clamped}%`;
}
/** Write a user-facing status/error message into the #status element. */
export function setStatus(el: HTMLElement, msg: string): void {
el.textContent = msg;
}