ICF 3.1.1.10
Technical documentation of ICF Libraries
CExtComposedParamsSetGuiComp.h
Go to the documentation of this file.
1/********************************************************************************
2** This file is part of the ICF Framework. Copyright (C) Witold Gantzke & Kirill Lepskiy
3** ICF Framework may be used under the terms of the LGPL License v. 2.1 by the Free Software Foundation.
4********************************************************************************/
5
6#ifndef iqtprm_CExtComposedParamsSetGuiComp_included
7#define iqtprm_CExtComposedParamsSetGuiComp_included
8
9
10// Qt includes
11#include <QtCore/QString>
12#include <QtCore/QSet>
13
14// ICF includes
16#include <iprm/IParamsSet.h>
20#include <iprmgui/iprmgui.h>
21
22
23namespace iprmgui
24{
25
26
32 istdgui::CComposedGuiComp, imod::TSingleModelObserverBase<iprm::IParamsSet> >,
34{
35public:
38
39 I_BEGIN_COMPONENT(CExtComposedParamsSetGuiComp);
40 I_REGISTER_INTERFACE(i2dgui::IViewExtender);
41 I_REGISTER_INTERFACE(imod::IModelEditor);
42 I_ASSIGN_MULTI_0(m_editorsCompPtr, "Editors", "List of GUI's for parameters edition", true);
43 I_ASSIGN_TO(m_observersCompPtr, m_editorsCompPtr, true);
44 I_ASSIGN_TO(m_extendersCompPtr, m_editorsCompPtr, false);
45 I_ASSIGN_MULTI_0(m_idsAttrPtr, "Ids", "List of parameter ID's according to defined editors, if ID equals '*' then the observed parameter set will be used, if it is empty than only GUI will be shown, but no parameter will be connected", true);
46 I_ASSIGN(m_showAllShapesAttrPtr, "ShowAllShapes", "If true all shapes, also generated by inactive GUI, will be shown", true, false);
47 I_END_COMPONENT;
48
49 // reimplemented (imod::IModelEditor)
50 void UpdateEditor(const istd::IChangeable::ChangeSet& changeSet) override;
51 void SetReadOnly(bool state) override;
52
53 // reimplemented (istdgui::CGuiComponentBase)
54 void OnGuiCreated() override;
55 void OnGuiDestroyed() override;
56
57 // reimplemented (i2dgui::IViewExtender)
58 void AddItemsToScene(i2dgui::IViewProvider* providerPtr, int flags) override;
59 void RemoveItemsFromScene(i2dgui::IViewProvider* providerPtr) override;
60
61protected:
62 void AttachToScene(i2dgui::IViewProvider* providerPtr, int flags);
64
65 // reimplemented (istdgui::CMultiPageGuiCompBase)
66 void CreatePages() override;
67 void OnPageChanged(int widgetIndex) override;
68
69 // reimplemented (istdgui::TGuiObserverWrap)
70 void OnGuiModelAttached() override;
71 void OnGuiModelDetached() override;
72 void UpdateModel() const override;
73
74private:
75 I_MULTIREF(imod::IModelEditor, m_editorsCompPtr);
76 I_MULTIREF(imod::IObserver, m_observersCompPtr);
77 I_MULTIREF(i2dgui::IViewExtender, m_extendersCompPtr);
78 I_MULTIATTR(QByteArray, m_idsAttrPtr);
79 I_MULTITEXTATTR(m_namesAttrPtr);
80 I_ATTR(bool, m_showAllShapesAttrPtr);
81
82 typedef QMap<imod::IModelEditor*, bool> ConnectedEditorsMap;
83 ConnectedEditorsMap m_connectedEditorsMap;
84
85 typedef QMap<i2dgui::IViewProvider*, int> ConnectedSceneFlags; // maps connected scene provider to connection flags
86 ConnectedSceneFlags m_connectedSceneFlags;
87};
88
89
90} // namespace iprmgui
91
92
93#endif // !iqtprm_CExtComposedParamsSetGuiComp_included
94
95
Interface for GUI objects presenting its results using extern view objects.
Interface for GUI objects managing view.
Common interface for an model editor.
Common interface for all classes implementing the Observer functionality in the Model/Observer design...
Definition IObserver.h:30
Basic implementation for a single model observer with binding to concrete data object interface.
New version of parameter set UI based on standard multi page UI concept.
void DetachFromScene(i2dgui::IViewProvider *providerPtr)
void OnGuiDestroyed() override
Called just before GUI is released.
void UpdateModel() const override
Do update of the model to reflect the current contents of GUI.
void RemoveItemsFromScene(i2dgui::IViewProvider *providerPtr) override
Called when items should be removed from specified scene.
void SetReadOnly(bool state) override
Set flag that the model data can be changed.
void AddItemsToScene(i2dgui::IViewProvider *providerPtr, int flags) override
Called when items should be added to specified scene.
void CreatePages() override
Create all container pages.
void OnGuiModelDetached() override
Called when model is detached or GUI is destroyed.
void OnPageChanged(int widgetIndex) override
void OnGuiCreated() override
Called just after GUI is initialized.
istdgui::TGuiObserverWrap< istdgui::CComposedGuiComp, imod::TSingleModelObserverBase< iprm::IParamsSet > > BaseClass
void AttachToScene(i2dgui::IViewProvider *providerPtr, int flags)
void UpdateEditor(const istd::IChangeable::ChangeSet &changeSet) override
Updates editor with model data.
void OnGuiModelAttached() override
Called when model is attached and GUI is created.
Set of change flags (its IDs).
Definition IChangeable.h:38
Component for the layouting/grouping of the UI-subcomponents.
Join functionality of istdgui::IGuiObject interface and imod::IObserver.
This package contains Qt based implementations of standard parameter components.

© Witold Gantzke and Kirill Lepskiy