Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TEveSelection.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/eve:$Id$
0002 // Author: Matevz Tadel 2007
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TEveSelection
0013 #define ROOT_TEveSelection
0014 
0015 #include "TEveElement.h"
0016 
0017 #include "TQObject.h"
0018 
0019 #include <map>
0020 
0021 class TEveSelection : public TEveElementList,
0022                       public TQObject
0023 {
0024 public:
0025    enum EPickToSelect  // How to convert picking events to top selected element:
0026    {
0027       kPS_Ignore,        // ignore picking
0028       kPS_Element,       // select element (default for selection)
0029       kPS_Projectable,   // select projectable
0030       kPS_Compound,      // select compound
0031       kPS_PableCompound, // select projectable and compound
0032       kPS_Master         // select master element (top-level compound)
0033    };
0034 
0035 private:
0036    TEveSelection(const TEveSelection&);            // Not implemented
0037    TEveSelection& operator=(const TEveSelection&); // Not implemented
0038 
0039 protected:
0040    typedef std::map<TEveElement*, Set_t>           SelMap_t;
0041    typedef std::map<TEveElement*, Set_t>::iterator SelMap_i;
0042 
0043    Int_t            fPickToSelect;
0044    Bool_t           fActive;
0045    Bool_t           fIsMaster;
0046 
0047    SelMap_t         fImpliedSelected;
0048 
0049    Select_foo       fSelElement;
0050    ImplySelect_foo  fIncImpSelElement;
0051    ImplySelect_foo  fDecImpSelElement;
0052 
0053    void DoElementSelect  (SelMap_i entry);
0054    void DoElementUnselect(SelMap_i entry);
0055 
0056    void RecheckImpliedSet(SelMap_i smi);
0057 
0058 public:
0059    TEveSelection(const char* n="TEveSelection", const char* t="");
0060    ~TEveSelection() override {}
0061 
0062    void SetHighlightMode();
0063 
0064    Int_t  GetPickToSelect()   const { return fPickToSelect; }
0065    void   SetPickToSelect(Int_t ps) { fPickToSelect = ps; }
0066 
0067    Bool_t GetIsMaster()       const { return fIsMaster; }
0068    void   SetIsMaster(Bool_t m)     { fIsMaster = m; }
0069 
0070    Bool_t AcceptElement(TEveElement* el) override;
0071 
0072    void AddElement(TEveElement* el) override;
0073    void RemoveElement(TEveElement* el) override;
0074    void RemoveElementLocal(TEveElement* el) override;
0075    void RemoveElements() override;
0076    void RemoveElementsLocal() override;
0077 
0078    virtual void RemoveImpliedSelected(TEveElement* el);
0079 
0080    void RecheckImpliedSetForElement(TEveElement* el);
0081 
0082    void SelectionAdded(TEveElement* el);    // *SIGNAL*
0083    void SelectionRemoved(TEveElement* el);  // *SIGNAL*
0084    void SelectionCleared();                 // *SIGNAL*
0085    void SelectionRepeated(TEveElement* el); // *SIGNAL*
0086 
0087    // ----------------------------------------------------------------
0088    // Interface to make selection active/non-active.
0089 
0090    virtual void ActivateSelection();
0091    virtual void DeactivateSelection();
0092 
0093    // ----------------------------------------------------------------
0094    // User input processing.
0095 
0096    TEveElement* MapPickedToSelected(TEveElement* el);
0097 
0098    virtual void UserPickedElement(TEveElement* el, Bool_t multi=kFALSE);
0099    virtual void UserRePickedElement(TEveElement* el);
0100    virtual void UserUnPickedElement(TEveElement* el);
0101 
0102    // ----------------------------------------------------------------
0103 
0104    ClassDefOverride(TEveSelection, 0); // Container for selected and highlighted elements.
0105 };
0106 
0107 #endif