Salome HOME
Updated copyright comment
[modules/homard.git] / src / HOMARDGUI / MonEditHypothesis.cxx
index 6f28eab49e017918ecdcd25430f39841b8a13537..795f89deeedb4eebaf1fb02e931fbdb9e5db5b28 100644 (file)
@@ -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
@@ -103,15 +103,15 @@ void MonEditHypothesis::InitValEdit()
   int NivMax = aHypothesis->GetNivMax();
   double DiamMin = aHypothesis->GetDiamMin();
   int AdapInit = aHypothesis->GetAdapInit();
-  int LevelOutput = aHypothesis->GetLevelOutput();
-  if ( NivMax > 0 || DiamMin > 0 || AdapInit != 0 || LevelOutput != 0 )
+  int ExtraOutput = aHypothesis->GetExtraOutput();
+  if ( NivMax > 0 || DiamMin > 0 || AdapInit != 0 || ExtraOutput != 1 )
   { GBAdvancedOptions->setVisible(1);
     if ( NivMax > 0 )
-    { spinBoxNivMax->setValue(NivMax);
-      spinBoxNivMax->setDisabled(true); }
+    { SpinBoxNivMax->setValue(NivMax);
+      SpinBoxNivMax->setDisabled(true); }
     else
     { TLMaximalLevel->setVisible(0);
-      spinBoxNivMax->setVisible(0); }
+      SpinBoxNivMax->setVisible(0); }
     if ( DiamMin > 0 )
     { doubleSpinBoxDiamMin->setValue(DiamMin);
       doubleSpinBoxDiamMin->setDisabled(true); }
@@ -131,19 +131,40 @@ void MonEditHypothesis::InitValEdit()
     else
     { GBAdapInit->setVisible(0) ;
     }
-    if ( LevelOutput != 0 )
+    if ( ExtraOutput % 2 == 0 )
     {
-      CBLevelOutput->setChecked(true);
-      CBLevelOutput->setEnabled(false);
+      CBOutputLevel->setChecked(true);
+      CBOutputLevel->setEnabled(false);
     }
-    else
-    { CBLevelOutput->setVisible(0) ;
+    else { CBOutputLevel->setVisible(0) ; }
+    if ( ExtraOutput % 3 == 0 )
+    {
+      CBOutputQuality->setChecked(true);
+      CBOutputQuality->setEnabled(false);
+    }
+    else { CBOutputQuality->setVisible(0) ; }
+    if ( ExtraOutput % 5 == 0 )
+    {
+      CBOutputDiameter->setChecked(true);
+      CBOutputDiameter->setEnabled(false);
+    }
+    else { CBOutputDiameter->setVisible(0) ; }
+    if ( ExtraOutput % 7 == 0 )
+    {
+      CBOutputParent->setChecked(true);
+      CBOutputParent->setEnabled(false);
+    }
+    else { CBOutputParent->setVisible(0) ; }
+    if ( ExtraOutput % 11 == 0 )
+    {
+      CBOutputVoisins->setChecked(true);
+      CBOutputVoisins->setEnabled(false);
     }
+    else { CBOutputVoisins->setVisible(0) ; }
   }
   else
   { GBAdvancedOptions->setVisible(0); }
 //
-  adjustSize();
 }
 // ----------------------------------------
 void MonEditHypothesis::InitAdaptUniforme()
@@ -151,28 +172,29 @@ void MonEditHypothesis::InitAdaptUniforme()
 // Affichage des informations pour une adaptation uniforme
 {
 //  Choix des options generales
-    GBFieldManagement->setVisible(0);
-    GBAreaManagement->setVisible(0);
-    GBUniform->setVisible(1);
-    adjustSize();
-    RBUniforme->setChecked(true);
-    RBUniforme->setEnabled(false);
-    RBChamp->setEnabled(false);
-    RBZone->setEnabled(false);
+  GBFieldManagement->setVisible(0);
+  GBAreaManagement->setVisible(0);
+  GBUniform->setVisible(1);
+  RBUniforme->setChecked(true);
+  RBUniforme->setEnabled(false);
+  RBChamp->setEnabled(false);
+  RBZone->setEnabled(false);
 //
 // Raffinement ou deraffinement ?
-    if (_aTypeDera == 0)
-    {
-        VERIFICATION(_aTypeRaff==1);
-        RBUniDera->setChecked(false);
-        RBUniRaff->setChecked(true);
-    }
-    if (_aTypeDera == 1)
-    {
-        VERIFICATION(_aTypeRaff==0);
-        RBUniDera->setChecked(true);
-        RBUniRaff->setChecked(false);
-    }
+  if (_aTypeDera == 0)
+  {
+      VERIFICATION(_aTypeRaff==1);
+      RBUniDera->setChecked(false);
+      RBUniRaff->setChecked(true);
+  }
+  if (_aTypeDera == 1)
+  {
+      VERIFICATION(_aTypeRaff==0);
+      RBUniDera->setChecked(true);
+      RBUniRaff->setChecked(false);
+  }
+//
+  adjustSize();
 //
 }
 // -------------------------------------
