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
21 * Enumeration of tags corresponding to the persistent object parameters.
25 DataTag_First = HYDROData_Object::DataTag_First + 100, ///< first tag, to reserve
26 DataTag_Operator, ///< name of the operator that must be executed for image update
27 DataTag_TrsfPoints ///< image transformation points (3 input + 3 output)
31 DEFINE_STANDARD_RTTI(HYDROData_Image);
34 * Returns the kind of this object. Must be redefined in all objects of known type.
36 HYDRODATA_EXPORT virtual const ObjectKind GetKind() const {return KIND_IMAGE;}
40 * \param theImage new image
42 HYDRODATA_EXPORT void SetImage(const QImage& theImage);
45 * Returns the kept image
47 HYDRODATA_EXPORT QImage Image();
50 * Stores the image transformation
51 * \param theTrsf new transformation
53 HYDRODATA_EXPORT void SetTrsf(const QTransform& theTrsf);
56 * Returns the kept transformation, or "identity" if not yet stored
58 HYDRODATA_EXPORT QTransform Trsf();
61 * Stores the image transformation points (3 input + 3 output)
62 * \param thePointAIn input point A
63 * \param thePointBIn input point B
64 * \param thePointCIn input point C
65 * \param thePointAOut output point A
66 * \param thePointBOut output point B
67 * \param thePointCOut output point C
69 HYDRODATA_EXPORT void SetTrsfPoints(const QPoint& thePointAIn,
70 const QPoint& thePointBIn,
71 const QPoint& thePointCIn,
72 const QPointF& thePointAOut,
73 const QPointF& thePointBOut,
74 const QPointF& thePointCOut);
77 * Returns the image transformation points (3 input + 3 output)
78 * \param thePointAIn input point A
79 * \param thePointBIn input point B
80 * \param thePointCIn input point C
81 * \param thePointAOut output point A
82 * \param thePointBOut output point B
83 * \param thePointCOut output point C
85 HYDRODATA_EXPORT void TrsfPoints(QPoint& thePointAIn,
88 QPointF& thePointAOut,
89 QPointF& thePointBOut,
90 QPointF& thePointCOut);
93 * Appends reference to other image.
94 * \param theReferenced the image referenced by this
96 HYDRODATA_EXPORT void AppendReference(Handle(HYDROData_Image) theReferenced);
99 * Returns the number of referenced images
100 * \return zero if there is no references
102 HYDRODATA_EXPORT int NbReferences();
105 * Returns reference by index.
106 * \param theIndex number of reference [0; NbReference)
107 * \returns the referenced image, or Null if index is invalid
109 HYDRODATA_EXPORT Handle(HYDROData_Image) Reference(const int theIndex) const;
112 * Updates reference by index. If index is one-bigger than \a NbReferences,
113 * this method appends it to the end (NbReferences is incremented).
114 * \param theIndex number of reference [0; NbReference]
115 * \param theReferenced the image referenced by this
117 HYDRODATA_EXPORT void ChangeReference(
118 const int theIndex, Handle(HYDROData_Image) theReferenced);
121 * Removes reference by index
122 * \param theIndex number of reference [0; NbReference)
124 HYDRODATA_EXPORT void RemoveReference(const int theIndex);
127 * Removes all references.
129 HYDRODATA_EXPORT void ClearReferences();
132 * Stores the operator name
133 * \param theOpName name of the operator that must be executed for image update
135 HYDRODATA_EXPORT void SetOperatorName(const QString theOpName);
138 * Returns the operator name
139 * \returns the name of the operator that must be executed for image update
141 HYDRODATA_EXPORT QString OperatorName();
144 * Stores the operator arguments
145 * \param theArgs array that stores the operator arguments, needed for execution
147 HYDRODATA_EXPORT void SetArgs(const QByteArray& theArgs);
150 * Returns the operator arguments
151 * \returns array that stores the operator arguments, needed for execution
153 HYDRODATA_EXPORT QByteArray Args();
156 * Sets the "MustBeUpdated" flag: if image is depended on updated features.
157 * \param theFlag is true for images that must be updated, false for up-to-date
159 HYDRODATA_EXPORT void MustBeUpdated(bool theFlag);
162 * Returns the "MustBeUpdated" flag: is image must be recomputed or not
163 * \returns false if image is up to date
165 HYDRODATA_EXPORT bool MustBeUpdated();
169 friend class HYDROData_Iterator;
172 * Creates new object in the internal data structure. Use higher level objects
173 * to create objects with real content.
178 * Destructs properties of the object and object itself, removes it from the document.