Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:46:36

0001 #ifndef eve_filter_h
0002 #define eve_filter_h
0003 
0004 #include <vector>
0005 #include <string>
0006 
0007 #include "TPRegexp.h"
0008 
0009 class TEveElement;
0010 
0011 // actions for apply_filter(...) and node_filter(...)
0012 enum {
0013   do_nothing    = 0,
0014   do_hide       = 1,
0015   do_remove     = 2
0016 };
0017 
0018 // split a path into the name and a list of parent folders
0019 void split_path(const std::string & path, std::string & name, std::vector<std::string> & parents);
0020 
0021 // generalizes a node name of the form namespace:Name_NUM into a (regexp) filter that allows any number
0022 TPRegexp make_filter(const std::string & token);
0023 
0024 // generalizes a list of node names of the form namespace:Name_NUM into a (regexp) filter that allows any of the "namespace:Name" followd by any number
0025 TPRegexp make_filter(const std::vector<std::string> & tokens);
0026 
0027 // apply the filters to a node, specifying if the removed elements should be hidden (default), deleted (does not work) or ignored (i.e. do nothing)
0028 void node_filter(TEveElement * node, int simplify = do_hide, bool verbose = false);
0029 
0030 // initializes the filter static variables from a list of elements to display and colors to use
0031 void init_filter(const std::vector< std::pair< std::string, Color_t> > & elements);
0032 
0033 // dump the filters
0034 void dump(void);
0035 
0036 // apply the filters to a node, then notify it to update itself and its children for redrawing
0037 void apply_filter(TEveElement * node, int simplify = do_hide, bool verbose = false);
0038 
0039 // find a TEve root object (could be a TEveGeoRootNode or a TEveGeoShape) by its name
0040 TEveElement * get_root_object(const char* name);
0041 
0042 #endif // eve_filter_h