1 // Copyright (C) 2011-2022 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #include "MonEditBoundaryDi.h"
21 #include "MonEditListGroup.h"
23 #include <QMessageBox>
25 #include "SalomeApp_Tools.h"
26 #include "HOMARDGUI_Utils.h"
27 #include "HomardQtCommun.h"
28 #include <utilities.h>
32 // -------------------------------------------------------------------------------------------------------------------------------------
33 MonEditBoundaryDi::MonEditBoundaryDi( MonCreateCase* parent, bool modal,
34 HOMARD::HOMARD_Gen_var myHomardGen,
35 QString caseName, QString Name):
36 // -------------------------------------------------------------------------------------------------------------------------------------
37 /* Constructs a MonEditBoundaryDi
38 herite de MonCreateBoundaryDi
40 MonCreateBoundaryDi(parent, modal, myHomardGen, caseName, Name)
42 MESSAGE("Debut de Boundary pour " << Name.toStdString().c_str());
43 setWindowTitle(QObject::tr("HOM_BOUN_D_EDIT_WINDOW_TITLE"));
46 aBoundary=myHomardGen->GetBoundary(CORBA::string_dup(_aName.toStdString().c_str()));
47 if (caseName==QString("")) { _aCaseName=aBoundary->GetCaseCreation();}
50 catch( SALOME::SALOME_Exception& S_ex )
52 QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
53 QObject::tr(CORBA::string_dup(S_ex.details.text)) );
57 HOMARD::ListGroupType_var maListe = aBoundary->GetGroups();
58 for ( int i = 0; i < maListe->length(); i++ )
59 _listeGroupesBoundary << QString(maListe[i]);
62 // ------------------------------
63 MonEditBoundaryDi::~MonEditBoundaryDi()
64 // ------------------------------
67 // ------------------------------
68 void MonEditBoundaryDi::InitValEdit()
69 // ------------------------------
71 LEName->setText(_aName);
72 LEName->setReadOnly(true);
74 QString aDataFile = aBoundary->GetDataFile();
75 LEFileName->setText(aDataFile);
76 LEFileName->setReadOnly(1);
77 PushFichier->setVisible(0);
81 // ------------------------------
82 bool MonEditBoundaryDi::PushOnApply()
83 // ------------------------------
87 // ------------------------------------------------------------------------
88 void MonEditBoundaryDi::SetFiltrage()
89 // // ------------------------------------------------------------------------
91 if (!CBGroupe->isChecked()) return;
92 if (_aCaseName.toStdString().c_str() == QString())
94 QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
95 QObject::tr("HOM_BOUN_CASE") );
98 HOMARD::HOMARD_Cas_var monCas= myHomardGen->GetCase(_aCaseName.toStdString().c_str());
99 HOMARD::ListGroupType_var _listeGroupesCas = monCas->GetGroups();
101 MonEditListGroup *aDlg = new MonEditListGroup(NULL, this, true, HOMARD::HOMARD_Gen::_duplicate(myHomardGen),
102 _aCaseName, _listeGroupesBoundary) ;