00001 // Filename: deferredNodeProperty.h 00002 // Created by: drose (20Mar02) 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 #ifndef DEFERREDNODEPROPERTY_H 00020 #define DEFERREDNODEPROPERTY_H 00021 00022 #include "pandabase.h" 00023 00024 #include "collideMask.h" 00025 #include "pmap.h" 00026 00027 class PandaNode; 00028 00029 /////////////////////////////////////////////////////////////////// 00030 // Class : DeferredNodeProperty 00031 // Description : This class keeps track of all the state we must make 00032 // note of during the graph traversal, but cannot apply 00033 // immediately. An instance of this class may be 00034 // assigned to nodes as they are created, and then later, 00035 // after the geometry has been created, the graph will 00036 // be traversed again and the state will be applied. 00037 // 00038 // This class is only local to this package; it is not 00039 // exported. 00040 //////////////////////////////////////////////////////////////////// 00041 class DeferredNodeProperty { 00042 public: 00043 DeferredNodeProperty(); 00044 DeferredNodeProperty(const DeferredNodeProperty ©); 00045 void operator = (const DeferredNodeProperty ©); 00046 00047 void compose(const DeferredNodeProperty &other); 00048 00049 void apply_to_node(PandaNode *node); 00050 00051 00052 public: 00053 enum Flags { 00054 F_has_from_collide_mask = 0x0001, 00055 F_has_into_collide_mask = 0x0002, 00056 }; 00057 00058 int _flags; 00059 CollideMask _from_collide_mask; 00060 CollideMask _into_collide_mask; 00061 }; 00062 00063 typedef pmap<PandaNode *, DeferredNodeProperty> DeferredNodes; 00064 00065 00066 #endif