MCPcopy Create free account
hub / github.com/chrxh/alien / onCenterLocation

Method onCenterLocation

source/Gui/SimulationParametersMainWindow.cpp:706–719  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

704}
705
706void SimulationParametersMainWindow::onCenterLocation(int locationIndex)
707{
708 auto parameters = _simulationFacade->getSimulationParameters();
709 auto location = LocationHelper::findLocation(parameters, locationIndex);
710 RealVector2D pos;
711 if (std::holds_alternative<SimulationParametersZone*>(location)) {
712 auto zone = std::get<SimulationParametersZone*>(location);
713 pos = {zone->posX, zone->posY};
714 } else {
715 auto source = std::get<RadiationSource*>(location);
716 pos = {source->posX, source->posY};
717 }
718 Viewport::get().setCenterInWorldPos(pos);
719}
720
721void SimulationParametersMainWindow::updateLocations()
722{

Callers

nothing calls this directly

Calls 2

setCenterInWorldPosMethod · 0.80

Tested by

no test coverage detected