15 #include <vsg/core/ref_ptr.h>
16 #include <vsg/nodes/Node.h>
29 template<
class N,
class V>
30 static void t_traverse(N& node, V& visitor)
32 for (
auto& child : node.children)
34 if ((visitor.traversalMask & (visitor.overrideMask | child.mask)) != MASK_OFF) child.node->accept(visitor);
38 void traverse(
Visitor& visitor)
override { t_traverse(*
this, visitor); }
39 void traverse(
ConstVisitor& visitor)
const override { t_traverse(*
this, visitor); }
40 void traverse(
RecordTraversal& visitor)
const override { t_traverse(*
this, visitor); }
44 void read(
Input& input)
override;
45 void write(
Output& output)
const override;
53 using Children = std::vector<Child>;
73 inline Mask boolToMask(
bool enabled) {
return enabled ? MASK_ALL : MASK_OFF; }
Definition: ConstVisitor.h:147
RecordTraversal traverses a scene graph doing view frustum culling and invoking state/commands to rec...
Definition: RecordTraversal.h:61
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.
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,...
Definition: Visitor.h:147