1 #include "DlgChangeUnderlyingMesh.hxx"
2 #include "DatasourceConstants.hxx"
7 DlgChangeUnderlyingMesh::DlgChangeUnderlyingMesh(SALOME_AppStudyEditor * studyEditor,
9 : GenericDialog(parent)
11 ui.setupUi(this->getPanel());
13 _studyEditor = studyEditor;
14 connect(this->ui.btnSelectMesh, SIGNAL(clicked()), this, SLOT(OnSelectMesh()));
15 this->setWindowTitle("Remplacement du maillage support");
18 /** This reset the dialog for a new selection */
19 void DlgChangeUnderlyingMesh::setFieldId(int fieldId) {
22 this->ui.txtMesh->setText(QString(""));
24 int DlgChangeUnderlyingMesh::getFieldId() {
28 int DlgChangeUnderlyingMesh::getMeshId() {
32 void DlgChangeUnderlyingMesh::accept() {
33 if ( _meshId == -1 ) {
34 QMessageBox::warning(this,
35 tr("Data verification"),
36 tr("You must select a mesh in the explorer and clic the button Mesh"));
39 GenericDialog::accept();
40 emit inputValidated();
44 void DlgChangeUnderlyingMesh::OnSelectMesh() {
45 SALOME_StudyEditor::SObjectList * listOfSObject = _studyEditor->getSelectedObjects();
46 if ( listOfSObject->size() > 0 ) {
47 SALOMEDS::SObject_var soMesh = listOfSObject->at(0);
48 // _GBO_ TODO: we should test here if it is a mesh (attribute in
50 _meshId = _studyEditor->getParameterInt(soMesh,OBJECT_ID);
51 const char * meshname = _studyEditor->getName(soMesh);
52 this->ui.txtMesh->setText(QString(meshname));