TMultiViewExtenderDelegatorCompWrap.h
Go to the documentation of this file.
1 #ifndef iqt2d_TMultiViewExtenderDelegatorCompWrap_included
2 #define iqt2d_TMultiViewExtenderDelegatorCompWrap_included
3 
4 
5 // ACF includes
6 #include <iqt2d/IViewExtender.h>
7 
8 
9 namespace iqt2d
10 {
11 
12 
16 template<class Base>
18  public Base,
19  virtual public iqt2d::IViewExtender
20 {
21 public:
22  typedef Base BaseClass;
23 
24  I_BEGIN_COMPONENT(TMultiViewExtenderDelegatorCompWrap);
25  I_REGISTER_INTERFACE(iqt2d::IViewExtender);
26  I_ASSIGN_MULTI_0(m_slaveExtendersCompPtr, "SlaveSceneExtenders", "List of the slave scene extenders", false);
27  I_END_COMPONENT;
28 
29  // reimplemented (iqt2d::IViewExtender)
30  virtual void AddItemsToScene(iqt2d::IViewProvider* providerPtr, int flags);
31  virtual void RemoveItemsFromScene(iqt2d::IViewProvider* providerPtr);
32 
33 private:
34  I_MULTIREF(iqt2d::IViewExtender, m_slaveExtendersCompPtr);
35 };
36 
37 
38 // reimplemented (iqt2d::IViewExtender)
39 
40 template<class Base>
42 {
43  if (m_slaveExtendersCompPtr.IsValid()){
44  int count = m_slaveExtendersCompPtr.GetCount();
45  for (int i = 0; i < count; i++){
46  if (m_slaveExtendersCompPtr[i] != NULL){
47  m_slaveExtendersCompPtr[i]->AddItemsToScene(providerPtr, flags);
48  }
49  }
50  }
51 }
52 
53 
54 template<class Base>
56 {
57  if (m_slaveExtendersCompPtr.IsValid()){
58  int count = m_slaveExtendersCompPtr.GetCount();
59  for (int i = 0; i < count; i++){
60  if (m_slaveExtendersCompPtr[i] != NULL){
61  m_slaveExtendersCompPtr[i]->RemoveItemsFromScene(providerPtr);
62  }
63  }
64  }
65 }
66 
67 
69 
70 
71 } // namespace iqt2d
72 
73 
74 #endif // !iqt2d_TMultiViewExtenderDelegatorCompWrap_included
75 
Interface for GUI objects presenting its results using extern view objects.
Definition: IViewExtender.h:19
Iterates over the list of the scene extenders to show their shapes on the same view provider...
virtual void RemoveItemsFromScene(iqt2d::IViewProvider *providerPtr)
Called when items should be removed from specified scene.
virtual void AddItemsToScene(iqt2d::IViewProvider *providerPtr, int flags)
Called when items should be added to specified scene.
#define NULL
Definition: istd.h:64
Interface for GUI objects managing view.
Definition: IViewProvider.h:24
TMultiViewExtenderDelegatorCompWrap< icomp::CComponentBase > CMultiViewExtenderDelegatorComp

© 2007-2017 Witold Gantzke and Kirill Lepskiy