CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
DDScopeClassification Struct Reference

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

#include <DDScope.h>

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 3 of file DDScope.cc.

References different_branch, query::result, subtree, and supertree.

5 {
7  DDGeoHistory::const_iterator lit = left.begin(); // left-iterator
8  DDGeoHistory::const_iterator rit = right.begin(); // right-iterator
9 
10  while( lit != left.end() && rit != right.end())
11  {
12  if( lit->siblingno() != rit->siblingno())
13  {
14  result = different_branch;
15  break;
16  }
17  ++lit;
18  ++rit;
19  }
20 
21  if( result != different_branch )
22  {
23  if( lit == left.end()) { // left history leaf node marks the root of a subtree which contains
24  result = supertree; // the leaf node of the right history or both roots are the same ...
25  }
26  else
27  {
28  result = subtree;
29  }
30  }
31  return result;
32 }
dd_scope_class
Definition: DDScope.h:7
tuple result
Definition: query.py:137
Definition: DDScope.h:7