Salome HOME
Updated copyright comment
[modules/homard.git] / src / HOMARD_I / HOMARD_Hypothesis_i.cxx
index e9d2f3d2479408c8e269fda6f8f6fa91b97abd3b..3adc47b8992f2528c2f8791787c38023f7bc6e97 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
@@ -16,6 +16,7 @@
 //
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // Remarques :
 // L'ordre de description des fonctions est le meme dans tous les fichiers
 // HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx :
@@ -112,10 +113,22 @@ bool HOMARD_Hypothesis_i::Restore( const std::string& stream )
 // Caracteristiques
 //=============================================================================
 //=============================================================================
-void HOMARD_Hypothesis_i::SetAdapRefinUnRef( CORBA::Long TypeAdap,CORBA::Long TypeRaff, CORBA::Long TypeDera )
+void HOMARD_Hypothesis_i::SetUnifRefinUnRef( CORBA::Long TypeRaffDera )
 {
   ASSERT( myHomardHypothesis );
-  myHomardHypothesis->SetAdapType( TypeAdap );
+  VERIFICATION( (TypeRaffDera==1) || (TypeRaffDera==-1) );
+  int TypeRaff, TypeDera ;
+  if ( TypeRaffDera == 1 )
+  {
+    TypeRaff = 1 ;
+    TypeDera = 0 ;
+  }
+  else if ( TypeRaffDera == -1 )
+  {
+    TypeRaff = 0 ;
+    TypeDera = 1 ;
+  }
+  myHomardHypothesis->SetAdapType( -1 );
   myHomardHypothesis->SetRefinTypeDera( TypeRaff, TypeDera );
 }
 //=============================================================================
@@ -218,6 +231,12 @@ HOMARD::listeComposantsHypo* HOMARD_Hypothesis_i::GetComps()
 //=============================================================================
 void HOMARD_Hypothesis_i::SetRefinThr( CORBA::Long TypeThR, CORBA::Double ThreshR )
 {
+  myHomardHypothesis->SetAdapType( 1 );
+  if ( TypeThR > 0 )
+  {
+    int TypeDera = myHomardHypothesis->GetUnRefType() ;
+    myHomardHypothesis->SetRefinTypeDera( 1, TypeDera );
+  }
   myHomardHypothesis->SetRefinThr( TypeThR, ThreshR );
 }
 //=============================================================================
@@ -229,6 +248,12 @@ CORBA::Long HOMARD_Hypothesis_i::GetRefinThrType()
 //=============================================================================
 void HOMARD_Hypothesis_i::SetUnRefThr( CORBA::Long TypeThC, CORBA::Double ThreshC )
 {
+  myHomardHypothesis->SetAdapType( 1 );
+  if ( TypeThC > 0 )
+  {
+    int TypeRaff = myHomardHypothesis->GetRefinType() ;
+    myHomardHypothesis->SetRefinTypeDera( TypeRaff, 1 );
+  }
   myHomardHypothesis->SetUnRefThr( TypeThC, ThreshC );
 }
 //=============================================================================
@@ -274,16 +299,16 @@ CORBA::Long HOMARD_Hypothesis_i::GetAdapInit()
   return myHomardHypothesis->GetAdapInit();
 }
 //=============================================================================
-void HOMARD_Hypothesis_i::SetLevelOutput( CORBA::Long LevelOutput )
+void HOMARD_Hypothesis_i::SetExtraOutput( CORBA::Long ExtraOutput )
 {
   ASSERT( myHomardHypothesis );
-  myHomardHypothesis->SetLevelOutput( LevelOutput );
+  myHomardHypothesis->SetExtraOutput( ExtraOutput );
 }
 //=============================================================================
-CORBA::Long HOMARD_Hypothesis_i::GetLevelOutput()
+CORBA::Long HOMARD_Hypothesis_i::GetExtraOutput()
 {
   ASSERT( myHomardHypothesis );
-  return myHomardHypothesis->GetLevelOutput();
+  return myHomardHypothesis->GetExtraOutput();
 }
 //=============================================================================
 void HOMARD_Hypothesis_i::AddGroup( const char* Group)
@@ -292,6 +317,18 @@ void HOMARD_Hypothesis_i::AddGroup( const char* Group)
   myHomardHypothesis->AddGroup( Group );
 }
 //=============================================================================
+void HOMARD_Hypothesis_i::SupprGroup( const char* Group )
+{
+  ASSERT( myHomardHypothesis );
+  myHomardHypothesis->SupprGroup(Group);
+}
+//=============================================================================
+void HOMARD_Hypothesis_i::SupprGroups()
+{
+  ASSERT( myHomardHypothesis );
+  myHomardHypothesis->SupprGroups();
+}
+//=============================================================================
 void HOMARD_Hypothesis_i::SetGroups(const HOMARD::ListGroupType& ListGroup)
 {
   ASSERT( myHomardHypothesis );
@@ -414,8 +451,22 @@ HOMARD::listeIters* HOMARD_Hypothesis_i::GetIterations()
 //=============================================================================
 void HOMARD_Hypothesis_i::AddZone( const char* NomZone, CORBA::Long TypeUse )
 {
-  MESSAGE ("Dans AddZone pour " << NomZone) ;
+  MESSAGE ("Dans AddZone pour " << NomZone << " et TypeUse = " << TypeUse ) ;
   ASSERT( myHomardHypothesis );
+  VERIFICATION( (TypeUse==1) || (TypeUse==-1) );
+  myHomardHypothesis->SetAdapType( 0 );
+  int TypeRaff, TypeDera ;
+  if ( TypeUse == 1 )
+  {
+    TypeRaff = 1 ;
+    TypeDera = myHomardHypothesis->GetUnRefType() ;
+  }
+  else if ( TypeUse == -1 )
+  {
+    TypeRaff = myHomardHypothesis->GetRefinType() ;
+    TypeDera = 1 ;
+  }
+  myHomardHypothesis->SetRefinTypeDera( TypeRaff, TypeDera );
   char* NomHypo = GetName() ;
   return _gen_i->AssociateHypoZone(NomHypo, NomZone, TypeUse) ;
 }