Salome HOME
[bos #32517][EDF] Dynamic log messages switched on and off by SALOME_VERBOSE environm...
[modules/homard.git] / src / HOMARDGUI / MonCreateBoundaryAn.cxx
index 91537d2057a228195d01a804b0b7a5db2107d797..0e0fe382a2d170a80d882c47b0ba8b997c4e70b7 100644 (file)
@@ -1,9 +1,9 @@
-// #Copyright (C) 2011-2013  CEA/DEN, EDF R&D
+// Copyright (C) 2011-2022  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
 // 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
@@ -38,6 +38,7 @@
 #define PI 3.141592653589793
 
 using namespace std;
+
 // ------------------------------------------------------------------------------------------------------------------------
 MonCreateBoundaryAn::MonCreateBoundaryAn(MonCreateCase* parent, bool modal,
                              HOMARD::HOMARD_Gen_var myHomardGen0,
@@ -49,7 +50,7 @@ MonCreateBoundaryAn::MonCreateBoundaryAn(MonCreateCase* parent, bool modal,
 */
     QDialog(0), Ui_CreateBoundaryAn(),
     _parent(parent),
-    _aName (""),
+    _Name (""),
     _aCaseName(caseName),
     _Xmin(0), _Xmax(0), _Xincr(0), _Ymin(0), _Ymax(0), _Yincr(0), _Zmin(0), _Zmax(0), _Zincr(0), _DMax(0),
     _Type(1),
@@ -60,6 +61,9 @@ MonCreateBoundaryAn::MonCreateBoundaryAn(MonCreateCase* parent, bool modal,
     _BoundaryAnXcone2(0), _BoundaryAnYcone2(0), _BoundaryAnZcone2(0), _BoundaryAnRayon2(0),
     _BoundaryAnXaxisCone(0), _BoundaryAnYaxisCone(0), _BoundaryAnZaxisCone(0),
     _BoundaryAngle(0),
+    _BoundaryAnToreXcentre(0), _BoundaryAnToreYcentre(0), _BoundaryAnToreZcentre(0),
+    _BoundaryAnToreXaxe(0), _BoundaryAnToreYaxe(0), _BoundaryAnToreZaxe(0),
+    _BoundaryAnToreRRev(0), _BoundaryAnToreRPri(0),
     Chgt (false)
     {
       MESSAGE("Constructeur") ;
@@ -68,22 +72,27 @@ MonCreateBoundaryAn::MonCreateBoundaryAn(MonCreateCase* parent, bool modal,
       setModal(modal);
 
     //  Gestion des icones
+      QPixmap pix ;
+      QIcon IS ;
       SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
-      QPixmap pix = resMgr->loadPixmap( "HOMARD", "spherepoint.png" );
-      QIcon IS=QIcon(pix);
+      pix = resMgr->loadPixmap( "HOMARD", "spherepoint.png" );
+      IS=QIcon(pix);
       RBSphere->setIcon(IS);
-      QPixmap pix2 = resMgr->loadPixmap( "HOMARD", "cylinderpointvector.png" );
-      QIcon IS2=QIcon(pix2);
-      RBCylindre->setIcon(IS2);
-      QPixmap pix3 = resMgr->loadPixmap( "HOMARD", "cone.png" );
-      QIcon IS3=QIcon(pix3);
-      RBCone->setIcon(IS3);
-      QPixmap pix4 = resMgr->loadPixmap( "HOMARD", "conepointvector.png" );
-      QIcon IS4=QIcon(pix4);
-      RB_Def_angle->setIcon(IS4);
-      QPixmap pix5 = resMgr->loadPixmap( "HOMARD", "conedxyz.png" );
-      QIcon IS5=QIcon(pix5);
-      RB_Def_radius->setIcon(IS5);
+      pix = resMgr->loadPixmap( "HOMARD", "cylinderpointvector.png" );
+      IS=QIcon(pix);
+      RBCylindre->setIcon(IS);
+      pix = resMgr->loadPixmap( "HOMARD", "cone.png" );
+      IS=QIcon(pix);
+      RBCone->setIcon(IS);
+      pix = resMgr->loadPixmap( "HOMARD", "conepointvector.png" );
+      IS=QIcon(pix);
+      RB_Def_angle->setIcon(IS);
+      pix = resMgr->loadPixmap( "HOMARD", "conedxyz.png" );
+      IS=QIcon(pix);
+      RB_Def_radius->setIcon(IS);
+      pix = resMgr->loadPixmap( "HOMARD", "toruspointvector.png" );
+      IS=QIcon(pix);
+      RBTore->setIcon(IS);
 
       InitConnect( );
 
@@ -97,12 +106,11 @@ MonCreateBoundaryAn::MonCreateBoundaryAn(MonCreateCase* parent,
                              HOMARD::HOMARD_Gen_var myHomardGen0,
                              QString caseName):
 // --------------------------------------------------------------------------------------------------------------
-// Constructeur appele par MonEditBoundaryAn
 //
     QDialog(0), Ui_CreateBoundaryAn(),
      myHomardGen(myHomardGen0),
     _parent(parent),
-    _aName (""),
+    _Name (""),
     _aCaseName(caseName),
     _Type(1),
     _BoundaryAnXcentre(0), _BoundaryAnYcentre(0), _BoundaryAnZcentre(0), _BoundaryAnRayon(0),
@@ -149,6 +157,7 @@ void MonCreateBoundaryAn::InitConnect()
     connect( RBCone,        SIGNAL(clicked()) , this, SLOT(SetCone()) ) ;
     connect( RB_Def_radius, SIGNAL(clicked()) , this, SLOT(SetConeR()) );
     connect( RB_Def_angle,  SIGNAL(clicked()) , this, SLOT(SetConeA()) );
+    connect( RBTore,        SIGNAL(clicked()) , this, SLOT(SetTore()) ) ;
     connect( buttonOk,     SIGNAL( pressed() ), this, SLOT( PushOnOK() ) );
     connect( buttonApply,  SIGNAL( pressed() ), this, SLOT( PushOnApply() ) );
     connect( buttonCancel, SIGNAL( pressed() ), this, SLOT( close() ) );
@@ -213,7 +222,6 @@ void MonCreateBoundaryAn::InitMinMax()
   // . Rayon
   SpinBox_Radius->setValue(_Rayon);
   SpinBox_Radius->setSingleStep(_Rayon/10.);
-  SpinBox_Radius->setMinimum(0.);
 
   // Sphere
   // . X du centre
@@ -228,7 +236,6 @@ void MonCreateBoundaryAn::InitMinMax()
   // . Rayon
   SpinBox_Rayon->setValue(_Rayon);
   SpinBox_Rayon->setSingleStep(_Rayon/10.);
-  SpinBox_Rayon->setMinimum(0.);
 
   // Cone en rayons
   // . X des centres
@@ -248,10 +255,8 @@ void MonCreateBoundaryAn::InitMinMax()
   SpinBox_Cone_Z2->setSingleStep(_Zincr);
   // . Rayons/Angles
   _BoundaryAnRayon1 = 0. ;
-  SpinBox_Cone_V1->setMinimum(0.);
   _BoundaryAnRayon2 = _Rayon ;
   SpinBox_Cone_V2->setSingleStep(_Rayon/10.);
-  SpinBox_Cone_V2->setMinimum(0.);
 
   // Cone en angle
   convertRayonAngle(1) ;
@@ -262,6 +267,32 @@ void MonCreateBoundaryAn::InitMinMax()
   SpinBox_Cone_X2->setValue(_BoundaryAnXorigCone);
   SpinBox_Cone_Y2->setValue(_BoundaryAnYorigCone);
   SpinBox_Cone_Z2->setValue(_BoundaryAnZorigCone);
+
+  // Tore
+  // . X du centre
+  SpinBoxToreXcent->setValue(_Xcentre);
+  SpinBoxToreXcent->setSingleStep(_Xincr);
+  // . Y du centre
+  SpinBoxToreYcent->setValue(_Ycentre);
+  SpinBoxToreYcent->setSingleStep(_Yincr);
+  // . Z du centre
+  SpinBoxToreZcent->setValue(_Zcentre);
+  SpinBoxToreZcent->setSingleStep(_Zincr);
+  // . X de l'axe
+  SpinBoxToreXaxe->setValue(0.);
+  SpinBoxToreXaxe->setSingleStep(0.1);
+  // . Y de l'axe
+  SpinBoxToreYaxe->setValue(0.);
+  SpinBoxToreYaxe->setSingleStep(0.1);
+  // . Z de l'axe
+  SpinBoxToreZaxe->setValue(1.);
+  SpinBoxToreZaxe->setSingleStep(0.1);
+  // . Rayon de revolution
+  SpinBoxToreRRev->setValue(_Rayon);
+  SpinBoxToreRRev->setSingleStep(_Rayon/10.);
+  // . Rayon primaire
+  SpinBoxToreRPri->setValue(_Rayon/3.);
+  SpinBoxToreRPri->setSingleStep(_Rayon/20.);
 }
 // ------------------------------------------------------------------------
 bool MonCreateBoundaryAn::PushOnApply()
@@ -361,8 +392,48 @@ bool MonCreateBoundaryAn::PushOnApply()
         }
         break;
       }
+      case 5 : // il s agit d un tore
+      {
+        if ((_BoundaryAnToreXcentre != SpinBoxToreXcent->value())  ||
+            (_BoundaryAnToreYcentre != SpinBoxToreYcent->value())  ||
+            (_BoundaryAnToreZcentre != SpinBoxToreZcent->value())  ||
+            (_BoundaryAnToreRRev   != SpinBoxToreRRev->value()) ||
+            (_BoundaryAnToreRPri   != SpinBoxToreRPri->value()) ||
+            (_BoundaryAnToreXaxe   != SpinBoxToreXaxe->value()) ||
+            (_BoundaryAnToreYaxe   != SpinBoxToreYaxe->value()) ||
+            (_BoundaryAnToreZaxe   != SpinBoxToreZaxe->value()) )
+        {
+          Chgt = true;
+          _BoundaryAnToreXcentre= SpinBoxToreXcent->value();
+          _BoundaryAnToreYcentre= SpinBoxToreYcent->value();
+          _BoundaryAnToreZcentre= SpinBoxToreZcent->value();
+          _BoundaryAnToreRRev=SpinBoxToreRRev->value();
+          _BoundaryAnToreRPri=SpinBoxToreRPri->value();
+          _BoundaryAnToreXaxe=SpinBoxToreXaxe->value();
+          _BoundaryAnToreYaxe=SpinBoxToreYaxe->value();
+          _BoundaryAnToreZaxe=SpinBoxToreZaxe->value();
+        }
+        break;
+      }
+
  }
 
+// Controles
+// L'axe pour un cylindre
+  if ( _Type == 5 )
+  {
+    double daux = _BoundaryAnXaxis*_BoundaryAnXaxis + _BoundaryAnYaxis*_BoundaryAnYaxis + _BoundaryAnZaxis*_BoundaryAnZaxis ;
+    if ( daux < 0.0000001 )
+    {
+      QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
+                                QObject::tr("HOM_AXE") );
+      return false;
+    }
+  }
+
+//
+// Création ou mise à jour de la frontière
+//
   bool bOK = CreateOrUpdateBoundaryAn();
 
   if ( bOK ) { HOMARD_UTILS::updateObjBrowser() ; }
@@ -371,79 +442,64 @@ bool MonCreateBoundaryAn::PushOnApply()
 
 }
 // ---------------------------------------------------