@@ -180,52 +202,53 @@ void MonEditHypothesis::InitAdaptZone()
 // -------------------------------------
 // Affichage des informations pour une adaptation selon des zones :
 {
-    MESSAGE ("Debut de InitAdaptZone");
+  MESSAGE ("Debut de InitAdaptZone");
 //  Choix des options generales
-    GBUniform->setVisible(0);
-    GBFieldManagement->setVisible(0);
-    GBAreaManagement->setVisible(1);
-    adjustSize();
-    RBZone->setChecked(true);
-    RBChamp->setEnabled(false);
-    RBUniforme->setEnabled(false);
-    RBZone->setEnabled(false);
+  GBUniform->setVisible(0);
+  GBFieldManagement->setVisible(0);
+  GBAreaManagement->setVisible(1);
+  RBZone->setChecked(true);
+  RBChamp->setEnabled(false);
+  RBUniforme->setEnabled(false);
+  RBZone->setEnabled(false);
 
 //  Recuperation de toutes les zones decrites et notation de celles retenues
-    GetAllZones();
-    HOMARD::listeZonesHypo_var mesZonesAvant = aHypothesis->GetZones();
-    for (int i=0; i<mesZonesAvant->length(); i++)
+  GetAllZones();
+  HOMARD::listeZonesHypo_var mesZonesAvant = aHypothesis->GetZones();
+  for (int i=0; i<mesZonesAvant->length(); i++)
+  {
+    MESSAGE ("i"<<i<<", zone :"<<string(mesZonesAvant[i])<<", type :"<<string(mesZonesAvant[i+1]));
+    for ( int j =0 ; j < TWZone->rowCount(); j++)
     {
-      MESSAGE ("i"<<i<<", zone :"<<string(mesZonesAvant[i])<<", type :"<<string(mesZonesAvant[i+1]));
-      for ( int j =0 ; j < TWZone->rowCount(); j++)
+      MESSAGE (". j"<<j<<", zone :"<<TWZone->item(j,2)->text().toStdString());
+      if ( TWZone->item(j,2)->text().toStdString() == string(mesZonesAvant[i]) )
       {
-        MESSAGE (". j"<<j<<", zone :"<<TWZone->item(j,2)->text().toStdString());
-        if ( TWZone->item(j,2)->text().toStdString() == string(mesZonesAvant[i]) )
+        MESSAGE ("OK avec "<<string(mesZonesAvant[i]));
+        if ( string(mesZonesAvant[i+1]) == "1" )
+        {
+          MESSAGE ("... RAFF");
+          TWZone->item( j,0 )->setCheckState( Qt::Checked );
+          TWZone->item( j,1 )->setCheckState( Qt::Unchecked ); }
+        else
         {
-          MESSAGE ("OK avec "<<string(mesZonesAvant[i]));
-          if ( string(mesZonesAvant[i+1]) == "1" )
-          {
-            MESSAGE ("... RAFF");
-            TWZone->item( j,0 )->setCheckState( Qt::Checked );
-            TWZone->item( j,1 )->setCheckState( Qt::Unchecked ); }
-          else
-          {
-            MESSAGE ("... DERA");
-            TWZone->item( j,0 )->setCheckState( Qt::Unchecked );
-            TWZone->item( j,1 )->setCheckState( Qt::Checked ); }
-          break;
-        }
+          MESSAGE ("... DERA");
+          TWZone->item( j,0 )->setCheckState( Qt::Unchecked );
+          TWZone->item( j,1 )->setCheckState( Qt::Checked ); }
+        break;
       }
-      i += 1 ;
     }
+    i += 1 ;
+  }
 //
 //  Inactivation des choix
-    for ( int j =0 ; j < TWZone->rowCount(); j++)
-    {
-      TWZone->item( j, 0 )->setFlags(0);
-      TWZone->item( j, 1 )->setFlags(0);
-    }
-    PBZoneNew->setVisible(0);
+  for ( int j =0 ; j < TWZone->rowCount(); j++)
+  {
+    TWZone->item( j, 0 )->setFlags(0);
+    TWZone->item( j, 1 )->setFlags(0);
+  }
+  PBZoneNew->setVisible(0);
+//
+  adjustSize();
 //
 }
 // -------------------------------------
@@ -242,7 +265,6 @@ void MonEditHypothesis::InitAdaptChamps()
     GBUniform->setVisible(0);
     GBAreaManagement->setVisible(0);
     GBFieldManagement->setVisible(1);
-    adjustSize();
     RBChamp->setChecked(true);
     RBUniforme->setEnabled(false);
     RBChamp->setEnabled(false);
@@ -344,6 +366,8 @@ void MonEditHypothesis::InitAdaptChamps()
     RBInf->setChecked(true);
     RBInf->setEnabled(true);
   }
+//
+  adjustSize();
 }
 // -------------------------------------
 void MonEditHypothesis::InitFieldInterp()
@@ -432,7 +456,7 @@ void MonEditHypothesis::SetFiltrage()
 {
   if (CBGroupe->isChecked())
   {
-    MonEditListGroup *aDlg = new MonEditListGroup(this, NULL, TRUE, HOMARD::HOMARD_Gen::_duplicate(myHomardGen),_aCaseName, _aListeGroupes) ;
+    MonEditListGroup *aDlg = new MonEditListGroup(this, NULL, true, HOMARD::HOMARD_Gen::_duplicate(myHomardGen),_aCaseName, _aListeGroupes) ;
     aDlg->show();
   }
 }