Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

panda/src/ribgsg/ribStuffTraverser.cxx

Go to the documentation of this file.
00001 // Filename: ribStuffTraverser.cxx
00002 // Created by:  drose (16Feb99)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) 2001, Disney Enterprises, Inc.  All rights reserved
00008 //
00009 // All use of this software is subject to the terms of the Panda 3d
00010 // Software license.  You should have received a copy of this license
00011 // along with this source code; you will also find a current copy of
00012 // the license at http://www.panda3d.org/license.txt .
00013 //
00014 // To contact the maintainers of this program write to
00015 // panda3d@yahoogroups.com .
00016 //
00017 ////////////////////////////////////////////////////////////////////
00018 
00019 #include "ribStuffTraverser.h"
00020 #include "ribGraphicsStateGuardian.h"
00021 
00022 #include <textureTransition.h>
00023 #include <lightTransition.h>
00024 #include <geomNode.h>
00025 
00026 ////////////////////////////////////////////////////////////////////
00027 //     Function: RibStuffTraverser::reached_node
00028 //       Access: Public
00029 //  Description: Called for each node of the scene graph; this does
00030 //               the work of identifying new things and registering
00031 //               them in the RIB file.
00032 ////////////////////////////////////////////////////////////////////
00033 bool RibStuffTraverser::
00034 reached_node(Node *node, AllTransitionsWrapper &state, NullLevelState &) {
00035   if (node->is_of_type(GeomNode::get_class_type())) {
00036     const TextureTransition *tex_attrib;
00037     if (!get_transition_into(tex_attrib, state)) {
00038       if (tex_attrib->is_on()) {
00039         _gsg->define_texture(tex_attrib->get_texture());
00040       }
00041     }
00042 
00043     const LightTransition *light_attrib;
00044     if (!get_transition_into(light_attrib, state)) {
00045       LightTransition::const_iterator li;
00046       for (li = light_attrib->begin(); li != light_attrib->end(); ++li) {
00047         _gsg->define_light(*li);
00048       }
00049     }
00050   }
00051   return true;
00052 }

Generated on Fri May 2 00:43:56 2003 for Panda by doxygen1.3