Salome HOME
Feature #86: The hierarchy in the Object Browser (T 19).
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_DataModel.h
index 97379263a0a804c9d55cf05775f3b09551e93dff..060a3db56936e155a39dc47c94da2856ac9c7488 100644 (file)
 
 #include <HYDROData_Document.h>
 #include <HYDROData_Entity.h>
+#include <HYDROData_Zone.h>
+#include <HYDROData_Region.h>
+#include <HYDROData_CalculationCase.h>
 
 #include <QMap>
+#include <QList>
 #include <LightApp_DataModel.h>
 
 #include <SUIT_TreeModel.h>
@@ -34,6 +38,7 @@
 class CAM_DataObject;
 class SUIT_DataObject;
 class HYDROGUI_DataObject;
+class HYDROGUI_Zone;
 
 /**
  * \class HYDROGUI_DataModel
@@ -139,6 +144,11 @@ public:
    */
   CAM_DataObject* createRootModuleObject( SUIT_DataObject* theParent );
 
+  /**
+   * Create a new region in the given calculation case containing given zones. 
+   */
+  bool createNewRegion( Handle(HYDROData_CalculationCase) theCase, const QList<HYDROGUI_Zone*>& theZonesList );
+
   /**
    * Correct an internal model object according to the current document mode
    */
@@ -210,6 +220,15 @@ public:
    */
   bool paste();
 
+  /**
+   * Creates the GUI data object according to the model object.
+   * \param theParent a created object will be appended as a child of this object
+   * \param theModelObject model object
+   * \param theParentEntry entry of parent object
+   */
+  void buildCaseTree( SUIT_DataObject*                  theParent,
+                      Handle(HYDROData_CalculationCase) theCase );
+
   /**
    * Update the sequence of the objects to be copied
    */
@@ -222,6 +241,7 @@ public:
    */
   static QString partitionName( const ObjectKind theObjectKind );
 
+protected:
   /**
    * Returns the document for the current study
    */
@@ -238,7 +258,6 @@ public:
                                      const QString&           theParentEntry = QString(),
                                      const bool               theIsBuildTree = true );
 
-protected:
   /**
    * Creates the GUI data object without corresponding model object: just by name
    * \param theParent a created object will be appended as a child of this object
@@ -249,6 +268,28 @@ protected:
                                      const QString&   theName,
                                      const QString&   theParentEntry = QString() );
 
+  /**
+   * Build object tree if the flag theIsBuildTree is true. 
+   * This is a conditional wrapper for buildObjectTree method.
+   * \param theParent a created object will be appended as a child of this object
+   * \param theObject the GUI object
+   * \param theParentEntry the entry of parent object
+   * \param theIsBuildTree if true then build the subtree of the GUI object
+   */
+  LightApp_DataObject* buildObject( SUIT_DataObject*     theParent,
+                                    HYDROGUI_DataObject* theObject,
+                                    const QString&       theParentEntry,
+                                    const bool           theIsBuildTree );
+
+  LightApp_DataObject* createZone( SUIT_DataObject*       theParent,
+                                   Handle(HYDROData_Zone) theModelObject,
+                                   const QString&         theParentEntry,
+                                   const bool             theIsBuildTree );
+
+  LightApp_DataObject* createRegion( SUIT_DataObject*         theParent,
+                                     Handle(HYDROData_Region) theModelObject,
+                                     const QString&           theParentEntry,
+                                     const bool               theIsBuildTree );
   /**
    * Build tree of model object.
    * \param theParent a created object will be appended as a child of this object