Salome HOME
Copyrights update 2015.
[modules/homard.git] / src / HOMARDGUI / MonCreateHypothesis.cxx
index d0ec929529b46266d155bd6e014a2cf9ad2f30da..26b9bfd00eab5521eba9e0c36584d7f4554168a4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2011-2014  CEA/DEN, EDF R&D
+// Copyright (C) 2011-2015  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
@@ -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,10 @@ MonCreateHypothesis::MonCreateHypothesis(MonCreateIteration* parent, bool modal,
       }
       SetFieldNo();
       GBAdvancedOptions->setVisible(0);
-      CBLevelOutput->setChecked(false);
+      CBOutputLevel->setChecked(false);
+      CBOutputQuality->setChecked(false);
+      CBOutputDiameter->setChecked(false);
+      _ExtraOutput = 1 ;
 //
       adjustSize();
 }
@@ -165,7 +168,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 +194,12 @@ 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 ; }
+    aHypothesis->SetExtraOutput(_ExtraOutput);
   }
 
   HOMARD_UTILS::updateObjBrowser() ;
@@ -679,7 +691,8 @@ void MonCreateHypothesis::SetUCL2()
 void MonCreateHypothesis::SetUCInf()
 // ------------------------------------------------------------------------
 {
-  _UsCmpI = 1 ;
+  if ( TWCMP->rowCount() == 1 ) { _UsCmpI = 2 ; }
+  else                          { _UsCmpI = 1 ; }
   RBInf->setChecked(true);
 }
 // ------------------------------------------------------------------------
@@ -776,8 +789,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 +900,18 @@ 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);
+    _ExtraOutput = 1 ;
   }
 //
   adjustSize();