Salome HOME
Invalidate method added.
[modules/hydro.git] / src / HYDROData / HYDROData_Entity.h
index 84a82778013ec8464eef81f4b5102e0f8bea04d7..02c191160873fe31ca2403e308454bd86f5987f6 100644 (file)
@@ -20,26 +20,28 @@ class Handle_HYDROData_Entity;
 ///! Kind of an object in a document
 typedef int ObjectKind;
 
-const ObjectKind KIND_UNKNOWN         = 0; ///! Unrecognized object
-const ObjectKind KIND_IMAGE           = 1;
-const ObjectKind KIND_POLYLINE        = 2;
-const ObjectKind KIND_BATHYMETRY      = 3;
-const ObjectKind KIND_ALTITUDE        = 4;
-const ObjectKind KIND_IMMERSIBLE_ZONE = 5;
-const ObjectKind KIND_RIVER           = 6;
-const ObjectKind KIND_STREAM          = 7;
-const ObjectKind KIND_CONFLUENCE      = 8;
-const ObjectKind KIND_CHANNEL         = 9;
-const ObjectKind KIND_OBSTACLE        = 10;
-const ObjectKind KIND_DIGUE           = 11;
-const ObjectKind KIND_PROFILE         = 12;
-const ObjectKind KIND_PROFILEUZ       = 13;
-const ObjectKind KIND_POLYLINEXY      = 14;
-const ObjectKind KIND_CALCULATION     = 15;
-const ObjectKind KIND_ZONE            = 16;
-const ObjectKind KIND_REGION          = 17;
-const ObjectKind KIND_VISUAL_STATE    = 18;
-const ObjectKind KIND_LAST            = KIND_VISUAL_STATE;
+const ObjectKind KIND_UNKNOWN           = 0; ///! Unrecognized object
+const ObjectKind KIND_IMAGE             = 1;
+const ObjectKind KIND_POLYLINE          = 2;
+const ObjectKind KIND_BATHYMETRY        = 3;
+const ObjectKind KIND_ALTITUDE          = 4;
+const ObjectKind KIND_IMMERSIBLE_ZONE   = 5;
+const ObjectKind KIND_RIVER             = 6;
+const ObjectKind KIND_STREAM            = 7;
+const ObjectKind KIND_CONFLUENCE        = 8;
+const ObjectKind KIND_CHANNEL           = 9;
+const ObjectKind KIND_OBSTACLE          = 10;
+const ObjectKind KIND_DIGUE             = 11;
+const ObjectKind KIND_PROFILE           = 12;
+const ObjectKind KIND_PROFILEUZ         = 13;
+const ObjectKind KIND_POLYLINEXY        = 14;
+const ObjectKind KIND_CALCULATION       = 15;
+const ObjectKind KIND_ZONE              = 16;
+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;
 
 DEFINE_STANDARD_HANDLE(HYDROData_Entity, MMgt_TShared)
 
@@ -80,12 +82,12 @@ public:
   /**
    * Returns the name of this object.
    */
-  HYDRODATA_EXPORT QString GetName() const;
+  HYDRODATA_EXPORT virtual QString GetName() const;
 
   /**
    * Updates the name of this object.
    */
-  HYDRODATA_EXPORT void SetName(const QString& theName);
+  HYDRODATA_EXPORT virtual void SetName( const QString& theName );
 
   /**
    * Dump object to Python script representation.
@@ -96,11 +98,9 @@ public:
   HYDRODATA_EXPORT virtual QStringList DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const;
 
   /**
-   * Updates object state.
-   * Base implementation dose nothing.
-   * \param theIsForce force reupdating of data object
+   * Updates object state. Base implementation dose nothing.
    */
-  HYDRODATA_EXPORT virtual void Update( const bool theIsForce = true );
+  HYDRODATA_EXPORT virtual void Update();
 
   /**
    * Returns data of object wrapped to QVariant.
@@ -108,6 +108,18 @@ 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 );
+
+  /**
+   * 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;
+
   /**
    * Checks is object exists in the data structure.
    * \returns true is object is not exists in the data model
@@ -122,19 +134,19 @@ public:
   /**
    * Returns unique integer identifier of the object (may be used for ordering of objects)
    */
-  HYDRODATA_EXPORT inline int ID() const {return myLab.Tag();}
+  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( Handle_HYDROData_Entity theDestination ) const;
 
   /**
    * Returns the label of this object.
    */
-  HYDRODATA_EXPORT TDF_Label& Label() {return myLab;}
+  HYDRODATA_EXPORT TDF_Label& Label() { return myLab; }
 
   /**
    * Returns father object. For object created under root document label