| 191 | } |
| 192 | |
| 193 | void EditorController::processInspectorWindows() |
| 194 | { |
| 195 | //process inspector windows |
| 196 | for (auto const& inspectorWindow : _inspectorWindows) { |
| 197 | inspectorWindow->process(); |
| 198 | } |
| 199 | |
| 200 | //inspector windows closed? |
| 201 | std::vector<InspectorWindow> inspectorWindows; |
| 202 | std::vector<CellOrParticleDescription> inspectedEntities; |
| 203 | for (auto const& inspectorWindow : _inspectorWindows) { |
| 204 | if (!inspectorWindow->isClosed()) { |
| 205 | inspectorWindows.emplace_back(inspectorWindow); |
| 206 | |
| 207 | auto id = inspectorWindow->getId(); |
| 208 | inspectedEntities.emplace_back(EditorModel::get().getInspectedEntity(id)); |
| 209 | } |
| 210 | } |
| 211 | _inspectorWindows = inspectorWindows; |
| 212 | EditorModel::get().setInspectedEntities(inspectedEntities); |
| 213 | |
| 214 | //update inspected entities from simulation |
| 215 | if (inspectedEntities.empty()) { |
| 216 | return; |
| 217 | } |
| 218 | std::vector<uint64_t> entityIds; |
| 219 | for (auto const& entity : inspectedEntities) { |
| 220 | entityIds.emplace_back(DescriptionEditService::get().getId(entity)); |
| 221 | } |
| 222 | auto inspectedData = _simulationFacade->getInspectedSimulationData(entityIds); |
| 223 | auto newInspectedEntities = DescriptionEditService::get().getObjects(inspectedData); |
| 224 | EditorModel::get().setInspectedEntities(newInspectedEntities); |
| 225 | |
| 226 | inspectorWindows.clear(); |
| 227 | for (auto const& inspectorWindow : _inspectorWindows) { |
| 228 | if (EditorModel::get().existsInspectedEntity(inspectorWindow->getId())) { |
| 229 | inspectorWindows.emplace_back(inspectorWindow); |
| 230 | } |
| 231 | } |
| 232 | _inspectorWindows = inspectorWindows; |
| 233 | } |
| 234 | |
| 235 | void EditorController::onSelectObjects(RealVector2D const& viewPos, bool modifierKeyPressed) |
| 236 | { |
nothing calls this directly
no test coverage detected