else if ( theCommandID == 111 ) {
filter.append( QObject::tr( "DAT_FILES_FILTER" ) + " (*.dat)" );
}
+ else if ( theCommandID == 140 ) {
+ filter.append( QObject::tr( "STL_ASCII_FILES_FILTER" ) + " (*.stl)" );
+ }
QString anInitialPath = "";
if ( SUIT_FileDlg::getLastVisitedPath().isEmpty() )
}
break;
}
+ case 140:
+ {
+ // STL format
+ aMeshes->length( 1 );
+ aMeshes[0] = theComponentMesh->CreateMeshesFromSTL( filename.toLatin1().constData() );
+ if ( aMeshes[0]->_is_nil() ) {
+ errors.append( QString( "%1 :\n\t%2" ).arg( filename ).
+ arg( QObject::tr( "SMESH_ERR_UNKNOWN_IMPORT_ERROR" ) ) );
+ }
+ break;
+ }
}
}
catch ( const SALOME::SALOME_Exception& S_ex ) {
aFilter = QObject::tr( "IDEAS_FILES_FILTER" ) + " (*.unv)";
}
break;
- case 140:
case 141:
{
// export STL
if ( SUIT_FileDlg::getLastVisitedPath().isEmpty() )
anInitialPath = QDir::currentPath();
- if ( theCommandID != 122 && theCommandID != 125 && theCommandID != 140 && theCommandID != 141) {
+ if ( theCommandID != 122 && theCommandID != 125 && theCommandID != 141) {
if ( anInitialPath.isEmpty() ) anInitialPath = SUIT_FileDlg::getLastVisitedPath();
aFilename = SUIT_FileDlg::getFileName(SMESHGUI::desktop(), anInitialPath + QString("/") + aMeshName,
aFilter, aTitle, false);
}
- else if(theCommandID == 140 || theCommandID == 141) { // Export to STL
+ else if(theCommandID == 141) { // Export to STL
QStringList filters;
QMap<QString, int>::const_iterator it = aFilterMapSTL.begin();
for ( ; it != aFilterMapSTL.end(); ++it )
case 123:
aMesh->ExportUNV( aFilename.toLatin1().data() );
break;
- case 140:
case 141:
aMesh->ExportSTL( aFilename.toLatin1().data(), aIsASCII_STL );
break;
case 113: // IMPORT
case 112:
case 111:
+ case 140:
{
if(checkLock(aStudy)) break;
::ImportMeshesFromFile(GetSMESHGen(),theCommandID);
case 124:
case 125:
case 126:
- case 140:
case 141:
{
::ExportMeshToFile(theCommandID);
createMenu( 111, importId, -1 );
createMenu( 112, importId, -1 );
createMenu( 113, importId, -1 );
+ createMenu( 140, importId, -1 );
createMenu( 121, exportId, -1 );
createMenu( 122, exportId, -1 );
createMenu( 123, exportId, -1 );
- createMenu( 140, exportId, -1 ); // export to stl STL
+ createMenu( 141, exportId, -1 ); // export to stl STL
createMenu( separator(), fileId, 10 );