45 DataConnections::const_iterator ci;
46 for (ci = _data_connections.begin(); ci != _data_connections.end(); ++ci) {
47 const DataConnection &connect = (*ci);
49 inputs[connect._parent_index].
get_data(connect._output_index);
50 if (!data.is_empty()) {
51 new_input.
set_data(connect._input_index, data);
56 if (dgraph_cat.is_spam()) {
57 bool any_data =
false;
58 Wires::const_iterator wi;
59 for (wi = _input_wires.begin(); wi != _input_wires.end(); ++wi) {
60 const string &name = (*wi).first;
61 const WireDef &def = (*wi).second;
62 if (new_input.
has_data(def._index)) {
65 << *
this <<
" receives:\n";
68 dgraph_cat.spam(
false)
69 <<
" " << name <<
" = " << new_input.
get_data(def._index)
76 do_transmit_data(trav, new_input, output);
79 if (dgraph_cat.is_spam()) {
80 bool any_data =
false;
81 Wires::const_iterator wi;
82 for (wi = _output_wires.begin(); wi != _output_wires.end(); ++wi) {
83 const string &name = (*wi).first;
84 const WireDef &def = (*wi).second;
88 << *
this <<
" transmits:\n";
91 dgraph_cat.spam(
false)
92 <<
" " << name <<
" = " << output.
get_data(def._index)
106 Wires::const_iterator wi;
107 for (wi = _input_wires.begin(); wi != _input_wires.end(); ++wi) {
108 const string &name = (*wi).first;
109 const WireDef &def = (*wi).second;
110 out << name <<
" " << def._data_type <<
"\n";
120 Wires::const_iterator wi;
121 for (wi = _output_wires.begin(); wi != _output_wires.end(); ++wi) {
122 const string &name = (*wi).first;
123 const WireDef &def = (*wi).second;
124 out << name <<
" " << def._data_type <<
"\n";
134 DataConnections::const_iterator ci;
135 for (ci = _data_connections.begin(); ci != _data_connections.end(); ++ci) {
136 const DataConnection &connect = (*ci);
137 nassertv(connect._parent_index >= 0 && connect._parent_index <
get_num_parents());
141 Wires::const_iterator wi;
143 for (wi = _input_wires.begin(); wi != _input_wires.end() && !found; ++wi) {
144 const string &name = (*wi).first;
145 const WireDef &def = (*wi).second;
146 if (def._index == connect._input_index) {
147 out << name <<
" " << def._data_type <<
" from "
148 << *
get_parent(connect._parent_index) <<
"\n";
169 define_input(
const string &name,
TypeHandle data_type) {
171 nassertr(_data_connections.empty(), 0);
174 wi = _input_wires.find(name);
175 if (wi != _input_wires.end()) {
177 WireDef &def = (*wi).second;
178 def._data_type = data_type;
183 WireDef &def = _input_wires[name];
184 def._data_type = data_type;
185 def._index = _input_wires.size() - 1;
202 define_output(
const string &name,
TypeHandle data_type) {
204 nassertr(_data_connections.empty(), 0);
207 wi = _output_wires.find(name);
208 if (wi != _output_wires.end()) {
210 WireDef &def = (*wi).second;
211 def._data_type = data_type;
216 WireDef &def = _output_wires[name];
217 def._data_type = data_type;
218 def._index = _output_wires.size() - 1;
229 PandaNode::parents_changed();
253 _data_connections.clear();
255 int num_datanode_parents = 0;
257 Wires::const_iterator wi;
258 for (wi = _input_wires.begin(); wi != _input_wires.end(); ++wi) {
259 const string &name = (*wi).first;
260 const WireDef &input_def = (*wi).second;
263 for (
int i = 0; i < num_parents; i++) {
265 if (parent_node->
is_of_type(DataNode::get_class_type())) {
267 num_datanode_parents++;
268 Wires::const_iterator pi;
269 pi = data_node->_output_wires.find(name);
270 if (pi != data_node->_output_wires.end()) {
271 const WireDef &output_def = (*pi).second;
273 if (output_def._data_type != input_def._data_type) {
275 <<
"Ignoring mismatched type for connection " << name
276 <<
" between " << *data_node <<
" and " << *
this <<
"\n";
279 dc._parent_index = i;
280 dc._output_index = output_def._index;
281 dc._input_index = input_def._index;
282 _data_connections.push_back(dc);
289 if (dgraph_cat.is_debug()) {
291 <<
"Multiple connections found for " << name <<
" into " << *
this
298 num_datanode_parents != 0) {
300 <<
"No data connected to " << *
this <<
"\n";
319 PandaNode::fillin(scan, manager);