mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-11-14 09:38:33 +05:00
PAL7252(improve File Dialog for export to MED for choosing format
of MED files to export to). Also, the value of "auto_groups" parameter of ExportToMED method changed to false(so, currently, automatic groups are never created).
This commit is contained in:
parent
c483b7246f
commit
a067f7f0d8
@ -240,9 +240,11 @@ namespace{
|
|||||||
SMESH::SMESH_Mesh_var aMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(anIObject);
|
SMESH::SMESH_Mesh_var aMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(anIObject);
|
||||||
if ( !aMesh->_is_nil() ) {
|
if ( !aMesh->_is_nil() ) {
|
||||||
QString aFilter, aTitle = QObject::tr("Export mesh");
|
QString aFilter, aTitle = QObject::tr("Export mesh");
|
||||||
|
QMap<QString, SMESH::MED_VERSION> aFilterMap;
|
||||||
switch ( theCommandID ) {
|
switch ( theCommandID ) {
|
||||||
case 122:
|
case 122:
|
||||||
aFilter = QObject::tr("MED files (*.med)");
|
aFilterMap.insert( QObject::tr("MED 2.1 (*.med)"), SMESH::MED_V2_1 );
|
||||||
|
aFilterMap.insert( QObject::tr("MED 2.2 (*.med)"), SMESH::MED_V2_2 );
|
||||||
break;
|
break;
|
||||||
case 121:
|
case 121:
|
||||||
aFilter = QObject::tr("DAT files (*.dat)");
|
aFilter = QObject::tr("DAT files (*.dat)");
|
||||||
@ -264,7 +266,25 @@ namespace{
|
|||||||
return;
|
return;
|
||||||
}}
|
}}
|
||||||
|
|
||||||
QString aFilename = QAD_FileDlg::getFileName(parent, "", aFilter, aTitle, false);
|
QString aFilename;
|
||||||
|
SMESH::MED_VERSION aFormat;
|
||||||
|
|
||||||
|
if ( theCommandID != 122)
|
||||||
|
aFilename = QAD_FileDlg::getFileName(parent, "", aFilter, aTitle, false);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
QStringList filters;
|
||||||
|
for ( QMap<QString, SMESH::MED_VERSION>::const_iterator it = aFilterMap.begin(); it != aFilterMap.end(); ++it )
|
||||||
|
filters.push_back( it.key() );
|
||||||
|
|
||||||
|
QAD_FileDlg* fd = new QAD_FileDlg( parent, false, true, true );
|
||||||
|
fd->setCaption( aTitle );
|
||||||
|
fd->setFilters( filters );
|
||||||
|
fd->exec();
|
||||||
|
aFilename = fd->selectedFile();
|
||||||
|
aFormat = aFilterMap[fd->selectedFilter()];
|
||||||
|
delete fd;
|
||||||
|
}
|
||||||
if ( !aFilename.isEmpty() ) {
|
if ( !aFilename.isEmpty() ) {
|
||||||
// Check whether the file already exists and delete it if yes
|
// Check whether the file already exists and delete it if yes
|
||||||
QFile aFile( aFilename );
|
QFile aFile( aFilename );
|
||||||
@ -273,7 +293,7 @@ namespace{
|
|||||||
QAD_WaitCursor wc;
|
QAD_WaitCursor wc;
|
||||||
switch ( theCommandID ) {
|
switch ( theCommandID ) {
|
||||||
case 122:
|
case 122:
|
||||||
aMesh->ExportToMED( aFilename.latin1(), true, SMESH::MED_V2_1 ); // currently, automatic groups are always created
|
aMesh->ExportToMED( aFilename.latin1(), false, aFormat ); // currently, automatic groups are never created
|
||||||
break;
|
break;
|
||||||
case 121:
|
case 121:
|
||||||
aMesh->ExportDAT( aFilename.latin1() );
|
aMesh->ExportDAT( aFilename.latin1() );
|
||||||
|
Loading…
Reference in New Issue
Block a user