1 // Copyright (C) 2011-2012 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.
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
22 #include "MonEditBoundaryDi.h"
23 #include "MonEditListGroup.h"
25 #include <QMessageBox>
27 #include "SalomeApp_Tools.h"
28 #include "HOMARDGUI_Utils.h"
29 #include "HomardQtCommun.h"
30 #include <utilities.h>
33 // -------------------------------------------------------------------------------------------------------------------------------------
34 MonEditBoundaryDi::MonEditBoundaryDi( MonCreateCase* parent, bool modal,
35 HOMARD::HOMARD_Gen_var myHomardGen,
36 QString caseName, QString BoundaryName):
37 // -------------------------------------------------------------------------------------------------------------------------------------
38 /* Constructs a MonEditBoundaryDi
39 herite de MonCreateBoundaryDi
41 MonCreateBoundaryDi(parent, modal, myHomardGen, caseName, BoundaryName)
43 MESSAGE("Debut de Boundary pour " << BoundaryName.toStdString().c_str());
44 setWindowTitle(QObject::tr("HOM_BOUN_D_EDIT_WINDOW_TITLE"));
47 _aBoundary=_myHomardGen->GetBoundary(CORBA::string_dup(_aBoundaryName.toStdString().c_str()));
48 if (caseName==QString("")) { _aCaseName=_aBoundary->GetCaseCreation();}
51 catch( SALOME::SALOME_Exception& S_ex )
53 QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
54 QString(CORBA::string_dup(S_ex.details.text)) );
58 HOMARD::ListGroupType_var maListe = _aBoundary->GetGroups();
59 for ( int i = 0; i < maListe->length(); i++ )
60 _listeGroupesBoundary << QString(maListe[i]);
63 // ------------------------------
64 MonEditBoundaryDi::~MonEditBoundaryDi()
65 // ------------------------------
69 // ------------------------------
70 void MonEditBoundaryDi::InitValEdit()
71 // ------------------------------
73 LEBoundaryName->setText(_aBoundaryName);
74 LEBoundaryName->setReadOnly(true);
76 QString aMeshFile = _aBoundary->GetMeshFile();
77 LEFileName->setText(aMeshFile);
78 LEFileName->setReadOnly(1);
79 PushFichier->setVisible(0);
82 // ------------------------------
83 bool MonEditBoundaryDi::PushOnApply()
84 // ------------------------------
88 // ------------------------------------------------------------------------
89 void MonEditBoundaryDi::SetFiltrage()
90 // // ------------------------------------------------------------------------
92 if (!CBGroupe->isChecked()) return;
93 if (_aCaseName.toStdString().c_str() == QString())
95 QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
96 QObject::tr("HOM_BOUN_CASE") );
99 HOMARD::HOMARD_Cas_var monCas= _myHomardGen->GetCase(_aCaseName.toStdString().c_str());
100 HOMARD::ListGroupType_var _listeGroupesCas = monCas->GetGroups();
102 MonEditListGroup *aDlg = new MonEditListGroup(NULL,this, TRUE, HOMARD::HOMARD_Gen::_duplicate(_myHomardGen),
103 _aCaseName, _listeGroupesBoundary) ;