CSelectionParamCameraComp.h
Go to the documentation of this file.
1 #ifndef iprm_CSelectionParamCameraComp_included
2 #define iprm_CSelectionParamCameraComp_included
3 
4 
5 // Qt includes
6 #include <QtCore/QMap>
7 
8 // ACF includes
9 #include "istd/TDelPtr.h"
10 #include <QtCore/QString>
11 #include "iprm/IParamsManager.h"
12 
13 // ACF-Solutions include
15 
16 
17 namespace icam
18 {
19 
20 
22 {
23 public:
25 
26  I_BEGIN_COMPONENT(CSelectionParamCameraComp);
27  I_ASSIGN(m_selectionIdAttrPtr, "SelectionId", "ID of selection in parameter set", false, "CameraIndex");
28  I_ASSIGN(m_defaultIndexAttrPtr, "DefaultIndex", "Default selected index, if negative no selected parameter ID will be used", true, 0);
29  I_ASSIGN(m_paramsManagerIdAttrPtr, "ParamsManagerId", "ID of parameters manager in parameter set", false, "ParamsManager");
30  I_ASSIGN(m_defaultSelectionCompPtr, "DefaultSelection", "Selection used if no selection ID defined", false, "Input");
31  I_ASSIGN(m_defaultParamsManagerCompPtr, "DefaultParamsManager", "Manager of parameter set used to realize selection if no manager ID defined", false, "ParamsManager");
32  I_END_COMPONENT;
33 
34  // reimplemented (iipr::IBitmapAcquisition)
35  virtual istd::CIndex2d GetBitmapSize(const iprm::IParamsSet* paramsPtr) const;
36 
37  // reimplemented (iproc::IProcessor)
38  virtual int GetProcessorState(const iprm::IParamsSet* paramsPtr) const;
39  virtual bool AreParamsAccepted(
40  const iprm::IParamsSet* paramsPtr,
41  const istd::IPolymorphic* inputPtr,
42  const istd::IChangeable* outputPtr) const;
43  virtual int DoProcessing(
44  const iprm::IParamsSet* paramsPtr,
45  const istd::IPolymorphic* inputPtr,
46  istd::IChangeable* outputPtr,
47  ibase::IProgressManager* progressManagerPtr = NULL);
48  virtual int BeginTask(
49  const iprm::IParamsSet* paramsPtr,
50  const istd::IPolymorphic* inputPtr,
51  istd::IChangeable* outputPtr,
52  ibase::IProgressManager* progressManagerPtr = NULL);
53  virtual int WaitTaskFinished(
54  int taskId = -1,
55  double timeoutTime = -1,
56  bool killOnTimeout = true);
57  virtual void CancelTask(int taskId = -1);
58  virtual void InitProcessor(const iprm::IParamsSet* paramsPtr);
59 
60 protected:
61  const iprm::IParamsSet* CreateParamsSet(const iprm::IParamsSet* paramsPtr) const;
62 
63  class JoinParamsSet: virtual public iprm::IParamsSet
64  {
65  public:
66  JoinParamsSet(const iprm::IParamsSet* origParamsPtr, const iprm::IParamsSet* selectedParamsPtr);
67 
68  // reimplemented (iprm::IParamsSet)
69  virtual Ids GetParamIds(bool editableOnly = false) const;
70  virtual const iser::ISerializable* GetParameter(const QByteArray& id) const;
71  virtual iser::ISerializable* GetEditableParameter(const QByteArray& id);
72 
73  // reimplemented (iser::ISerializable)
74  virtual bool Serialize(iser::IArchive& archive);
75 
76  private:
77  const iprm::IParamsSet* m_origParamsPtr;
78  const iprm::IParamsSet* m_selectedParamsPtr;
79  };
80 
81 private:
82  I_ATTR(QByteArray, m_selectionIdAttrPtr);
83  I_ATTR(int, m_defaultIndexAttrPtr);
84  I_ATTR(QByteArray, m_paramsManagerIdAttrPtr);
85  I_REF(iprm::ISelectionParam, m_defaultSelectionCompPtr);
86  I_REF(iprm::IParamsManager, m_defaultParamsManagerCompPtr);
87 
92  typedef QMap<int, ParamSetPtr> ParamsMap;
93 
94  ParamsMap m_paramsMap;
95 };
96 
97 
98 } // namespace icam
99 
100 
101 #endif // !iprm_CSelectionParamCameraComp_included
102 
103 
virtual bool Serialize(iser::IArchive &archive)
virtual iser::ISerializable * GetEditableParameter(const QByteArray &id)
virtual void CancelTask(int taskId=-1)
Remove task from queue.
const iprm::IParamsSet * CreateParamsSet(const iprm::IParamsSet *paramsPtr) const
virtual int WaitTaskFinished(int taskId=-1, double timeoutTime=-1, bool killOnTimeout=true)
Wait for task is finished.
virtual int BeginTask(const iprm::IParamsSet *paramsPtr, const istd::IPolymorphic *inputPtr, istd::IChangeable *outputPtr, ibase::IProgressManager *progressManagerPtr=NULL)
Begin new task for this processor and add them to queue.
virtual bool AreParamsAccepted(const iprm::IParamsSet *paramsPtr, const istd::IPolymorphic *inputPtr, const istd::IChangeable *outputPtr) const
Check if specified parameter set is accepted for this processor.
Implementation of bitmap acquisition delegating all calls to some slave object.
virtual Ids GetParamIds(bool editableOnly=false) const
virtual const iser::ISerializable * GetParameter(const QByteArray &id) const
virtual int GetProcessorState(const iprm::IParamsSet *paramsPtr) const
Get state of this processor for processing of specified parameters.
virtual int DoProcessing(const iprm::IParamsSet *paramsPtr, const istd::IPolymorphic *inputPtr, istd::IChangeable *outputPtr, ibase::IProgressManager *progressManagerPtr=NULL)
Do synchronized processing.
JoinParamsSet(const iprm::IParamsSet *origParamsPtr, const iprm::IParamsSet *selectedParamsPtr)
virtual void InitProcessor(const iprm::IParamsSet *paramsPtr)
Init processor to optimal process with specified params.
virtual istd::CIndex2d GetBitmapSize(const iprm::IParamsSet *paramsPtr) const
Get size of acquired bitmap for specified parameters.

© 2007-2011 Witold Gantzke and Kirill Lepskiy