- setModal( false );
- setAttribute( Qt::WA_DeleteOnClose, true );
- setWindowTitle( tr( "ADAPT_PREF_MG_ADAPT" ) );
- setSizeGripEnabled( true );
-
-
- myTabWidget = new QTabWidget( this );
-
- // Arguments
-
- myArgs = new SMESHGUI_MgAdaptArguments( myTabWidget );
- SMESH::str_array* str = model->getOptionValuesStrVec();
- SMESH::str_array* str2 = model->getCustomOptionValuesStrVec();
- std::vector<std::string> s;
- for (int i = 0; i< str->length(); i++) s.push_back( (*str)[i].in());
- for (int j = str->length(); j< str2->length(); j++) s.push_back((*str2)[ j - str->length() ].in() );
- //~str.insert( str.end(), str2.begin(), str2.end() );
-
- myAdvOpt = new MgAdaptAdvWidget(myTabWidget, &s);
-
- int argsTab = myTabWidget->addTab( myArgs, tr( "Args" ) );
- int advTab = myTabWidget->addTab( myAdvOpt, tr( "ADVOP" ) );
-
- myAdvOpt->workingDirectoryLabel ->setText (tr( "WORKING_DIR" ));
- myAdvOpt->workingDirectoryPushButton ->setText (tr( "SELECT_DIR" ));
- myAdvOpt->keepWorkingFilesCheck ->setText (tr( "KEEP_WORKING_FILES" ));
- myAdvOpt->verboseLevelLabel ->setText (tr( "VERBOSE_LEVEL" ));
- myAdvOpt->removeLogOnSuccessCheck ->setText (tr( "REMOVE_LOG_ON_SUCCESS" ));
- myAdvOpt->logInFileCheck ->setText (tr( "LOG_IN_FILE" ));
- myAdvOpt->logGroupBox ->setTitle(tr( "LOG_GROUP_TITLE" ));
-
- // buttons
- QPushButton* okBtn = new QPushButton( tr( "SMESH_BUT_OK" ), this );
- okBtn->setAutoDefault( true );
- okBtn->setDefault( true );
- okBtn->setFocus();
- QPushButton* buttonApply = new QPushButton(tr("SMESH_BUT_APPLY"), this);
- buttonApply->setAutoDefault(true);
- QPushButton* buttonApplyAndClose = new QPushButton(tr("SMESH_BUT_APPLY_AND_CLOSE"), this);
- buttonApplyAndClose->setAutoDefault(true);
- QPushButton* cancelBtn = new QPushButton( tr( "SMESH_BUT_CANCEL" ), this );
- cancelBtn->setAutoDefault( true );
- QPushButton* helpBtn = new QPushButton( tr( "SMESH_BUT_HELP" ), this );
- helpBtn->setAutoDefault( true );
-
- QHBoxLayout* btnLayout = new QHBoxLayout;
- btnLayout->setSpacing( SPACING );
- btnLayout->setMargin( 0 );
- btnLayout->addWidget( buttonApplyAndClose );
- btnLayout->addStretch( 10 );
- btnLayout->addWidget( buttonApply );
- btnLayout->addStretch( 10 );
- btnLayout->addWidget( okBtn );
- btnLayout->addStretch( 10 );
- btnLayout->addWidget( cancelBtn );
- btnLayout->addStretch( 10 );
- btnLayout->addWidget( helpBtn );
- okBtn->hide(); // tab 1
-
- QVBoxLayout* l = new QVBoxLayout ( this );
- l->setMargin( MARGIN );
- l->setSpacing( SPACING );
- l->addWidget( myTabWidget );
- l->addStretch();
- l->addLayout( btnLayout );
-
-
- connect( okBtn, SIGNAL( clicked() ), this, SLOT( clickOnOk() ) );
- connect( helpBtn, SIGNAL( clicked() ), this, SLOT( clickOnHelp() ) );
- connect(cancelBtn, SIGNAL(clicked()), this, SLOT(reject()));
- connect(buttonApply, SIGNAL(clicked()), this,SLOT(clickOnApply()));
- connect(buttonApplyAndClose, SIGNAL(clicked()), this,SLOT(clickOnOk()));
- connect(myArgs, SIGNAL(meshDimSignal(ADAPTATION_MODE)), myAdvOpt, SLOT( onMeshDimChanged(ADAPTATION_MODE)) );
+ setModal( false );
+ setAttribute( Qt::WA_DeleteOnClose, true );
+ setWindowTitle( tr( "ADAPT_PREF_MG_ADAPT" ) );
+ setSizeGripEnabled( true );
+
+ myTabWidget = new QTabWidget( this );
+
+ // Arguments
+
+ myArgs = new SMESHGUI_MgAdaptArguments( myTabWidget );
+ SMESH::str_array* str = model->getOptionValuesStrVec();
+ SMESH::str_array* str2 = model->getCustomOptionValuesStrVec();
+ std::vector<std::string> s;
+ for (int i = 0; i< str->length(); i++) s.push_back( (*str)[i].in());
+ for (int j = str->length(); j< str2->length(); j++) s.push_back((*str2)[ j - str->length() ].in() );
+ //~str.insert( str.end(), str2.begin(), str2.end() );
+
+ myAdvOpt = new MgAdaptAdvWidget(myTabWidget, &s);
+
+ int argsTab = myTabWidget->addTab( myArgs, tr( "Args" ) );
+ int advTab = myTabWidget->addTab( myAdvOpt, tr( "ADVOP" ) );
+
+ myAdvOpt->workingDirectoryLabel ->setText (tr( "WORKING_DIR" ));
+ myAdvOpt->workingDirectoryPushButton ->setText (tr( "SELECT_DIR" ));
+ myAdvOpt->keepWorkingFilesCheck ->setText (tr( "KEEP_WORKING_FILES" ));
+ myAdvOpt->verboseLevelLabel ->setText (tr( "VERBOSE_LEVEL" ));
+ myAdvOpt->removeLogOnSuccessCheck ->setText (tr( "REMOVE_LOG_ON_SUCCESS" ));
+ myAdvOpt->logInFileCheck ->setText (tr( "LOG_IN_FILE" ));
+ myAdvOpt->logGroupBox ->setTitle(tr( "LOG_GROUP_TITLE" ));
+
+ // buttons
+ QPushButton* okBtn = new QPushButton( tr( "SMESH_BUT_OK" ), this );
+ okBtn->setAutoDefault( true );
+ okBtn->setDefault( true );
+ okBtn->setFocus();
+ QPushButton* buttonApply = new QPushButton(tr("SMESH_BUT_APPLY"), this);
+ buttonApply->setAutoDefault(true);
+ QPushButton* buttonApplyAndClose = new QPushButton(tr("SMESH_BUT_APPLY_AND_CLOSE"), this);
+ buttonApplyAndClose->setAutoDefault(true);
+ QPushButton* cancelBtn = new QPushButton( tr( "SMESH_BUT_CANCEL" ), this );
+ cancelBtn->setAutoDefault( true );
+ QPushButton* helpBtn = new QPushButton( tr( "SMESH_BUT_HELP" ), this );
+ helpBtn->setAutoDefault( true );
+
+ QHBoxLayout* btnLayout = new QHBoxLayout;
+ btnLayout->setSpacing( SPACING );
+ btnLayout->setMargin( 0 );
+ btnLayout->addWidget( buttonApplyAndClose );
+ btnLayout->addStretch( 10 );
+ btnLayout->addWidget( buttonApply );
+ btnLayout->addStretch( 10 );
+ btnLayout->addWidget( okBtn );
+ btnLayout->addStretch( 10 );
+ btnLayout->addWidget( cancelBtn );
+ btnLayout->addStretch( 10 );
+ btnLayout->addWidget( helpBtn );
+ okBtn->hide(); // tab 1
+
+ QVBoxLayout* l = new QVBoxLayout ( this );
+ l->setMargin( MARGIN );
+ l->setSpacing( SPACING );
+ l->addWidget( myTabWidget );
+ l->addStretch();
+ l->addLayout( btnLayout );
+
+
+ connect( okBtn, SIGNAL(clicked()), this, SLOT( clickOnOk() ) );
+ connect( helpBtn, SIGNAL(clicked()), this, SLOT( clickOnHelp() ) );
+ connect(cancelBtn, SIGNAL(clicked()), this, SLOT(reject()));
+ connect(buttonApply, SIGNAL(clicked()), this,SLOT(clickOnApply()));
+ connect(buttonApplyAndClose, SIGNAL(clicked()), this,SLOT(clickOnOk()));
+ connect(myArgs, SIGNAL(meshDimSignal(ADAPTATION_MODE)), myAdvOpt, SLOT( onMeshDimChanged(ADAPTATION_MODE)) );
- bool ret = true;
- myArgs->aMedfile->setChecked(myData->fromMedFile) ;
- if (myData->fromMedFile)
- {
-
- *(myArgs->myFileInDir) = QString(myData->myFileInDir) ;
- myArgs->selectMedFileLineEdit->setText(QString(myData->myMeshFileIn)) ;
- // myData->myInMeshName = // TODO
-
- }
- else
- {
- myArgs->aBrowserObject->setText(QString(myData->myInMeshName));
- //~ myArgs->myFileInDir =""; // TODO
- //~ myArgs->selectMedFileLineEdit->setText(); // TODO
- }
- myArgs->meshNameLineEdit->setText(QString(myData->myOutMeshName));
- myArgs->medFileCheckBox->setChecked(myData->myMeshOutMed);
-
- if(myData->myMeshOutMed)
- {
- *(myArgs->myFileOutDir) = QString(myData->myFileOutDir);
- myArgs->selectOutMedFileLineEdit->setText(QString(myData->myMeshFileOut));
-
- }
- else
- {
- *(myArgs->myFileOutDir) = QString(""); //TODO
- }
-
- myArgs->publishOut->setChecked(myData->myPublish);
-
- myArgs->localButton->setChecked(myData->myUseLocalMap);
- myArgs->backgroundButton->setChecked(myData->myUseBackgroundMap);
- myArgs->constantButton->setChecked(myData->myUseConstantValue);
-
- if (myData->myUseConstantValue)
- {
- myArgs->dvalue->setValue(myData->myConstantValue);
- }
- else
- {
- myArgs->dvalue->setValue(0.0);
- }
-
- if (myData->myUseBackgroundMap)
- {
-
- *(myArgs->myFileSizeMapDir) = QString(myData->myFileSizeMapDir) ;
- myArgs->selectMedFileBackgroundLineEdit->setText(QString(myData->myMeshFileBackground));
- }
- else
- {
- *(myArgs->myFileSizeMapDir) = QString("") ; //TODO
- myArgs->selectMedFileBackgroundLineEdit->setText(""); //TODO
- }
-
- myArgs->fieldNameCmb->setCurrentText(QString(myData->myFieldName));
- myArgs->noTimeStep->setChecked(myData->myUseNoTimeStep);
- myArgs->lastTimeStep->setChecked( myData->myUseLastTimeStep);
- myArgs->chosenTimeStep->setChecked(myData->myUseChosenTimeStep);
- if (myData->myUseChosenTimeStep)
- {
- myArgs->rankSpinBox->setValue(myData->myRank);
- myArgs->timeStep->setValue(myData->myTimeStep);
- }
-
- myAdvOpt->workingDirectoryLineEdit->setText(QString(myData->myWorkingDir));
- myAdvOpt->logInFileCheck->setChecked(myData->myPrintLogInFile);
-
- myAdvOpt->verboseLevelSpin->setValue(myData->myVerboseLevel);
- myAdvOpt->removeLogOnSuccessCheck->setChecked(myData->myRemoveLogOnSuccess);
- myAdvOpt->keepWorkingFilesCheck->setChecked(myData->myKeepFiles);
-
- return ret;
+ bool ret = true;
+ myArgs->aMedfile->setChecked(myData->fromMedFile) ;
+ if (myData->fromMedFile)
+ {
+
+ *(myArgs->myFileInDir) = QString(myData->myFileInDir) ;
+ myArgs->selectMedFileLineEdit->setText(QString(myData->myMeshFileIn)) ;
+ // myData->myInMeshName = // TODO
+
+ }
+ else
+ {
+ myArgs->aBrowserObject->setText(QString(myData->myInMeshName));
+ //~ myArgs->myFileInDir =""; // TODO
+ //~ myArgs->selectMedFileLineEdit->setText(); // TODO
+ }
+ myArgs->meshNameLineEdit->setText(QString(myData->myOutMeshName));
+ myArgs->medFileCheckBox->setChecked(myData->myMeshOutMed);
+
+ if(myData->myMeshOutMed)
+ {
+ *(myArgs->myFileOutDir) = QString(myData->myFileOutDir);
+ myArgs->selectOutMedFileLineEdit->setText(QString(myData->myMeshFileOut));
+ }
+ else
+ {
+ *(myArgs->myFileOutDir) = QString(""); //TODO
+ }
+
+ myArgs->publishOut->setChecked(myData->myPublish);
+
+ myArgs->localButton->setChecked(myData->myUseLocalMap);
+ myArgs->backgroundButton->setChecked(myData->myUseBackgroundMap);
+ myArgs->constantButton->setChecked(myData->myUseConstantValue);
+
+ if (myData->myUseConstantValue)
+ {
+ myArgs->dvalue->setValue(myData->myConstantValue);
+ }
+ else
+ {
+ myArgs->dvalue->setValue(0.0);
+ }
+
+ if (myData->myUseBackgroundMap)
+ {
+
+ *(myArgs->myFileSizeMapDir) = QString(myData->myFileSizeMapDir) ;
+ myArgs->selectMedFileBackgroundLineEdit->setText(QString(myData->myMeshFileBackground));
+ }
+ else
+ {
+ *(myArgs->myFileSizeMapDir) = QString("") ; //TODO
+ myArgs->selectMedFileBackgroundLineEdit->setText(""); //TODO
+ }
+
+ myArgs->fieldNameCmb->setCurrentText(QString(myData->myFieldName));
+ myArgs->noTimeStep->setChecked(myData->myUseNoTimeStep);
+ myArgs->lastTimeStep->setChecked( myData->myUseLastTimeStep);
+ myArgs->chosenTimeStep->setChecked(myData->myUseChosenTimeStep);
+ if (myData->myUseChosenTimeStep)
+ {
+ myArgs->rankSpinBox->setValue(myData->myRank);
+ myArgs->timeStep->setValue(myData->myTimeStep);
+ }
+
+ myAdvOpt->workingDirectoryLineEdit->setText(QString(myData->myWorkingDir));
+ myAdvOpt->logInFileCheck->setChecked(myData->myPrintLogInFile);
+
+ myAdvOpt->verboseLevelSpin->setValue(myData->myVerboseLevel);
+ myAdvOpt->removeLogOnSuccessCheck->setChecked(myData->myRemoveLogOnSuccess);
+ myAdvOpt->keepWorkingFilesCheck->setChecked(myData->myKeepFiles);
+
+ return ret;
- bool ret = true;
- SMESH::MgAdaptHypothesisData* aData = new SMESH::MgAdaptHypothesisData();
- aData->fromMedFile = myArgs->aMedfile->isChecked();
- if (aData->fromMedFile)
- {
-
- aData->myFileInDir = CORBA::string_dup(myArgs->myFileInDir->toStdString().c_str());
- aData->myMeshFileIn = CORBA::string_dup(myArgs->selectMedFileLineEdit->text().toStdString().c_str());
- // aData->myInMeshName = // TODO
- }
- else // TODO browser
- {
- aData->myInMeshName = CORBA::string_dup(myArgs->aBrowserObject->text().toStdString().c_str());
- aData->myFileInDir = CORBA::string_dup(myAdvOpt->workingDirectoryLineEdit->text().toStdString().c_str());
-
- TCollection_AsciiString aGenericName = (char*)aData->myFileInDir;
- TCollection_AsciiString aGenericName2 = "MgAdapt_";
- aGenericName2 += getpid();
- aGenericName2 += "_";
- aGenericName2 += Abs((Standard_Integer)(long) aGenericName.ToCString());
- aGenericName2 += ".med";
- aGenericName+=aGenericName2;
- emit myArgs->toExportMED(aGenericName.ToCString());
- aData->myMeshFileIn = aGenericName2.ToCString();
- }
- aData->myOutMeshName = CORBA::string_dup(myArgs->meshNameLineEdit->text().toStdString().c_str());
- aData->myMeshOutMed = myArgs->medFileCheckBox->isChecked();
- if(aData->myMeshOutMed)
- {
- aData->myFileOutDir = CORBA::string_dup(myArgs->myFileOutDir->toStdString().c_str());
- aData->myMeshFileOut = CORBA::string_dup(myArgs->selectOutMedFileLineEdit->text().toStdString().c_str());
-
- }
- else
- {
- aData->myMeshFileOut = "";
- }
-
- aData->myPublish = myArgs->publishOut->isChecked();
-
-
- aData->myUseLocalMap = myArgs->localButton->isChecked();
- aData->myUseBackgroundMap = myArgs->backgroundButton->isChecked();
- aData->myUseConstantValue = myArgs->constantButton->isChecked();
- if (aData->myUseConstantValue)
- {
- aData->myConstantValue = myArgs->dvalue->value();
- }
- else
- {
- aData->myConstantValue = 0.0;
- }
- if (aData->myUseBackgroundMap)
- {
- aData->myFileSizeMapDir = CORBA::string_dup(myArgs->myFileSizeMapDir->toStdString().c_str());
- aData->myMeshFileBackground = CORBA::string_dup(myArgs->selectMedFileBackgroundLineEdit->text().toStdString().c_str());
- }
- else
- {
- aData->myMeshFileBackground = "";
- }
-
- aData->myFieldName = CORBA::string_dup(myArgs->fieldNameCmb->currentText().toStdString().c_str());
- aData->myUseNoTimeStep = myArgs->noTimeStep->isChecked();
- aData->myUseLastTimeStep = myArgs->lastTimeStep->isChecked();
- aData->myUseChosenTimeStep = myArgs->chosenTimeStep->isChecked();
- if (aData->myUseChosenTimeStep)
- {
- aData->myRank = myArgs->rankSpinBox->value();
- aData->myTimeStep = myArgs->timeStep->value();
-
- }
-
-
- aData->myWorkingDir = CORBA::string_dup(myAdvOpt->workingDirectoryLineEdit->text().toStdString().c_str());
- aData->myPrintLogInFile = myAdvOpt->logInFileCheck->isChecked();
- aData->myVerboseLevel = myAdvOpt->verboseLevelSpin->value();
- aData->myRemoveLogOnSuccess = myAdvOpt->removeLogOnSuccessCheck->isChecked();
- aData->myKeepFiles = myAdvOpt->keepWorkingFilesCheck->isChecked();
- model->setData(*aData);
- QString msg;
- checkParams(msg);
- delete aData;
- return ret;
+ bool ret = true;
+ SMESH::MgAdaptHypothesisData* aData = new SMESH::MgAdaptHypothesisData();
+ aData->fromMedFile = myArgs->aMedfile->isChecked();
+ if (aData->fromMedFile)
+ {
+
+ aData->myFileInDir = CORBA::string_dup(myArgs->myFileInDir->toStdString().c_str());
+ aData->myMeshFileIn = CORBA::string_dup(myArgs->selectMedFileLineEdit->text().toStdString().c_str());
+ // aData->myInMeshName = // TODO
+ }
+ else // TODO browser
+ {
+ aData->myInMeshName = CORBA::string_dup(myArgs->aBrowserObject->text().toStdString().c_str());
+ aData->myFileInDir = CORBA::string_dup(myAdvOpt->workingDirectoryLineEdit->text().toStdString().c_str());
+
+ TCollection_AsciiString aGenericName = (char*)aData->myFileInDir;
+ TCollection_AsciiString aGenericName2 = "MgAdapt_";
+ aGenericName2 += getpid();
+ aGenericName2 += "_";
+ aGenericName2 += Abs((Standard_Integer)(long) aGenericName.ToCString());
+ aGenericName2 += ".med";
+ aGenericName+=aGenericName2;
+ emit myArgs->toExportMED(aGenericName.ToCString());
+ aData->myMeshFileIn = aGenericName2.ToCString();
+ }
+ aData->myOutMeshName = CORBA::string_dup(myArgs->meshNameLineEdit->text().toStdString().c_str());
+ aData->myMeshOutMed = myArgs->medFileCheckBox->isChecked();
+ if(aData->myMeshOutMed)
+ {
+ aData->myFileOutDir = CORBA::string_dup(myArgs->myFileOutDir->toStdString().c_str());
+ aData->myMeshFileOut = CORBA::string_dup(myArgs->selectOutMedFileLineEdit->text().toStdString().c_str());
+
+ }
+ else
+ {
+ aData->myMeshFileOut = "";
+ }
+
+ aData->myPublish = myArgs->publishOut->isChecked();
+
+
+ aData->myUseLocalMap = myArgs->localButton->isChecked();
+ aData->myUseBackgroundMap = myArgs->backgroundButton->isChecked();
+ aData->myUseConstantValue = myArgs->constantButton->isChecked();
+ if (aData->myUseConstantValue)
+ {
+ aData->myConstantValue = myArgs->dvalue->value();
+ }
+ else
+ {
+ aData->myConstantValue = 0.0;
+ }
+ if (aData->myUseBackgroundMap)
+ {
+ aData->myFileSizeMapDir = CORBA::string_dup(myArgs->myFileSizeMapDir->toStdString().c_str());
+ aData->myMeshFileBackground = CORBA::string_dup(myArgs->selectMedFileBackgroundLineEdit->text().toStdString().c_str());
+ }
+ else
+ {
+ aData->myMeshFileBackground = "";
+ }
+
+ aData->myFieldName = CORBA::string_dup(myArgs->fieldNameCmb->currentText().toStdString().c_str());
+ aData->myUseNoTimeStep = myArgs->noTimeStep->isChecked();
+ aData->myUseLastTimeStep = myArgs->lastTimeStep->isChecked();
+ aData->myUseChosenTimeStep = myArgs->chosenTimeStep->isChecked();
+ if (aData->myUseChosenTimeStep)
+ {
+ aData->myRank = myArgs->rankSpinBox->value();
+ aData->myTimeStep = myArgs->timeStep->value();
+
+ }
+
+ aData->myWorkingDir = CORBA::string_dup(myAdvOpt->workingDirectoryLineEdit->text().toStdString().c_str());
+ aData->myPrintLogInFile = myAdvOpt->logInFileCheck->isChecked();
+ aData->myVerboseLevel = myAdvOpt->verboseLevelSpin->value();
+ aData->myRemoveLogOnSuccess = myAdvOpt->removeLogOnSuccessCheck->isChecked();
+ aData->myKeepFiles = myAdvOpt->keepWorkingFilesCheck->isChecked();
+ model->setData(*aData);
+ QString msg;
+ checkParams(msg);
+ delete aData;
+ return ret;
-
- myFileInDir = new QString("");
- myFileOutDir = new QString("");
- myFileSizeMapDir = new QString("");
- if ( SUIT_FileDlg::getLastVisitedPath().isEmpty() )
- {
- *myFileInDir = QDir::currentPath();
- *myFileOutDir = QDir::currentPath();
- *myFileSizeMapDir = QDir::currentPath();
- }
- else
- {
- *myFileInDir = SUIT_FileDlg::getLastVisitedPath();
- *myFileOutDir = SUIT_FileDlg::getLastVisitedPath();
- *myFileSizeMapDir = SUIT_FileDlg::getLastVisitedPath();
- }
-
- meshDim = 0;
- // Mesh in
- aMeshIn = new QGroupBox( tr( "MeshIn" ), this );
- aMedfile = new QRadioButton( tr( "MEDFile" ), aMeshIn );
- aBrowser = new QRadioButton( tr( "Browser" ), aMeshIn );
- aBrowserObject = new QLineEdit( aMeshIn );
- selectMedFilebutton = new QPushButton("", aMeshIn);
- selectMedFileLineEdit = new QLineEdit( aMeshIn );
-
- meshIn = new QGridLayout( aMeshIn );
-
- meshIn->setMargin( MARGIN );
- meshIn->setSpacing( SPACING );
- meshIn->addWidget( aMedfile, 0, 0, 1,1 );
- meshIn->addWidget( aBrowser, 0, 1,1,1);
- meshIn->addWidget( aBrowserObject, 0, 2, 1, 1 );
- meshIn->addWidget( selectMedFilebutton, 1, 0,1, 1);
- meshIn->addWidget( selectMedFileLineEdit, 1, 1, 1, 1 );
- hspacer = new QSpacerItem(188, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
-
- meshInGroup = new QButtonGroup( this );
- meshInGroup->addButton( aMedfile, 0 );
- meshInGroup->addButton( aBrowser, 1 );
-
- //Mesh out
-
- aMeshOut = new QGroupBox( tr( "MeshOut" ), this );
- meshName = new QLabel(tr("MeshName"), aMeshOut);
- secondHspacer = new QSpacerItem(100, 30);
- meshNameLineEdit = new QLineEdit(aMeshOut) ;
- medFileCheckBox = new QCheckBox(tr("MEDFile"), aMeshOut);
- selectOutMedFilebutton = new QPushButton("", aMeshOut);
- thirdHspacer = new QSpacerItem(188, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
- selectOutMedFileLineEdit = new QLineEdit(aMeshOut) ;
- publishOut = new QCheckBox(tr("Publish_MG_ADAPT"), aMeshOut);
-
- meshOut = new QGridLayout( aMeshOut );
-
- meshOut->setMargin( MARGIN );
- meshOut->setSpacing( SPACING );
- meshOut->addWidget( meshName, 0, 0, 1,1 );
- meshOut->addItem( secondHspacer, 0, 1, 1, 1 );
- meshOut->addWidget( meshNameLineEdit, 0, 2,1,1);
- meshOut->addWidget( medFileCheckBox, 1, 0,1,1 );
- meshOut->addWidget( selectOutMedFilebutton, 1, 1,1,1 );
- meshOut->addWidget( selectOutMedFileLineEdit, 1, 2,1,1);
- meshOut->addWidget( publishOut, 2, 0,1,1 );
-
- //size map definition
-
- sizeMapDefinition = new QGroupBox(tr("SIZE_MAP_DEF"), this);
- localButton = new QRadioButton(tr("LOCAL_MG_ADAPT"), sizeMapDefinition);
- backgroundButton = new QRadioButton(tr("BACKGRND_MG_ADAPT"), sizeMapDefinition);
- constantButton = new QRadioButton(tr("CNST_MG_ADAPT"), sizeMapDefinition);
- medFileBackground = new QLabel(tr("MED_FILE_BCKG"), sizeMapDefinition);
- selectMedFileBackgroundbutton = new QPushButton(tr(""), sizeMapDefinition);
- selectMedFileBackgroundLineEdit = new QLineEdit(sizeMapDefinition);
- valueLabel = new QLabel(tr("VALUE_MG_ADAPT"), sizeMapDefinition);
- dvalue = new QDoubleSpinBox(sizeMapDefinition);
- sizeMapDefGroup = new QButtonGroup( this );
- sizeMapDefGroup->addButton( localButton, 0 );
- sizeMapDefGroup->addButton( backgroundButton, 1 );
- sizeMapDefGroup->addButton( constantButton, 2 );
-
- sizeMapDefGroupLayout = new QGridLayout(sizeMapDefinition);
- sizeMapDefGroupLayout->addWidget(localButton, 0,0);
- sizeMapDefGroupLayout->addWidget(backgroundButton, 0,1);
- sizeMapDefGroupLayout->addWidget(constantButton, 0,2);
- sizeMapDefGroupLayout->addWidget(medFileBackground, 1,0);
- sizeMapDefGroupLayout->addWidget(selectMedFileBackgroundbutton, 1,1);
- sizeMapDefGroupLayout->addWidget(selectMedFileBackgroundLineEdit, 1,2);
- sizeMapDefGroupLayout->addWidget(valueLabel, 2,0);
- sizeMapDefGroupLayout->addWidget(dvalue, 2,1);
-
- // size Map field
- sizeMapField = new QGroupBox(tr("SIZE_MAP_FIELD"), this);
- fieldName = new QLabel(tr("MG_ADAPT_FIELD_NAME"), sizeMapField);
- fieldNameCmb = new QComboBox(sizeMapField);
- noTimeStep = new QRadioButton(tr("MG_ADAPT_NO_T_ST"), sizeMapField);
- lastTimeStep = new QRadioButton(tr("MG_ADAPT_L_ST"), sizeMapField);
- chosenTimeStep = new QRadioButton(tr("MG_ADAPT_CH_ST"), sizeMapField);
- timeStepLabel = new QLabel(tr("MG_ADAPT_TSTP"), sizeMapField);
- timeStep = new QSpinBox(sizeMapField);
- //~timeStep->setMinimum(-1);
- rankLabel = new QLabel(tr("MG_ADAPT_RANK"), sizeMapField);
- rankSpinBox = new QSpinBox(sizeMapField);
- rankSpinBox->setMinimum(-1);
-
- timeStepGroup = new QButtonGroup(this);
- timeStepGroup->addButton(noTimeStep, 0);
- timeStepGroup->addButton(lastTimeStep, 1);
- timeStepGroup->addButton(chosenTimeStep, 2);
-
- sizeMapFieldGroupLayout = new QGridLayout(sizeMapField);
-
- sizeMapFieldGroupLayout->addWidget(fieldName, 0,0);
- sizeMapFieldGroupLayout->addWidget(fieldNameCmb, 0,1);
- sizeMapFieldGroupLayout->addWidget(noTimeStep, 1,0);
- sizeMapFieldGroupLayout->addWidget(lastTimeStep, 1,1);
- sizeMapFieldGroupLayout->addWidget(chosenTimeStep, 1,2);
- sizeMapFieldGroupLayout->addWidget(timeStepLabel, 2,0);
- sizeMapFieldGroupLayout->addWidget(timeStep, 2,1);
- sizeMapFieldGroupLayout->addWidget(rankLabel, 2,2);
- sizeMapFieldGroupLayout->addWidget(rankSpinBox, 2,3);
-
-
- QGridLayout* argumentsLayout = new QGridLayout( this );
- argumentsLayout->setMargin( MARGIN );
- argumentsLayout->setSpacing( SPACING );
-
- argumentsLayout->addWidget( aMeshIn, 0, 0, 1, 3 );
- argumentsLayout->addWidget( aMeshOut, 1, 0, 1, 3 );
- argumentsLayout->addWidget( sizeMapDefinition, 2, 0, 1, 3 );
- argumentsLayout->addWidget( sizeMapField, 3, 0, 1, 3 );
- argumentsLayout->setColumnStretch( 1, 5 );
- argumentsLayout->setRowStretch( 4, 5 );
-
- // Initial state
- setMode( Mesh, Local);
- medFileCheckBox->setChecked(true);
- visibleTimeStepRankLabel (false);
-
- // Connections
- connect( meshInGroup, SIGNAL( buttonClicked( int ) ), this, SLOT( modeChanged( int ) ) );
- connect( sizeMapDefGroup, SIGNAL( buttonClicked( int ) ), this, SLOT( sizeMapDefChanged( int ) ) );
- connect( selectMedFilebutton, SIGNAL( pressed( ) ), this, SLOT( onSelectMedFilebuttonClicked( ) ) );
- connect( medFileCheckBox, SIGNAL (stateChanged(int)), this, SLOT(onMedFileCheckBox(int) ) );
- connect( publishOut, SIGNAL (stateChanged(int)), this, SLOT(onPublishOut(int) ) );
- connect( selectOutMedFilebutton, SIGNAL( pressed()), this, SLOT(onSelectOutMedFilebutton()));
- connect( selectMedFileBackgroundbutton, SIGNAL(pressed()), this, SLOT(onSelectMedFileBackgroundbutton()) );
- connect( timeStepGroup, SIGNAL( buttonClicked( int ) ), this, SLOT( timeStepGroupChanged( int ) ) );
- emit updateSelection();
+ myFileInDir = new QString("");
+ myFileOutDir = new QString("");
+ myFileSizeMapDir = new QString("");
+ if ( SUIT_FileDlg::getLastVisitedPath().isEmpty() )
+ {
+ *myFileInDir = QDir::currentPath();
+ *myFileOutDir = QDir::currentPath();
+ *myFileSizeMapDir = QDir::currentPath();
+ }
+ else
+ {
+ *myFileInDir = SUIT_FileDlg::getLastVisitedPath();
+ *myFileOutDir = SUIT_FileDlg::getLastVisitedPath();
+ *myFileSizeMapDir = SUIT_FileDlg::getLastVisitedPath();
+ }
+
+ meshDim = 0;
+ // Mesh in
+ aMeshIn = new QGroupBox( tr( "MeshIn" ), this );
+ aMedfile = new QRadioButton( tr( "MEDFile" ), aMeshIn );
+ aBrowser = new QRadioButton( tr( "Browser" ), aMeshIn );
+ aBrowserObject = new QLineEdit( aMeshIn );
+ selectMedFilebutton = new QPushButton("", aMeshIn);
+ selectMedFileLineEdit = new QLineEdit( aMeshIn );
+
+ meshIn = new QGridLayout( aMeshIn );
+
+ meshIn->setMargin( MARGIN );
+ meshIn->setSpacing( SPACING );
+ meshIn->addWidget( aMedfile, 0, 0, 1,1 );
+ meshIn->addWidget( aBrowser, 0, 1,1,1);
+ meshIn->addWidget( aBrowserObject, 0, 2, 1, 1 );
+ meshIn->addWidget( selectMedFilebutton, 1, 0,1, 1);
+ meshIn->addWidget( selectMedFileLineEdit, 1, 1, 1, 1 );
+ hspacer = new QSpacerItem(188, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
+
+ meshInGroup = new QButtonGroup( this );
+ meshInGroup->addButton( aMedfile, 0 );
+ meshInGroup->addButton( aBrowser, 1 );
+
+ //Mesh out
+
+ aMeshOut = new QGroupBox( tr( "MeshOut" ), this );
+ meshName = new QLabel(tr("MeshName"), aMeshOut);
+ secondHspacer = new QSpacerItem(100, 30);
+ meshNameLineEdit = new QLineEdit(aMeshOut) ;
+ medFileCheckBox = new QCheckBox(tr("MEDFile"), aMeshOut);
+ selectOutMedFilebutton = new QPushButton("", aMeshOut);
+ thirdHspacer = new QSpacerItem(188, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
+ selectOutMedFileLineEdit = new QLineEdit(aMeshOut) ;
+ publishOut = new QCheckBox(tr("Publish_MG_ADAPT"), aMeshOut);
+
+ meshOut = new QGridLayout( aMeshOut );
+
+ meshOut->setMargin( MARGIN );
+ meshOut->setSpacing( SPACING );
+ meshOut->addWidget( meshName, 0, 0, 1,1 );
+ meshOut->addItem( secondHspacer, 0, 1, 1, 1 );
+ meshOut->addWidget( meshNameLineEdit, 0, 2,1,1);
+ meshOut->addWidget( medFileCheckBox, 1, 0,1,1 );
+ meshOut->addWidget( selectOutMedFilebutton, 1, 1,1,1 );
+ meshOut->addWidget( selectOutMedFileLineEdit, 1, 2,1,1);
+ meshOut->addWidget( publishOut, 2, 0,1,1 );
+
+ //size map definition
+
+ sizeMapDefinition = new QGroupBox(tr("SIZE_MAP_DEF"), this);
+ localButton = new QRadioButton(tr("LOCAL_MG_ADAPT"), sizeMapDefinition);
+ backgroundButton = new QRadioButton(tr("BACKGRND_MG_ADAPT"), sizeMapDefinition);
+ constantButton = new QRadioButton(tr("CNST_MG_ADAPT"), sizeMapDefinition);
+ medFileBackground = new QLabel(tr("MED_FILE_BCKG"), sizeMapDefinition);
+ selectMedFileBackgroundbutton = new QPushButton(tr(""), sizeMapDefinition);
+ selectMedFileBackgroundLineEdit = new QLineEdit(sizeMapDefinition);
+ valueLabel = new QLabel(tr("VALUE_MG_ADAPT"), sizeMapDefinition);
+ dvalue = new QDoubleSpinBox(sizeMapDefinition);
+ sizeMapDefGroup = new QButtonGroup( this );
+ sizeMapDefGroup->addButton( localButton, 0 );
+ sizeMapDefGroup->addButton( backgroundButton, 1 );
+ sizeMapDefGroup->addButton( constantButton, 2 );
+
+ sizeMapDefGroupLayout = new QGridLayout(sizeMapDefinition);
+ sizeMapDefGroupLayout->addWidget(localButton, 0,0);
+ sizeMapDefGroupLayout->addWidget(backgroundButton, 0,1);
+ sizeMapDefGroupLayout->addWidget(constantButton, 0,2);
+ sizeMapDefGroupLayout->addWidget(medFileBackground, 1,0);
+ sizeMapDefGroupLayout->addWidget(selectMedFileBackgroundbutton, 1,1);
+ sizeMapDefGroupLayout->addWidget(selectMedFileBackgroundLineEdit, 1,2);
+ sizeMapDefGroupLayout->addWidget(valueLabel, 2,0);
+ sizeMapDefGroupLayout->addWidget(dvalue, 2,1);
+
+ // size Map field
+ sizeMapField = new QGroupBox(tr("SIZE_MAP_FIELD"), this);
+ fieldName = new QLabel(tr("MG_ADAPT_FIELD_NAME"), sizeMapField);
+ fieldNameCmb = new QComboBox(sizeMapField);
+ noTimeStep = new QRadioButton(tr("MG_ADAPT_NO_T_ST"), sizeMapField);
+ lastTimeStep = new QRadioButton(tr("MG_ADAPT_L_ST"), sizeMapField);
+ chosenTimeStep = new QRadioButton(tr("MG_ADAPT_CH_ST"), sizeMapField);
+ timeStepLabel = new QLabel(tr("MG_ADAPT_TSTP"), sizeMapField);
+ timeStep = new QSpinBox(sizeMapField);
+ //~timeStep->setMinimum(-1);
+ rankLabel = new QLabel(tr("MG_ADAPT_RANK"), sizeMapField);
+ rankSpinBox = new QSpinBox(sizeMapField);
+ rankSpinBox->setMinimum(-1);
+
+ timeStepGroup = new QButtonGroup(this);
+ timeStepGroup->addButton(noTimeStep, 0);
+ timeStepGroup->addButton(lastTimeStep, 1);
+ timeStepGroup->addButton(chosenTimeStep, 2);
+
+ sizeMapFieldGroupLayout = new QGridLayout(sizeMapField);
+
+ sizeMapFieldGroupLayout->addWidget(fieldName, 0,0);
+ sizeMapFieldGroupLayout->addWidget(fieldNameCmb, 0,1);
+ sizeMapFieldGroupLayout->addWidget(noTimeStep, 1,0);
+ sizeMapFieldGroupLayout->addWidget(lastTimeStep, 1,1);
+ sizeMapFieldGroupLayout->addWidget(chosenTimeStep, 1,2);
+ sizeMapFieldGroupLayout->addWidget(timeStepLabel, 2,0);
+ sizeMapFieldGroupLayout->addWidget(timeStep, 2,1);
+ sizeMapFieldGroupLayout->addWidget(rankLabel, 2,2);
+ sizeMapFieldGroupLayout->addWidget(rankSpinBox, 2,3);
+
+ QGridLayout* argumentsLayout = new QGridLayout( this );
+ argumentsLayout->setMargin( MARGIN );
+ argumentsLayout->setSpacing( SPACING );
+
+ argumentsLayout->addWidget( aMeshIn, 0, 0, 1, 3 );
+ argumentsLayout->addWidget( aMeshOut, 1, 0, 1, 3 );
+ argumentsLayout->addWidget( sizeMapDefinition, 2, 0, 1, 3 );
+ argumentsLayout->addWidget( sizeMapField, 3, 0, 1, 3 );
+ argumentsLayout->setColumnStretch( 1, 5 );
+ argumentsLayout->setRowStretch( 4, 5 );
+
+ // Initial state
+ setMode( Mesh, Local);
+ medFileCheckBox->setChecked(true);
+ visibleTimeStepRankLabel (false);
+
+ // Connections
+ connect( meshInGroup, SIGNAL( buttonClicked( int ) ), this, SLOT( modeChanged( int ) ) );
+ connect( sizeMapDefGroup, SIGNAL( buttonClicked( int ) ), this, SLOT( sizeMapDefChanged( int ) ) );
+ connect( selectMedFilebutton, SIGNAL( pressed( ) ), this, SLOT( onSelectMedFilebuttonClicked( ) ) );
+ connect( medFileCheckBox, SIGNAL (stateChanged(int)), this, SLOT(onMedFileCheckBox(int) ) );
+ connect( publishOut, SIGNAL (stateChanged(int)), this, SLOT(onPublishOut(int) ) );
+ connect( selectOutMedFilebutton, SIGNAL( pressed()), this, SLOT(onSelectOutMedFilebutton()));
+ connect( selectMedFileBackgroundbutton, SIGNAL(pressed()), this, SLOT(onSelectMedFileBackgroundbutton()) );
+ connect( timeStepGroup, SIGNAL( buttonClicked( int ) ), this, SLOT( timeStepGroupChanged( int ) ) );
+ emit updateSelection();