+ QString aNewObjName;
+ if (CheckNameExistingBathy(anObjectName, aNewObjName))
+ {
+ aBathymetryObj->SetName( aNewObjName );
+ replacemWarn += "\n'" + anObjectName + "' => '" + aNewObjName + "'";
+ }
+ else
+ aBathymetryObj->SetName( anObjectName );
+
+ aBathymetryObj->SetName( anObjectName );
+ aBathymetryObj->Update();
+ QString anEntry = HYDROGUI_DataObject::dataObjectEntry( aBathymetryObj );
+ theBrowseObjectsEntries.append( anEntry );
+ }
+ else //myedit off + non-fuse => import separate files
+ {
+ bool AtLeastOneWasImported = false;
+ foreach (QString filename, aFileNames)
+ {
+ Handle(HYDROData_Bathymetry) aBathymetryObj = Handle(HYDROData_Bathymetry)::DownCast( doc()->CreateObject( KIND_BATHYMETRY ) );
+ if ( aBathymetryObj.IsNull() )
+ continue;
+ aBathymetryObj->SetAltitudesInverted( anIsInvertAltitudes, false );
+ if ( !aBathymetryObj->ImportFromFiles( QStringList(filename) ) )
+ {
+ UnreadFilesWarn += "\n" + filename;
+ continue;
+ }
+
+ QString anObjectName = QFileInfo( filename ).baseName();
+ QString aNewObjName;
+ if (CheckNameExistingBathy(anObjectName, aNewObjName))
+ {
+ aBathymetryObj->SetName( aNewObjName );
+ replacemWarn += "\n'" + anObjectName + "' => '" + aNewObjName + "'";
+ }
+ else
+ aBathymetryObj->SetName( anObjectName );
+
+ AtLeastOneWasImported = true;
+ aBathymetryObj->Update();
+ QString anEntry = HYDROGUI_DataObject::dataObjectEntry( aBathymetryObj );
+ theBrowseObjectsEntries.append( anEntry );
+ }
+ if (!AtLeastOneWasImported)
+ {
+ theErrorMsg = tr( "BAD_IMPORTED_BATHYMETRY_FILES" ).arg( aFileNames.join("\n") );
+ return false;
+ }
+ }
+ }
+
+ if (!UnreadFilesWarn.isNull())
+ SUIT_MessageBox::warning( module()->getApp()->desktop(),
+ tr( "BATHYMETRY_IMPORT_WARNING" ), "The next files cannot be imported:" + UnreadFilesWarn );
+
+
+ if (!replacemWarn.isNull())
+ SUIT_MessageBox::warning( module()->getApp()->desktop(),
+ tr( "BATHYMETRY_IMPORT_WARNING" ), "The next objects names are already exist in the document; so the new objects was renamed:" + replacemWarn );