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
const std::set< FWModelId > & selected() const
void itemChanged(const FWEventItem *)
void select(const FWModelId &iId)
const FWSelectionManager & operator=(const FWSelectionManager &)=delete
const std::set< FWEventItem * > & selectedItems() const
std::set< FWEventItem * > m_itemSelection
std::set< FWModelId > m_newSelection
void unselectItem(FWEventItem *)
void unselect(const FWModelId &iId)
FWModelChangeManager * m_changeManager
std::vector< std::pair< int, sigc::connection > > m_itemConnectionCount
sigc::signal< void, const FWSelectionManager & > itemSelectionChanged_
sigc::signal< void, const FWSelectionManager & > selectionChanged_
FWSelectionManager(FWModelChangeManager *iCM)
std::set< FWModelId > m_selection
void selectItem(FWEventItem *)