fix deletion of point cloud
This commit is contained in:
@@ -79578,6 +79578,10 @@ ENDSEC
|
||||
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) => {
|
||||
|
||||
@@ -88,10 +88,25 @@
|
||||
loadByPc(pointClouds[i])
|
||||
}
|
||||
}
|
||||
let notFound = [...loadedPointClouds.filter(pc => pointClouds.find(ipc => ipc.id === pc.id) === null)];
|
||||
for (let entry in notFound) {
|
||||
// entry.pointCloud
|
||||
//TODO: Remove from Potree
|
||||
|
||||
for (let entry in loadedPointClouds) {
|
||||
if (pointClouds.find(ipc => ipc.id === loadedPointClouds[entry].id))
|
||||
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