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

Method setRoot

radiantcore/scenegraph/SceneGraph.cpp:72–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70}
71
72void SceneGraph::setRoot(const IMapRootNodePtr& newRoot)
73{
74 if (_root == newRoot)
75 {
76 return;
77 }
78
79 _undoEventHandler.disconnect();
80
81 if (_root)
82 {
83 // "Uninstantiate" the whole scene
84 UninstanceSubgraphWalker walker(*this);
85 _root->traverse(walker);
86 }
87
88 _root = newRoot;
89
90 // Refresh the space partition class
91 _spacePartition = std::make_shared<Octree>();
92
93 if (_root)
94 {
95 // New root not NULL, "instantiate" the whole scene
96 GraphPtr self = shared_from_this();
97 InstanceSubgraphWalker instanceWalker(self);
98 _root->traverse(instanceWalker);
99
100 _undoEventHandler = _root->getUndoSystem().signal_undoEvent().connect(
101 sigc::mem_fun(this, &SceneGraph::onUndoEvent)
102 );
103 }
104}
105
106void SceneGraph::onUndoEvent(IUndoSystem::EventType type, const std::string& operationName)
107{

Callers 8

setupSceneGraphMethod · 0.80
setupSceneGraphMethod · 0.80
setRootNodeMethod · 0.80
TEST_FFunction · 0.80
setupSceneGraphMethod · 0.80
setupSceneGraphMethod · 0.80
freeMapMethod · 0.80

Calls 3

disconnectMethod · 0.45
traverseMethod · 0.45
connectMethod · 0.45

Tested by

no test coverage detected