ICF 3.1.1.10
Technical documentation of ICF Libraries
CSelectionParamCameraComp.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#pragma once
7
8
9// Qt includes
10#include <QtCore/QMap>
11
12// ICF includes
13#include <QtCore/QString>
14#include <iprm/IParamsManager.h>
16
17
18namespace icam
19{
20
21
23{
24public:
26
27 I_BEGIN_COMPONENT(CSelectionParamCameraComp);
28 I_ASSIGN(m_selectionIdAttrPtr, "SelectionId", "ID of selection in parameter set", false, "CameraIndex");
29 I_ASSIGN(m_defaultIndexAttrPtr, "DefaultIndex", "Default selected index, if negative no selected parameter ID will be used", true, 0);
30 I_ASSIGN(m_paramsManagerIdAttrPtr, "ParamsManagerId", "ID of parameters manager in parameter set", false, "ParamsManager");
31 I_ASSIGN(m_defaultSelectionCompPtr, "DefaultSelection", "Selection used if no selection ID defined", false, "Input");
32 I_ASSIGN(m_defaultParamsManagerCompPtr, "DefaultParamsManager", "Manager of parameter set used to realize selection if no manager ID defined", false, "ParamsManager");
33 I_END_COMPONENT;
34
35 // reimplemented (iipr::IBitmapAcquisition)
36 istd::CIndex2d GetBitmapSize(const iprm::IParamsSet* paramsPtr) const override;
37
38 // reimplemented (iproc::IProcessor)
39 int GetProcessorState(const iprm::IParamsSet* paramsPtr) const override;
40 virtual bool AreParamsAccepted(
41 const iprm::IParamsSet* paramsPtr,
42 const istd::IPolymorphic* inputPtr,
43 const istd::IChangeable* outputPtr) const override;
45 const iprm::IParamsSet* paramsPtr,
46 const istd::IPolymorphic* inputPtr,
47 istd::IChangeable* outputPtr,
48 bool allowAsync = false,
49 iproc::IProgressManager* progressManagerPtr = nullptr) override;
50 void InitProcessor(const iprm::IParamsSet* paramsPtr, bool doReset) override;
51
52protected:
53 std::unique_ptr<const iprm::IParamsSet> CreateParamsSet(const iprm::IParamsSet* paramsPtr) const;
54
55 class JoinParamsSet: virtual public iprm::IParamsSet
56 {
57 public:
58 JoinParamsSet(const iprm::IParamsSet* origParamsPtr, const iprm::IParamsSet* selectedParamsPtr);
59
60 // reimplemented (iprm::IParamsSet)
61 Ids GetParamIds(bool editableOnly = false) const override;
62 const iser::ISerializable* GetParameter(const QByteArray& id) const override;
63 iser::ISerializable* GetEditableParameter(const QByteArray& id) override;
64
65 // reimplemented (iser::IObject)
66 QByteArray GetFactoryId() const override;
67
68 // reimplemented (iser::ISerializable)
69 bool Serialize(iser::IArchive& archive) override;
70
71 private:
72 const iprm::IParamsSet* m_origParamsPtr;
73 const iprm::IParamsSet* m_selectedParamsPtr;
74 };
75
76private:
77 I_ATTR(QByteArray, m_selectionIdAttrPtr);
78 I_ATTR(int, m_defaultIndexAttrPtr);
79 I_ATTR(QByteArray, m_paramsManagerIdAttrPtr);
80 I_REF(iprm::ISelectionParam, m_defaultSelectionCompPtr);
81 I_REF(iprm::IParamsManager, m_defaultParamsManagerCompPtr);
82
83 typedef std::unique_ptr<const iprm::IParamsSet> ParamSetPtr;
87 typedef std::map<int, ParamSetPtr> ParamsMap;
88
89 ParamsMap m_paramsMap;
90};
91
92
93} // namespace icam
94
95
Implementation of bitmap acquisition delegating all calls to some slave object.
const iser::ISerializable * GetParameter(const QByteArray &id) const override
Get any parameter.
iser::ISerializable * GetEditableParameter(const QByteArray &id) override
Get access to editable parameter.
QByteArray GetFactoryId() const override
bool Serialize(iser::IArchive &archive) override
Load or store state of this object as a archive stream.
JoinParamsSet(const iprm::IParamsSet *origParamsPtr, const iprm::IParamsSet *selectedParamsPtr)
Ids GetParamIds(bool editableOnly=false) const override
Get list of used parameter IDs in the parameter set.
int GetProcessorState(const iprm::IParamsSet *paramsPtr) const override
Get state of this processor for processing of specified parameters.
virtual bool AreParamsAccepted(const iprm::IParamsSet *paramsPtr, const istd::IPolymorphic *inputPtr, const istd::IChangeable *outputPtr) const override
Check if specified parameter set is accepted for this processor.
istd::CIndex2d GetBitmapSize(const iprm::IParamsSet *paramsPtr) const override
Get size of acquired bitmap for specified parameters.
std::unique_ptr< const iprm::IParamsSet > CreateParamsSet(const iprm::IParamsSet *paramsPtr) const
virtual iproc::CTaskState DoProcessing(const iprm::IParamsSet *paramsPtr, const istd::IPolymorphic *inputPtr, istd::IChangeable *outputPtr, bool allowAsync=false, iproc::IProgressManager *progressManagerPtr=nullptr) override
Do synchronized processing.
void InitProcessor(const iprm::IParamsSet *paramsPtr, bool doReset) override
Init processor and give him all or part of parameters.
Manager of parameters set.
Set of general parameters.
Definition IParamsSet.h:29
QSet< QByteArray > Ids
Definition IParamsSet.h:31
Interface allowing to select single option from list of options.
Represent state of asynchronous operation.
Definition CTaskState.h:28
Consume information about progress of some process.
Represent input/output persistence archive.
Definition IArchive.h:34
Common class for all classes which objects can be archived or restored from archive.
Index implementation for addressing elements in 2D-space.
Definition CIndex2d.h:25
Common interface for data model objects, which can be changed.
Definition IChangeable.h:32
Contains interfaces, implementations and components of image acquisition and processing.

© Witold Gantzke and Kirill Lepskiy