CMS 3D CMS Logo

Public Member Functions

DDScopeClassification Struct Reference

Classification of scope describe by A towards B. More...

#include <DDScope.h>

List of all members.

Public Member Functions

dd_scope_class operator() (const DDGeoHistory &, const DDGeoHistory &) const

Detailed Description

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.

Definition at line 17 of file DDScope.h.


Member Function Documentation

dd_scope_class DDScopeClassification::operator() ( const DDGeoHistory left,
const DDGeoHistory right 
) const

Definition at line 5 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
  //DDGeoHistory::size_type depth = 0;
  while(lit != left.end() && rit!=right.end()) {
    //DCOUT('s', "  classify: a=" << *lit << std::endl << "              : b=" << *rit );
    if (lit->siblingno() != rit->siblingno()) {
      result = different_branch;
      break;
    }  
    //++depth;
    ++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;
 
}