Skip to content

Commit

Permalink
Replace direct manipulation of query results with method calls.
Browse files Browse the repository at this point in the history
This will make it easier to refactor a bit of this code.
  • Loading branch information
ewencp committed Mar 1, 2013
1 parent c377ab3 commit 60ea70f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 3 additions & 4 deletions libprox/include/prox/geom/LevelQueryHandler.hpp
Expand Up @@ -775,12 +775,11 @@ class LevelQueryHandler : public QueryHandler<SimulationTraits> {
// to includeAddition() because we know it always
// returns true
evt.addAddition( typename QueryEventType::Addition(node->rtnode, QueryEventType::Imposter) );
results.insert( node->rtnode->aggregateID() );
addResult( node->rtnode->aggregateID() );
for(int i = 0; i < node->rtnode->size(); i++) {
ObjectID child_id = loc->iteratorID(node->rtnode->object(i).object);
typename ResultSet::iterator result_it = results.find(child_id);
assert(result_it != results.end());
results.erase(result_it);
assert(results.find(child_id) != results.end());
removeResult(child_id);
// No need to check like Cut code does for
// whether to includeRemoval() because we know
// it always returns true
Expand Down
7 changes: 3 additions & 4 deletions libprox/include/prox/geom/RTreeCutQueryHandler.hpp
Expand Up @@ -808,12 +808,11 @@ class RTreeCutQueryHandler : public QueryHandler<SimulationTraits> {
// to includeAddition() because we know it always
// returns true
evt.addAddition( typename QueryEventType::Addition(node->rtnode, QueryEventType::Imposter) );
results.insert( node->rtnode->aggregateID() );
addResult( node->rtnode->aggregateID() );
for(int i = 0; i < node->rtnode->size(); i++) {
ObjectID child_id = loc->iteratorID(node->rtnode->object(i).object);
typename ResultSet::iterator result_it = results.find(child_id);
assert(result_it != results.end());
results.erase(result_it);
assert(results.find(child_id) != results.end());
removeResult(child_id);
// No need to check like Cut code does for
// whether to includeRemoval() because we know
// it always returns true
Expand Down

0 comments on commit 60ea70f

Please sign in to comment.