From 5241c4f2734905fff1b4f0e001e13b7a1a39130d Mon Sep 17 00:00:00 2001 From: Florian Kotthoff <74312290+FlorianK13@users.noreply.github.com> Date: Fri, 18 Oct 2024 15:42:47 +0200 Subject: [PATCH] Move SelectedMesh to Scene #332 --- src/components/ThreeViewer/Scene.jsx | 4 ++-- src/pages/Simulation.jsx | 5 +---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/components/ThreeViewer/Scene.jsx b/src/components/ThreeViewer/Scene.jsx index 9399f5a..290d530 100644 --- a/src/components/ThreeViewer/Scene.jsx +++ b/src/components/ThreeViewer/Scene.jsx @@ -19,8 +19,6 @@ const Scene = ({ geometries, simulationMeshes, setSimulationMeshes, - selectedMesh, - setSelectedMesh, selectedPVSystem, setSelectedPVSystem, vegetationGeometries, @@ -32,6 +30,8 @@ const Scene = ({ const [pvSystems, setPVSystems] = useState([]) // pvPoints are the red points that appear when drawing PV systems const [pvPoints, setPVPoints] = useState([]) + // highlighted meshes for resimulation + const [selectedMesh, setSelectedMesh] = useState([]) window.setPVPoints = setPVPoints const position = [ diff --git a/src/pages/Simulation.jsx b/src/pages/Simulation.jsx index ee23fea..597421f 100644 --- a/src/pages/Simulation.jsx +++ b/src/pages/Simulation.jsx @@ -26,8 +26,7 @@ function Index() { surrounding: [], background: [], }) - // highlighted meshes for resimulation - const [selectedMesh, setSelectedMesh] = useState([]) + // highlighted PVSystems for deletion or calculation const [selectedPVSystem, setSelectedPVSystem] = useState([]) // meshes that were simulated @@ -64,8 +63,6 @@ function Index() { geometries={geometries} simulationMeshes={simulationMeshes} setSimulationMeshes={setSimulationMeshes} - selectedMesh={selectedMesh} - setSelectedMesh={setSelectedMesh} selectedPVSystem={selectedPVSystem} setSelectedPVSystem={setSelectedPVSystem} vegetationGeometries={vegetationGeometries}