Salome HOME
Dump Image data to python script (Feature #13).
[modules/hydro.git] / src / HYDROData / HYDROData_Image.h
index dda1648b3ab7cbdf34f308c852c18357a0a6bd12..b9db13c6bde1ea88c4ecff3cdca7305ac19896a1 100644 (file)
@@ -16,6 +16,18 @@ DEFINE_STANDARD_HANDLE(HYDROData_Image, HYDROData_Object)
  */
 class HYDROData_Image : public HYDROData_Object
 {
+protected:
+  /**
+   * Enumeration of tags corresponding to the persistent object parameters.
+   */
+  enum DataTag
+  {
+    DataTag_First = HYDROData_Object::DataTag_First + 100, ///< first tag, to reserve
+    DataTag_Operator,    ///< name of the operator that must be executed for image update
+    DataTag_TrsfPoints,  ///< image transformation points (3 input + 3 output)
+    DataTag_FilePath     ///< image imported file path
+  };
+
 public:
   DEFINE_STANDARD_RTTI(HYDROData_Image);
 
@@ -24,17 +36,39 @@ public:
    */
   HYDRODATA_EXPORT virtual const ObjectKind GetKind() const {return KIND_IMAGE;}
 
+  /**
+   * Dump Image object to Python script representation.
+   */
+  HYDRODATA_EXPORT virtual QStringList DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const;
+
   /**
    * Stores the image
    * \param theImage new image
    */
   HYDRODATA_EXPORT void SetImage(const QImage& theImage);
 
+  /**
+   * Load the image from file
+   * \param theFilePath path to image
+   */
+  HYDRODATA_EXPORT bool LoadImage(const QString& theFilePath);
+
   /**
    * Returns the kept image
    */
   HYDRODATA_EXPORT QImage Image();
 
+  /**
+   * Stores the image file path
+   * \param theFilePath image file path
+   */
+  HYDRODATA_EXPORT void SetFilePath(const QString& theFilePath);
+
+  /**
+   * Returns uploaded image file path
+   */
+  HYDRODATA_EXPORT QString GetFilePath() const;
+
   /**
    * Stores the image transformation
    * \param theTrsf new transformation
@@ -44,7 +78,7 @@ public:
   /**
    * Returns the kept transformation, or "identity" if not yet stored
    */
-  HYDRODATA_EXPORT QTransform Trsf();
+  HYDRODATA_EXPORT QTransform Trsf() const;
 
   /**
    * Stores the image transformation points (3 input + 3 output)
@@ -76,7 +110,7 @@ public:
                                    QPoint& thePointCIn,
                                    QPointF& thePointAOut,
                                    QPointF& thePointBOut,
-                                   QPointF& thePointCOut);
+                                   QPointF& thePointCOut) const;
 
   /**
    * Appends reference to other image.
@@ -88,7 +122,7 @@ public:
    * Returns the number of referenced images
    * \return zero if there is no references
    */
-  HYDRODATA_EXPORT int NbReferences();
+  HYDRODATA_EXPORT int NbReferences() const;
 
   /**
    * Returns reference by index.
@@ -127,7 +161,7 @@ public:
    * Returns the operator name
    * \returns the name of the operator that must be executed for image update
    */
-  HYDRODATA_EXPORT QString OperatorName();
+  HYDRODATA_EXPORT QString OperatorName() const;
 
   /**
    * Stores the operator arguments
@@ -139,7 +173,7 @@ public:
    * Returns the operator arguments
    * \returns array that stores the operator arguments, needed for execution
    */
-  HYDRODATA_EXPORT QByteArray Args();
+  HYDRODATA_EXPORT QByteArray Args() const;
   
   /**
    * Sets the "MustBeUpdated" flag: if image is depended on updated features.