Salome HOME
Merge relevant changes from V8_0_0_BR branch
[modules/homard.git] / src / HOMARDGUI / MonCreateBoundaryAn.cxx
index 21a0b2fab9b0d5169b5dd6c077af3d078113fd0b..034195636678376f12b1173f5bc12ec588a6826d 100644 (file)
@@ -1,9 +1,9 @@
-// #Copyright (C) 2011-2013  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
 // 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
@@ -17,8 +17,6 @@
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
-using namespace std;
-
 #include "MonCreateBoundaryAn.h"
 #include "MonCreateCase.h"
 
@@ -38,6 +36,8 @@ using namespace std;
 
 #include "math.h"
 #define PI 3.141592653589793
+
+using namespace std;
 // ------------------------------------------------------------------------------------------------------------------------
 MonCreateBoundaryAn::MonCreateBoundaryAn(MonCreateCase* parent, bool modal,
                              HOMARD::HOMARD_Gen_var myHomardGen0,
@@ -60,6 +60,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 +71,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( );
 
@@ -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()
@@ -280,12 +311,12 @@ bool MonCreateBoundaryAn::PushOnApply()
   {
       case 1 : // il s agit d un cylindre
       {
-        if ((_BoundaryAnXcentre != SpinBox_Xcent->value())  or
-            (_BoundaryAnYcentre != SpinBox_Ycent->value())  or
-            (_BoundaryAnZcentre != SpinBox_Zcent->value())  or
-            (_BoundaryAnRayon   != SpinBox_Radius->value()) or
-            (_BoundaryAnXaxis   != SpinBox_Xaxis->value()) or
-            (_BoundaryAnYaxis   != SpinBox_Yaxis->value()) or
+        if ((_BoundaryAnXcentre != SpinBox_Xcent->value())  ||
+            (_BoundaryAnYcentre != SpinBox_Ycent->value())  ||
+            (_BoundaryAnZcentre != SpinBox_Zcent->value())  ||
+            (_BoundaryAnRayon   != SpinBox_Radius->value()) ||
+            (_BoundaryAnXaxis   != SpinBox_Xaxis->value()) ||
+            (_BoundaryAnYaxis   != SpinBox_Yaxis->value()) ||
             (_BoundaryAnZaxis   != SpinBox_Zaxis->value()) )
         {
           Chgt = true;
@@ -302,9 +333,9 @@ bool MonCreateBoundaryAn::PushOnApply()
 
       case 2 : // il s agit d une sphere
       {
-        if ((_BoundaryAnXcentre != SpinBox_Xcentre->value()) or
-            (_BoundaryAnYcentre != SpinBox_Ycentre->value()) or
-            (_BoundaryAnZcentre != SpinBox_Zcentre->value()) or
+        if ((_BoundaryAnXcentre != SpinBox_Xcentre->value()) ||
+            (_BoundaryAnYcentre != SpinBox_Ycentre->value()) ||
+            (_BoundaryAnZcentre != SpinBox_Zcentre->value()) ||
             (_BoundaryAnRayon   != SpinBox_Rayon->value())  )
         {
            Chgt = true;
@@ -318,12 +349,12 @@ bool MonCreateBoundaryAn::PushOnApply()
 
       case 3 : // il s agit d un cone defini par un axe et un angle
       {
-        if ((_BoundaryAnXaxisCone != SpinBox_Cone_X1->value())  or
-            (_BoundaryAnYaxisCone != SpinBox_Cone_Y1->value())  or
-            (_BoundaryAnZaxisCone != SpinBox_Cone_Z1->value())  or
-            (_BoundaryAnXorigCone != SpinBox_Cone_X2->value())  or
-            (_BoundaryAnYorigCone != SpinBox_Cone_Y2->value())  or
-            (_BoundaryAnZorigCone != SpinBox_Cone_Z2->value())  or
+        if ((_BoundaryAnXaxisCone != SpinBox_Cone_X1->value())  ||
+            (_BoundaryAnYaxisCone != SpinBox_Cone_Y1->value())  ||
+            (_BoundaryAnZaxisCone != SpinBox_Cone_Z1->value())  ||
+            (_BoundaryAnXorigCone != SpinBox_Cone_X2->value())  ||
+            (_BoundaryAnYorigCone != SpinBox_Cone_Y2->value())  ||
+            (_BoundaryAnZorigCone != SpinBox_Cone_Z2->value())  ||
             (_BoundaryAngle       != SpinBox_Cone_V1->value()) )
         {
            Chgt = true;
@@ -340,13 +371,13 @@ bool MonCreateBoundaryAn::PushOnApply()
 
       case 4 : // il s agit d un cone defini par les 2 rayons
       {
-        if ((_BoundaryAnXcone1 != SpinBox_Cone_X1->value())  or
-            (_BoundaryAnYcone1 != SpinBox_Cone_Y1->value())  or
-            (_BoundaryAnZcone1 != SpinBox_Cone_Z1->value())  or
-            (_BoundaryAnRayon1 != SpinBox_Cone_V1->value())  or
-            (_BoundaryAnXcone2 != SpinBox_Cone_X2->value())  or
-            (_BoundaryAnYcone2 != SpinBox_Cone_Y2->value())  or
-            (_BoundaryAnZcone2 != SpinBox_Cone_Z2->value())  or
+        if ((_BoundaryAnXcone1 != SpinBox_Cone_X1->value())  ||
+            (_BoundaryAnYcone1 != SpinBox_Cone_Y1->value())  ||
+            (_BoundaryAnZcone1 != SpinBox_Cone_Z1->value())  ||
+            (_BoundaryAnRayon1 != SpinBox_Cone_V1->value())  ||
+            (_BoundaryAnXcone2 != SpinBox_Cone_X2->value())  ||
+            (_BoundaryAnYcone2 != SpinBox_Cone_Y2->value())  ||
+            (_BoundaryAnZcone2 != SpinBox_Cone_Z2->value())  ||
             (_BoundaryAnRayon2 != SpinBox_Cone_V2->value()) )
         {
            Chgt = true;
@@ -361,6 +392,30 @@ 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;
+      }
+
  }
 
   bool bOK = CreateOrUpdateBoundaryAn();
@@ -440,6 +495,21 @@ bool MonCreateBoundaryAn:: CreateOrUpdateBoundaryAn()
       }
       break;
     }
+   case 5 : // il s agit d un tore
+    {
+      try
+      {
+        aBoundaryAn = myHomardGen->CreateBoundaryTorus(CORBA::string_dup(_aName.toStdString().c_str()), \
+        _BoundaryAnToreXcentre, _BoundaryAnToreYcentre, _BoundaryAnToreZcentre, _BoundaryAnToreXaxe, _BoundaryAnToreYaxe, _BoundaryAnToreZaxe, _BoundaryAnToreRRev, _BoundaryAnToreRPri );
+      }
+      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;
+    }
   }
   _parent->AddBoundaryAn(_aName);
 
@@ -455,7 +525,8 @@ void MonCreateBoundaryAn::PushOnOK()
 void MonCreateBoundaryAn::PushOnHelp()
 // ------------------------------------------------------------------------
 {
-  HOMARD_UTILS::PushOnHelp(QString("gui_create_boundary.html"), QString("un-cylindre") ) ;
+  std::string LanguageShort = myHomardGen->GetLanguageShort();
+  HOMARD_UTILS::PushOnHelp(QString("gui_create_boundary.html"), QString("un-cylindre"), QString(LanguageShort.c_str()));
 }
 
 // -----------------------------------
@@ -474,9 +545,9 @@ void MonCreateBoundaryAn::SetNewName()
     {
       if ( aName ==  QString(MyObjects[i]))
       {
-          num=num+1;
-          aName="";
-          break;
+        num ++ ;
+        aName = "" ;
+        break ;
       }
    }
   }
@@ -490,8 +561,11 @@ void MonCreateBoundaryAn::SetCylinder()
   gBCylindre->setVisible(1);
   gBSphere->setVisible(0);
   gBCone->setVisible(0);
-  adjustSize();
+  gBTore->setVisible(0);
+//
   _Type=1;
+//
+  adjustSize();
 //   MESSAGE("Fin de SetCylinder")
 }
 // ------------------------------------------------------------------------
@@ -502,8 +576,11 @@ void MonCreateBoundaryAn::SetSphere()
   gBCylindre->setVisible(0);
   gBSphere->setVisible(1);
   gBCone->setVisible(0);
-  adjustSize();
+  gBTore->setVisible(0);
+//
   _Type=2;
+//
+  adjustSize();
 //   MESSAGE("Fin de SetSphere")
 }
 // ------------------------------------------------------------------------
@@ -513,12 +590,12 @@ void MonCreateBoundaryAn::SetConeR()
   MESSAGE("Debut de SetConeR")
 //
 // Stockage et conversion des valeurs si elles ont change
-  if ((_BoundaryAnXaxisCone != SpinBox_Cone_X1->value())  or
-      (_BoundaryAnYaxisCone != SpinBox_Cone_Y1->value())  or
-      (_BoundaryAnZaxisCone != SpinBox_Cone_Z1->value())  or
-      (_BoundaryAnXorigCone != SpinBox_Cone_X2->value())  or
-      (_BoundaryAnYorigCone != SpinBox_Cone_Y2->value())  or
-      (_BoundaryAnZorigCone != SpinBox_Cone_Z2->value())  or
+  if ((_BoundaryAnXaxisCone != SpinBox_Cone_X1->value())  ||
+      (_BoundaryAnYaxisCone != SpinBox_Cone_Y1->value())  ||
+      (_BoundaryAnZaxisCone != SpinBox_Cone_Z1->value())  ||
+      (_BoundaryAnXorigCone != SpinBox_Cone_X2->value())  ||
+      (_BoundaryAnYorigCone != SpinBox_Cone_Y2->value())  ||
+      (_BoundaryAnZorigCone != SpinBox_Cone_Z2->value())  ||
       (_BoundaryAngle       != SpinBox_Cone_V1->value()) )
   {
     MESSAGE("Stockage et conversion")
@@ -534,28 +611,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")
@@ -566,13 +643,13 @@ void MonCreateBoundaryAn::SetConeA()
 {
   MESSAGE("Debut de SetConeA")
 // Stockage et conversion des valeurs si elles ont change
-  if ((_BoundaryAnXcone1 != SpinBox_Cone_X1->value())  or
-      (_BoundaryAnYcone1 != SpinBox_Cone_Y1->value())  or
-      (_BoundaryAnZcone1 != SpinBox_Cone_Z1->value())  or
-      (_BoundaryAnRayon1 != SpinBox_Cone_V1->value())  or
-      (_BoundaryAnXcone2 != SpinBox_Cone_X2->value())  or
-      (_BoundaryAnYcone2 != SpinBox_Cone_Y2->value())  or
-      (_BoundaryAnZcone2 != SpinBox_Cone_Z2->value())  or
+  if ((_BoundaryAnXcone1 != SpinBox_Cone_X1->value())  ||
+      (_BoundaryAnYcone1 != SpinBox_Cone_Y1->value())  ||
+      (_BoundaryAnZcone1 != SpinBox_Cone_Z1->value())  ||
+      (_BoundaryAnRayon1 != SpinBox_Cone_V1->value())  ||
+      (_BoundaryAnXcone2 != SpinBox_Cone_X2->value())  ||
+      (_BoundaryAnYcone2 != SpinBox_Cone_Y2->value())  ||
+      (_BoundaryAnZcone2 != SpinBox_Cone_Z2->value())  ||
       (_BoundaryAnRayon2 != SpinBox_Cone_V2->value()) )
   {
     MESSAGE("Stockage et conversion")
@@ -589,21 +666,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.);
@@ -622,8 +699,8 @@ void MonCreateBoundaryAn::SetCone()
   gBCylindre->setVisible(0);
   gBSphere->setVisible(0);
   gBCone->setVisible(1);
+  gBTore->setVisible(0);
 //
-  adjustSize();
   if ( RB_Def_radius->isChecked() )
   {
     SetConeR();
@@ -632,9 +709,26 @@ 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 :