First operational version of AppearanceView. Cleanup of symbols for

sources and other bugfix.
This commit is contained in:
brunoherbelin
2020-11-15 23:49:56 +01:00
parent 196ce3df1b
commit 8c9b753544
22 changed files with 542 additions and 186 deletions

View File

@@ -228,8 +228,10 @@ void Group::clear()
void Group::attach(Node *child)
{
children_.insert(child);
child->refcount_++;
if (child != nullptr) {
children_.insert(child);
child->refcount_++;
}
}
@@ -242,17 +244,18 @@ void Group::sort()
children_.swap(ordered_children);
}
void Group::detatch(Node *child)
void Group::detach(Node *child)
{
// find the node with this id, and erase it out of the list of children
// NB: do NOT delete with remove : this takes all nodes with same depth (i.e. equal depth in set)
NodeSet::iterator it = std::find_if(children_.begin(), children_.end(), hasId(child->id()));
if ( it != children_.end()) {
// detatch child from group parent
children_.erase(it);
child->refcount_--;
if (child != nullptr) {
// find the node with this id, and erase it out of the list of children
// NB: do NOT delete with remove : this takes all nodes with same depth (i.e. equal depth in set)
NodeSet::iterator it = std::find_if(children_.begin(), children_.end(), hasId(child->id()));
if ( it != children_.end()) {
// detatch child from group parent
children_.erase(it);
child->refcount_--;
}
}
}
void Group::update( float dt )