mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-07 00:10:00 +01:00
fixed Switch node in Scene, removed Animation node from scene, created display mode for Source.
39 lines
628 B
C++
39 lines
628 B
C++
#include "SearchVisitor.h"
|
|
|
|
#include "Scene.h"
|
|
|
|
SearchVisitor::SearchVisitor(Node *node) : Visitor(), node_(node), found_(false)
|
|
{
|
|
|
|
}
|
|
|
|
|
|
void SearchVisitor::visit(Node &n)
|
|
{
|
|
if ( node_ == &n ){
|
|
found_ = true;
|
|
}
|
|
}
|
|
|
|
void SearchVisitor::visit(Group &n)
|
|
{
|
|
for (NodeSet::iterator node = n.begin(); node != n.end(); node++) {
|
|
(*node)->accept(*this);
|
|
if (found_)
|
|
break;
|
|
}
|
|
}
|
|
|
|
void SearchVisitor::visit(Switch &n)
|
|
{
|
|
if (n.numChildren()>0)
|
|
n.activeChild()->accept(*this);
|
|
}
|
|
|
|
|
|
void SearchVisitor::visit(Scene &n)
|
|
{
|
|
// search only in workspace
|
|
n.ws()->accept(*this);
|
|
}
|