CSelectableSceneExtenderComp.h
Go to the documentation of this file.
1 #ifndef iqt2d_CSelectableSceneExtenderComp_included
2 #define iqt2d_CSelectableSceneExtenderComp_included
3 
4 
5 // ACF includes
7 #include <icomp/CComponentBase.h>
8 #include <iprm/ISelectionParam.h>
9 #include <iqt2d/IViewExtender.h>
10 
11 
12 namespace iqt2d
13 {
14 
15 
17  public icomp::CComponentBase,
18  public imod::TSingleModelObserverBase<iprm::ISelectionParam>,
19  virtual public iqt2d::IViewExtender
20 {
21 public:
24 
26 
27  I_BEGIN_COMPONENT(CSelectableSceneExtenderComp);
28  I_REGISTER_INTERFACE(iqt2d::IViewExtender);
29  I_REGISTER_INTERFACE(imod::IObserver);
30  I_ASSIGN_MULTI_0(m_extendersCompPtr, "SceneExtenders", "List of scene extenders", true);
31  I_END_COMPONENT;
32 
33  // reimplemented (imod::IObserver)
34  virtual bool OnModelAttached(imod::IModel* modelPtr, istd::IChangeable::ChangeSet& changeMask);
35  virtual bool OnModelDetached(imod::IModel* modelPtr);
36 
37  // reimplemented (iqt2d::IViewExtender)
38  virtual void AddItemsToScene(iqt2d::IViewProvider* providerPtr, int flags);
39  virtual void RemoveItemsFromScene(iqt2d::IViewProvider* providerPtr);
40 
41 protected:
42  void AttachCurrent();
43  void DetachCurrent();
44 
45  // reimplemented (imod::CSingleModelObserverBase)
46  virtual void AfterUpdate(imod::IModel* modelPtr, const istd::IChangeable::ChangeSet& changeSet);
47 
48 private:
49  I_MULTIREF(iqt2d::IViewExtender, m_extendersCompPtr);
50 
51  typedef QMap<iqt2d::IViewProvider*, int> ConnectedSceneFlags; // maps connected scene provider to connection flags
52  ConnectedSceneFlags m_connectedSceneFlags;
53 
54  int m_currentSelectedIndex;
55 };
56 
57 
58 } // namespace iqt2d
59 
60 
61 #endif // !iqt2d_CSelectableSceneExtenderComp_included
62 
63 
Interface for GUI objects presenting its results using extern view objects.
Definition: IViewExtender.h:19
Base class for component implementation.
virtual bool OnModelAttached(imod::IModel *modelPtr, istd::IChangeable::ChangeSet &changeMask)
This call back function will be called, if an observable object is about to be attached.
virtual bool OnModelDetached(imod::IModel *modelPtr)
This call back function will be called, if an observable object is about to be detached.
Basic implementation for a single model observer with binding to concrete data object interface...
virtual void AddItemsToScene(iqt2d::IViewProvider *providerPtr, int flags)
Called when items should be added to specified scene.
virtual void RemoveItemsFromScene(iqt2d::IViewProvider *providerPtr)
Called when items should be removed from specified scene.
imod::TSingleModelObserverBase< iprm::ISelectionParam > BaseClass2
virtual void AfterUpdate(imod::IModel *modelPtr, const istd::IChangeable::ChangeSet &changeSet)
This function will be called after update of the observer contents occures.
Common interface for all classes implementing the Observer functionality in the Model/Observer design...
Definition: IObserver.h:24
Common interface for model objects, that supports Model/Observer design pattern.
Definition: IModel.h:23
Set of change flags (its IDs).
Definition: IChangeable.h:30
Interface for GUI objects managing view.
Definition: IViewProvider.h:24

© 2007-2017 Witold Gantzke and Kirill Lepskiy