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)
28 DataTag_FilePath ///< image imported file path
32 DEFINE_STANDARD_RTTI(HYDROData_Image);
35 * Returns the kind of this object. Must be redefined in all objects of known type.
37 HYDRODATA_EXPORT virtual const ObjectKind GetKind() const {return KIND_IMAGE;}
41 * \param theImage new image
43 HYDRODATA_EXPORT void SetImage(const QImage& theImage);
46 * Returns the kept image
48 HYDRODATA_EXPORT QImage Image();
51 * Stores the image file path
52 * \param theFilePath image file path
54 HYDRODATA_EXPORT void SetFilePath(const QString& theFilePath);
57 * Returns uploaded image file path
59 HYDRODATA_EXPORT QString GetFilePath() const;
62 * Stores the image transformation
63 * \param theTrsf new transformation
65 HYDRODATA_EXPORT void SetTrsf(const QTransform& theTrsf);
68 * Returns the kept transformation, or "identity" if not yet stored
70 HYDRODATA_EXPORT QTransform Trsf();
73 * Stores the image transformation points (3 input + 3 output)
74 * \param thePointAIn input point A
75 * \param thePointBIn input point B
76 * \param thePointCIn input point C
77 * \param thePointAOut output point A
78 * \param thePointBOut output point B
79 * \param thePointCOut output point C
81 HYDRODATA_EXPORT void SetTrsfPoints(const QPoint& thePointAIn,
82 const QPoint& thePointBIn,
83 const QPoint& thePointCIn,
84 const QPointF& thePointAOut,
85 const QPointF& thePointBOut,
86 const QPointF& thePointCOut);
89 * Returns the image transformation points (3 input + 3 output)
90 * \param thePointAIn input point A
91 * \param thePointBIn input point B
92 * \param thePointCIn input point C
93 * \param thePointAOut output point A
94 * \param thePointBOut output point B
95 * \param thePointCOut output point C
97 HYDRODATA_EXPORT void TrsfPoints(QPoint& thePointAIn,
100 QPointF& thePointAOut,
101 QPointF& thePointBOut,
102 QPointF& thePointCOut);
105 * Appends reference to other image.
106 * \param theReferenced the image referenced by this
108 HYDRODATA_EXPORT void AppendReference(Handle(HYDROData_Image) theReferenced);
111 * Returns the number of referenced images
112 * \return zero if there is no references
114 HYDRODATA_EXPORT int NbReferences();
117 * Returns reference by index.
118 * \param theIndex number of reference [0; NbReference)
119 * \returns the referenced image, or Null if index is invalid
121 HYDRODATA_EXPORT Handle(HYDROData_Image) Reference(const int theIndex) const;
124 * Updates reference by index. If index is one-bigger than \a NbReferences,
125 * this method appends it to the end (NbReferences is incremented).
126 * \param theIndex number of reference [0; NbReference]
127 * \param theReferenced the image referenced by this
129 HYDRODATA_EXPORT void ChangeReference(
130 const int theIndex, Handle(HYDROData_Image) theReferenced);
133 * Removes reference by index
134 * \param theIndex number of reference [0; NbReference)
136 HYDRODATA_EXPORT void RemoveReference(const int theIndex);
139 * Removes all references.
141 HYDRODATA_EXPORT void ClearReferences();
144 * Stores the operator name
145 * \param theOpName name of the operator that must be executed for image update
147 HYDRODATA_EXPORT void SetOperatorName(const QString theOpName);
150 * Returns the operator name
151 * \returns the name of the operator that must be executed for image update
153 HYDRODATA_EXPORT QString OperatorName();
156 * Stores the operator arguments
157 * \param theArgs array that stores the operator arguments, needed for execution
159 HYDRODATA_EXPORT void SetArgs(const QByteArray& theArgs);
162 * Returns the operator arguments
163 * \returns array that stores the operator arguments, needed for execution
165 HYDRODATA_EXPORT QByteArray Args();
168 * Sets the "MustBeUpdated" flag: if image is depended on updated features.
169 * \param theFlag is true for images that must be updated, false for up-to-date
171 HYDRODATA_EXPORT void MustBeUpdated(bool theFlag);
174 * Returns the "MustBeUpdated" flag: is image must be recomputed or not
175 * \returns false if image is up to date
177 HYDRODATA_EXPORT bool MustBeUpdated();
181 friend class HYDROData_Iterator;
184 * Creates new object in the internal data structure. Use higher level objects
185 * to create objects with real content.
190 * Destructs properties of the object and object itself, removes it from the document.