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

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

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