From 60bed446ee2f228743389385bfb5584a3b2b4074 Mon Sep 17 00:00:00 2001 From: nicolas Date: Thu, 19 Dec 2013 07:13:37 +0000 Subject: [PATCH] =?utf8?q?Fonction=20de=20suppression=20des=20associations?= =?utf8?q?=20entre=20fronti=C3=83=C2=A8res=20et=20groupes?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- idl/HOMARD_Cas.idl | 1 + src/HOMARDGUI/MonCreateCase.cxx | 6 ++++++ src/HOMARD_I/HOMARD_Cas_i.cxx | 7 +++++++ src/HOMARD_I/HOMARD_Cas_i.hxx | 1 + src/HOMARD_I/HOMARD_Gen_i.cxx | 27 ++++++++++++++------------- 5 files changed, 29 insertions(+), 13 deletions(-) diff --git a/idl/HOMARD_Cas.idl b/idl/HOMARD_Cas.idl index a278eabb..348587bf 100644 --- a/idl/HOMARD_Cas.idl +++ b/idl/HOMARD_Cas.idl @@ -74,6 +74,7 @@ module HOMARD void AddBoundaryGroup(in string BoundaryName, in string Group) raises (SALOME::SALOME_Exception); ListBoundaryGroupType GetBoundaryGroup() raises (SALOME::SALOME_Exception); + void SupprBoundaryGroup() raises (SALOME::SALOME_Exception); void SetPyram(in long Pyram) raises (SALOME::SALOME_Exception); long GetPyram() raises (SALOME::SALOME_Exception); diff --git a/src/HOMARDGUI/MonCreateCase.cxx b/src/HOMARDGUI/MonCreateCase.cxx index 61e78011..dc8966cd 100644 --- a/src/HOMARDGUI/MonCreateCase.cxx +++ b/src/HOMARDGUI/MonCreateCase.cxx @@ -196,6 +196,7 @@ bool MonCreateCase::PushOnApply() return false; } +// On verifie qu'un groupe n'est pas associe a deux frontieres differentes if (CBBoundaryA->isChecked()) { QStringList ListeGroup ; @@ -227,6 +228,7 @@ bool MonCreateCase::PushOnApply() } } +// Creation du cas if (aCaseName != _aCaseName ) { _aCaseName = aCaseName; @@ -259,10 +261,14 @@ bool MonCreateCase::PushOnApply() InitBoundarys(); } +// Repertoire et type aCase->SetDirName(aDirName.toStdString().c_str()); _aDirName=aDirName; aCase->SetConfType(_ConfType); +// Menage des eventuelles frontieres deja enregistrees + aCase->SupprBoundaryGroup() ; + // Enregistrement de la frontiere discrete if (CBBoundaryD->isChecked()) { diff --git a/src/HOMARD_I/HOMARD_Cas_i.cxx b/src/HOMARD_I/HOMARD_Cas_i.cxx index d8c23b2e..91b0825f 100755 --- a/src/HOMARD_I/HOMARD_Cas_i.cxx +++ b/src/HOMARD_I/HOMARD_Cas_i.cxx @@ -362,6 +362,13 @@ HOMARD::ListBoundaryGroupType* HOMARD_Cas_i::GetBoundaryGroup() return aResult._retn(); } //============================================================================= +void HOMARD_Cas_i::SupprBoundaryGroup() +{ + MESSAGE ("SupprBoundaryGroup"); + ASSERT(myHomardCas ); + myHomardCas->SupprBoundaryGroup(); +} +//============================================================================= void HOMARD_Cas_i::SetPyram( CORBA::Long Pyram ) { MESSAGE ("SetPyram, Pyram = " << Pyram ); diff --git a/src/HOMARD_I/HOMARD_Cas_i.hxx b/src/HOMARD_I/HOMARD_Cas_i.hxx index a3f032a0..3aa1ae35 100644 --- a/src/HOMARD_I/HOMARD_Cas_i.hxx +++ b/src/HOMARD_I/HOMARD_Cas_i.hxx @@ -84,6 +84,7 @@ public: void AddBoundaryGroup( const char* Boundary, const char* Group); HOMARD::ListBoundaryGroupType* GetBoundaryGroup(); + void SupprBoundaryGroup( ); void SetPyram( CORBA::Long Pyram ); CORBA::Long GetPyram(); diff --git a/src/HOMARD_I/HOMARD_Gen_i.cxx b/src/HOMARD_I/HOMARD_Gen_i.cxx index d38628bb..71966dc7 100755 --- a/src/HOMARD_I/HOMARD_Gen_i.cxx +++ b/src/HOMARD_I/HOMARD_Gen_i.cxx @@ -1208,7 +1208,7 @@ HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCaseFromIteration(const char* nomCas, // A.1. Controle du repertoire de depart de l'iteration #ifndef WIN32 codret = chdir(DirNameStart) ; -#else +#else codret = _chdir(DirNameStart) ; #endif if ( codret != 0 ) @@ -1241,7 +1241,7 @@ HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCaseFromIteration(const char* nomCas, } } closedir(dp); -#else +#else HANDLE hFind = INVALID_HANDLE_VALUE; WIN32_FIND_DATA ffd; hFind = FindFirstFile(DirNameStart, &ffd); @@ -1259,7 +1259,7 @@ HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCaseFromIteration(const char* nomCas, } } FindClose(hFind); - } + } #endif MESSAGE ( "==> file_configuration : " << file_configuration ) ; MESSAGE ( "==> file_maillage_homard : " << file_maillage_homard ) ; @@ -1381,7 +1381,7 @@ HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCaseFromIteration(const char* nomCas, nomDirIterTotal = std::string(nomDirCase) + "/" + std::string(nomDirIter) ; #ifndef WIN32 if (mkdir(nomDirIterTotal.c_str(), S_IRWXU|S_IRGRP|S_IXGRP) != 0) -#else +#else if (_mkdir(nomDirIterTotal.c_str()) != 0) #endif { @@ -1531,11 +1531,11 @@ std::string HOMARD_Gen_i::CreateCase1(const char* DirNameStart, CORBA::Long Numb HANDLE hFind1 = INVALID_HANDLE_VALUE; WIN32_FIND_DATA ffd1; hFind1 = FindFirstFile(DirName_1.c_str(), &ffd1); - while (FindNextFile(hFind1, &ffd1) != 0) + while (FindNextFile(hFind1, &ffd1) != 0) { - if (ffd1.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) continue; //skip directories + if (ffd1.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) continue; //skip directories std::string file_name_1(ffd1.cFileName); -#endif +#endif int bilan = file_name_1.find("HOMARD.Configuration.") ; if ( bilan != string::npos ) { @@ -1610,7 +1610,7 @@ std::string HOMARD_Gen_i::CreateCase1(const char* DirNameStart, CORBA::Long Numb } #ifndef WIN32 closedir(dp); - chdir(nomDirWork.c_str()); + chdir(nomDirWork.c_str()); #else FindClose(hFind); } @@ -2554,7 +2554,7 @@ CORBA::Long HOMARD_Gen_i::Compute(const char* NomIteration, CORBA::Long etatMena { delete myDriver; MESSAGE ( ". On retourne dans nomDirWork = " << nomDirWork ); - + #ifndef WIN32 chdir(nomDirWork.c_str()); #else @@ -2738,7 +2738,7 @@ CORBA::Long HOMARD_Gen_i::ComputeAdap(HOMARD::HOMARD_Cas_var myCase, HOMARD::HOM char* HOMARD_Gen_i::CreateDirNameIter(const char* nomrep, CORBA::Long num ) { MESSAGE ( "CreateDirNameIter : nomrep ="<< nomrep << ", num = "<NewObject(aCaseSO); aStudyBuilder->Addreference(aSubSO, aBoundarySO); +// aStudyBuilder->RemoveReference(aSubSO); aStudyBuilder->CommitCommand(); -- 2.39.2