ATLAS Offline Software
Loading...
Searching...
No Matches
AscObjSelectionManager.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5
7// //
8// Header file for class AscObjSelectionManager //
9// //
10// Description: Manages selection of associated objects //
11// //
12// Author: Thomas H. Kittelmann (Thomas.Kittelmann@cern.ch) //
13// Initial version: April 2008 //
14// //
16
17#ifndef ASCOBJSELECTIONMANAGER_H
18#define ASCOBJSELECTIONMANAGER_H
19
20//Fixme: Make this class usable by prd system also. Maybe make common
21//handle base class which tells simple/detailed nodes?
22
24#include <QObject>
25#include <QList>
26
28class IVP13DSystem;
31class SoSeparator;
32class SoNode;
33class SoPath;
34
35//Lifetime of this object should be from system refresh to system erase.
36
37class AscObjSelectionManager : public QObject, public VP1HelperClassBase {
38
39 Q_OBJECT
40
41public:
42 //Will create selection nodes as appropriate under the event root.
44 void aboutTodelete();//Call this just before deletion (needed since signals should not be emitted from destructors).
46 //Associated objects must all be attached under this separator:
47 SoSeparator * getAscObjAttachSep() const;
48
50 //Fixme: add method for changing mode of operation (single, toggle, shift+click)
51
52 enum MODE { SINGLE, TOGGLE, SHIFT };
53 static QString toString(MODE) ;
54 MODE mode() const;
55 void setMode(MODE);
56
58
59 void ensureDeselected(const QList<AssociatedObjectHandleBase*>&);
60 void ensureSelected(const QList<AssociatedObjectHandleBase*>&);//Call with length==1 if in single mode.
61 void deselectAll();
62
63 const QList<AssociatedObjectHandleBase*>& currentSelection() const;
64
65 SoSeparator* eventRoot();
66
67signals:
68 void currentSelectionChanged(const QList<AssociatedObjectHandleBase*>&);
69
70private:
71 //For system:
72 friend class VP1TrackSystem;
73// void setEventData( SoCooperativeSelection * sel_click, SoCooperativeSelection * sel_highlight );
74// void eraseEventData();
75 //The following returns true if the passed selection node belongs to
76 //this manager (if not, the system must handle the selection in
77 //another way).
79 void userClickedOnBgd();
80
81// bool handleUserDeselectedSingleNode(SoCooperativeSelection*, SoNode* , SoPath*);//SINGLE
82// bool handleUserChangedSelection(SoCooperativeSelection*, QSet<SoNode*>, QSet<SoPath*>);//TOGGLE/SHIFT
83private:
84 //For associated objects:
86 void registerAscObj(SoSeparator*simple,SoSeparator *detailed,AssociatedObjectHandleBase*);
87 void unregisterAscObj(SoSeparator*simple,SoSeparator *detailed);
88 //Fixme: When a handle changes pickable state to unpickable it
89 //must be removed from selection list if selected!
90private Q_SLOTS:
91// void ascObjDetailLevelAboutToChange();
93private:
94 class Imp;
96};
97
98#endif
#define MODE
void unregisterAscObj(SoSeparator *simple, SoSeparator *detailed)
void pretendUserClicked(AssociatedObjectHandleBase *)
void ensureSelected(const QList< AssociatedObjectHandleBase * > &)
bool handleUserSelectedSingleNode(SoCooperativeSelection *, SoNode *, SoPath *, AssociatedObjectHandleBase *&)
void currentSelectionChanged(const QList< AssociatedObjectHandleBase * > &)
void registerAscObj(SoSeparator *simple, SoSeparator *detailed, AssociatedObjectHandleBase *)
SoSeparator * getAscObjAttachSep() const
AscObjSelectionManager(SoSeparator *eventRoot, IVP13DSystem *, TrackSystemController *)
const QList< AssociatedObjectHandleBase * > & currentSelection() const
void ensureDeselected(const QList< AssociatedObjectHandleBase * > &)
VP1HelperClassBase(IVP1System *sys=0, QString helpername="")