Panda3D
 All Classes Functions Variables Enumerations
dataGraphTraverser.h
1 // Filename: dataGraphTraverser.h
2 // Created by: drose (11Mar02)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef DATAGRAPHTRAVERSER_H
16 #define DATAGRAPHTRAVERSER_H
17 
18 #include "pandabase.h"
19 
20 #include "dataNodeTransmit.h"
21 #include "pvector.h"
22 #include "pmap.h"
23 
24 class DataNode;
25 class PandaNode;
26 
27 ////////////////////////////////////////////////////////////////////
28 // Class : DataGraphTraverser
29 // Description : This object supervises the traversal of the data
30 // graph and the moving of data from one DataNode to its
31 // children. The data graph is used to manage data from
32 // input devices, etc. See the overview of the data
33 // graph in dataNode.h.
34 ////////////////////////////////////////////////////////////////////
35 class EXPCL_PANDA_DGRAPH DataGraphTraverser {
36 PUBLISHED:
39 
40  INLINE Thread *get_current_thread() const;
41 
42  void traverse(PandaNode *node);
43  void traverse_below(PandaNode *node, const DataNodeTransmit &output);
44  void collect_leftovers();
45 
46 private:
47  void r_transmit(DataNode *data_node, const DataNodeTransmit inputs[]);
48 
50 
51  Thread *_current_thread;
52 
53  class CollectedData {
54  public:
55  INLINE CollectedData();
56  void set_data(int parent_index, const DataNodeTransmit &data);
57 
58  int _num_parents;
59  DataVector _data;
60  };
62  MultipassData _multipass_data;
63 };
64 
65 #include "dataGraphTraverser.I"
66 
67 #endif
A basic node of the scene graph or data graph.
Definition: pandaNode.h:72
The fundamental type of node for the data graph.
Definition: dataNode.h:64
static Thread * get_current_thread()
Returns a pointer to the currently-executing Thread object.
Definition: thread.I:145
A thread; that is, a lightweight process.
Definition: thread.h:51
Encapsulates the data generated from (or sent into) any particular DataNode.
This object supervises the traversal of the data graph and the moving of data from one DataNode to it...