From ff994e705dc1fed52e5cbe4a79848531bfe8994b Mon Sep 17 00:00:00 2001 From: CODEX Date: Fri, 5 Jun 2026 00:03:31 +0300 Subject: [PATCH] beam: avoid point cloud highlight masking --- frontend/dcViewer.js | 6 +++++- frontend/index.html | 2 +- frontend/transformGizmo.js | 17 ++++++++++++++--- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/frontend/dcViewer.js b/frontend/dcViewer.js index 6a2616d..d211054 100644 --- a/frontend/dcViewer.js +++ b/frontend/dcViewer.js @@ -441,6 +441,8 @@ const getBaseEdgesForModel = (modelId) => { return !!toggleEdges?.checked; }; +const isPointCloudModel = (modelId) => modelTypes[modelId] === "las"; + const applyDisplayModeToModel = (modelId) => { const model = sceneModels[modelId] || viewer?.scene?.models?.[modelId]; if (!model) return; @@ -1323,7 +1325,9 @@ const setSelection = (ids, modelId) => { }; activeTransformTarget = { modelId, objectId: uniqueIds[0] || "__model__" }; scene.setObjectsHighlighted(scene.highlightedObjectIds || [], false); - scene.setObjectsHighlighted(uniqueIds, true); + if (!isPointCloudModel(modelId)) { + scene.setObjectsHighlighted(uniqueIds, true); + } updateTransformInputs(transform); // Global center for group updateGlobalInputs(centerFromAABB(aabb)); diff --git a/frontend/index.html b/frontend/index.html index 8f58365..8c77143 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -239,6 +239,6 @@ - + diff --git a/frontend/transformGizmo.js b/frontend/transformGizmo.js index b16fb96..cff174c 100644 --- a/frontend/transformGizmo.js +++ b/frontend/transformGizmo.js @@ -18,6 +18,13 @@ export class TransformGizmo { this._bindTree(); } + _isPointCloudTarget(model, objectId = null) { + const entity = objectId ? this.scene.objects[objectId] : null; + const firstObject = entity || Object.values(model?.objects || {})[0]; + const firstMesh = firstObject?.meshes?.[0] || model?.meshes?.[0]; + return firstMesh?._geometry?._state?.primitiveName === "points"; + } + setMode(next) { if (!["translate", "rotate", "scale"].includes(next)) return; this.mode = next; @@ -66,7 +73,9 @@ export class TransformGizmo { scale: model.scale ? [...model.scale] : [1, 1, 1], }, }); - this.scene.setObjectsHighlighted([objectId], true); + if (!this._isPointCloudTarget(model, objectId)) { + this.scene.setObjectsHighlighted([objectId], true); + } this.target = { modelId, objectId }; return; } @@ -74,7 +83,7 @@ export class TransformGizmo { // Если objectId нет, работаем всей моделью const ids = Object.keys(model.objects || {}); - if (ids.length) { + if (ids.length && !this._isPointCloudTarget(model)) { this.scene.setObjectsHighlighted(ids, true); } this.onTargetChange?.({ @@ -101,7 +110,9 @@ export class TransformGizmo { if (model) { const ids = Object.keys(model.objects || {}); this.scene.setObjectsHighlighted(this.scene.highlightedObjectIds || [], false); - this.scene.setObjectsHighlighted(ids, true); + if (!this._isPointCloudTarget(model)) { + this.scene.setObjectsHighlighted(ids, true); + } this.target = { modelId, objectId: null }; } }