3 #include "TEveElement.h" 9 if ( regular_expression )
regexp = TPRegexp( regular_expression );
10 std::stack<std::pair<TEveElement*,TEveElement::List_i> >
parents;
11 parents.push( std::pair<TEveElement*,TEveElement::List_i>( element, element->BeginChildren() ) );
13 unsigned int index = 0;
14 unsigned int indexLimit = 1000000;
15 while ( !parents.empty() && ++index < indexLimit ) {
17 if ( parents.top().second == parents.top().first->EndChildren() )
21 if ( !parents.empty() ) ++(parents.top().second);
26 if ( (*parents.top().second)->NumChildren() > 0 ) {
27 parents.push( std::pair<TEveElement*,TEveElement::List_i>( *(parents.top().second),
28 (*parents.top().second)->BeginChildren() ) );
34 ++(parents.top().second);
36 if ( index >= indexLimit ) {
38 <<
"You either have a tree with loops or navigation logic is broken." << std::endl;
67 if (!element )
return;
68 TNamed* named =
dynamic_cast<TNamed*
>(element);
69 if ( named && !
regexp.MatchB(named->GetName()) )
return;
TEveElementIter(TEveElement *, const char *regular_expression=0)
std::vector< TEveElement * >::iterator iter
std::vector< TEveElement * > elements
void addElement(TEveElement *)