From: Gerald NICOLAS Date: Tue, 9 Jan 2018 16:11:23 +0000 (+0100) Subject: automatisation FrontTrack - nouveaux fichiers sources X-Git-Tag: V8_5_0a1~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4cfda7c0cf384b6150d449bc0f96276217e21176;p=modules%2Fhomard.git automatisation FrontTrack - nouveaux fichiers sources --- diff --git a/doc/en/images/create_boundary.png b/doc/en/images/create_boundary.png new file mode 100755 index 00000000..0460d485 Binary files /dev/null and b/doc/en/images/create_boundary.png differ diff --git a/doc/en/images/create_boundary_cao_2.png b/doc/en/images/create_boundary_cao_2.png new file mode 100755 index 00000000..94da749c Binary files /dev/null and b/doc/en/images/create_boundary_cao_2.png differ diff --git a/doc/en/images/create_case_5.png b/doc/en/images/create_case_5.png deleted file mode 100644 index 9424c9c6..00000000 Binary files a/doc/en/images/create_case_5.png and /dev/null differ diff --git a/doc/fr/images/create_boundary.png b/doc/fr/images/create_boundary.png new file mode 100755 index 00000000..0460d485 Binary files /dev/null and b/doc/fr/images/create_boundary.png differ diff --git a/doc/fr/images/create_boundary_cao_1.png b/doc/fr/images/create_boundary_cao_1.png new file mode 100755 index 00000000..a2df8993 Binary files /dev/null and b/doc/fr/images/create_boundary_cao_1.png differ diff --git a/doc/fr/images/create_boundary_cao_2.png b/doc/fr/images/create_boundary_cao_2.png new file mode 100755 index 00000000..c508cf6b Binary files /dev/null and b/doc/fr/images/create_boundary_cao_2.png differ diff --git a/doc/fr/images/create_case_5.png b/doc/fr/images/create_case_5.png deleted file mode 100644 index 418535b5..00000000 Binary files a/doc/fr/images/create_case_5.png and /dev/null differ diff --git a/resources/geometry.png b/resources/geometry.png new file mode 100755 index 00000000..5732d5df Binary files /dev/null and b/resources/geometry.png differ diff --git a/src/HOMARDGUI/CreateBoundaryCAO.ui b/src/HOMARDGUI/CreateBoundaryCAO.ui new file mode 100755 index 00000000..c74c6012 --- /dev/null +++ b/src/HOMARDGUI/CreateBoundaryCAO.ui @@ -0,0 +1,133 @@ + + + CreateBoundaryCAO + + + + 0 + 0 + 566 + 195 + + + + + 0 + 0 + + + + Get CAO + + + true + + + true + + + + 9 + + + 6 + + + + + + + + + 9 + + + 6 + + + + + Help + + + + + + + Cancel + + + + + + + Apply + + + + + + + OK + + + + + + + + + + Filtering with groups + + + + + + + + 370 + 21 + + + + + + + + + + + + + + + XAO + + + + + + + + 382 + 21 + + + + 32 + + + + + + + Name + + + + + + + + diff --git a/src/HOMARDGUI/MonCreateBoundaryCAO.cxx b/src/HOMARDGUI/MonCreateBoundaryCAO.cxx new file mode 100755 index 00000000..efefdebe --- /dev/null +++ b/src/HOMARDGUI/MonCreateBoundaryCAO.cxx @@ -0,0 +1,202 @@ +// Copyright (C) 2011-2016 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#include "MonCreateBoundaryCAO.h" +#include "MonCreateListGroupCAO.h" +#include "MonCreateCase.h" + +#include +#include + +#include "SalomeApp_Tools.h" +#include "HOMARDGUI_Utils.h" +#include "HomardQtCommun.h" +#include + +using namespace std; + +// ------------------------------------------------------------------------------- +MonCreateBoundaryCAO::MonCreateBoundaryCAO(MonCreateCase* parent, bool modal, + HOMARD::HOMARD_Gen_var myHomardGen0, + QString caseName, QString aName) +// --------------------------------------------------------------------------------- +/* Constructs a MonCreateBoundaryCAO */ + : + QDialog(0), Ui_CreateBoundaryCAO(), + _parent(parent), _aName(aName), + myHomardGen(HOMARD::HOMARD_Gen::_duplicate(myHomardGen0)), + _aCaseName(caseName) + { + MESSAGE("Constructeur") ; + setupUi(this); + setModal(modal); + InitConnect(); + + if ( _aName == QString("") ) {SetNewName();}; + } + +// ------------------------------------------------------------------------ +MonCreateBoundaryCAO::~MonCreateBoundaryCAO() +// ------------------------------------------------------------------------ +{ + // no need to delete child widgets, Qt does it all for us +} +// ------------------------------------------------------------------------ +void MonCreateBoundaryCAO::InitConnect() +// ------------------------------------------------------------------------ +{ + connect( PushFichier, SIGNAL(pressed()), this, SLOT(SetCAOFile())); + connect( buttonOk, SIGNAL(pressed()), this, SLOT( PushOnOK())); + connect( buttonApply, SIGNAL(pressed()), this, SLOT( PushOnApply())); + connect( buttonCancel, SIGNAL(pressed()), this, SLOT(close())); + connect( buttonHelp, SIGNAL(pressed()), this, SLOT( PushOnHelp())); + connect( CBGroupe, SIGNAL(stateChanged(int)), this, SLOT( SetFiltrage())); +} + +// ------------------------------------------------------------------------ +bool MonCreateBoundaryCAO::PushOnApply() +// ------------------------------------------------------------------------ +// Appele lorsque l'un des boutons Ok ou Apply est presse +// +{ +// Verifications + + QString aName=LEName->text().trimmed(); + if (aName=="") { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_BOUN_NAME") ); + return false; + } + +// La CAO + QString aCAOFile=LEFileName->text().trimmed(); + if (aCAOFile ==QString("")) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_BOUN_CAO") ); + return false; + } + +// Creation de l'objet CORBA si ce n'est pas deja fait sous le meme nom + if ( _aName != aName ) + { + try + { + _aName=aName; + aBoundary=myHomardGen->CreateBoundaryCAO(CORBA::string_dup(_aName.toStdString().c_str()), aCAOFile.toStdString().c_str()); + _parent->AddBoundaryCAO(_aName); + aBoundary->SetCaseCreation(_aCaseName.toStdString().c_str()); + } + catch( SALOME::SALOME_Exception& S_ex ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr(CORBA::string_dup(S_ex.details.text)) ); + return false; + } + } + +// Les groupes + AssocieLesGroupes(); + + HOMARD_UTILS::updateObjBrowser(); + return true; +} + + +// ------------------------------------------------------------------------ +void MonCreateBoundaryCAO::PushOnOK() +// ------------------------------------------------------------------------ +{ + if (PushOnApply()) this->close(); + if ( _parent ) { _parent->raise(); _parent->activateWindow(); }; +} +// ------------------------------------------------------------------------ +void MonCreateBoundaryCAO::PushOnHelp() +// ------------------------------------------------------------------------ +{ + std::string LanguageShort = myHomardGen->GetLanguageShort(); + HOMARD_UTILS::PushOnHelp(QString("gui_create_boundary.html"), QString("CAO"), QString(LanguageShort.c_str())); +} +// ------------------------------------------------------------------------ +void MonCreateBoundaryCAO::AssocieLesGroupes() +// ------------------------------------------------------------------------ +{ + HOMARD::ListGroupType_var aSeqGroupe = new HOMARD::ListGroupType; + aSeqGroupe->length(_listeGroupesBoundary.size()); + QStringList::const_iterator it; + int i=0; + for (it = _listeGroupesBoundary.constBegin(); it != _listeGroupesBoundary.constEnd(); it++) + aSeqGroupe[i++]=(*it).toStdString().c_str(); + aBoundary->SetGroups(aSeqGroupe); + +} + +// ------------------------------------------------- +void MonCreateBoundaryCAO::SetNewName() +// -------------------------------------------------- +{ + + HOMARD::listeBoundarys_var MyObjects = myHomardGen->GetAllBoundarysName(); + int num = 0; QString aName=""; + while (aName == QString("") ) + { + aName.setNum(num+1) ; + aName.insert(0, QString("Boun_")) ; + for ( int i=0; ilength(); i++) + { + if ( aName == QString(MyObjects[i])) + { + num ++ ; + aName = "" ; + break ; + } + } + } + LEName->setText(aName); +} +// ------------------------------------------------------------------------ +void MonCreateBoundaryCAO::SetCAOFile() +// ------------------------------------------------------------------------ +{ + QString aCAOFile = HOMARD_QT_COMMUN::PushNomFichier( false, QString("xao") ); + if (!(aCAOFile.isEmpty())) LEFileName->setText(aCAOFile); +} + +// ------------------------------------------------------------------------ +void MonCreateBoundaryCAO::setGroups (QStringList listGroup) +// ------------------------------------------------------------------------ +{ + _listeGroupesBoundary = listGroup; +} +// ------------------------------------------------------------------------ +void MonCreateBoundaryCAO::SetFiltrage() +// // ------------------------------------------------------------------------ +{ + if (!CBGroupe->isChecked()) return; + if (_aCaseName.toStdString().c_str() == QString()) { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_BOUN_CASE") ); + return; + } + + MonCreateListGroupCAO *aDlg = new MonCreateListGroupCAO(NULL, this, true, HOMARD::HOMARD_Gen::_duplicate(myHomardGen), + _aCaseName, _listeGroupesBoundary) ; + aDlg->show(); +} + diff --git a/src/HOMARDGUI/MonCreateBoundaryCAO.h b/src/HOMARDGUI/MonCreateBoundaryCAO.h new file mode 100755 index 00000000..7f135abb --- /dev/null +++ b/src/HOMARDGUI/MonCreateBoundaryCAO.h @@ -0,0 +1,73 @@ +// Copyright (C) 2011-2016 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef MON_CREATEBOUNDARYCAO_H +#define MON_CREATEBOUNDARYCAO_H + +#include "HOMARDGUI_Exports.hxx" + +#include +#include + +#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) +#include CORBA_CLIENT_HEADER(HOMARD_Gen) +#include CORBA_CLIENT_HEADER(HOMARD_Boundary) + +#include "ui_CreateBoundaryCAO.h" +#include + +class MonCreateCase; +class HOMARD_EXPORT MonCreateBoundaryCAO : public QDialog, public Ui_CreateBoundaryCAO +{ + Q_OBJECT + +public: + MonCreateBoundaryCAO( MonCreateCase* parent, bool modal, + HOMARD::HOMARD_Gen_var myHomardGen, + QString caseName, QString BoundaryName ); + ~MonCreateBoundaryCAO(); + virtual void setGroups (QStringList listGroup); + +protected : + + MonCreateCase *_parent; + + QString _aName; + QString _aCaseName; + + + HOMARD::HOMARD_Boundary_var aBoundary; + HOMARD::HOMARD_Gen_var myHomardGen; + + QStringList _listeGroupesBoundary; + + virtual void AssocieLesGroupes(); + virtual void InitConnect(); + virtual void SetNewName(); + +public slots: + + virtual void SetCAOFile(); + virtual void SetFiltrage(); + virtual void PushOnOK(); + virtual bool PushOnApply(); + virtual void PushOnHelp(); +}; + +#endif // MON_CREATEBOUNDARYCAO_H diff --git a/src/HOMARDGUI/MonCreateListGroupCAO.cxx b/src/HOMARDGUI/MonCreateListGroupCAO.cxx new file mode 100755 index 00000000..8c8286aa --- /dev/null +++ b/src/HOMARDGUI/MonCreateListGroupCAO.cxx @@ -0,0 +1,150 @@ +// Copyright (C) 2011-2016 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#include "MonCreateListGroupCAO.h" +#include "MonCreateHypothesis.h" +#include "MonCreateBoundaryCAO.h" + +#include + +#include "SalomeApp_Tools.h" +#include "HOMARDGUI_Utils.h" +#include "HomardQtCommun.h" +#include + +#include +#include +#include +#include +#include + +using namespace std; + +// -------------------------------------------------------------------------------------------------------------- +MonCreateListGroupCAO::MonCreateListGroupCAO(MonCreateHypothesis* parentHyp, MonCreateBoundaryCAO* parentBound, bool modal, + HOMARD::HOMARD_Gen_var myHomardGen0, QString aCaseName, QStringList listeGroupesHypo) : +// -------------------------------------------------------------------------------------------------------------- +// + QDialog(0), Ui_CreateListGroup(), + _aCaseName (aCaseName), + _listeGroupesHypo (listeGroupesHypo), + _parentHyp(parentHyp), + _parentBound(parentBound) +{ + MESSAGE("Debut de MonCreateListGroupCAO") + myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen0); + setupUi(this); + setModal(modal); + InitConnect(); + InitGroupes(); +} +// -------------------------------------------------------------------------------------------------------------- +MonCreateListGroupCAO::MonCreateListGroupCAO(MonCreateHypothesis* parentHyp, MonCreateBoundaryCAO* parentBound, + HOMARD::HOMARD_Gen_var myHomardGen, QString aCaseName, QStringList listeGroupesHypo) : +// -------------------------------------------------------------------------------------------------------------- +// + QDialog(0), Ui_CreateListGroup(), + _aCaseName (aCaseName), + _listeGroupesHypo (listeGroupesHypo), + _parentHyp(parentHyp), + _parentBound(parentBound) +{ + myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen); + setupUi(this); + InitConnect(); +} + +// ------------------------------------------------------------------------ +MonCreateListGroupCAO::~MonCreateListGroupCAO() +// ------------------------------------------------------------------------ +{ + // no need to delete child widgets, Qt does it all for us +} +// ------------------------------------------------------------------------ +void MonCreateListGroupCAO::InitConnect() +// ------------------------------------------------------------------------ +{ + connect( buttonOk, SIGNAL( pressed() ), this, SLOT( PushOnOK() ) ); + connect( buttonApply, SIGNAL( pressed() ), this, SLOT( PushOnApply() ) ); + connect( buttonCancel, SIGNAL( pressed() ), this, SLOT( close() ) ); + connect( buttonHelp, SIGNAL( pressed() ), this, SLOT( PushOnHelp() ) ); +} +// ------------------------------------------------------------------------ +bool MonCreateListGroupCAO::PushOnApply() +// ------------------------------------------------------------------------ +// Appele lorsque l'un des boutons Ok ou Apply est presse +// +{ + QStringList ListeGroup ; + for ( int row=0; row< TWGroupe->rowCount(); row++) + { + if ( TWGroupe->item( row, 0 )->checkState() == Qt::Checked ) + ListeGroup.insert(0, QString(TWGroupe->item(row, 1)->text()) ); + } + if ( _parentHyp ) { _parentHyp->setGroups(ListeGroup);}; + if ( _parentBound ) { _parentBound->setGroups(ListeGroup);}; + return true; +} + + +// ------------------------------------------------------------------------ +void MonCreateListGroupCAO::PushOnOK() +// ------------------------------------------------------------------------ +{ + if (PushOnApply()) this->close(); + if ( _parentHyp ) { _parentHyp->raise(); _parentHyp->activateWindow(); }; + if ( _parentBound ) { _parentBound->raise(); _parentBound->activateWindow(); }; +} +// ------------------------------------------------------------------------ +void MonCreateListGroupCAO::PushOnHelp() +// ------------------------------------------------------------------------ +{ + std::string LanguageShort = myHomardGen->GetLanguageShort(); + HOMARD_UTILS::PushOnHelp(QString("gui_create_hypothese.html"), QString(""), QString(LanguageShort.c_str())); +} +// ------------------------------------------------------------------------ +void MonCreateListGroupCAO::InitGroupes() +// ------------------------------------------------------------------------ +{ + MESSAGE("Debut de MonCreateListGroupCAO::InitGroupes "); + for ( int row=0; row< TWGroupe->rowCount(); row++) + TWGroupe->removeRow(row); + TWGroupe->setRowCount(0); + if (_aCaseName == QString("")) { return; }; + HOMARD::HOMARD_Cas_var monCas= myHomardGen->GetCase(_aCaseName.toStdString().c_str()); + HOMARD::ListGroupType_var _listeGroupesCas = monCas->GetGroups(); + for ( int i = 0; i < _listeGroupesCas->length(); i++ ) + { + TWGroupe->insertRow(i); + TWGroupe->setItem( i, 0, new QTableWidgetItem( QString ("") ) ); + TWGroupe->item( i, 0 )->setFlags( 0 ); + TWGroupe->item( i, 0 )->setFlags( Qt::ItemIsUserCheckable|Qt::ItemIsEnabled ); + if (_listeGroupesHypo.contains (QString((_listeGroupesCas)[i]))) + {TWGroupe->item( i, 0 )->setCheckState( Qt::Checked );} + else + {TWGroupe->item( i, 0 )->setCheckState( Qt::Unchecked );} + TWGroupe->setItem( i, 1, new QTableWidgetItem(QString((_listeGroupesCas)[i]).trimmed())); + TWGroupe->item( i, 1 )->setFlags(Qt::ItemIsEnabled |Qt::ItemIsSelectable ); + } + TWGroupe->resizeColumnsToContents(); + TWGroupe->resizeRowsToContents(); + TWGroupe->clearSelection(); +// MESSAGE("Fin de MonCreateListGroupCAO::InitGroupes "); +} + diff --git a/src/HOMARDGUI/MonCreateListGroupCAO.h b/src/HOMARDGUI/MonCreateListGroupCAO.h new file mode 100755 index 00000000..19432667 --- /dev/null +++ b/src/HOMARDGUI/MonCreateListGroupCAO.h @@ -0,0 +1,64 @@ +// Copyright (C) 2011-2016 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef MON_CREATELISTGROUPCAO_H +#define MON_CREATELISTGROUPCAO_H + +#include "HOMARDGUI_Exports.hxx" + +#include +#include + +#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) +#include CORBA_CLIENT_HEADER(HOMARD_Gen) + +#include "ui_CreateListGroup.h" +#include + +class MonCreateHypothesis; +class MonCreateBoundaryCAO; +class HOMARD_EXPORT MonCreateListGroupCAO : public QDialog, public Ui_CreateListGroup +{ + Q_OBJECT + +public: + MonCreateListGroupCAO( MonCreateHypothesis* parentHyp, MonCreateBoundaryCAO* parentBound, bool modal, HOMARD::HOMARD_Gen_var myHomardGen, QString aCaseName, QStringList listeGroupesHypo); + MonCreateListGroupCAO( MonCreateHypothesis* parentHyp, MonCreateBoundaryCAO* parentBound, HOMARD::HOMARD_Gen_var myHomardGen, QString aCaseName, QStringList listeGroupesHypo); + virtual ~MonCreateListGroupCAO(); + +protected : + + HOMARD::HOMARD_Gen_var myHomardGen; + + MonCreateHypothesis * _parentHyp; + MonCreateBoundaryCAO * _parentBound; + QString _aCaseName; + QStringList _listeGroupesHypo; + + virtual void InitConnect(); + virtual void InitGroupes(); + +public slots: + virtual void PushOnOK(); + virtual bool PushOnApply(); + virtual void PushOnHelp(); + +}; + +#endif // MON_CREATELISTGROUPCAO_H diff --git a/src/HOMARDGUI/MonEditBoundaryCAO.cxx b/src/HOMARDGUI/MonEditBoundaryCAO.cxx new file mode 100755 index 00000000..d217ea14 --- /dev/null +++ b/src/HOMARDGUI/MonEditBoundaryCAO.cxx @@ -0,0 +1,105 @@ +// Copyright (C) 2011-2016 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#include "MonEditBoundaryCAO.h" +#include "MonEditListGroupCAO.h" + +#include + +#include "SalomeApp_Tools.h" +#include "HOMARDGUI_Utils.h" +#include "HomardQtCommun.h" +#include + +using namespace std; + +// ------------------------------------------------------------------------------------------------------------------------------------- +MonEditBoundaryCAO::MonEditBoundaryCAO( MonCreateCase* parent, bool modal, + HOMARD::HOMARD_Gen_var myHomardGen, + QString caseName, QString Name): +// ------------------------------------------------------------------------------------------------------------------------------------- +/* Constructs a MonEditBoundaryCAO + herite de MonCreateBoundaryCAO +*/ + MonCreateBoundaryCAO(parent, modal, myHomardGen, caseName, Name) +{ + MESSAGE("Debut de Boundary pour " << Name.toStdString().c_str()); + setWindowTitle(QObject::tr("HOM_BOUN_C_EDIT_WINDOW_TITLE")); + try + { + aBoundary=myHomardGen->GetBoundary(CORBA::string_dup(_aName.toStdString().c_str())); + if (caseName==QString("")) { _aCaseName=aBoundary->GetCaseCreation();} + InitValEdit(); + } + catch( SALOME::SALOME_Exception& S_ex ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr(CORBA::string_dup(S_ex.details.text)) ); + return; + } + + HOMARD::ListGroupType_var maListe = aBoundary->GetGroups(); + for ( int i = 0; i < maListe->length(); i++ ) + _listeGroupesBoundary << QString(maListe[i]); + +} +// ------------------------------ +MonEditBoundaryCAO::~MonEditBoundaryCAO() +// ------------------------------ +{ +} +// ------------------------------ +void MonEditBoundaryCAO::InitValEdit() +// ------------------------------ +{ + LEName->setText(_aName); + LEName->setReadOnly(true); + + QString aDataFile = aBoundary->GetDataFile(); + LEFileName->setText(aDataFile); + LEFileName->setReadOnly(1); + PushFichier->setVisible(0); +// + adjustSize(); +} +// ------------------------------ +bool MonEditBoundaryCAO::PushOnApply() +// ------------------------------ +{ + return true; +} +// ------------------------------------------------------------------------ +void MonEditBoundaryCAO::SetFiltrage() +// // ------------------------------------------------------------------------ +{ + if (!CBGroupe->isChecked()) return; + if (_aCaseName.toStdString().c_str() == QString()) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_BOUN_CASE") ); + return; + } + HOMARD::HOMARD_Cas_var monCas= myHomardGen->GetCase(_aCaseName.toStdString().c_str()); + HOMARD::ListGroupType_var _listeGroupesCas = monCas->GetGroups(); + + MonEditListGroupCAO *aDlg = new MonEditListGroupCAO(NULL, this, true, HOMARD::HOMARD_Gen::_duplicate(myHomardGen), + _aCaseName, _listeGroupesBoundary) ; + aDlg->show(); +} + diff --git a/src/HOMARDGUI/MonEditBoundaryCAO.h b/src/HOMARDGUI/MonEditBoundaryCAO.h new file mode 100755 index 00000000..b86f4dc5 --- /dev/null +++ b/src/HOMARDGUI/MonEditBoundaryCAO.h @@ -0,0 +1,51 @@ +// Copyright (C) 2011-2016 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef MON_EDITBOUNDARYCAO_H +#define MON_EDITBOUNDARYCAO_H + +#include "HOMARDGUI_Exports.hxx" + +#include +#include + +#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) +#include CORBA_CLIENT_HEADER(HOMARD_Gen) + +#include + +class HOMARD_EXPORT MonEditBoundaryCAO : public MonCreateBoundaryCAO +{ + Q_OBJECT +public: + MonEditBoundaryCAO( MonCreateCase* parent, bool modal, + HOMARD::HOMARD_Gen_var myHomardGen, + QString caseName, QString Name ); + virtual ~MonEditBoundaryCAO(); + +protected : + virtual void InitValEdit(); + virtual bool PushOnApply(); + virtual void SetFiltrage(); + +public slots: + +}; + +#endif diff --git a/src/HOMARDGUI/MonEditListGroupCAO.cxx b/src/HOMARDGUI/MonEditListGroupCAO.cxx new file mode 100755 index 00000000..783e368c --- /dev/null +++ b/src/HOMARDGUI/MonEditListGroupCAO.cxx @@ -0,0 +1,61 @@ +// Copyright (C) 2011-2016 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#include "MonEditListGroupCAO.h" +#include + +using namespace std; +//--------------------------------------------------------------------- +MonEditListGroupCAO::MonEditListGroupCAO( MonCreateHypothesis* parentHyp, + MonCreateBoundaryCAO* parentBound, + bool modal, + HOMARD::HOMARD_Gen_var myHomardGen, + QString aCaseName, + QStringList listeGroupesHypo): +//--------------------------------------------------------------------- +MonCreateListGroupCAO(parentHyp,parentBound,myHomardGen,aCaseName,listeGroupesHypo) +{ + MESSAGE("Debut de MonEditListGroupCAO"); + setWindowTitle(QObject::tr("HOM_GROU_EDIT_WINDOW_TITLE")); + setModal(true); + InitGroupes(); +} + +//------------------------------------ +MonEditListGroupCAO:: ~MonEditListGroupCAO() +//------------------------------------ +{ +} +// ------------------------------------- +void MonEditListGroupCAO:: InitGroupes() +// ------------------------------------- +{ + for (int i = 0; i < _listeGroupesHypo.size(); i++ ) + { + std::cerr << _listeGroupesHypo[i].toStdString().c_str() << std::endl; + TWGroupe->insertRow(i); + TWGroupe->setItem( i, 0, new QTableWidgetItem( QString ("") ) ); + TWGroupe->item( i, 0 )->setFlags( 0 ); + TWGroupe->item( i, 0 )->setCheckState( Qt::Checked ); + TWGroupe->setItem( i, 1, new QTableWidgetItem(_listeGroupesHypo[i])); + } + TWGroupe->resizeRowsToContents(); +} + + diff --git a/src/HOMARDGUI/MonEditListGroupCAO.h b/src/HOMARDGUI/MonEditListGroupCAO.h new file mode 100755 index 00000000..7a72ce5e --- /dev/null +++ b/src/HOMARDGUI/MonEditListGroupCAO.h @@ -0,0 +1,49 @@ +// Copyright (C) 2011-2016 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef MON_EDITLISTGROUPCAO_H +#define MON_EDITLISTGROUPCAO_H + +#include "HOMARDGUI_Exports.hxx" + +#include +#include + +#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) +#include CORBA_CLIENT_HEADER(HOMARD_Gen) + +#include + +class MonCreateHypothesis; +class MonCreateBoundaryCAO; +class HOMARD_EXPORT MonEditListGroupCAO : public MonCreateListGroupCAO +{ + Q_OBJECT + +public: + MonEditListGroupCAO( MonCreateHypothesis* parentHyp, MonCreateBoundaryCAO* parentBound, bool modal, HOMARD::HOMARD_Gen_var myHomardGen, QString aCaseName, QStringList listeGroupesHypo); + virtual ~MonEditListGroupCAO(); + +protected : + + virtual void InitGroupes(); + +}; + +#endif // MON_EDITLISTGROUPCAO_H