Panda3D
 All Classes Functions Variables Enumerations
deferredNodeProperty.h
00001 // Filename: deferredNodeProperty.h
00002 // Created by:  drose (20Mar02)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #ifndef DEFERREDNODEPROPERTY_H
00016 #define DEFERREDNODEPROPERTY_H
00017 
00018 #include "pandabase.h"
00019 
00020 #include "collideMask.h"
00021 #include "pmap.h"
00022 
00023 class PandaNode;
00024 
00025 ////////////////////////////////////////////////////////////////////
00026 //       Class : DeferredNodeProperty
00027 // Description : This class keeps track of all the state we must make
00028 //               note of during the graph traversal, but cannot apply
00029 //               immediately.  An instance of this class may be
00030 //               assigned to nodes as they are created, and then later,
00031 //               after the geometry has been created, the graph will
00032 //               be traversed again and the state will be applied.
00033 //
00034 //               This class is only local to this package; it is not
00035 //               exported.
00036 ////////////////////////////////////////////////////////////////////
00037 class DeferredNodeProperty {
00038 public:
00039   DeferredNodeProperty();
00040   DeferredNodeProperty(const DeferredNodeProperty &copy);
00041   void operator = (const DeferredNodeProperty &copy);
00042 
00043   void compose(const DeferredNodeProperty &other);
00044 
00045   void apply_to_node(PandaNode *node);
00046 
00047 
00048 public:
00049   enum Flags {
00050     F_has_from_collide_mask   = 0x0001,
00051     F_has_into_collide_mask   = 0x0002,
00052   };
00053 
00054   int _flags;
00055   CollideMask _from_collide_mask;
00056   CollideMask _into_collide_mask;
00057 };
00058 
00059 typedef pmap<PandaNode *, DeferredNodeProperty> DeferredNodes;
00060 
00061 
00062 #endif
 All Classes Functions Variables Enumerations