-// Copyright (C) 2011-2012 CEA/DEN, EDF R&D
+// Copyright (C) 2011-2020 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.
+// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-using namespace std;
-
#include "MonCreateBoundaryDi.h"
#include "MonCreateListGroup.h"
#include "MonCreateCase.h"
#include "HomardQtCommun.h"
#include <utilities.h>
+using namespace std;
+
// -------------------------------------------------------------------------------
MonCreateBoundaryDi::MonCreateBoundaryDi(MonCreateCase* parent, bool modal,
- HOMARD::HOMARD_Gen_var myHomardGen,
- QString caseName, QString aBoundaryName)
+ HOMARD::HOMARD_Gen_var myHomardGen0,
+ QString caseName, QString aName)
// ---------------------------------------------------------------------------------
/* Constructs a MonCreateBoundaryDi */
:
QDialog(0), Ui_CreateBoundaryDi(),
- _parent(parent), _aBoundaryName(aBoundaryName),
- _myHomardGen(HOMARD::HOMARD_Gen::_duplicate(myHomardGen)),
+ _parent(parent), _aName(aName),
+ myHomardGen(HOMARD::HOMARD_Gen::_duplicate(myHomardGen0)),
_aCaseName(caseName)
{
MESSAGE("Constructeur") ;
setModal(modal);
InitConnect();
- if ( _aBoundaryName == QString("") ) {SetNewBoundaryName();};
+ if ( _aName == QString("") ) {SetNewName();};
}
// ------------------------------------------------------------------------
{
// Verifications
- QString aBoundaryName=LEBoundaryName->text().trimmed();
- if (aBoundaryName=="") {
+ QString aName=LEName->text().trimmed();
+ if (aName=="") {
QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
QObject::tr("HOM_BOUN_NAME") );
return false;
}
// Creation de l'objet CORBA si ce n'est pas deja fait sous le meme nom
- if ( _aBoundaryName != aBoundaryName )
+ if ( _aName != aName )
{
try
{
- _aBoundaryName=aBoundaryName;
- _aBoundary=_myHomardGen->CreateBoundaryDi(CORBA::string_dup(_aBoundaryName.toStdString().c_str()), aMeshName.toStdString().c_str(), aMeshFile.toStdString().c_str());
- _parent->addBoundaryDi(_aBoundaryName);
- _aBoundary->SetCaseCreation(_aCaseName.toStdString().c_str());
+ _aName=aName;
+ aBoundary=myHomardGen->CreateBoundaryDi(CORBA::string_dup(_aName.toStdString().c_str()), aMeshName.toStdString().c_str(), aMeshFile.toStdString().c_str());
+ _parent->AddBoundaryDi(_aName);
+ aBoundary->SetCaseCreation(_aCaseName.toStdString().c_str());
}
catch( SALOME::SALOME_Exception& S_ex )
{
QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
- QString(CORBA::string_dup(S_ex.details.text)) );
+ QObject::tr(CORBA::string_dup(S_ex.details.text)) );
return false;
}
}
void MonCreateBoundaryDi::PushOnHelp()
// ------------------------------------------------------------------------
{
- HOMARD_UTILS::PushOnHelp(QString("gui_create_boundary.html#frontiere-discrete"));
+ std::string LanguageShort = myHomardGen->GetLanguageShort();
+ HOMARD_UTILS::PushOnHelp(QString("gui_create_boundary.html"), QString("frontiere-discrete"), QString(LanguageShort.c_str()));
}
// ------------------------------------------------------------------------
void MonCreateBoundaryDi::AssocieLesGroupes()
int i=0;
for (it = _listeGroupesBoundary.constBegin(); it != _listeGroupesBoundary.constEnd(); it++)
aSeqGroupe[i++]=(*it).toStdString().c_str();
- _aBoundary->SetGroups(aSeqGroupe);
+ aBoundary->SetGroups(aSeqGroupe);
}
// -------------------------------------------------
-void MonCreateBoundaryDi::SetNewBoundaryName()
+void MonCreateBoundaryDi::SetNewName()
// --------------------------------------------------
{
- HOMARD::listeBoundarys_var MyBoundarys = _myHomardGen->GetAllBoundarys();
- int num = 0; QString aBoundaryName="";
- while (aBoundaryName == QString("") )
+ HOMARD::listeBoundarys_var MyObjects = myHomardGen->GetAllBoundarysName();
+ int num = 0; QString aName="";
+ while (aName == QString("") )
{
- aBoundaryName.setNum(num+1) ;
- aBoundaryName.insert(0, QString("Boun_")) ;
- for ( int i=0; i<MyBoundarys->length(); i++)
+ aName.setNum(num+1) ;
+ aName.insert(0, QString("Boun_")) ;
+ for ( int i=0; i<MyObjects->length(); i++)
{
- if ( aBoundaryName == QString(MyBoundarys[i]))
+ if ( aName == QString(MyObjects[i]))
{
- num=num+1;
- aBoundaryName="";
- break;
+ num ++ ;
+ aName = "" ;
+ break ;
}
}
}
- LEBoundaryName->setText(aBoundaryName);
+ LEName->setText(aName);
}
// ------------------------------------------------------------------------
void MonCreateBoundaryDi::SetMeshFile()
// ------------------------------------------------------------------------
{
- QString aMeshFile = HOMARD_QT_COMMUN::PushNomFichier();
+ QString aMeshFile = HOMARD_QT_COMMUN::PushNomFichier( false, QString("med") );
if (!(aMeshFile.isEmpty())) LEFileName->setText(aMeshFile);
}
return;
}
- MonCreateListGroup *aDlg = new MonCreateListGroup(NULL,this, TRUE, HOMARD::HOMARD_Gen::_duplicate(_myHomardGen),
+ MonCreateListGroup *aDlg = new MonCreateListGroup(NULL, this, true, HOMARD::HOMARD_Gen::_duplicate(myHomardGen),
_aCaseName, _listeGroupesBoundary) ;
aDlg->show();
}