1 # PyOpenSG is (C) Copyright 2005-2009 by Allen Bierbaum
3 # This file is part of PyOpenSG.
5 # PyOpenSG is free software; you can redistribute it and/or modify it under
6 # the terms of the GNU Lesser General Public License as published by the Free
7 # Software Foundation; either version 2 of the License, or (at your option)
10 # PyOpenSG is distributed in the hope that it will be useful, but WITHOUT ANY
11 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
15 # You should have received a copy of the GNU Lesser General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
22 class PrintTreeTraverser(object):
26 def traverse(self
, node
):
27 return osg2
.osg
.traverse(node
, self
.enter
, self
.exit
)
29 def enter(self
, node
):
31 print " "*self
.depth
, "Enter: %s [%s]"%(osg2
.osg
.getName(node
),core
)
33 return osg2
.osg
.Action
.Continue
35 def exit(self
, node
, result
):
38 print " "*self
.depth
, "Exit: %s [%s]"%(osg2
.osg
.getName(node
),core
)