mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-04 10:40:09 -06:00
Enable iteration over ChunkNodes, not just Chunks
This commit is contained in:
@@ -98,8 +98,8 @@ bool ChunkNode::updateChunkTree(const RenderData& data) {
|
||||
}
|
||||
}
|
||||
|
||||
void ChunkNode::depthFirst(const std::function<void(const Chunk&)>& f) const {
|
||||
f(_chunk);
|
||||
void ChunkNode::depthFirst(const std::function<void(const ChunkNode&)>& f) const {
|
||||
f(*this);
|
||||
if (!isLeaf()) {
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
_children[i]->depthFirst(f);
|
||||
@@ -182,6 +182,10 @@ const ChunkNode& ChunkNode::getChild(Quad quad) const {
|
||||
return *_children[quad];
|
||||
}
|
||||
|
||||
const Chunk& ChunkNode::getChunk() const {
|
||||
return _chunk;
|
||||
}
|
||||
|
||||
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
@@ -62,13 +62,12 @@ public:
|
||||
bool isRoot() const;
|
||||
bool isLeaf() const;
|
||||
|
||||
void depthFirst(const std::function<void(const Chunk&)>& f) const;
|
||||
|
||||
void depthFirst(const std::function<void(const ChunkNode&)>& f) const;
|
||||
|
||||
const ChunkNode& getChild(Quad quad) const;
|
||||
const Chunk& getChunk() const;
|
||||
|
||||
void renderDepthFirst(const RenderData& data);
|
||||
|
||||
void renderReversedBreadthFirst(const RenderData& data);
|
||||
void renderThisChunk(const RenderData& data);
|
||||
bool updateChunkTree(const RenderData& data);
|
||||
|
||||
Reference in New Issue
Block a user