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

Method generateSourceName

source/Gui/LocationHelper.cpp:136–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

134}
135
136std::string LocationHelper::generateSourceName(SimulationParameters& parameters)
137{
138 int counter = 0;
139 bool alreadyUsed;
140 std::string result;
141 do {
142 alreadyUsed = false;
143 result = "Radiation " + std::to_string(++counter);
144 for (int i = 0; i < parameters.numRadiationSources; ++i) {
145 auto name = std::string(parameters.radiationSource[i].name);
146 if (result == name) {
147 alreadyUsed = true;
148 break;
149 }
150 }
151 } while (alreadyUsed);
152
153 return result;
154}

Callers

nothing calls this directly

Calls 1

to_stringFunction · 0.85

Tested by

no test coverage detected