Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TEveSelection.h
Go to the documentation of this file.
1// @(#)root/eve:$Id$
2// Author: Matevz Tadel 2007
3
4/*************************************************************************
5 * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_TEveSelection
13#define ROOT_TEveSelection
14
15#include "TEveElement.h"
16
17#include "TQObject.h"
18
19#include <map>
20
22 public TQObject
23{
24public:
25 enum EPickToSelect // How to convert picking events to top selected element:
26 {
27 kPS_Ignore, // ignore picking
28 kPS_Element, // select element (default for selection)
29 kPS_Projectable, // select projectable
30 kPS_Compound, // select compound
31 kPS_PableCompound, // select projectable and compound
32 kPS_Master // select master element (top-level compound)
33 };
34
35private:
36 TEveSelection(const TEveSelection&); // Not implemented
37 TEveSelection& operator=(const TEveSelection&); // Not implemented
38
39protected:
40 typedef std::map<TEveElement*, Set_t> SelMap_t;
41 typedef std::map<TEveElement*, Set_t>::iterator SelMap_i;
42
46
48
52
53 void DoElementSelect (SelMap_i entry);
54 void DoElementUnselect(SelMap_i entry);
55
57
58public:
59 TEveSelection(const char* n="TEveSelection", const char* t="");
60 ~TEveSelection() override {}
61
62 void SetHighlightMode();
63
66
67 Bool_t GetIsMaster() const { return fIsMaster; }
69
70 Bool_t AcceptElement(TEveElement* el) override;
71
72 void AddElement(TEveElement* el) override;
73 void RemoveElement(TEveElement* el) override;
74 void RemoveElementLocal(TEveElement* el) override;
75 void RemoveElements() override;
76 void RemoveElementsLocal() override;
77
78 virtual void RemoveImpliedSelected(TEveElement* el);
79
81
82 void SelectionAdded(TEveElement* el); // *SIGNAL*
83 void SelectionRemoved(TEveElement* el); // *SIGNAL*
84 void SelectionCleared(); // *SIGNAL*
85 void SelectionRepeated(TEveElement* el); // *SIGNAL*
86
87 // ----------------------------------------------------------------
88 // Interface to make selection active/non-active.
89
90 virtual void ActivateSelection();
91 virtual void DeactivateSelection();
92
93 // ----------------------------------------------------------------
94 // User input processing.
95
97
98 virtual void UserPickedElement(TEveElement* el, Bool_t multi=kFALSE);
99 virtual void UserRePickedElement(TEveElement* el);
100 virtual void UserUnPickedElement(TEveElement* el);
101
102 // ----------------------------------------------------------------
103
104 ClassDefOverride(TEveSelection, 0); // Container for selected and highlighted elements.
105};
106
107#endif
bool Bool_t
Definition RtypesCore.h:63
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
A list of TEveElements.
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
Definition TEveElement.h:36
void(TEveElement::* ImplySelect_foo)()
void(TEveElement::* Select_foo)(Bool_t)
Make sure there is a SINGLE running TEveSelection for each selection type (select/highlight).
Bool_t AcceptElement(TEveElement *el) override
Pre-addition check.
TEveElement * MapPickedToSelected(TEveElement *el)
Given element el that was picked or clicked by the user, find the parent/ancestor element that should...
ImplySelect_foo fIncImpSelElement
ImplySelect_foo fDecImpSelElement
virtual void RemoveImpliedSelected(TEveElement *el)
Remove element from all implied-selected sets.
void RemoveElementsLocal() override
Virtual from TEveElement.
SelMap_t fImpliedSelected
std::map< TEveElement *, Set_t > SelMap_t
~TEveSelection() override
void RecheckImpliedSet(SelMap_i smi)
Recalculate implied-selected state for given selection entry.
void SetPickToSelect(Int_t ps)
void SelectionRepeated(TEveElement *el)
Called when secondary selection changed internally.
void SetHighlightMode()
Set to 'highlight' mode.
void SelectionRemoved(TEveElement *el)
Emit SelectionRemoved signal.
TEveSelection(const TEveSelection &)
void DoElementUnselect(SelMap_i entry)
Deselect element indicated by the entry and clear its implied-selected set.
void RecheckImpliedSetForElement(TEveElement *el)
If given element is selected or implied-selected with this selection and recheck implied-set for give...
void RemoveElements() override
Add an element into selection, virtual from TEveElement.
Select_foo fSelElement
virtual void DeactivateSelection()
Deactivate this selection.
void SetIsMaster(Bool_t m)
virtual void UserRePickedElement(TEveElement *el)
Called when secondary selection becomes empty.
virtual void ActivateSelection()
Activate this selection.
void RemoveElementLocal(TEveElement *el) override
Virtual from TEveElement.
virtual void UserPickedElement(TEveElement *el, Bool_t multi=kFALSE)
Called when user picks/clicks on an element.
void SelectionAdded(TEveElement *el)
Emit SelectionAdded signal.
Int_t GetPickToSelect() const
virtual void UserUnPickedElement(TEveElement *el)
Called when secondary selection becomes empty.
Bool_t GetIsMaster() const
void AddElement(TEveElement *el) override
Add an element into selection, virtual from TEveElement.
void RemoveElement(TEveElement *el) override
Add an element into selection, virtual from TEveElement.
void SelectionCleared()
Emit SelectionCleared signal.
void DoElementSelect(SelMap_i entry)
Select element indicated by the entry and fill its implied-selected set.
std::map< TEveElement *, Set_t >::iterator SelMap_i
TEveSelection & operator=(const TEveSelection &)
This is the ROOT implementation of the Qt object communication mechanism (see also http://www....
Definition TQObject.h:48
const Int_t n
Definition legend1.C:16
TMarker m
Definition textangle.C:8