-bool MonCreateBoundaryAn:: CreateOrUpdateBoundaryAn()
+bool MonCreateBoundaryAn::CreateOrUpdateBoundaryAn()
 //----------------------------------------------------
 //  Creation de l'objet boundary
 {
-  _aName = LEName->text().trimmed();
-  switch (_Type)
+  MESSAGE("Debut de CreateOrUpdateBoundaryAn avec _Type ="<<_Type<<", _Name ="<<_Name.toStdString().c_str()<<" et LEName ="<<LEName->text().trimmed().toStdString().c_str());
+//
+  if (_Name != LEName->text().trimmed())
   {
-    case 1 : // il s agit d un cylindre
-    {
-      try
-      {
-        aBoundaryAn = myHomardGen->CreateBoundaryCylinder(CORBA::string_dup(_aName.toStdString().c_str()), \
-        _BoundaryAnXcentre, _BoundaryAnYcentre, _BoundaryAnZcentre, _BoundaryAnXaxis, _BoundaryAnYaxis, _BoundaryAnZaxis, _BoundaryAnRayon );
-      }
-      catch( SALOME::SALOME_Exception& S_ex )
-      {
-        QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
-                                  QObject::tr(CORBA::string_dup(S_ex.details.text)) );
-        return false ;
-      }
-      break;
-    }
-    case 2 : // il s agit d une sphere
-    {
-      try
-      {
-        aBoundaryAn = myHomardGen->CreateBoundarySphere(CORBA::string_dup(_aName.toStdString().c_str()), \
-        _BoundaryAnXcentre, _BoundaryAnYcentre, _BoundaryAnZcentre, _BoundaryAnRayon);
-      }
-      catch( SALOME::SALOME_Exception& S_ex )
-      {
-        QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
-                                  QObject::tr(CORBA::string_dup(S_ex.details.text)) );
-        return false ;
-      }
-      break;
-    }
-    case 3 : // il s agit d un cone defini par un axe et un angle
+    _Name = LEName->text().trimmed() ;
+    try
     {
-      try
-      {
-        aBoundaryAn = myHomardGen->CreateBoundaryConeA(CORBA::string_dup(_aName.toStdString().c_str()), \
-        _BoundaryAnXaxisCone, _BoundaryAnYaxisCone, _BoundaryAnZaxisCone, _BoundaryAngle, \
-        _BoundaryAnXorigCone, _BoundaryAnYorigCone, _BoundaryAnYorigCone);
-      }
-      catch( SALOME::SALOME_Exception& S_ex )
+      switch (_Type)
       {
-        QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
-                                  QObject::tr(CORBA::string_dup(S_ex.details.text)) );
-        return false ;
+        case 1 : // il s agit d un cylindre
+        { aBoundaryAn = myHomardGen->CreateBoundaryCylinder(CORBA::string_dup(_Name.toStdString().c_str()), \
+            _BoundaryAnXcentre, _BoundaryAnYcentre, _BoundaryAnZcentre, _BoundaryAnXaxis, _BoundaryAnYaxis, _BoundaryAnZaxis, _BoundaryAnRayon );
+          break;
+        }
+        case 2 : // il s agit d une sphere
+        { aBoundaryAn = myHomardGen->CreateBoundarySphere(CORBA::string_dup(_Name.toStdString().c_str()), \
+            _BoundaryAnXcentre, _BoundaryAnYcentre, _BoundaryAnZcentre, _BoundaryAnRayon);
+          break;
+       }
+        case 3 : // il s agit d un cone defini par un axe et un angle
+        { aBoundaryAn = myHomardGen->CreateBoundaryConeA(CORBA::string_dup(_Name.toStdString().c_str()), \
+            _BoundaryAnXaxisCone, _BoundaryAnYaxisCone, _BoundaryAnZaxisCone, _BoundaryAngle, \
+            _BoundaryAnXorigCone, _BoundaryAnYorigCone, _BoundaryAnYorigCone);
+          break;
+        }
+        case 4 : // il s agit d un cone defini par les 2 rayons
+        { aBoundaryAn = myHomardGen->CreateBoundaryConeR(CORBA::string_dup(_Name.toStdString().c_str()), \
+            _BoundaryAnXcone1, _BoundaryAnYcone1, _BoundaryAnZcone1, _BoundaryAnRayon1, \
+            _BoundaryAnXcone2, _BoundaryAnYcone2, _BoundaryAnZcone2, _BoundaryAnRayon2);
+          break;
+        }
+        case 5 : // il s agit d un tore
+        { aBoundaryAn = myHomardGen->CreateBoundaryTorus(CORBA::string_dup(_Name.toStdString().c_str()), \
+            _BoundaryAnToreXcentre, _BoundaryAnToreYcentre, _BoundaryAnToreZcentre, _BoundaryAnToreXaxe, _BoundaryAnToreYaxe, _BoundaryAnToreZaxe, _BoundaryAnToreRRev, _BoundaryAnToreRPri );
+          break;
+        }
       }
