Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#6107: Associate a LayerManager instance with a scene (root) node at …
…construction time This removes the (wrong) direct reference the GlobalSceneGraph to update the nodes
- Loading branch information
1 parent
89c334b
commit 102b2c7
Showing
11 changed files
with
43 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
#include "Traverse.h" | ||
|
||
#include "iscenegraph.h" | ||
#include "scenelib.h" | ||
#include "ibrush.h" | ||
#include "ipatch.h" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,44 @@ | ||
#ifndef REMOVEFROMLAYERWALKER_H_ | ||
#define REMOVEFROMLAYERWALKER_H_ | ||
#pragma once | ||
|
||
#include "ilayer.h" | ||
|
||
namespace scene { | ||
namespace scene | ||
{ | ||
|
||
class RemoveFromLayerWalker : | ||
public selection::SelectionSystem::Visitor, | ||
public NodeVisitor | ||
public NodeVisitor | ||
{ | ||
private: | ||
int _layer; | ||
|
||
public: | ||
/** | ||
* Pass the ID of the layer the items should be removed from. | ||
* Pass the ID of the layer the nodes should be removed from | ||
*/ | ||
RemoveFromLayerWalker(int layer) : | ||
_layer(layer) | ||
{} | ||
|
||
// SelectionSystem::Visitor | ||
void visit(const INodePtr& node) const { | ||
void visit(const INodePtr& node) const override | ||
{ | ||
// Remove the node from this layer | ||
node->removeFromLayer(_layer); | ||
|
||
if (Node_isEntity(node)) { | ||
if (Node_isEntity(node)) | ||
{ | ||
// We have an entity, traverse all children too | ||
node->traverseChildren(const_cast<RemoveFromLayerWalker&>(*this)); | ||
} | ||
} | ||
|
||
// scene::NodeVisitor | ||
bool pre(const INodePtr& node) { | ||
bool pre(const INodePtr& node) override | ||
{ | ||
node->removeFromLayer(_layer); | ||
return true; | ||
} | ||
}; | ||
|
||
} // namespace scene | ||
|
||
#endif /* REMOVEFROMLAYERWALKER_H_ */ | ||
} // namespace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters