+
+QStringList HYDROGUI_Zone::getBathymetries() const
+{
+ QStringList aRes;
+ Handle(HYDROData_Zone) aZone = Handle(HYDROData_Zone)::DownCast( modelObject() );
+ if ( !aZone.IsNull() )
+ {
+ HYDROData_SequenceOfObjects aSeq = aZone->GetGeometryObjects();
+ // Collect all used bathymetries names when merging is necessary
+ // or just get the name of bathymetry of a single geometry object
+ HYDROData_SequenceOfObjects::Iterator anIter( aSeq );
+ for ( ; anIter.More(); anIter.Next() )
+ {
+ Handle(HYDROData_Object) aRefGeomObj =
+ Handle(HYDROData_Object)::DownCast( anIter.Value() );
+ if ( !aRefGeomObj.IsNull() )
+ {
+ // Get bathymetry name
+ Handle(HYDROData_Bathymetry) aBathymetry = aRefGeomObj->GetBathymetry();
+ if ( !aBathymetry.IsNull() && !aRes.contains( aBathymetry->GetName() ))
+ {
+ aRes.append( aBathymetry->GetName() );
+ }
+ }
+ }
+ }
+ return aRes;
+}
+
+HYDROData_Zone::MergeBathymetriesType HYDROGUI_Zone::getMergeType() const
+{
+ HYDROData_Zone::MergeBathymetriesType aRes = HYDROData_Zone::Merge_UNKNOWN;
+ Handle(HYDROData_Zone) aZone = Handle(HYDROData_Zone)::DownCast( modelObject() );
+ if ( !aZone.IsNull() )
+ {
+ aRes = aZone->GetMergeType();
+ }
+ return aRes;
+}
+
+void HYDROGUI_Zone::setMergeType( int theMergeType, QString theBathymetryName )
+{
+ Handle(HYDROData_Zone) aZone = Handle(HYDROData_Zone)::DownCast( modelObject() );
+ if ( !aZone.IsNull() )
+ {
+ HYDROData_Zone::MergeBathymetriesType aMergeType =
+ ( HYDROData_Zone::MergeBathymetriesType )theMergeType;
+ aZone->SetMergeType( aMergeType );
+ if ( aMergeType == HYDROData_Zone::Merge_Object )
+ {
+ // Find a bathymetry by the given name and set it as the zone's merge bathymetry
+ HYDROData_SequenceOfObjects aSeq = aZone->GetGeometryObjects();
+ HYDROData_SequenceOfObjects::Iterator anIter( aSeq );
+ for ( ; anIter.More(); anIter.Next() )
+ {
+ Handle(HYDROData_Object) aRefGeomObj =
+ Handle(HYDROData_Object)::DownCast( anIter.Value() );
+ if ( !aRefGeomObj.IsNull() )
+ {
+ // Get bathymetry name
+ Handle(HYDROData_Bathymetry) aBathymetry = aRefGeomObj->GetBathymetry();
+ if ( !aBathymetry.IsNull() && theBathymetryName == aBathymetry->GetName() )
+ {
+ aZone->SetMergeBathymetry( aBathymetry );
+ break;
+ }
+ }
+ }
+ }
+ }
+}