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

Function importMap

radiantcore/map/algorithm/Import.cpp:232–257  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230};
231
232void importMap(const scene::INodePtr& node)
233{
234 if (!GlobalSceneGraph().root())
235 {
236 rError() << "Cannot merge map, no scenegraph root present." << std::endl;
237 return;
238 }
239
240 // Discard all layer information found in the data to be merged
241 // We move everything into the active layer
242 {
243 scene::LayerList layers;
244 layers.insert(GlobalSceneGraph().root()->getLayerManager().getActiveLayer());
245
246 scene::AssignNodeToLayersWalker walker(layers);
247 node->traverse(walker);
248 }
249
250 // Rewrite the incoming group IDs to not be in conflict with the target scene
251 SelectionGroupRemapper remapper(GlobalSceneGraph().root()->getSelectionGroupManager());
252 node->traverseChildren(remapper);
253
254 // Now move everything into the target map
255 EntityMerger merger(GlobalSceneGraph().root());
256 node->traverseChildren(merger);
257}
258
259void prepareNamesForImport(const scene::IMapRootNodePtr& targetRoot, const scene::INodePtr& foreignRoot)
260{

Callers 2

importMethod · 0.85
importFromStreamFunction · 0.85

Calls 6

rErrorFunction · 0.85
rootMethod · 0.45
insertMethod · 0.45
getActiveLayerMethod · 0.45
traverseMethod · 0.45
traverseChildrenMethod · 0.45

Tested by

no test coverage detected