*** empty log message ***

This commit is contained in:
David Rose 2001-05-08 18:01:38 +00:00
parent afde609976
commit 4c301e522b
3 changed files with 28 additions and 27 deletions

View File

@ -216,10 +216,10 @@ compare_to(const AllTransitionsWrapper &other) const {
return 0;
}
if (_cache == (NodeTransitionCache *)NULL) {
return -1;
return other._cache->is_identity() ? 0 : -1;
}
if (other._cache == (NodeTransitionCache *)NULL) {
return 1;
return _cache->is_identity() ? 0 : 1;
}
return _cache->compare_to(*other._cache);

View File

@ -8,6 +8,8 @@
#include "config_graph.h"
#include "setTransitionHelpers.h"
#include <indent.h>
////////////////////////////////////////////////////////////////////
// Function: NodeTransitionCache::Constructor
// Access: Public
@ -73,9 +75,8 @@ is_identity() const {
////////////////////////////////////////////////////////////////////
int NodeTransitionCache::
compare_to(const NodeTransitionCache &other) const {
int result = tmap_compare_cache(_cache.begin(), _cache.end(),
other._cache.begin(), other._cache.end());
return result;
return tmap_compare_cache(_cache.begin(), _cache.end(),
other._cache.begin(), other._cache.end());
}
////////////////////////////////////////////////////////////////////
@ -496,6 +497,7 @@ void NodeTransitionCache::
write(ostream &out, int indent_level) const {
Cache::const_iterator ci;
for (ci = _cache.begin(); ci != _cache.end(); ++ci) {
(*ci).second.write(out, indent_level);
indent(out, indent_level) << (*ci).first << "\n";
(*ci).second.write(out, indent_level + 2);
}
}

View File

@ -17,18 +17,19 @@ describe_ambiguous_wrt(const Node *node,
InputIterator arc_list_end,
TypeHandle graph_type) {
if (wrt_cat.is_warning()) {
int num_parents = node->get_num_parents(graph_type);
const UpRelationPointers &urp = node->find_connection(graph_type).get_up();
int num_parents = urp.size();
wrt_cat.warning()
<< *node << " has " << num_parents << " parents; wrt() ambiguous.\n"
<< " parents are: ";
nassertv(num_parents > 1);
NodeRelation *parent_arc = node->get_parent(graph_type, 0);
NodeRelation *parent_arc = urp[0];
wrt_cat.warning(false) << *parent_arc->get_parent();
for (int i = 1; i < num_parents; i++) {
parent_arc = node->get_parent(graph_type, 0);
parent_arc = urp[i];
wrt_cat.warning(false)
<< ", " << *node->get_parent(graph_type, i)->get_parent();
<< ", " << *parent_arc->get_parent();
}
wrt_cat.warning(false) << "\n";
@ -131,7 +132,8 @@ get_cached_net_transition(NodeRelation *arc, Node *&root,
// Get the node above the arc.
Node *node = arc->get_parent();
int num_parents = node->get_num_parents(graph_type);
const UpRelationPointers &urp = node->find_connection(graph_type).get_up();
int num_parents = urp.size();
if (num_parents != 1) {
// The node has zero or multiple parents. It's thus either the
@ -155,7 +157,7 @@ get_cached_net_transition(NodeRelation *arc, Node *&root,
} else {
// The node has exactly one parent. Carry on.
NodeRelation *parent_arc = node->get_parent(graph_type, 0);
NodeRelation *parent_arc = urp[0];
get_cached_net_transition(parent_arc, root, as_of, now, net, graph_type);
// Now recompute our own cache.
@ -223,14 +225,15 @@ get_cached_net_transition(const Node *node,
return;
}
int num_parents = node->get_num_parents(graph_type);
const UpRelationPointers &urp = node->find_connection(graph_type).get_up();
int num_parents = urp.size();
const NodeRelation *parent_arc = (const NodeRelation *)NULL;
if (num_parents == 1) {
// There is only one parent, so there's no doubt as to which arc
// to choose.
parent_arc = node->get_parent(graph_type, 0);
parent_arc = urp[0];
} else if (num_parents == 0) {
// This node has no parents. Stop here.
@ -262,7 +265,7 @@ get_cached_net_transition(const Node *node,
// one.
describe_ambiguous_wrt(node, arc_list_begin, arc_list_end, graph_type);
#endif
parent_arc = node->get_parent(graph_type, 0);
parent_arc = urp[0];
}
}
@ -317,14 +320,15 @@ get_uncached_net_transition(const Node *node,
return;
}
int num_parents = node->get_num_parents(graph_type);
const UpRelationPointers &urp = node->find_connection(graph_type).get_up();
int num_parents = urp.size();
const NodeRelation *parent_arc = (const NodeRelation *)NULL;
if (num_parents == 1) {
// There is only one parent, so there's no doubt as to which arc
// to choose.
parent_arc = node->get_parent(graph_type, 0);
parent_arc = urp[0];
} else if (num_parents == 0) {
// This node has no parents. Stop here.
@ -353,7 +357,7 @@ get_uncached_net_transition(const Node *node,
// one.
describe_ambiguous_wrt(node, arc_list_begin, arc_list_end, graph_type);
#endif
parent_arc = node->get_parent(graph_type, 0);
parent_arc = urp[0];
}
}
@ -620,7 +624,8 @@ get_uncached_wrt_subtree(Node *node, Node *to, TransitionWrapper &result,
TypeHandle graph_type) {
nassertr(node != (Node *)NULL, to);
int num_parents = node->get_num_parents(graph_type);
const UpRelationPointers &urp = node->find_connection(graph_type).get_up();
int num_parents = urp.size();
if (num_parents == 0) {
// This node has no parents. Stop here.
@ -654,7 +659,7 @@ get_uncached_wrt_subtree(Node *node, Node *to, TransitionWrapper &result,
// Actually, we do need to keep walking up till we find the actual
// top of the instanced subtree, so we can return the correct
// pointer.
int num_parents = node->get_num_parents(graph_type);
num_parents = node->get_num_parents(graph_type);
while (num_parents == 1) {
node = node->get_parent(graph_type, 0)->get_parent();
num_parents = node->get_num_parents(graph_type);
@ -667,7 +672,7 @@ get_uncached_wrt_subtree(Node *node, Node *to, TransitionWrapper &result,
}
}
const NodeRelation *parent_arc = node->get_parent(graph_type, 0);
const NodeRelation *parent_arc = urp[0];
Node *stop =
get_uncached_wrt_subtree(parent_arc->get_parent(), to,
@ -875,12 +880,6 @@ cached_wrt_subtree(NodeRelation *arc, Node *to, UpdateSeq as_of, UpdateSeq now,
<< " should be:\n";
check_trans.write(wrt_cat.warning(false), 4);
result = check_trans;
/*
cerr << "Begin recheck.\n";
int num = check_trans.compare_to(result);
cerr << "Done recheck, result = " << num << "\n";
*/
}
}
#endif