15#include <vsg/core/ref_ptr.h>
16#include <vsg/nodes/Node.h>
36 using Children = std::vector<Child>;
55 template<
class N,
class V>
56 static void t_traverse(N& node, V& visitor)
58 for (
auto& child : node.children)
60 if ((visitor.traversalMask & (visitor.overrideMask | child.mask)) != MASK_OFF) child.node->accept(visitor);
64 void traverse(Visitor& visitor)
override { t_traverse(*
this, visitor); }
65 void traverse(ConstVisitor& visitor)
const override { t_traverse(*
this, visitor); }
66 void traverse(RecordTraversal& visitor)
const override { t_traverse(*
this, visitor); }
68 void read(Input& input)
override;
69 void write(Output& output)
const override;
76 inline Mask boolToMask(
bool enabled) {
return enabled ? MASK_ALL : MASK_OFF; }
Switch node for toggling on/off recording of children.
Definition Switch.h:25
void addChild(bool enabled, ref_ptr< Node > child)
add a child to the back of the children list.
void setSingleChildOn(size_t index)
set specified child to be on and all other children off.
void addChild(Mask mask, ref_ptr< Node > child)
add a child to the back of the children list.
void setAllChildren(bool enabled)
set all children to specified state.
ref_ptr< Object > clone(const CopyOp ©op={}) const override
Definition Switch.h:52
int compare(const Object &rhs) const override
compare two objects, return -1 if this object is less than rhs, return 0 if it's equal,...