8 #include "TEveManager.h" 10 #include "TEveElement.h" 11 #include "TEveGeoNode.h" 13 #include "TCollection.h" 14 #include "TObjString.h" 27 split( path, parents,
'/',
false );
28 if (parents.empty()) {
31 name = parents.back();
36 static TPRegexp
ns_name_index(
"([[:alnum:]]+:[[:alnum:]-\\[\\]]+)(_[0-9]+)+" );
43 filter += ((TObjString*)(
ns_name_index.MatchS( token )->At(1)))->GetString();
47 return TPRegexp( filter.c_str() );
51 TPRegexp
make_filter(
const std::vector<std::string> & tokens) {
58 filter += ((TObjString*)(
ns_name_index.MatchS( tokens[0] )->At(1)))->GetString();
61 for (
unsigned int i = 1;
i < tokens.size(); ++
i) {
64 filter += ((TObjString*)(
ns_name_index.MatchS( tokens[i] )->At(1)))->GetString();
69 return TPRegexp( filter.c_str() );
79 for (TEveElement::List_i
i = node->BeginChildren();
i != node->EndChildren(); ++
i)
82 TEveGeoNode *
child = (TEveGeoNode*)(*
i);
83 for (
unsigned int det = 0; det <
filters.size(); ++det) {
84 if (
filters[det].MatchB( child->GetName() )) {
88 std::cout << child->GetName() <<
" (found)" << std::endl;
90 child->SetRnrSelf(
true );
91 child->SetMainColor(
colors[det] );
95 child->SetRnrSelf(
true );
96 child->SetRnrChildren(
false );
112 else if (
parents.MatchB( child->GetName() )) {
116 std::cout << child->GetName() <<
" (look inside...)" << std::endl;
118 child->SetRnrSelf(
false );
119 child->SetRnrChildren(
true );
125 std::cout << child->GetName() <<
" (unused)" << std::endl;
130 child->SetRnrSelf(
false );
131 child->SetRnrChildren(
false );
147 std::vector< std::string > all_parents;
148 std::vector< std::string > all_names;
150 for (
unsigned int i = 0;
i <
elements.size(); ++
i) {
151 std::vector< std::string > s_parents;
154 all_names.push_back( s_name );
155 all_parents.insert( all_parents.end(), s_parents.begin(), s_parents.end() );
161 for (
unsigned int i = 0;
i < all_names.size(); ++
i)
170 for (
unsigned int i = 0;
i <
filters.size(); ++
i)
183 node->ElementChanged(
true,
true );
191 for (TEveElement::List_i
i = gEve->GetScenes()->BeginChildren();
i != gEve->GetScenes()->EndChildren(); ++
i) {
192 TEveScene * scene =
dynamic_cast<TEveScene *
> (*i);
195 for (TEveElement::List_i
n = scene->BeginChildren();
n != scene->EndChildren(); ++
n) {
197 if (obj_name == 0
or strcmp(name, obj_name))
void node_filter(TEveElement *node, int simplify, bool verbose)
unsigned int matching_nodes
std::vector< Color_t > colors
static TPRegexp ns_name_index("([[:alnum:]]+:[[:alnum:]-\\[\\]]+)(_[0-9]+)+")
void init_filter(const std::vector< std::pair< std::string, Color_t > > &elements)
std::vector< TPRegexp > filters
U second(std::pair< T, U > const &p)
void apply_filter(TEveElement *node, int simplify, bool verbose)
TPRegexp make_filter(const std::string &token)
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
TEveElement * get_root_object(const char *name)
void split_path(const std::string &path, std::string &name, std::vector< std::string > &parents)
void expand_node(TEveElement *element)
const char * get_name(const TEveElement *element)