-      break;
     }
-    case 4 : // il s agit d un cone defini par les 2 rayons
+    catch( SALOME::SALOME_Exception& S_ex )
     {
-      try
-      {
-        aBoundaryAn = myHomardGen->CreateBoundaryConeR(CORBA::string_dup(_aName.toStdString().c_str()), \
-        _BoundaryAnXcone1, _BoundaryAnYcone1, _BoundaryAnZcone1, _BoundaryAnRayon1, \
-        _BoundaryAnXcone2, _BoundaryAnYcone2, _BoundaryAnZcone2, _BoundaryAnRayon2);
-      }
-      catch( SALOME::SALOME_Exception& S_ex )
-      {
-        QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
-                                  QObject::tr(CORBA::string_dup(S_ex.details.text)) );
-        return false ;
-      }
-      break;
+      QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
+                                QObject::tr(CORBA::string_dup(S_ex.details.text)) );
+      return false ;
     }
-  }
-  _parent->AddBoundaryAn(_aName);
+    _parent->AddBoundaryAn(_Name);
 
-  return true;
+    return true;
+  }
+  else {
+    QMessageBox::warning( 0, QObject::tr("HOM_WARNING"),
+                             QObject::tr("HOM_SELECT_OBJECT_4") );
+    return false ;
+  }
+  MESSAGE("Fin de CreateOrUpdateBoundaryAn");
 }
 // ------------------------------------------------------------------------
 void MonCreateBoundaryAn::PushOnOK()
