fix deletion of point cloud
This commit is contained in:
@@ -79578,6 +79578,10 @@ ENDSEC
|
|||||||
tree.jstree('uncheck_node', node);
|
tree.jstree('uncheck_node', node);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
pointcloud.addEventListener("remove", () => {
|
||||||
|
const nodeObj = tree.jstree(true).get_node(node);
|
||||||
|
tree.jstree(true).delete_node(nodeObj);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
let onMeasurementAdded = (e) => {
|
let onMeasurementAdded = (e) => {
|
||||||
|
|||||||
@@ -88,10 +88,25 @@
|
|||||||
loadByPc(pointClouds[i])
|
loadByPc(pointClouds[i])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let notFound = [...loadedPointClouds.filter(pc => pointClouds.find(ipc => ipc.id === pc.id) === null)];
|
|
||||||
for (let entry in notFound) {
|
for (let entry in loadedPointClouds) {
|
||||||
// entry.pointCloud
|
if (pointClouds.find(ipc => ipc.id === loadedPointClouds[entry].id))
|
||||||
//TODO: Remove from Potree
|
continue;
|
||||||
|
|
||||||
|
const index = viewer.scene.pointclouds.indexOf(loadedPointClouds[entry].pointCloud);
|
||||||
|
if (index > -1) {
|
||||||
|
window.viewer.scene.pointclouds.forEach(function (layer) {
|
||||||
|
if (layer === loadedPointClouds[entry].pointCloud)
|
||||||
|
window.viewer.scene.scenePointCloud.remove(layer);
|
||||||
|
});
|
||||||
|
viewer.scene.pointclouds.splice(index, 1);
|
||||||
|
|
||||||
|
loadedPointClouds[entry].pointCloud.dispatchEvent({
|
||||||
|
type: "remove"
|
||||||
|
});
|
||||||
|
|
||||||
|
loadedPointClouds.splice(entry, 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user