1 #ifndef HYDROData_Image_HeaderFile
2 #define HYDROData_Image_HeaderFile
4 #include <HYDROData_Object.h>
9 DEFINE_STANDARD_HANDLE(HYDROData_Image, HYDROData_Object)
11 /**\class HYDROData_Image
12 * \brief Class that stores/retreives information about the image.
14 * Keeps image as binary array, transformation and other properties
15 * of image with correspondent API for forkind wit hthese properties.
17 class HYDROData_Image : public HYDROData_Object
20 DEFINE_STANDARD_RTTI(HYDROData_Image);
23 * Returns the kind of this object. Must be redefined in all objects of known type.
25 HYDRODATA_EXPORT virtual const ObjectKind GetKind() const {return KIND_IMAGE;}
29 * \param theImage new image
31 HYDRODATA_EXPORT void SetImage(const QImage& theImage);
34 * Returns the kept image
36 HYDRODATA_EXPORT QImage Image();
39 * Stores the image transformation
40 * \param theTrsf new transformation
42 HYDRODATA_EXPORT void SetTrsf(const QTransform& theTrsf);
45 * Returns the kept transformation, or "identity" if not yet stored
47 HYDRODATA_EXPORT QTransform Trsf();
50 * Stores the image transformation points (3 input + 3 output)
51 * \param thePointAIn input point A
52 * \param thePointBIn input point B
53 * \param thePointCIn input point C
54 * \param thePointAOut output point A
55 * \param thePointBOut output point B
56 * \param thePointCOut output point C
58 HYDRODATA_EXPORT void SetTrsfPoints(const QPoint& thePointAIn,
59 const QPoint& thePointBIn,
60 const QPoint& thePointCIn,
61 const QPointF& thePointAOut,
62 const QPointF& thePointBOut,
63 const QPointF& thePointCOut);
66 * Returns the image transformation points (3 input + 3 output)
67 * \param thePointAIn input point A
68 * \param thePointBIn input point B
69 * \param thePointCIn input point C
70 * \param thePointAOut output point A
71 * \param thePointBOut output point B
72 * \param thePointCOut output point C
74 HYDRODATA_EXPORT void TrsfPoints(QPoint& thePointAIn,
77 QPointF& thePointAOut,
78 QPointF& thePointBOut,
79 QPointF& thePointCOut);
82 * Appends reference to other image.
83 * \param theReferenced the image referenced by this
85 HYDRODATA_EXPORT void AppendReference(Handle(HYDROData_Image) theReferenced);
88 * Returns the number of referenced images
89 * \return zero if there is no references
91 HYDRODATA_EXPORT int NbReferences();
94 * Returns reference by index.
95 * \param theIndex number of reference [0; NbReference)
96 * \returns the referenced image, or Null if index is invalid
98 HYDRODATA_EXPORT Handle(HYDROData_Image) Reference(const int theIndex) const;
101 * Updates reference by index. If index is one-bigger than \a NbReferences,
102 * this method appends it to the end (NbReferences is incremented).
103 * \param theIndex number of reference [0; NbReference]
104 * \param theReferenced the image referenced by this
106 HYDRODATA_EXPORT void ChangeReference(
107 const int theIndex, Handle(HYDROData_Image) theReferenced);
110 * Removes reference by index
111 * \param theIndex number of reference [0; NbReference)
113 HYDRODATA_EXPORT void RemoveReference(const int theIndex);
116 * Removes all references.
118 HYDRODATA_EXPORT void ClearReferences();
121 * Stores the operator name
122 * \param theOpName name of the operator that must be executed for image update
124 HYDRODATA_EXPORT void SetOperatorName(const QString theOpName);
127 * Returns the operator name
128 * \returns the name of the operator that must be executed for image update
130 HYDRODATA_EXPORT QString OperatorName();
133 * Stores the operator arguments
134 * \param theArgs array that stores the operator arguments, needed for execution
136 HYDRODATA_EXPORT void SetArgs(const QByteArray& theArgs);
139 * Returns the operator arguments
140 * \returns array that stores the operator arguments, needed for execution
142 HYDRODATA_EXPORT QByteArray Args();
145 * Sets the "MustBeUpdated" flag: if image is depended on updated features.
146 * \param theFlag is true for images that must be updated, false for up-to-date
148 HYDRODATA_EXPORT void MustBeUpdated(bool theFlag);
151 * Returns the "MustBeUpdated" flag: is image must be recomputed or not
152 * \returns false if image is up to date
154 HYDRODATA_EXPORT bool MustBeUpdated();
158 friend class HYDROData_Iterator;
161 * Creates new object in the internal data structure. Use higher level objects
162 * to create objects with real content.
167 * Destructs properties of the object and object itself, removes it from the document.