CMS 3D CMS Logo

FWSelectionManager.h
Go to the documentation of this file.
1 #ifndef Fireworks_Core_FWSelectionManager_h
2 #define Fireworks_Core_FWSelectionManager_h
3 // -*- C++ -*-
4 //
5 // Package: Core
6 // Class : FWSelectionManager
7 //
16 //
17 // Original Author: Chris Jones
18 // Created: Fri Jan 18 14:40:45 EST 2008
19 //
20 
21 // system include files
22 #include "sigc++/signal.h"
23 #include "sigc++/connection.h"
24 #include <set>
25 #include <vector>
26 
27 // user include files
29 
30 // forward declarations
31 class FWEventItem;
33 
35  //only an item can set the selection
36  friend class FWEventItem;
37 
38 public:
40  //virtual ~FWSelectionManager();
41 
42  // ---------- const member functions ---------------------
43  const std::set<FWModelId>& selected() const;
44 
45  const std::set<FWEventItem*>& selectedItems() const;
46  // ---------- static member functions --------------------
47 
48  // ---------- member functions ---------------------------
49  void clearSelection();
50  void clearItemSelection();
52 
53  sigc::signal<void, const FWSelectionManager&> selectionChanged_;
54  sigc::signal<void, const FWSelectionManager&> itemSelectionChanged_;
55 
56 private:
57  void finishedAllSelections();
58  void select(const FWModelId& iId);
59  void unselect(const FWModelId& iId);
60  void itemChanged(const FWEventItem*);
61 
62  void selectItem(FWEventItem*);
64 
65  FWSelectionManager(const FWSelectionManager&) = delete; // stop default
66 
67  const FWSelectionManager& operator=(const FWSelectionManager&) = delete; // stop default
68 
69  // ---------- member data --------------------------------
71  std::set<FWModelId> m_selection;
72  std::set<FWModelId> m_newSelection;
74  std::vector<std::pair<int, sigc::connection> > m_itemConnectionCount;
75  std::set<FWEventItem*> m_itemSelection;
76 };
77 
78 #endif
FWSelectionManager::finishedAllSelections
void finishedAllSelections()
Definition: FWSelectionManager.cc:91
FWSelectionManager::unselect
void unselect(const FWModelId &iId)
Definition: FWSelectionManager.cc:117
FWSelectionManager::m_changeManager
FWModelChangeManager * m_changeManager
Definition: FWSelectionManager.h:70
FWModelId
Definition: FWModelId.h:28
FWModelId.h
FWModelChangeManager
Definition: FWModelChangeManager.h:33
FWSelectionManager::clearSelection
void clearSelection()
Definition: FWSelectionManager.cc:63
FWSelectionManager::select
void select(const FWModelId &iId)
Definition: FWSelectionManager.cc:99
FWSelectionManager::itemChanged
void itemChanged(const FWEventItem *)
Definition: FWSelectionManager.cc:129
FWSelectionManager::itemSelectionChanged_
sigc::signal< void, const FWSelectionManager & > itemSelectionChanged_
Definition: FWSelectionManager.h:54
FWSelectionManager::selectionChanged_
sigc::signal< void, const FWSelectionManager & > selectionChanged_
Definition: FWSelectionManager.h:53
FWSelectionManager::selected
const std::set< FWModelId > & selected() const
Definition: FWSelectionManager.cc:168
FWSelectionManager::selectItem
void selectItem(FWEventItem *)
Definition: FWSelectionManager.cc:157
FWSelectionManager::selectedItems
const std::set< FWEventItem * > & selectedItems() const
Definition: FWSelectionManager.cc:170
FWSelectionManager::clearModelSelectionLeaveItem
void clearModelSelectionLeaveItem()
Definition: FWSelectionManager.cc:83
FWSelectionManager
Definition: FWSelectionManager.h:34
FWSelectionManager::m_wasChanged
bool m_wasChanged
Definition: FWSelectionManager.h:73
FWSelectionManager::operator=
const FWSelectionManager & operator=(const FWSelectionManager &)=delete
FWSelectionManager::clearItemSelection
void clearItemSelection()
Definition: FWSelectionManager.cc:72
FWEventItem
Definition: FWEventItem.h:56
FWSelectionManager::m_itemConnectionCount
std::vector< std::pair< int, sigc::connection > > m_itemConnectionCount
Definition: FWSelectionManager.h:74
FWSelectionManager::m_itemSelection
std::set< FWEventItem * > m_itemSelection
Definition: FWSelectionManager.h:75
FWSelectionManager::m_newSelection
std::set< FWModelId > m_newSelection
Definition: FWSelectionManager.h:72
FWSelectionManager::FWSelectionManager
FWSelectionManager(FWModelChangeManager *iCM)
Definition: FWSelectionManager.cc:34
FWSelectionManager::unselectItem
void unselectItem(FWEventItem *)
Definition: FWSelectionManager.cc:161
FWSelectionManager::m_selection
std::set< FWModelId > m_selection
Definition: FWSelectionManager.h:71