CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch2/src/Fireworks/Macros/eve_macros.h

Go to the documentation of this file.
00001 #ifndef eve_macros_h
00002 #define eve_macros_h
00003 
00004 #include <vector>
00005 #include <string>
00006 #include <Rtypes.h>
00007 class TEveElement;
00008 
00009 // get the name from an object derived from both TEveElement and TNamed
00010 const char* get_name( const TEveElement * element );
00011 
00012 // get the title from an object derived from both TEveElement and TNamed
00013 const char* get_title( const TEveElement * element );
00014 
00015 // force a node to expand its internal reprsentation, so all children are actually present
00016 void expand_node( TEveElement * element );
00017 
00018 // retrieve a TShape from a TEveElement
00019 const TGeoShape * get_shape( const TEveElement * element );
00020 
00021 // overloaded non-const TShape retrieval, allowed from a TGeoShape only
00022 TGeoShape * get_shape( TEveElement * element );
00023 
00024 // return a copy of the local-to-global transformation applied to a TEveElement
00025 TGeoMatrix * get_transform( const TEveElement * element );
00026 
00027 // clone a TEveGeoShape or TEveGeoNode into a new TEveGeoShape, and add it as a child to a parent if one is given
00028 TEveGeoShape * clone( const TEveElement * element, TEveElement * parent = 0);
00029 
00030 // set an element's color and alpha, and possibly its children's up to levels levels deep
00031 void set_color( TEveElement * element, Color_t color, float alpha = 1.0, unsigned int levels = 0 );
00032 
00033 // check if a node has any children or if it's a leaf node
00034 bool is_leaf_node( const TEveElement * element );
00035 
00036 // toggle an elements's children visibility, based on their name
00037 // names are checked only up to their length, so for example tec:TEC will match both tec:TEC_1 and tec:TEC_2
00038 void set_children_visibility( TEveElement * element, const std::string & node_name, const std::vector<std::string> & children_name, bool visibility );
00039 
00040 // set Tracker's Endcaps visibility
00041 void set_tracker_endcap_visibility( TEveElement * tracker, bool visibility );
00042 
00043 // show Tracker's Endcaps
00044 void show_tracker_endcap( TEveElement * tracker );
00045 
00046 // hide Tracker's Endcaps
00047 void hide_tracker_endcap( TEveElement * tracker );
00048 
00049 #endif // eve_macros_h