Classification of scope describe by A towards B. More...
#include <DDScope.h>
Public Member Functions | |
dd_scope_class | operator() (const DDGeoHistory &, const DDGeoHistory &) const |
Classification of scope describe by A towards B.
The leaf-node of A defines the root of a subtree in the DDExpandedView, so does the leaf-node of B.
dd_scope_class DDScopeClassification::operator() | ( | const DDGeoHistory & | left, |
const DDGeoHistory & | right | ||
) | const |
Definition at line 3 of file DDScope.cc.
References different_branch, query::result, subtree, and supertree.
{ dd_scope_class result = subtree; DDGeoHistory::const_iterator lit = left.begin(); // left-iterator DDGeoHistory::const_iterator rit = right.begin(); // right-iterator while( lit != left.end() && rit != right.end()) { if( lit->siblingno() != rit->siblingno()) { result = different_branch; break; } ++lit; ++rit; } if( result != different_branch ) { if( lit == left.end()) { // left history leaf node marks the root of a subtree which contains result = supertree; // the leaf node of the right history or both roots are the same ... } else { result = subtree; } } return result; }