ICF 3.0.5.47
Technical documentation of ICF Libraries
CCalibration2dProxyComp.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// ICF includes
12#include <i2d/ICalibration2d.h>
14
15
16namespace icalib
17{
18
19
27{
28public:
30
31 I_BEGIN_COMPONENT(CCalibration2dProxyComp);
32 I_REGISTER_INTERFACE(ICalibration2d);
33 I_REGISTER_INTERFACE(ITransformation2d);
34 I_REGISTER_INTERFACE(istd::IChangeable);
35 I_ASSIGN(m_calibrationProviderCompPtr, "CalibrationProvider", "Provider of a 2D calibration", true, "CalibrationProvider");
36 I_ASSIGN_TO(m_calibrationProviderModelCompPtr, m_calibrationProviderCompPtr, true);
37 I_ASSIGN(m_defaultCalibrCompPtr, "DefaultCalibrationProvider", "Provides default (fallback) calibration if the input calibration provider was failed", false, "DefaultCalibrationProvider");
38 I_END_COMPONENT;
39
41
42 // reimplemented (i2d::ICalibration2d)
43 const i2d::CRectangle* GetArgumentArea() const override;
44 const i2d::CRectangle* GetResultArea() const override;
45 const imath::IUnitInfo* GetArgumentUnitInfo() const override;
46 const imath::IUnitInfo* GetResultUnitInfo() const override;
47 std::unique_ptr<i2d::ICalibration2d> CreateCombinedCalibration(const ITransformation2d& transformation) const override;
48
49 // reimplemented (i2d::ITransformation2d)
50 int GetTransformationFlags() const override;
51 virtual bool GetDistance(
52 const i2d::CVector2d& origPos1,
53 const i2d::CVector2d& origPos2,
54 double& result,
55 ExactnessMode mode = EM_NONE) const override;
56 virtual bool GetPositionAt(
57 const i2d::CVector2d& origPosition,
58 i2d::CVector2d& result,
59 ExactnessMode mode = EM_NONE) const override;
60 virtual bool GetInvPositionAt(
61 const i2d::CVector2d& transfPosition,
62 i2d::CVector2d& result,
63 ExactnessMode mode = EM_NONE) const override;
64 virtual bool GetLocalTransform(
65 const i2d::CVector2d& origPosition,
66 i2d::CAffine2d& result,
67 ExactnessMode mode = EM_NONE) const override;
69 const i2d::CVector2d& transfPosition,
70 i2d::CAffine2d& result,
71 ExactnessMode mode = EM_NONE) const override;
72
73 // reimplemented (imath::TISurjectFunction<i2d::CVector2d, i2d::CVector2d>)
74 bool GetInvValueAt(const i2d::CVector2d& argument, i2d::CVector2d& result) const override;
75 i2d::CVector2d GetInvValueAt(const i2d::CVector2d& argument) const override;
76
77 // reimplemented (imath::TIMathFunction<i2d::CVector2d, i2d::CVector2d>)
78 bool GetValueAt(const i2d::CVector2d& argument, i2d::CVector2d& result) const override;
79 i2d::CVector2d GetValueAt(const i2d::CVector2d& argument) const override;
80
81 // reimplemented (iser::ISerializable)
82 bool Serialize(iser::IArchive& archive) override;
83
84 // reimplemented (istd::IChangeable)
85 std::unique_ptr<istd::IChangeable> CloneMe(CompatibilityMode mode = CM_WITHOUT_REFS) const override;
86
87protected:
88 // reimplemented (icomp::CComponentBase)
89 void OnComponentCreated() override;
90 void OnComponentDestroyed() override;
91
92private:
93 const i2d::ICalibration2d* GetCalibration() const;
94
95private:
96 I_REF(i2d::ICalibration2dProvider, m_calibrationProviderCompPtr);
97 I_REF(imod::IModel, m_calibrationProviderModelCompPtr);
98 I_REF(i2d::ICalibration2d, m_defaultCalibrCompPtr);
99
100 imod::CModelUpdateBridge m_updateBridge;
101};
102
103
104} // namespace icalib
105
106
This class defines an affine 2D-transformation.
Definition CAffine2d.h:22
Definition of rectangle area orthogonal to axis of coordination system.
Definition CRectangle.h:31
Definition of position or mathematical vector on 2D plane.
Definition CVector2d.h:29
Common interface for an object, which delivers a 2D-calibration.
@ EM_NONE
There are no preferences, should be automatically selected.
Implementation of a proxy of ICalibration2d interface realized over ICalibration2dProvider access.
std::unique_ptr< i2d::ICalibration2d > CreateCombinedCalibration(const ITransformation2d &transformation) const override
virtual bool GetDistance(const i2d::CVector2d &origPos1, const i2d::CVector2d &origPos2, double &result, ExactnessMode mode=EM_NONE) const override
Compute a shortness distance in transformed coordinations.
bool GetInvValueAt(const i2d::CVector2d &argument, i2d::CVector2d &result) const override
bool Serialize(iser::IArchive &archive) override
Load or store state of this object as a archive stream.
virtual bool GetPositionAt(const i2d::CVector2d &origPosition, i2d::CVector2d &result, ExactnessMode mode=EM_NONE) const override
Get position after transformation.
i2d::CVector2d GetValueAt(const i2d::CVector2d &argument) const override
void OnComponentCreated() override
std::unique_ptr< istd::IChangeable > CloneMe(CompatibilityMode mode=CM_WITHOUT_REFS) const override
Make a copy of this object.
const i2d::CRectangle * GetArgumentArea() const override
Get optional area where arguments are defined properly.
i2d::CVector2d GetInvValueAt(const i2d::CVector2d &argument) const override
bool GetValueAt(const i2d::CVector2d &argument, i2d::CVector2d &result) const override
virtual bool GetLocalTransform(const i2d::CVector2d &origPosition, i2d::CAffine2d &result, ExactnessMode mode=EM_NONE) const override
Get local transformation (from original to transformed coordinate system) at some original position.
void OnComponentDestroyed() override
virtual bool GetLocalInvTransform(const i2d::CVector2d &transfPosition, i2d::CAffine2d &result, ExactnessMode mode=EM_NONE) const override
Get local transformation (from transformed to original coordinate system) at some transformed positio...
const imath::IUnitInfo * GetArgumentUnitInfo() const override
Get unit description of calibration input (transformation function argument).
const imath::IUnitInfo * GetResultUnitInfo() const override
Get unit description of calibration output (transformation function result).
virtual bool GetInvPositionAt(const i2d::CVector2d &transfPosition, i2d::CVector2d &result, ExactnessMode mode=EM_NONE) const override
Get position after transformation.
const i2d::CRectangle * GetResultArea() const override
Get optional area where results are defined properly.
int GetTransformationFlags() const override
Get flags of describing type of this transformation.
Base class for component implementation.
Common interface to get information about a measurement unit.
Definition IUnitInfo.h:27
Reflects the changes of observed objects as changes of some other object (over istd::IChangeable),...
Common interface for model objects, that supports Model/Observer design pattern.
Definition IModel.h:29
Represent input/output persistence archive.
Definition IArchive.h:33
Common interface for data model objects, which can be changed.
Definition IChangeable.h:32
CompatibilityMode
Control how relationship betweeen objects are interpreted.
@ CM_WITHOUT_REFS
External references are simple ignored.
Contains interfaces, implementations and components related to 2D calibration and transformations.

© Witold Gantzke and Kirill Lepskiy