00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TEveSelection
00013 #define ROOT_TEveSelection
00014
00015 #include "TEveElement.h"
00016
00017 #include "TQObject.h"
00018
00019 #include <map>
00020
00021 class TEveSelection : public TEveElementList,
00022 public TQObject
00023 {
00024 public:
00025 enum EPickToSelect
00026 {
00027 kPS_Ignore,
00028 kPS_Element,
00029 kPS_Projectable,
00030 kPS_Compound,
00031 kPS_PableCompound,
00032 kPS_Master
00033 };
00034
00035 private:
00036 TEveSelection(const TEveSelection&);
00037 TEveSelection& operator=(const TEveSelection&);
00038
00039 protected:
00040 typedef std::map<TEveElement*, Set_t> SelMap_t;
00041 typedef std::map<TEveElement*, Set_t>::iterator SelMap_i;
00042
00043 Int_t fPickToSelect;
00044 Bool_t fActive;
00045 Bool_t fIsMaster;
00046
00047 SelMap_t fImpliedSelected;
00048
00049 Select_foo fSelElement;
00050 ImplySelect_foo fIncImpSelElement;
00051 ImplySelect_foo fDecImpSelElement;
00052
00053 void DoElementSelect (SelMap_i entry);
00054 void DoElementUnselect(SelMap_i entry);
00055
00056 void RecheckImpliedSet(SelMap_i smi);
00057
00058 public:
00059 TEveSelection(const char* n="TEveSelection", const char* t="");
00060 virtual ~TEveSelection() {}
00061
00062 void SetHighlightMode();
00063
00064 Int_t GetPickToSelect() const { return fPickToSelect; }
00065 void SetPickToSelect(Int_t ps) { fPickToSelect = ps; }
00066
00067 Bool_t GetIsMaster() const { return fIsMaster; }
00068 void SetIsMaster(Bool_t m) { fIsMaster = m; }
00069
00070 virtual Bool_t AcceptElement(TEveElement* el);
00071
00072 virtual void AddElement(TEveElement* el);
00073 virtual void RemoveElement(TEveElement* el);
00074 virtual void RemoveElementLocal(TEveElement* el);
00075 virtual void RemoveElements();
00076 virtual void RemoveElementsLocal();
00077
00078 virtual void RemoveImpliedSelected(TEveElement* el);
00079
00080 void RecheckImpliedSetForElement(TEveElement* el);
00081
00082 void SelectionAdded(TEveElement* el);
00083 void SelectionRemoved(TEveElement* el);
00084 void SelectionCleared();
00085 void SelectionRepeated(TEveElement* el);
00086
00087
00088
00089
00090 virtual void ActivateSelection();
00091 virtual void DeactivateSelection();
00092
00093
00094
00095
00096 TEveElement* MapPickedToSelected(TEveElement* el);
00097
00098 virtual void UserPickedElement(TEveElement* el, Bool_t multi=kFALSE);
00099 virtual void UserRePickedElement(TEveElement* el);
00100 virtual void UserUnPickedElement(TEveElement* el);
00101
00102
00103
00104 ClassDef(TEveSelection, 0);
00105 };
00106
00107 #endif