X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROGUI%2FHYDROGUI_DataModel.cxx;h=dbe6cead511cd96d7b0dbd2f36861e88313a27c6;hb=5cae7e874afd2fc1b6f61023e8ebd33a933db3c7;hp=a1be099ce1118ca1e55b9c4639e954928ab23c8b;hpb=0c3fbbc9e9f468fdf49ed86754cd026e22528eb2;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_DataModel.cxx b/src/HYDROGUI/HYDROGUI_DataModel.cxx index a1be099c..dbe6cead 100644 --- a/src/HYDROGUI/HYDROGUI_DataModel.cxx +++ b/src/HYDROGUI/HYDROGUI_DataModel.cxx @@ -25,6 +25,8 @@ #include "HYDROGUI_DataObject.h" #include "HYDROGUI_Module.h" #include "HYDROGUI_Tool.h" +#include "HYDROGUI_Zone.h" +#include "HYDROGUI_Region.h" #include #include @@ -527,8 +529,7 @@ LightApp_DataObject* HYDROGUI_DataModel::createObject( SUIT_DataObject* const QString& theParentEntry, const bool theIsBuildTree ) { - HYDROGUI_DataObject* aResObj = - new HYDROGUI_DataObject( theParent, theModelObject, theParentEntry ); + HYDROGUI_DataObject* aResObj = new HYDROGUI_DataObject( theParent, theModelObject, theParentEntry ); if ( theIsBuildTree ) { @@ -538,6 +539,34 @@ LightApp_DataObject* HYDROGUI_DataModel::createObject( SUIT_DataObject* return aResObj; } +LightApp_DataObject* HYDROGUI_DataModel::buildObject( SUIT_DataObject* theParent, + HYDROGUI_DataObject* theObject, + const QString& theParentEntry, + const bool theIsBuildTree ) +{ + if ( theIsBuildTree ) + { + buildObjectTree( theParent, theObject, theParentEntry ); + } + return theObject; +} + +LightApp_DataObject* HYDROGUI_DataModel::createZone( SUIT_DataObject* theParent, + Handle(HYDROData_Zone) theModelObject, + const QString& theParentEntry, + const bool theIsBuildTree ) +{ + return buildObject( theParent, new HYDROGUI_Zone( theParent, theModelObject, theParentEntry ), theParentEntry, theIsBuildTree ); +} + +LightApp_DataObject* HYDROGUI_DataModel::createRegion( SUIT_DataObject* theParent, + Handle(HYDROData_Region) theModelObject, + const QString& theParentEntry, + const bool theIsBuildTree ) +{ + return buildObject( theParent, new HYDROGUI_Region( theParent, theModelObject, theParentEntry ), theParentEntry, theIsBuildTree ); +} + LightApp_DataObject* HYDROGUI_DataModel::createObject( SUIT_DataObject* theParent, const QString& theName, const QString& theParentEntry ) @@ -604,7 +633,7 @@ void HYDROGUI_DataModel::buildObjectTree( SUIT_DataObject* theParent, Handle(HYDROData_Region) aCaseRegion = Handle(HYDROData_Region)::DownCast( anIter.Value() ); if( !aCaseRegion.IsNull() && !aCaseRegion->IsRemoved() ) - createObject( aCaseRegionsSect, aCaseRegion, "", true ); + createRegion( aCaseRegionsSect, aCaseRegion, "", true ); } } else if ( anObjectKind == KIND_REGION ) @@ -619,7 +648,7 @@ void HYDROGUI_DataModel::buildObjectTree( SUIT_DataObject* theParent, Handle(HYDROData_Zone) aRegionZone = Handle(HYDROData_Zone)::DownCast( anIter.Value() ); if( !aRegionZone.IsNull() && !aRegionZone->IsRemoved() ) - createObject( aGuiObj, aRegionZone, "", true ); + createZone( aGuiObj, aRegionZone, "", true ); } } }