Salome HOME
patch for crash in channel
[modules/hydro.git] / src / HYDROData / HYDROData_Entity.h
index dd067a187fa9de588ed177378ccdcf5b38248052..76a4c10a055062d20de89d2c815e7db86798645c 100644 (file)
@@ -41,7 +41,12 @@ const ObjectKind KIND_REGION            = 17;
 const ObjectKind KIND_VISUAL_STATE      = 18;
 const ObjectKind KIND_ARTIFICIAL_OBJECT = 19;
 const ObjectKind KIND_NATURAL_OBJECT    = 20;
-const ObjectKind KIND_LAST              = KIND_NATURAL_OBJECT;
+const ObjectKind KIND_DUMMY_3D          = 21;
+const ObjectKind KIND_SHAPES_GROUP      = 22;
+const ObjectKind KIND_SPLITTED_GROUP    = 23;
+const ObjectKind KIND_STREAM_ALTITUDE   = 24;
+const ObjectKind KIND_OBSTACLE_ALTITUDE = 25;
+const ObjectKind KIND_LAST              = KIND_OBSTACLE_ALTITUDE;
 
 DEFINE_STANDARD_HANDLE(HYDROData_Entity, MMgt_TShared)
 
@@ -89,6 +94,11 @@ public:
    */
   HYDRODATA_EXPORT virtual void SetName( const QString& theName );
 
+  /**
+   * Returns the name of this object valid for Python script.
+   */
+  HYDRODATA_EXPORT virtual QString GetObjPyName() const;
+
   /**
    * Dump object to Python script representation.
    * Base implementation returns empty list,
@@ -108,17 +118,24 @@ public:
    */
   HYDRODATA_EXPORT virtual QVariant GetDataVariant();
 
+
   /**
    * Sets the "MustBeUpdated" flag: if object is depended on updated features.
    * \param theFlag is true for objects that must be updated, false for up-to-date
    */
-  HYDRODATA_EXPORT void SetToUpdate( bool theFlag );
+  HYDRODATA_EXPORT virtual void SetToUpdate( bool theFlag );
 
   /**
    * Returns the "MustBeUpdated" flag: is object data must be updated or not
    * \returns false if object is up to date
    */
-  HYDRODATA_EXPORT bool IsMustBeUpdated() const;
+  HYDRODATA_EXPORT virtual bool IsMustBeUpdated() const;
+
+  /**
+   * Returns flag indicating that object is updateble or not.
+   */
+  HYDRODATA_EXPORT virtual bool CanBeUpdated() const;
+
 
   /**
    * Checks is object exists in the data structure.
@@ -139,17 +156,12 @@ public:
    */
   HYDRODATA_EXPORT virtual bool CanRemove();
 
-  /**
-   * Returns unique integer identifier of the object (may be used for ordering of objects)
-   */
-  HYDRODATA_EXPORT inline int ID() const { return myLab.Tag(); }
-
   /**
    * Copies all properties of this to the destinated object.
    * Objects must be the same type.
    * \param theDestination initialized object (from any document) - target of copying
    */
-  HYDRODATA_EXPORT void CopyTo( Handle_HYDROData_Entity theDestination ) const;
+  HYDRODATA_EXPORT void CopyTo( const Handle(HYDROData_Entity)& theDestination ) const;
 
   /**
    * Returns the label of this object.
@@ -320,6 +332,28 @@ protected:
                                  QStringList&                    theScript,
                                  const Handle(HYDROData_Entity)& theRefObject,
                                  const QString&                  theMethod ) const;
+
+  bool checkObjectPythonDefinition( MapOfTreatedObjects&            theTreatedObjects,
+                                    QStringList&                    theScript,
+                                    const Handle(HYDROData_Entity)& theRefObject ) const;
+
+  void setPythonObjectColor( QStringList&         theScript,
+                             const QColor&        theColor,
+                             const QColor&        theDefaultColor,
+                             const QString&       theMethod ) const;
+
+  /**
+   * Dump the initial object creation to a Python script.
+   * You should call it from DumpToPython implementation before 
+   * dumping fields of the object.
+   */
+  HYDRODATA_EXPORT virtual QStringList dumpObjectCreation( MapOfTreatedObjects& theTreatedObjects ) const;
+
+  /**
+   * Returns an object type name as a string for dumping to Python.
+   */
+  QString getPyTypeID() const;
+
 protected:
 
   Handle(TDataStd_ReferenceList) getReferenceList( const int  theTag,