Salome HOME
Tests for Bathymetry object.
[modules/hydro.git] / src / HYDROData / HYDROData_Object.h
index f448d70a72f3a24c3320808061df257f84517c14..7ea49e6b1c46daa92c2d930981e8e4854a031190 100644 (file)
@@ -5,7 +5,11 @@
 
 #include <NCollection_Sequence.hxx>
 #include <TDF_Label.hxx>
-#include <QString>
+#include <QMap>
+
+class QString;
+class QVariant;
+class QStringList;
 
 ///! Kind of an object in a document
 typedef int ObjectKind;
@@ -13,9 +17,13 @@ typedef int ObjectKind;
 const ObjectKind KIND_UNKNOWN = 0;
 const ObjectKind KIND_IMAGE = 1;
 const ObjectKind KIND_POLYLINE = 2;
+const ObjectKind KIND_VISUAL_STATE = 3;
+const ObjectKind KIND_BATHYMETRY = 4;
 
 DEFINE_STANDARD_HANDLE(HYDROData_Object, MMgt_TShared)
 
+typedef QMap<QString,Handle(Standard_Transient)> MapOfTreatedObjects;
+
 /**\class HYDROData_Object
  * \brief Generic class of any object in the data model.
  *
@@ -25,6 +33,16 @@ DEFINE_STANDARD_HANDLE(HYDROData_Object, MMgt_TShared)
  */
 class HYDROData_Object : public MMgt_TShared
 {
+protected:
+  /**
+   * Enumeration of tags corresponding to the persistent object parameters.
+   */
+  enum DataTag
+  {
+    DataTag_First = 0     ///< first tag, to reserve
+    // ...
+  };
+
 public:
   DEFINE_STANDARD_RTTI(HYDROData_Object);
 
@@ -43,6 +61,26 @@ public:
    */
   HYDRODATA_EXPORT void SetName(const QString& theName);
 
+  /**
+   * Dump object to Python script representation.
+   * Base implementation returns empty list,
+   * You should reimplement this function in your derived class if it
+   * has Python API and can be imported/exported from/to Python script.
+   */
+  HYDRODATA_EXPORT virtual QStringList DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const;
+
+  /**
+   * Updates object state.
+   * Base implementation dose nothing.
+   */
+  HYDRODATA_EXPORT virtual void Update();
+
+  /**
+   * Returns data of object wrapped to QVariant.
+   * Base implementation returns null value.
+   */
+  HYDRODATA_EXPORT virtual QVariant GetDataVariant();
+
   /**
    * Checks is object exists in the data structure.
    * \returns true is object is not exists in the data model
@@ -107,7 +145,7 @@ protected:
    * \returns pointer to the internal data structure wit harray content, 
    *          or NULL if array size is zero
    */
-  const char* ByteArray(const int theTag, int& theLen);
+  const char* ByteArray(const int theTag, int& theLen) const;
 
 protected:
   /// Array of pointers to the properties of this object; index in this array is returned by \a AddProperty.