ImagingTools Core SDK
CLayerViewComp.h
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ImtCore-Commercial
2#pragma once
3
4
5// ACF includes
6#include <iprm/IEnableableParam.h>
7#include <iprm/IIdParam.h>
8#include <iprm/IOptionsList.h>
9#include <iprm/ISelectionParam.h>
10#include <imod/TSingleModelObserverBase.h>
11#include <icomp/CComponentBase.h>
12#include <imod/CModelUpdateBridge.h>
13
14// ImtCore includes
15#include <imtbase/CStaticObjectCollection.h>
16#include <imtloggui/IScenographer.h>
17
18
19namespace imtloggui
20{
21
22
23class CLayerViewComp:
24 public icomp::CComponentBase,
26 public imod::TSingleModelObserverBase<iprm::ISelectionParam>,
27 virtual public iprm::IIdParam,
28 virtual public iprm::IEnableableParam
29{
30public:
31 typedef icomp::CComponentBase BaseClass;
32 typedef imtbase::CStaticObjectCollection BaseClass2;
33
34 I_BEGIN_COMPONENT(CLayerViewComp)
35 I_REGISTER_INTERFACE(IObjectCollection);
36 I_REGISTER_INTERFACE(iprm::IIdParam);
37 I_REGISTER_INTERFACE(iprm::IEnableableParam);
38 I_ASSIGN_MULTI_0(m_idAttrPtr, "RepresentationViewIds", "Representation view ids", false);
39 I_ASSIGN_MULTI_0(m_nameAttrPtr, "RepresentationViewNames", "Representation view names", false);
40 I_ASSIGN_MULTI_0(m_representationViewCompPtr, "RepresentationViews", "Representation views", false);
41 I_END_COMPONENT
42
43 CLayerViewComp();
44
45 // reimplemented (iprm::IEnableableParam)
46 virtual bool IsEnabled() const override;
47 virtual bool IsEnablingAllowed() const override;
48 virtual bool SetEnabled(bool isEnabled = true) override;
49
50 // reimplemented (iprm::IIdParam)
51 virtual QByteArray GetId() const override;
52 virtual void SetId(const QByteArray& id) override;
53
54protected:
55 QByteArray GetSelectedRepresentationViewId();
56
57 // reimplemented (imod::CSingleModelObserverBase)
58 virtual void OnUpdate(const istd::IChangeable::ChangeSet& changeSet) override;
59
60 // reimplemented (icomp::CComponentBase)
61 virtual void OnComponentCreated() override;
62
63private:
64 I_MULTIATTR(QByteArray, m_idAttrPtr);
65 I_MULTIATTR(QString, m_nameAttrPtr);
66 I_MULTIREF(IScenographer, m_representationViewCompPtr);
67
68 imod::CModelUpdateBridge m_updateBridge;
69 QByteArray m_groupId;
70 bool m_isEnabled;
71};
72
73
74} // namespace imtloggui
75
76