dataGraphTraverser.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // Filename: dataGraphTraverser.h
  2. // Created by: drose (11Mar02)
  3. //
  4. ////////////////////////////////////////////////////////////////////
  5. //
  6. // PANDA 3D SOFTWARE
  7. // Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
  8. //
  9. // All use of this software is subject to the terms of the Panda 3d
  10. // Software license. You should have received a copy of this license
  11. // along with this source code; you will also find a current copy of
  12. // the license at http://etc.cmu.edu/panda3d/docs/license/ .
  13. //
  14. // To contact the maintainers of this program write to
  15. // [email protected] .
  16. //
  17. ////////////////////////////////////////////////////////////////////
  18. #ifndef DATAGRAPHTRAVERSER_H
  19. #define DATAGRAPHTRAVERSER_H
  20. #include "pandabase.h"
  21. #include "dataNodeTransmit.h"
  22. #include "pvector.h"
  23. #include "pmap.h"
  24. class DataNode;
  25. class PandaNode;
  26. ////////////////////////////////////////////////////////////////////
  27. // Class : DataGraphTraverser
  28. // Description : This object supervises the traversal of the data
  29. // graph and the moving of data from one DataNode to its
  30. // children. The data graph is used to manage data from
  31. // input devices, etc. See the overview of the data
  32. // graph in dataNode.h.
  33. ////////////////////////////////////////////////////////////////////
  34. class EXPCL_PANDA DataGraphTraverser {
  35. PUBLISHED:
  36. DataGraphTraverser();
  37. ~DataGraphTraverser();
  38. void traverse(PandaNode *node);
  39. void traverse_below(PandaNode *node, const DataNodeTransmit &output);
  40. void collect_leftovers();
  41. private:
  42. void r_transmit(DataNode *data_node, const DataNodeTransmit inputs[]);
  43. typedef pvector<DataNodeTransmit> DataVector;
  44. class CollectedData {
  45. public:
  46. INLINE CollectedData();
  47. void set_data(int parent_index, const DataNodeTransmit &data);
  48. int _num_parents;
  49. DataVector _data;
  50. };
  51. typedef pmap<DataNode *, CollectedData> MultipassData;
  52. MultipassData _multipass_data;
  53. };
  54. #include "dataGraphTraverser.I"
  55. #endif