Salome HOME
Move color tags to the base geometrical object class.
[modules/hydro.git] / src / HYDROData / HYDROData_Entity.h
index ca4ac508826d871ece52ba5ee5ba6f7ca3feb9c2..3fb5d239b65d111a2d77873151986903866d3950 100644 (file)
@@ -24,13 +24,21 @@ 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_IMMERSIBLE_ZONE = 4;
-const ObjectKind KIND_GUIDE_LINE      = 5;
-const ObjectKind KIND_PROFILE         = 6;
-const ObjectKind KIND_CALCULATION     = 7;
-const ObjectKind KIND_ZONE            = 8;
-const ObjectKind KIND_REGION          = 9;
-const ObjectKind KIND_VISUAL_STATE    = 10;
+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;
 
 DEFINE_STANDARD_HANDLE(HYDROData_Entity, MMgt_TShared)
@@ -61,15 +69,6 @@ protected:
     // ...
   };
 
-  /**
-   * Enumeration of tags corresponding to the child sub-objects of object.
-   */
-  enum ChildTag
-  {
-    ChildTag_First = 0    ///< first tag, to reserve
-    // ...
-  };
-
 public:
   DEFINE_STANDARD_RTTI(HYDROData_Entity);
 
@@ -97,11 +96,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.
@@ -109,6 +106,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
@@ -137,6 +146,12 @@ public:
    */
   HYDRODATA_EXPORT TDF_Label& Label() {return myLab;}
 
+  /**
+   * Returns father object. For object created under root document label
+   * this method always return NULL object.
+   */
+  HYDRODATA_EXPORT virtual Handle(HYDROData_Entity) GetFatherObject() const;
+
 protected:
 
   friend class HYDROData_Iterator;
@@ -182,6 +197,14 @@ protected:
    */
   int NbReferenceObjects( const int theTag = 0 ) const;
 
+  /**
+   * Internal method that used to check object for entry into the reference list
+   * \param theObj pointer to reference object
+   * \param theTag tag of a label to store attribute (for 0 this is myLab)
+   */
+  bool HasReference( const Handle_HYDROData_Entity& theObj,
+                     const int                      theTag = 0 ) const;
+
   /**
    * Internal method that used to store the reference object label attribute
    * \param theObj pointer to reference object