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

Method setDefaultShapeDataForZone

source/Gui/SimulationParametersMainWindow.cpp:743–754  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

741}
742
743void SimulationParametersMainWindow::setDefaultShapeDataForZone(SimulationParametersZone& spot) const
744{
745 auto worldSize = _simulationFacade->getWorldSize();
746
747 auto maxRadius = toFloat(std::min(worldSize.x, worldSize.y)) / 2;
748 if (spot.shapeType == SpotShapeType_Circular) {
749 spot.shapeData.circularSpot.coreRadius = maxRadius / 3;
750 } else {
751 spot.shapeData.rectangularSpot.height = maxRadius / 3;
752 spot.shapeData.rectangularSpot.width = maxRadius / 3;
753 }
754}
755
756void SimulationParametersMainWindow::correctLayout(float origMasterHeight, float origExpertWidgetHeight)
757{

Callers

nothing calls this directly

Calls 2

toFloatFunction · 0.85
getWorldSizeMethod · 0.80

Tested by

no test coverage detected