X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHOMARDGUI%2FMonCreateHypothesis.cxx;h=46a09ead0ba6d9bf7e658076be150c96c5658fd8;hb=refs%2Ftags%2FV9_13_0b1;hp=629dca87f53b4db28e59127c89eea963697b2a22;hpb=dceaa0ae1b8afc0a1c616b93d793e2fdbccf5dbc;p=modules%2Fhomard.git diff --git a/src/HOMARDGUI/MonCreateHypothesis.cxx b/src/HOMARDGUI/MonCreateHypothesis.cxx index 629dca87..46a09ead 100644 --- a/src/HOMARDGUI/MonCreateHypothesis.cxx +++ b/src/HOMARDGUI/MonCreateHypothesis.cxx @@ -1,9 +1,9 @@ -// Copyright (C) 2011-2013 CEA/DEN, EDF R&D +// Copyright (C) 2011-2024 CEA, EDF // // 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 @@ -52,7 +52,7 @@ MonCreateHypothesis::MonCreateHypothesis(MonCreateIteration* parent, bool modal, _NivMax(-1), _DiamMin(-1.), _AdapInit(0), - _LevelOutput(0) + _ExtraOutput(1) { MESSAGE("Constructeur") ; @@ -74,7 +74,12 @@ MonCreateHypothesis::MonCreateHypothesis(MonCreateIteration* parent, bool modal, } SetFieldNo(); GBAdvancedOptions->setVisible(0); - CBLevelOutput->setChecked(false); + CBOutputLevel->setChecked(false); + CBOutputQuality->setChecked(false); + CBOutputDiameter->setChecked(false); + CBOutputParent->setChecked(false); + CBOutputVoisins->setChecked(false); + _ExtraOutput = 1 ; // adjustSize(); } @@ -111,7 +116,6 @@ void MonCreateHypothesis::InitConnect() connect( CBJump, SIGNAL(stateChanged(int)), this, SLOT(SetUseField())); connect( PBZoneNew, SIGNAL(pressed()), this, SLOT(PushZoneNew())); connect( PBZoneEdit, SIGNAL(pressed()), this, SLOT(PushZoneEdit()) ); - connect( PBZoneDelete, SIGNAL(pressed()), this, SLOT(PushZoneDelete()) ); connect( CBGroupe, SIGNAL(stateChanged(int)), this, SLOT(SetFiltrage())); connect( RBFieldNo, SIGNAL(clicked()), this, SLOT(SetFieldNo())); @@ -165,7 +169,13 @@ bool MonCreateHypothesis::PushOnApply() } // Mise en place des attributs - aHypothesis->SetAdapRefinUnRef(_aTypeAdap,_aTypeRaff,_aTypeDera); + if ( _aTypeAdap == -1 ) + { + int TypeRaffDera ; + if ( _aTypeRaff == 1 ) { TypeRaffDera = 1 ; } + else { TypeRaffDera = -1 ; } + aHypothesis->SetUnifRefinUnRef(TypeRaffDera); + } aHypothesis->SetTypeFieldInterp(_TypeFieldInterp); aHypothesis->SetCaseCreation(_aCaseName.toStdString().c_str()); @@ -185,9 +195,14 @@ bool MonCreateHypothesis::PushOnApply() aHypothesis->SetDiamMin(_DiamMin); // Enregistrement de l'intialisation de l'adaptation aHypothesis->SetAdapInit(_AdapInit); -// Sortie des niveaux de raffinement - if (CBLevelOutput->isChecked()) { _LevelOutput = 1 ; } - aHypothesis->SetLevelOutput(_LevelOutput); +// Sortie optionnelle des niveaux de raffinement, des diametres, des qualites + _ExtraOutput = 1 ; + if (CBOutputLevel->isChecked()) { _ExtraOutput = 2 ; } + if (CBOutputQuality->isChecked()) { _ExtraOutput = 3*_ExtraOutput ; } + if (CBOutputDiameter->isChecked()) { _ExtraOutput = 5*_ExtraOutput ; } + if (CBOutputParent->isChecked()) { _ExtraOutput = 7*_ExtraOutput ; } + if (CBOutputVoisins->isChecked()) { _ExtraOutput = 11*_ExtraOutput ; } + aHypothesis->SetExtraOutput(_ExtraOutput); } HOMARD_UTILS::updateObjBrowser() ; @@ -301,8 +316,8 @@ void MonCreateHypothesis::SetZone() void MonCreateHypothesis::PushZoneNew() // ------------------------------------------------------------------------ { - MESSAGE("Debut de MonCreateHypothesis::PushZoneNew") - MonCreateZone *aDlg = new MonCreateZone(this, TRUE, HOMARD::HOMARD_Gen::_duplicate(myHomardGen), _aCaseName) ; + MESSAGE("Debut de MonCreateHypothesis::PushZoneNew"); + MonCreateZone *aDlg = new MonCreateZone(this, true, HOMARD::HOMARD_Gen::_duplicate(myHomardGen), _aCaseName) ; aDlg->show(); } @@ -310,7 +325,7 @@ void MonCreateHypothesis::PushZoneNew() void MonCreateHypothesis::PushZoneEdit() // ------------------------------------------------------------------------ { - MESSAGE("Debut de MonCreateHypothesis::PushZoneEdit") + MESSAGE("Debut de MonCreateHypothesis::PushZoneEdit"); int colonne = TWZone->currentColumn(); QTableWidgetItem * monItem = TWZone->currentItem(); if (colonne !=2 || monItem == NULL) @@ -320,18 +335,9 @@ void MonCreateHypothesis::PushZoneEdit() return; } QString zoneName = monItem->text().trimmed(); - MonEditZone *aDlg = new MonEditZone(this, TRUE, HOMARD::HOMARD_Gen::_duplicate(myHomardGen), _aCaseName, zoneName) ; + MonEditZone *aDlg = new MonEditZone(this, true, HOMARD::HOMARD_Gen::_duplicate(myHomardGen), _aCaseName, zoneName) ; aDlg->show(); } -// ------------------------------------------------------------------------ -void MonCreateHypothesis::PushZoneDelete() -// ------------------------------------------------------------------------ -{ - MESSAGE("Debut de MonCreateHypothesis::PushZoneDelete") - QMessageBox::warning( 0, QObject::tr("HOM_WARNING"), - QObject::tr("HOM_INACTIVE_BUTTON") ); - return; -} // ------------------------------------------------------------------------ void MonCreateHypothesis::GetAllZones() @@ -340,7 +346,7 @@ void MonCreateHypothesis::GetAllZones() // et affichage dans le tableau // Par defaut, aucune n'est selectionnee { - MESSAGE("Debut de GetAllZones") ; + MESSAGE("Debut de GetAllZones"); HOMARD::listeZones_var mesZones = myHomardGen->GetAllZonesName(); int nbrow=TWZone->rowCount(); for ( int row=0; row< nbrow; row++) @@ -679,7 +685,8 @@ void MonCreateHypothesis::SetUCL2() void MonCreateHypothesis::SetUCInf() // ------------------------------------------------------------------------ { - _UsCmpI = 1 ; + if ( TWCMP->rowCount() == 1 ) { _UsCmpI = 2 ; } + else { _UsCmpI = 1 ; } RBInf->setChecked(true); } // ------------------------------------------------------------------------ @@ -694,7 +701,7 @@ void MonCreateHypothesis::SetFiltrage() // ------------------------------------------------------------------------ { if (!CBGroupe->isChecked()) return; - MonCreateListGroup *aDlg = new MonCreateListGroup(this, NULL, TRUE, HOMARD::HOMARD_Gen::_duplicate(myHomardGen),_aCaseName, _aListeGroupes) ; + MonCreateListGroup *aDlg = new MonCreateListGroup(this, NULL, true, HOMARD::HOMARD_Gen::_duplicate(myHomardGen),_aCaseName, _aListeGroupes) ; aDlg->show(); } @@ -776,8 +783,8 @@ void MonCreateHypothesis::AssocieComposants() _aFieldName=CBFieldName->currentText(); aHypothesis->SetField(CORBA::string_dup(_aFieldName.toStdString().c_str()) ) ; - aHypothesis->SetRefinThr( _TypeThR, _ThreshR ) ; - aHypothesis->SetUnRefThr( _TypeThC, _ThreshC ) ; + if ( _TypeThR > 0 ) { aHypothesis->SetRefinThr( _TypeThR, _ThreshR ) ; } + if ( _TypeThC > 0 ) { aHypothesis->SetUnRefThr( _TypeThC, _ThreshC ) ; } aHypothesis->SetUseField( _UsField ) ; aHypothesis->SetUseComp( _UsCmpI ) ; _aListeComposant = GetListCompChecked() ; @@ -887,20 +894,20 @@ void MonCreateHypothesis::SetAdvanced() MESSAGE("Debut de SetAdvanced "); if (CBAdvanced->isChecked()) { GBAdvancedOptions->setVisible(1); - if (_aFieldFile != QString("")) - { GBAdapInit->setVisible(1) ; - } - else - { GBAdapInit->setVisible(0) ; - } + if (_aFieldFile != QString("")) { GBAdapInit->setVisible(1) ; } + else { GBAdapInit->setVisible(0) ; } } else { GBAdvancedOptions->setVisible(0); _NivMax = -1 ; _DiamMin = -1. ; _AdapInit = 0 ; - CBLevelOutput->setChecked(false); - _LevelOutput = 0 ; + CBOutputLevel->setChecked(false); + CBOutputQuality->setChecked(false); + CBOutputDiameter->setChecked(false); + CBOutputParent->setChecked(false); + CBOutputVoisins->setChecked(false); + _ExtraOutput = 1 ; } // adjustSize();