mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 15:33:10 +02:00
added removeChildAtIndex() which removes a node, but doesn't delete it
This commit is contained in:
parent
17b137cc53
commit
e0d040a73b
2 changed files with 10 additions and 0 deletions
|
@ -89,6 +89,15 @@ void VoxelNode::deleteChildAtIndex(int childIndex) {
|
|||
}
|
||||
}
|
||||
|
||||
// does not delete the node!
|
||||
VoxelNode* VoxelNode::removeChildAtIndex(int childIndex) {
|
||||
VoxelNode* returnedChild = _children[childIndex];
|
||||
if (_children[childIndex]) {
|
||||
_children[childIndex] = NULL;
|
||||
}
|
||||
return returnedChild;
|
||||
}
|
||||
|
||||
void VoxelNode::addChildAtIndex(int childIndex) {
|
||||
if (!_children[childIndex]) {
|
||||
_children[childIndex] = new VoxelNode(childOctalCode(_octalCode, childIndex));
|
||||
|
|
|
@ -43,6 +43,7 @@ public:
|
|||
unsigned char* getOctalCode() const { return _octalCode; };
|
||||
VoxelNode* getChildAtIndex(int i) const { return _children[i]; };
|
||||
void deleteChildAtIndex(int childIndex);
|
||||
VoxelNode* removeChildAtIndex(int childIndex);
|
||||
void addChildAtIndex(int childIndex);
|
||||
void setColorFromAverageOfChildren();
|
||||
void setRandomColor(int minimumBrightness);
|
||||
|
|
Loading…
Reference in a new issue