TObject2dCompWrap.h
Go to the documentation of this file.
1 #ifndef i2d_TObject2dCompWrap_included
2 #define i2d_TObject2dCompWrap_included
3 
4 
5 // ACF includes
6 #include <icomp/CComponentBase.h>
7 #include <i2d/ICalibration2d.h>
8 #include <i2d/IObject2d.h>
9 
10 
11 namespace i2d
12 {
13 
14 
19 template <class BaseObject2d>
20 class TObject2dCompWrap: public icomp::CComponentBase, public BaseObject2d
21 {
22 public:
24  typedef BaseObject2d BaseClass2;
25 
26  I_BEGIN_COMPONENT(TObject2dCompWrap);
27  I_REGISTER_INTERFACE(IObject2d);
28  I_REGISTER_INTERFACE(iser::ISerializable);
29  I_REGISTER_INTERFACE(istd::IChangeable);
30  I_ASSIGN(m_calibrationCompPtr, "Calibration", "Calibration associated with this 2d object", false, "Calibration");
31  I_END_COMPONENT;
32 
33 protected:
34  // reimplemented (icomp::CComponentBase)
35  virtual void OnComponentCreated();
36 
37 private:
38  I_REF(i2d::ICalibration2d, m_calibrationCompPtr);
39 };
40 
41 
42 // protected methods
43 
44 // reimplemented (icomp::CComponentBase)
45 
46 template <class BaseObject2d>
48 {
49  BaseClass::OnComponentCreated();
50 
51  BaseClass2::SetCalibration(m_calibrationCompPtr.GetPtr(), false);
52 }
53 
54 
55 } // namespace i2d
56 
57 
58 #endif // !i2d_TObject2dCompWrap_included
59 
60 
Base class for component implementation.
Common class for all classes which objects can be archived or restored from archive.
Definition: ISerializable.h:23
Common interface for data model objects, which can be changed.
Definition: IChangeable.h:24
icomp::CComponentBase BaseClass
Common interface for describing the 2D-objects.
Definition: IObject2d.h:22
Base class for all components implementing 2D objects.
virtual void OnComponentCreated()

© 2007-2017 Witold Gantzke and Kirill Lepskiy