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 virtual ~TEveSelection() {}
61
62 void SetHighlightMode();
63
66
67 Bool_t GetIsMaster() const { return fIsMaster; }
69
70 virtual Bool_t AcceptElement(TEveElement* el);
71
72 virtual void AddElement(TEveElement* el);
73 virtual void RemoveElement(TEveElement* el);
74 virtual void RemoveElementLocal(TEveElement* el);
75 virtual void RemoveElements();
76 virtual void RemoveElementsLocal();
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 ClassDef(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 ClassDef(name, id)
Definition Rtypes.h:337
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).
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.
virtual Bool_t AcceptElement(TEveElement *el)
Pre-addition check.
SelMap_t fImpliedSelected
std::map< TEveElement *, Set_t > SelMap_t
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 &)
virtual ~TEveSelection()
void DoElementUnselect(SelMap_i entry)
Deselect element indicated by the entry and clear its implied-selected set.
virtual void RemoveElements()
Add an element into selection, virtual from TEveElement.
void RecheckImpliedSetForElement(TEveElement *el)
If given element is selected or implied-selected with this selection and recheck implied-set for give...
virtual void RemoveElement(TEveElement *el)
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.
virtual void RemoveElementsLocal()
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
virtual void AddElement(TEveElement *el)
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 &)
virtual void RemoveElementLocal(TEveElement *el)
Virtual from TEveElement.
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