MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / startMergeOperation

Method startMergeOperation

radiantcore/map/Map.cpp:1334–1380  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1332}
1333
1334void Map::startMergeOperation(const std::string& sourceMap)
1335{
1336 if (!os::fileOrDirExists(sourceMap))
1337 {
1338 throw cmd::ExecutionFailure(fmt::format(_("File doesn't exist: {0}"), sourceMap));
1339 }
1340
1341 prepareMergeOperation();
1342
1343 auto sourceMapResource = GlobalMapResourceManager().createFromPath(sourceMap);
1344
1345 try
1346 {
1347 if (sourceMapResource->load())
1348 {
1349 assignRenderSystem(sourceMapResource->getRootNode());
1350
1351 // Compare the scenes and get the report
1352 auto result = scene::merge::GraphComparer::Compare(sourceMapResource->getRootNode(), getRoot());
1353
1354 // Create the merge actions
1355 _mergeOperation = scene::merge::MergeOperation::CreateFromComparisonResult(*result);
1356
1357 if (_mergeOperation->hasActions())
1358 {
1359 // Create renderable merge actions
1360 createMergeActions();
1361
1362 // Switch to merge mode
1363 setEditMode(EditMode::Merge);
1364
1365 emitMapEvent(IMap::MapMergeOperationStarted);
1366 }
1367 else
1368 {
1369 radiant::NotificationMessage::SendInformation(_("The Merge Operation turns out to be empty, nothing to do."));
1370 }
1371
1372 // Dispose of the resource, we don't need it anymore
1373 sourceMapResource->clear();
1374 }
1375 }
1376 catch (const IMapResource::OperationException& ex)
1377 {
1378 radiant::NotificationMessage::SendError(ex.what());
1379 }
1380}
1381
1382void Map::startMergeOperation(const std::string& sourceMap, const std::string& baseMap)
1383{

Callers 3

onLoadAndCompareMethod · 0.80
TEST_FFunction · 0.80
syncWithRemoteFunction · 0.80

Calls 10

fileOrDirExistsFunction · 0.85
ExecutionFailureClass · 0.85
createFromPathMethod · 0.80
hasActionsMethod · 0.80
whatMethod · 0.80
formatFunction · 0.50
_Function · 0.50
loadMethod · 0.45
getRootNodeMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected