X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROGUI%2FHYDROGUI_Zone.cxx;fp=src%2FHYDROGUI%2FHYDROGUI_Zone.cxx;h=c1139e1e4e66153e03a82a6dddabb20245e7f8d7;hb=3f5985973d0fb31476b8d0efa7fa187ece1fca90;hp=469695cf7525571c720343917491cc51119d3867;hpb=2ca0651c272b155f0782ce79a4a63d5f9d9f466d;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_Zone.cxx b/src/HYDROGUI/HYDROGUI_Zone.cxx index 469695cf..c1139e1e 100644 --- a/src/HYDROGUI/HYDROGUI_Zone.cxx +++ b/src/HYDROGUI/HYDROGUI_Zone.cxx @@ -101,6 +101,7 @@ QString HYDROGUI_Zone::getObjectName() const QString aName; for ( ; anIter.More(); anIter.Next() ) { + aName.clear(); Handle(HYDROData_Object) aRefGeomObj = Handle(HYDROData_Object)::DownCast( anIter.Value() ); if ( !aRefGeomObj.IsNull() ) @@ -116,13 +117,29 @@ QString HYDROGUI_Zone::getObjectName() const aRes = aName; break; } - - if ( !aNamesSet.contains( aName ) ) + } + } + else + { + Handle(HYDROData_LandCover) aRefLandCoverObj = + Handle(HYDROData_LandCover)::DownCast( anIter.Value() ); + if ( !aRefLandCoverObj.IsNull() ) + { + // Get name of land cover object + aName = aRefLandCoverObj->GetName(); + if ( !isMergingNeed ) { - aRes += aName + ", "; - aNamesSet.insert( aName ); + // Get the first land cover object's altitude name and go out + aRes = aName; + break; } - } + } + } + + if ( !aName.isEmpty() && !aNamesSet.contains( aName ) ) + { + aRes += aName + ", "; + aNamesSet.insert( aName ); } } // Remove the last comma if necessary