@@ -455,8 +511,8 @@ void MonCreateBoundaryAn::PushOnOK()
 void MonCreateBoundaryAn::PushOnHelp()
 // ------------------------------------------------------------------------
 {
-  char* LanguageShort = myHomardGen->GetLanguageShort();
-  HOMARD_UTILS::PushOnHelp(QString("gui_create_boundary.html"), QString("un-cylindre"), QString(LanguageShort));
+  std::string LanguageShort = myHomardGen->GetLanguageShort();
+  HOMARD_UTILS::PushOnHelp(QString("gui_create_boundary.html"), QString("un-cylindre"), QString(LanguageShort.c_str()));
 }
 
 // -----------------------------------
@@ -475,9 +531,9 @@ void MonCreateBoundaryAn::SetNewName()
     {
       if ( aName ==  QString(MyObjects[i]))
       {
-          num=num+1;
-          aName="";
-          break;
+        num ++ ;
+        aName = "" ;
+        break ;
       }
    }
   }
@@ -487,31 +543,37 @@ void MonCreateBoundaryAn::SetNewName()
 void MonCreateBoundaryAn::SetCylinder()
 // ------------------------------------------------------------------------
 {
-  MESSAGE("Debut de SetCylinder")
+  MESSAGE("Debut de SetCylinder");
   gBCylindre->setVisible(1);
   gBSphere->setVisible(0);
   gBCone->setVisible(0);
-  adjustSize();
+  gBTore->setVisible(0);
+//
   _Type=1;
+//
+  adjustSize();
 //   MESSAGE("Fin de SetCylinder")
 }
 // ------------------------------------------------------------------------
 void MonCreateBoundaryAn::SetSphere()
 // ------------------------------------------------------------------------
 {
-  MESSAGE("Debut de SetSphere")
+  MESSAGE("Debut de SetSphere");
   gBCylindre->setVisible(0);
   gBSphere->setVisible(1);
   gBCone->setVisible(0);
-  adjustSize();
+  gBTore->setVisible(0);
+//
   _Type=2;
+//
+  adjustSize();
 //   MESSAGE("Fin de SetSphere")
 }
 // ------------------------------------------------------------------------
 void MonCreateBoundaryAn::SetConeR()
 // ------------------------------------------------------------------------
 {
-  MESSAGE("Debut de SetConeR")
+  MESSAGE("Debut de SetConeR");
 //
 // Stockage et conversion des valeurs si elles ont change
   if ((_BoundaryAnXaxisCone != SpinBox_Cone_X1->value())  ||
@@ -522,7 +584,7 @@ void MonCreateBoundaryAn::SetConeR()
       (_BoundaryAnZorigCone != SpinBox_Cone_Z2->value())  ||
       (_BoundaryAngle       != SpinBox_Cone_V1->value()) )
   {
-    MESSAGE("Stockage et conversion")
+    MESSAGE("Stockage et conversion");
     _BoundaryAnXaxisCone = SpinBox_Cone_X1->value() ;
     _BoundaryAnYaxisCone = SpinBox_Cone_Y1->value() ;
     _BoundaryAnZaxisCone = SpinBox_Cone_Z1->value() ;
@@ -535,28 +597,28 @@ void MonCreateBoundaryAn::SetConeR()
 //
   _Type=4;
 //
-  TLCone_X1->setText(QApplication::translate("CreateBoundaryAn", "X centre 1", 0, QApplication::UnicodeUTF8));
+  TLCone_X1->setText(QApplication::translate("CreateBoundaryAn", "X centre 1", 0));
   SpinBox_Cone_X1->setValue(_BoundaryAnXcone1);
-  TLCone_Y1->setText(QApplication::translate("CreateBoundaryAn", "Y centre 1", 0, QApplication::UnicodeUTF8));
+  TLCone_Y1->setText(QApplication::translate("CreateBoundaryAn", "Y centre 1", 0));
   SpinBox_Cone_Y1->setValue(_BoundaryAnYcone1);
-  TLCone_Z1->setText(QApplication::translate("CreateBoundaryAn", "Z centre 1", 0, QApplication::UnicodeUTF8));
+  TLCone_Z1->setText(QApplication::translate("CreateBoundaryAn", "Z centre 1", 0));
   SpinBox_Cone_Z1->setValue(_BoundaryAnZcone1);
 //
-  TLCone_V1->setText(QApplication::translate("CreateBoundaryAn", "Radius 1", 0, QApplication::UnicodeUTF8));
+  TLCone_V1->setText(QApplication::translate("CreateBoundaryAn", "Radius 1", 0));
   SpinBox_Cone_V1->setSingleStep(_Rayon/10.);
   SpinBox_Cone_V1->setMaximum(100000.*_DMax);
   SpinBox_Cone_V1->setValue(_BoundaryAnRayon1);
 //
-  TLCone_X2->setText(QApplication::translate("CreateBoundaryAn", "X centre 2", 0, QApplication::UnicodeUTF8));
+  TLCone_X2->setText(QApplication::translate("CreateBoundaryAn", "X centre 2", 0));
   SpinBox_Cone_X2->setValue(_BoundaryAnXcone2);
-  TLCone_Y2->setText(QApplication::translate("CreateBoundaryAn", "Y centre 2", 0, QApplication::UnicodeUTF8));
+  TLCone_Y2->setText(QApplication::translate("CreateBoundaryAn", "Y centre 2", 0));
   SpinBox_Cone_Y2->setValue(_BoundaryAnYcone2);
-  TLCone_Z2->setText(QApplication::translate("CreateBoundaryAn", "Z centre 2", 0, QApplication::UnicodeUTF8));
+  TLCone_Z2->setText(QApplication::translate("CreateBoundaryAn", "Z centre 2", 0));
   SpinBox_Cone_Z2->setValue(_BoundaryAnZcone2);
 //
   TLCone_V2->setVisible(1);
   SpinBox_Cone_V2->setVisible(1);
-  TLCone_V2->setText(QApplication::translate("CreateBoundaryAn", "Radius 2", 0, QApplication::UnicodeUTF8));
+  TLCone_V2->setText(QApplication::translate("CreateBoundaryAn", "Radius 2", 0));
   SpinBox_Cone_V2->setValue(_BoundaryAnRayon2);
 //
 //   MESSAGE("Fin de SetConeR")
@@ -565,7 +627,7 @@ void MonCreateBoundaryAn::SetConeR()
 void MonCreateBoundaryAn::SetConeA()
 // ------------------------------------------------------------------------
 {
-  MESSAGE("Debut de SetConeA")
+  MESSAGE("Debut de SetConeA");
 // Stockage et conversion des valeurs si elles ont change
   if ((_BoundaryAnXcone1 != SpinBox_Cone_X1->value())  ||
       (_BoundaryAnYcone1 != SpinBox_Cone_Y1->value())  ||
@@ -576,7 +638,7 @@ void MonCreateBoundaryAn::SetConeA()
       (_BoundaryAnZcone2 != SpinBox_Cone_Z2->value())  ||
       (_BoundaryAnRayon2 != SpinBox_Cone_V2->value()) )
   {
-    MESSAGE("Stockage et conversion")
+    MESSAGE("Stockage et conversion");
     _BoundaryAnXcone1 = SpinBox_Cone_X1->value() ;
     _BoundaryAnYcone1 = SpinBox_Cone_Y1->value() ;
     _BoundaryAnZcone1 = SpinBox_Cone_Z1->value() ;
@@ -590,21 +652,21 @@ void MonCreateBoundaryAn::SetConeA()
 //
   _Type=3;
 //
-  TLCone_X1->setText(QApplication::translate("CreateBoundaryAn", "X axis", 0, QApplication::UnicodeUTF8));
+  TLCone_X1->setText(QApplication::translate("CreateBoundaryAn", "X axis", 0));
   SpinBox_Cone_X1->setValue(_BoundaryAnXaxisCone);
-  TLCone_Y1->setText(QApplication::translate("CreateBoundaryAn", "Y axis", 0, QApplication::UnicodeUTF8));
+  TLCone_Y1->setText(QApplication::translate("CreateBoundaryAn", "Y axis", 0));
   SpinBox_Cone_Y1->setValue(_BoundaryAnYaxisCone);
-  TLCone_Z1->setText(QApplication::translate("CreateBoundaryAn", "Z axis", 0, QApplication::UnicodeUTF8));
+  TLCone_Z1->setText(QApplication::translate("CreateBoundaryAn", "Z axis", 0));
   SpinBox_Cone_Z1->setValue(_BoundaryAnZaxisCone);
 //
-  TLCone_X2->setText(QApplication::translate("CreateBoundaryAn", "X centre", 0, QApplication::UnicodeUTF8));
+  TLCone_X2->setText(QApplication::translate("CreateBoundaryAn", "X centre", 0));
   SpinBox_Cone_X2->setValue(_BoundaryAnXorigCone);
-  TLCone_Y2->setText(QApplication::translate("CreateBoundaryAn", "Y centre", 0, QApplication::UnicodeUTF8));
+  TLCone_Y2->setText(QApplication::translate("CreateBoundaryAn", "Y centre", 0));
   SpinBox_Cone_Y2->setValue(_BoundaryAnYorigCone);
-  TLCone_Z2->setText(QApplication::translate("CreateBoundaryAn", "Z centre", 0, QApplication::UnicodeUTF8));
+  TLCone_Z2->setText(QApplication::translate("CreateBoundaryAn", "Z centre", 0));
   SpinBox_Cone_Z2->setValue(_BoundaryAnZorigCone);
 //
-  TLCone_V1->setText(QApplication::translate("CreateBoundaryAn", "Angle", 0, QApplication::UnicodeUTF8));
+  TLCone_V1->setText(QApplication::translate("CreateBoundaryAn", "Angle", 0));
   SpinBox_Cone_V1->setValue(_BoundaryAngle);
   SpinBox_Cone_V1->setSingleStep(1.);
   SpinBox_Cone_V1->setMaximum(90.);
@@ -619,12 +681,12 @@ void MonCreateBoundaryAn::SetConeA()
 void MonCreateBoundaryAn::SetCone()
 // ------------------------------------------------------------------------
 {
-  MESSAGE("Debut de SetCone")
+  MESSAGE("Debut de SetCone");
   gBCylindre->setVisible(0);
   gBSphere->setVisible(0);
   gBCone->setVisible(1);
+  gBTore->setVisible(0);
 //
-  adjustSize();
   if ( RB_Def_radius->isChecked() )
   {
     SetConeR();
@@ -633,16 +695,33 @@ void MonCreateBoundaryAn::SetCone()
   {
     SetConeA();
   }
+//
+  adjustSize();
 //   MESSAGE("Fin de SetCone")
 }
 // ------------------------------------------------------------------------
+void MonCreateBoundaryAn::SetTore()
+// ------------------------------------------------------------------------
+{
+  MESSAGE("Debut de SetTore");
+  gBCylindre->setVisible(0);
+  gBSphere->setVisible(0);
+  gBCone->setVisible(0);
+  gBTore->setVisible(1);
+//
+  _Type=5;
+//
+  adjustSize();
+//   MESSAGE("Fin de SetTore")
+}
+// ------------------------------------------------------------------------
 void MonCreateBoundaryAn::convertRayonAngle(int option)
 // ------------------------------------------------------------------------
 // Conversion entre les deux formulations du cone :
 // par deux rayons ou avec un axe et un angle.
 // Voir sfcoi1 de HOMARD
 {
-  MESSAGE("Debut de convertRayonAngle, option = "<<option)
+  MESSAGE("Debut de convertRayonAngle, option = "<<option);
 //
 //         o
 //         !    .