X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROGUI%2FHYDROGUI_DataModel.h;h=dde52d05706e242d126b9baef36c82d8427199c5;hb=81c9f5cdf82909d0aebd2c491c50fa7516cc80b7;hp=1f2f3fb23f1a472254eb4afd28109ae29ddb7247;hpb=bd1a4992da8d54929ec556df6db4e7e0ebbfbbd7;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_DataModel.h b/src/HYDROGUI/HYDROGUI_DataModel.h index 1f2f3fb2..dde52d05 100644 --- a/src/HYDROGUI/HYDROGUI_DataModel.h +++ b/src/HYDROGUI/HYDROGUI_DataModel.h @@ -24,9 +24,13 @@ #define HYDROGUI_DATAMODEL_H #include -#include +#include +#include +#include +#include #include +#include #include #include @@ -34,6 +38,7 @@ class CAM_DataObject; class SUIT_DataObject; class HYDROGUI_DataObject; +class HYDROGUI_Zone; /** * \class HYDROGUI_DataModel @@ -111,7 +116,7 @@ public: * \param the data model object * \return the only one object referenced to the given data model object, or null if not found */ - virtual HYDROGUI_DataObject* getDataObject( const Handle(HYDROData_Object)& theModelObject ); + virtual HYDROGUI_DataObject* getDataObject( const Handle(HYDROData_Entity)& theModelObject ); /** * Returns a data object referenced to the given data object. @@ -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& theZonesList ); + /** * Correct an internal model object according to the current document mode */ @@ -147,7 +157,7 @@ public: /** * Find a data object by the specified entry and kind */ - Handle(HYDROData_Object) objectByEntry( const QString& theEntry, + Handle(HYDROData_Entity) objectByEntry( const QString& theEntry, const ObjectKind theObjectKind = KIND_UNKNOWN ); /** @@ -210,6 +220,25 @@ public: */ bool paste(); + /** + * Rename the object + */ + bool rename( Handle(HYDROData_Entity) theEntity, const QString& theName ); + + /** + * Creates the Calculation Case subtree for usage within an operation dialog. + * \param theParent a created object will be appended as a child of this GUI object + * \param theCase the calculation case model object + */ + void buildCaseTree( SUIT_DataObject* theParent, + Handle(HYDROData_CalculationCase) theCase ); + + /** + * Updates the object subtree. + * \param theObj the data model entity + */ + void updateObjectTree( Handle(HYDROData_Entity)& theObj ); + /** * Update the sequence of the objects to be copied */ @@ -235,7 +264,7 @@ protected: * \param theParentEntry entry of parent object */ LightApp_DataObject* createObject( SUIT_DataObject* theParent, - Handle(HYDROData_Object) theModelObject, + Handle(HYDROData_Entity) theModelObject, const QString& theParentEntry = QString(), const bool theIsBuildTree = true ); @@ -250,14 +279,70 @@ protected: const QString& theParentEntry = QString() ); /** - * Build tree of model object. + * 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 + * \param theIsInOperation if true then the tree is used for a browser within an operation, it is false by default + */ + LightApp_DataObject* buildObject( SUIT_DataObject* theParent, + HYDROGUI_DataObject* theObject, + const QString& theParentEntry, + const bool theIsBuildTree, + const bool theIsInOperation = false ); + + /** + * Build object tree if the flag theIsBuildTree is true. + * \param theParent a created object will be appended as a child of this GUI object + * \param theModelObject the data model zone object + * \param theParentEntry the entry of parent object + * \param theIsBuildTree if true then build the subtree of the GUI object + * \param theIsInOperation if true then the tree is used for a browser within an operation, it is false by default + */ + LightApp_DataObject* createZone( SUIT_DataObject* theParent, + Handle(HYDROData_Zone) theModelObject, + const QString& theParentEntry, + const bool theIsBuildTree , + const bool theIsInOperation = false ); + + /** + * Build object tree if the flag theIsBuildTree is true. + * \param theParent a created object will be appended as a child of this GUI object + * \param theModelObject the data model region object + * \param theParentEntry the entry of parent object + * \param theIsBuildTree if true then build the subtree of the GUI object + * \param theIsInOperation if true then the tree is used for a browser within an operation, it is false by default + */ + LightApp_DataObject* createRegion( SUIT_DataObject* theParent, + Handle(HYDROData_Region) theModelObject, + const QString& theParentEntry, + const bool theIsBuildTree , + const bool theIsInOperation = false ); + /** + * Build partition for object. + * \param theObject gui object for which the partition will be build + * \param theObjects sequence of builded objects + * \param thePartName name of created partition + * \param theIsCreateEmpty if true then partition will be created in any case + */ + void buildObjectPartition( SUIT_DataObject* theObject, + const HYDROData_SequenceOfObjects& theObjects, + const QString& thePartName, + const bool theIsCreateEmpty ); + + /** + * Build tree of a model object. * \param theParent a created object will be appended as a child of this object * \param theObject gui object for which the tree will be build * \param theParentEntry entry of parent object + * \param theIsInOperation if true then the tree is used for a browser within an operation, it is false by default */ void buildObjectTree( SUIT_DataObject* theParent, SUIT_DataObject* theObject, - const QString& theParentEntry = QString() ); + const QString& theParentEntry = QString(), + const bool theIsInOperation = false ); /** * Removes data object from the tree. @@ -278,6 +363,7 @@ protected: protected: QString myStudyURL; ///< the saved/opened document URL + QByteArray myStates; }; #endif