1 // Copyright (C) 2011-2021 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #include "SMESHGUI_HomardBoundaryDlg.h"
22 #include "SMESHGUI_HomardAdaptDlg.h"
23 #include "SMESHGUI_HomardListGroup.h"
25 #include "SMESHGUI_Utils.h"
27 #include <QFileDialog>
28 #include <QMessageBox>
30 #include "SalomeApp_Tools.h"
31 #include "SMESHGUI_HomardUtils.h"
32 #include <utilities.h>
34 #include <SUIT_Desktop.h>
35 #include <SUIT_MessageBox.h>
36 #include <SUIT_ResourceMgr.h>
37 #include <SUIT_Session.h>
38 #include <SUIT_ViewManager.h>
41 #define PI 3.141592653589793
45 // ----------------------------------------------------------------------------------
46 SMESH_CreateBoundaryAn::SMESH_CreateBoundaryAn(SMESHGUI_HomardAdaptDlg* parent, bool modal,
47 SMESHHOMARD::HOMARD_Gen_var myHomardGen0,
49 /* Constructs a SMESH_CreateBoundaryAn
50 appele pour une vraie creation
51 initialise un cylindre et non une sphere
53 QDialog(0), SMESH_Ui_CreateBoundaryAn(),
58 _BoundaryAnXcentre(0), _BoundaryAnYcentre(0), _BoundaryAnZcentre(0), _BoundaryAnRayon(0),
59 _BoundaryAnXaxis(0), _BoundaryAnYaxis(0), _BoundaryAnZaxis(0),
60 _Xcentre(0), _Ycentre(0), _Zcentre(0), _Rayon(0),
61 _Xmin(0), _Xmax(0), _Xincr(0), _Ymin(0), _Ymax(0), _Yincr(0), _Zmin(0), _Zmax(0), _Zincr(0), _DMax(0),
62 _BoundaryAnXcone1(0), _BoundaryAnYcone1(0), _BoundaryAnZcone1(0), _BoundaryAnRayon1(0),
63 _BoundaryAnXcone2(0), _BoundaryAnYcone2(0), _BoundaryAnZcone2(0), _BoundaryAnRayon2(0),
64 _BoundaryAnXaxisCone(0), _BoundaryAnYaxisCone(0), _BoundaryAnZaxisCone(0),
65 _BoundaryAnXorigCone(0), _BoundaryAnYorigCone(0), _BoundaryAnZorigCone(0),
67 _BoundaryAnToreXcentre(0), _BoundaryAnToreYcentre(0), _BoundaryAnToreZcentre(0),
68 _BoundaryAnToreXaxe(0), _BoundaryAnToreYaxe(0), _BoundaryAnToreZaxe(0),
69 _BoundaryAnToreRRev(0), _BoundaryAnToreRPri(0),
72 MESSAGE("Constructeur") ;
73 myHomardGen = SMESHHOMARD::HOMARD_Gen::_duplicate(myHomardGen0);
80 SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
81 pix = resMgr->loadPixmap( "HOMARD", "spherepoint.png" );
83 RBSphere->setIcon(IS);
84 pix = resMgr->loadPixmap( "HOMARD", "cylinderpointvector.png" );
86 RBCylindre->setIcon(IS);
87 pix = resMgr->loadPixmap( "HOMARD", "cone.png" );
90 pix = resMgr->loadPixmap( "HOMARD", "conepointvector.png" );
92 RB_Def_angle->setIcon(IS);
93 pix = resMgr->loadPixmap( "HOMARD", "conedxyz.png" );
95 RB_Def_radius->setIcon(IS);
96 pix = resMgr->loadPixmap( "HOMARD", "toruspointvector.png" );
103 InitValBoundaryAn(); // Cherche les valeurs de la boite englobante le maillage
104 InitMinMax(); // Initialise les bornes des boutons
105 SetCylinder(); // Propose un cylindre en premier choix
108 // -------------------------------------------------------------------------------
109 SMESH_CreateBoundaryAn::SMESH_CreateBoundaryAn(SMESHGUI_HomardAdaptDlg* parent,
110 SMESHHOMARD::HOMARD_Gen_var myHomardGen0,
112 QDialog(0), SMESH_Ui_CreateBoundaryAn(),
115 _aCaseName(caseName),
117 _BoundaryAnXcentre(0), _BoundaryAnYcentre(0), _BoundaryAnZcentre(0), _BoundaryAnRayon(0),
118 _BoundaryAnXaxis(0), _BoundaryAnYaxis(0), _BoundaryAnZaxis(0),
119 // Pour affichage lors de l edition d une BoundaryAn sans nom de Cas
120 _Xcentre(0), _Ycentre(0), _Zcentre(0), _Rayon(0),
121 _Xmin(1), _Xmax(1), _Xincr(1), _Ymin(1), _Ymax(1), _Yincr(1), _Zmin(1), _Zmax(1), _Zincr(1), _DMax(1),
123 myHomardGen(myHomardGen0)
125 // MESSAGE("Debut de SMESH_CreateBoundaryAn")
127 SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
128 QPixmap pix = resMgr->loadPixmap( "HOMARD", "spherepoint.png" );
130 RBSphere->setIcon(IS);
131 QPixmap pix2 = resMgr->loadPixmap( "HOMARD", "cylinderpointvector.png" );
132 QIcon IS2=QIcon(pix2);
133 RBCylindre->setIcon(IS2);
134 QPixmap pix3 = resMgr->loadPixmap( "HOMARD", "cone.png" );
135 QIcon IS3=QIcon(pix3);
136 RBCone->setIcon(IS3);
137 QPixmap pix4 = resMgr->loadPixmap( "HOMARD", "conepointvector.png" );
138 QIcon IS4=QIcon(pix4);
139 RB_Def_angle->setIcon(IS4);
140 QPixmap pix5 = resMgr->loadPixmap( "HOMARD", "conedxyz.png" );
141 QIcon IS5=QIcon(pix5);
142 RB_Def_radius->setIcon(IS5);
147 // ------------------------------------------------------------------------
148 SMESH_CreateBoundaryAn::~SMESH_CreateBoundaryAn()
149 // ------------------------------------------------------------------------
151 // no need to delete child widgets, Qt does it all for us
153 // ------------------------------------------------------------------------
154 void SMESH_CreateBoundaryAn::InitConnect()
155 // ------------------------------------------------------------------------
157 connect( RBCylindre, SIGNAL(clicked()) , this, SLOT(SetCylinder()) ) ;
158 connect( RBSphere, SIGNAL(clicked()) , this, SLOT(SetSphere()) ) ;
159 connect( RBCone, SIGNAL(clicked()) , this, SLOT(SetCone()) ) ;
160 connect( RB_Def_radius, SIGNAL(clicked()) , this, SLOT(SetConeR()) );
161 connect( RB_Def_angle, SIGNAL(clicked()) , this, SLOT(SetConeA()) );
162 connect( RBTore, SIGNAL(clicked()) , this, SLOT(SetTore()) ) ;
163 connect( buttonOk, SIGNAL( pressed() ), this, SLOT( PushOnOK() ) );
164 connect( buttonApply, SIGNAL( pressed() ), this, SLOT( PushOnApply() ) );
165 connect( buttonCancel, SIGNAL( pressed() ), this, SLOT( close() ) );
166 connect( buttonHelp, SIGNAL( pressed() ), this, SLOT( PushOnHelp() ) );
168 // ------------------------------------------------------------------------
169 void SMESH_CreateBoundaryAn::InitValBoundaryAn()
170 // ------------------------------------------------------------------------
173 // 1. Les coordonnees extremes du maillage
175 if (_aCaseName == QString("")) { return; }
177 SMESHHOMARD::HOMARD_Cas_var aCas = myHomardGen->GetCase(_aCaseName.toStdString().c_str());
178 SMESHHOMARD::extrema_var MesExtremes = aCas->GetBoundingBox();
179 int num = MesExtremes->length() ;
181 _Xmin=MesExtremes[0]; _Xmax=MesExtremes[1]; _Xincr=MesExtremes[2];
182 _Ymin=MesExtremes[3]; _Ymax=MesExtremes[4]; _Yincr=MesExtremes[5];
183 _Zmin=MesExtremes[6]; _Zmax=MesExtremes[7]; _Zincr=MesExtremes[8];
184 _DMax=MesExtremes[9];
185 MESSAGE ("_Xmin : " << _Xmin << " _Xmax : " << _Xmax << " _Xincr : " << _Xincr ) ;
186 MESSAGE ("_Ymin : " << _Ymin << " _Ymax : " << _Ymax << " _Yincr : " << _Yincr ) ;
187 MESSAGE ("_Zmin : " << _Zmin << " _Zmax : " << _Zmax << " _Zincr : " << _Zincr) ;
188 MESSAGE ("_DMax : " << _DMax);
190 // 2. Caracteristiques des frontieres
192 _Xcentre=(_Xmin + _Xmax)/2.;
194 _Ycentre=(_Ymin + _Ymax)/2.;
196 _Zcentre=(_Zmin + _Zmax)/2.;
201 // ------------------------------------------------------------------------
202 void SMESH_CreateBoundaryAn::InitMinMax()
203 // ------------------------------------------------------------------------
207 SpinBox_Xcent->setValue(_Xcentre);
208 SpinBox_Xcent->setSingleStep(_Xincr);
210 SpinBox_Ycent->setValue(_Ycentre);
211 SpinBox_Ycent->setSingleStep(_Yincr);
213 SpinBox_Zcent->setValue(_Zcentre);
214 SpinBox_Zcent->setSingleStep(_Zincr);
216 SpinBox_Xaxis->setValue(0.);
217 SpinBox_Xaxis->setSingleStep(0.1);
219 SpinBox_Yaxis->setValue(0.);
220 SpinBox_Yaxis->setSingleStep(0.1);
222 SpinBox_Zaxis->setValue(1.);
223 SpinBox_Zaxis->setSingleStep(0.1);
225 SpinBox_Radius->setValue(_Rayon);
226 SpinBox_Radius->setSingleStep(_Rayon/10.);
230 SpinBox_Xcentre->setValue(_Xcentre);
231 SpinBox_Xcentre->setSingleStep(_Xincr);
233 SpinBox_Ycentre->setValue(_Ycentre);
234 SpinBox_Ycentre->setSingleStep(_Yincr);
236 SpinBox_Zcentre->setValue(_Zcentre);
237 SpinBox_Zcentre->setSingleStep(_Zincr);
239 SpinBox_Rayon->setValue(_Rayon);
240 SpinBox_Rayon->setSingleStep(_Rayon/10.);
244 _BoundaryAnXcone1 = _Xcentre ;
245 SpinBox_Cone_X1->setSingleStep(_Xincr);
246 _BoundaryAnXcone2 = _Xcentre ;
247 SpinBox_Cone_X2->setSingleStep(_Xincr);
249 _BoundaryAnYcone1 = _Ycentre ;
250 SpinBox_Cone_Y1->setSingleStep(_Yincr);
251 _BoundaryAnYcone2 = _Ycentre ;
252 SpinBox_Cone_Y2->setSingleStep(_Yincr);
254 _BoundaryAnZcone1 = _Zmin ;
255 SpinBox_Cone_Z1->setSingleStep(_Zincr);
256 _BoundaryAnZcone2 = _Zmax ;
257 SpinBox_Cone_Z2->setSingleStep(_Zincr);
259 _BoundaryAnRayon1 = 0. ;
260 _BoundaryAnRayon2 = _Rayon ;
261 SpinBox_Cone_V2->setSingleStep(_Rayon/10.);
264 convertRayonAngle(1) ;
265 SpinBox_Cone_X1->setValue(_BoundaryAnXaxisCone);
266 SpinBox_Cone_Y1->setValue(_BoundaryAnYaxisCone);
267 SpinBox_Cone_Z1->setValue(_BoundaryAnZaxisCone);
268 SpinBox_Cone_V1->setValue(_BoundaryAngle);
269 SpinBox_Cone_X2->setValue(_BoundaryAnXorigCone);
270 SpinBox_Cone_Y2->setValue(_BoundaryAnYorigCone);
271 SpinBox_Cone_Z2->setValue(_BoundaryAnZorigCone);
275 SpinBoxToreXcent->setValue(_Xcentre);
276 SpinBoxToreXcent->setSingleStep(_Xincr);
278 SpinBoxToreYcent->setValue(_Ycentre);
279 SpinBoxToreYcent->setSingleStep(_Yincr);
281 SpinBoxToreZcent->setValue(_Zcentre);
282 SpinBoxToreZcent->setSingleStep(_Zincr);
284 SpinBoxToreXaxe->setValue(0.);
285 SpinBoxToreXaxe->setSingleStep(0.1);
287 SpinBoxToreYaxe->setValue(0.);
288 SpinBoxToreYaxe->setSingleStep(0.1);
290 SpinBoxToreZaxe->setValue(1.);
291 SpinBoxToreZaxe->setSingleStep(0.1);
292 // . Rayon de revolution
293 SpinBoxToreRRev->setValue(_Rayon);
294 SpinBoxToreRRev->setSingleStep(_Rayon/10.);
296 SpinBoxToreRPri->setValue(_Rayon/3.);
297 SpinBoxToreRPri->setSingleStep(_Rayon/20.);
299 // ------------------------------------------------------------------------
300 bool SMESH_CreateBoundaryAn::PushOnApply()
301 // ------------------------------------------------------------------------
302 // Appele lorsque l'un des boutons Ok ou Apply est presse
305 if (LEName->text().trimmed()=="")
307 QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
308 QObject::tr("HOM_BOUN_NAME") );
314 case 1 : // il s agit d un cylindre
316 if ((_BoundaryAnXcentre != SpinBox_Xcent->value()) ||
317 (_BoundaryAnYcentre != SpinBox_Ycent->value()) ||
318 (_BoundaryAnZcentre != SpinBox_Zcent->value()) ||
319 (_BoundaryAnRayon != SpinBox_Radius->value()) ||
320 (_BoundaryAnXaxis != SpinBox_Xaxis->value()) ||
321 (_BoundaryAnYaxis != SpinBox_Yaxis->value()) ||
322 (_BoundaryAnZaxis != SpinBox_Zaxis->value()) )
325 _BoundaryAnXaxis= SpinBox_Xaxis->value();
326 _BoundaryAnYaxis= SpinBox_Yaxis->value();
327 _BoundaryAnZaxis= SpinBox_Zaxis->value();
328 _BoundaryAnXcentre=SpinBox_Xcent->value();
329 _BoundaryAnYcentre=SpinBox_Ycent->value();
330 _BoundaryAnZcentre=SpinBox_Zcent->value();
331 _BoundaryAnRayon=SpinBox_Radius->value();
336 case 2 : // il s agit d une sphere
338 if ((_BoundaryAnXcentre != SpinBox_Xcentre->value()) ||
339 (_BoundaryAnYcentre != SpinBox_Ycentre->value()) ||
340 (_BoundaryAnZcentre != SpinBox_Zcentre->value()) ||
341 (_BoundaryAnRayon != SpinBox_Rayon->value()) )
344 _BoundaryAnXcentre=SpinBox_Xcentre->value();
345 _BoundaryAnYcentre=SpinBox_Ycentre->value();
346 _BoundaryAnZcentre=SpinBox_Zcentre->value();
347 _BoundaryAnRayon=SpinBox_Rayon->value();
352 case 3 : // il s agit d un cone defini par un axe et un angle
354 if ((_BoundaryAnXaxisCone != SpinBox_Cone_X1->value()) ||
355 (_BoundaryAnYaxisCone != SpinBox_Cone_Y1->value()) ||
356 (_BoundaryAnZaxisCone != SpinBox_Cone_Z1->value()) ||
357 (_BoundaryAnXorigCone != SpinBox_Cone_X2->value()) ||
358 (_BoundaryAnYorigCone != SpinBox_Cone_Y2->value()) ||
359 (_BoundaryAnZorigCone != SpinBox_Cone_Z2->value()) ||
360 (_BoundaryAngle != SpinBox_Cone_V1->value()) )
363 _BoundaryAnXaxisCone = SpinBox_Cone_X1->value() ;
364 _BoundaryAnYaxisCone = SpinBox_Cone_Y1->value() ;
365 _BoundaryAnZaxisCone = SpinBox_Cone_Z1->value() ;
366 _BoundaryAnXorigCone = SpinBox_Cone_X2->value() ;
367 _BoundaryAnYorigCone = SpinBox_Cone_Y2->value() ;
368 _BoundaryAnZorigCone = SpinBox_Cone_Z2->value() ;
369 _BoundaryAngle = SpinBox_Cone_V1->value() ;
374 case 4 : // il s agit d un cone defini par les 2 rayons
376 if ((_BoundaryAnXcone1 != SpinBox_Cone_X1->value()) ||
377 (_BoundaryAnYcone1 != SpinBox_Cone_Y1->value()) ||
378 (_BoundaryAnZcone1 != SpinBox_Cone_Z1->value()) ||
379 (_BoundaryAnRayon1 != SpinBox_Cone_V1->value()) ||
380 (_BoundaryAnXcone2 != SpinBox_Cone_X2->value()) ||
381 (_BoundaryAnYcone2 != SpinBox_Cone_Y2->value()) ||
382 (_BoundaryAnZcone2 != SpinBox_Cone_Z2->value()) ||
383 (_BoundaryAnRayon2 != SpinBox_Cone_V2->value()) )
386 _BoundaryAnXcone1 = SpinBox_Cone_X1->value() ;
387 _BoundaryAnYcone1 = SpinBox_Cone_Y1->value() ;
388 _BoundaryAnZcone1 = SpinBox_Cone_Z1->value() ;
389 _BoundaryAnRayon1 = SpinBox_Cone_V1->value() ;
390 _BoundaryAnXcone2 = SpinBox_Cone_X2->value() ;
391 _BoundaryAnYcone2 = SpinBox_Cone_Y2->value() ;
392 _BoundaryAnZcone2 = SpinBox_Cone_Z2->value() ;
393 _BoundaryAnRayon2 = SpinBox_Cone_V2->value() ;
397 case 5 : // il s agit d un tore
399 if ((_BoundaryAnToreXcentre != SpinBoxToreXcent->value()) ||
400 (_BoundaryAnToreYcentre != SpinBoxToreYcent->value()) ||
401 (_BoundaryAnToreZcentre != SpinBoxToreZcent->value()) ||
402 (_BoundaryAnToreRRev != SpinBoxToreRRev->value()) ||
403 (_BoundaryAnToreRPri != SpinBoxToreRPri->value()) ||
404 (_BoundaryAnToreXaxe != SpinBoxToreXaxe->value()) ||
405 (_BoundaryAnToreYaxe != SpinBoxToreYaxe->value()) ||
406 (_BoundaryAnToreZaxe != SpinBoxToreZaxe->value()) )
409 _BoundaryAnToreXcentre= SpinBoxToreXcent->value();
410 _BoundaryAnToreYcentre= SpinBoxToreYcent->value();
411 _BoundaryAnToreZcentre= SpinBoxToreZcent->value();
412 _BoundaryAnToreRRev=SpinBoxToreRRev->value();
413 _BoundaryAnToreRPri=SpinBoxToreRPri->value();
414 _BoundaryAnToreXaxe=SpinBoxToreXaxe->value();
415 _BoundaryAnToreYaxe=SpinBoxToreYaxe->value();
416 _BoundaryAnToreZaxe=SpinBoxToreZaxe->value();
424 // L'axe pour un cylindre
427 double daux = _BoundaryAnXaxis*_BoundaryAnXaxis + _BoundaryAnYaxis*_BoundaryAnYaxis + _BoundaryAnZaxis*_BoundaryAnZaxis ;
428 if ( daux < 0.0000001 )
430 QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
431 QObject::tr("HOM_AXE") );
437 // Création ou mise à jour de la frontière
439 bool bOK = CreateOrUpdateBoundaryAn();
441 //if ( bOK ) { HOMARD_UTILS::updateObjBrowser() ; }
446 // ---------------------------------------------------
447 bool SMESH_CreateBoundaryAn::CreateOrUpdateBoundaryAn()
448 //----------------------------------------------------
449 // Creation de l'objet boundary
451 MESSAGE("Debut de CreateOrUpdateBoundaryAn avec _Type ="<<_Type<<", _Name ="<<_Name.toStdString().c_str()<<" et LEName ="<<LEName->text().trimmed().toStdString().c_str());
453 if (_Name != LEName->text().trimmed())
455 _Name = LEName->text().trimmed() ;
460 case 1 : // il s agit d un cylindre
461 { aBoundaryAn = myHomardGen->CreateBoundaryCylinder(CORBA::string_dup(_Name.toStdString().c_str()), \
462 _BoundaryAnXcentre, _BoundaryAnYcentre, _BoundaryAnZcentre, _BoundaryAnXaxis, _BoundaryAnYaxis, _BoundaryAnZaxis, _BoundaryAnRayon );
465 case 2 : // il s agit d une sphere
466 { aBoundaryAn = myHomardGen->CreateBoundarySphere(CORBA::string_dup(_Name.toStdString().c_str()), \
467 _BoundaryAnXcentre, _BoundaryAnYcentre, _BoundaryAnZcentre, _BoundaryAnRayon);
470 case 3 : // il s agit d un cone defini par un axe et un angle
471 { aBoundaryAn = myHomardGen->CreateBoundaryConeA(CORBA::string_dup(_Name.toStdString().c_str()), \
472 _BoundaryAnXaxisCone, _BoundaryAnYaxisCone, _BoundaryAnZaxisCone, _BoundaryAngle, \
473 _BoundaryAnXorigCone, _BoundaryAnYorigCone, _BoundaryAnYorigCone);
476 case 4 : // il s agit d un cone defini par les 2 rayons
477 { aBoundaryAn = myHomardGen->CreateBoundaryConeR(CORBA::string_dup(_Name.toStdString().c_str()), \
478 _BoundaryAnXcone1, _BoundaryAnYcone1, _BoundaryAnZcone1, _BoundaryAnRayon1, \
479 _BoundaryAnXcone2, _BoundaryAnYcone2, _BoundaryAnZcone2, _BoundaryAnRayon2);
482 case 5 : // il s agit d un tore
483 { aBoundaryAn = myHomardGen->CreateBoundaryTorus(CORBA::string_dup(_Name.toStdString().c_str()), \
484 _BoundaryAnToreXcentre, _BoundaryAnToreYcentre, _BoundaryAnToreZcentre, _BoundaryAnToreXaxe, _BoundaryAnToreYaxe, _BoundaryAnToreZaxe, _BoundaryAnToreRRev, _BoundaryAnToreRPri );
489 catch( SALOME::SALOME_Exception& S_ex )
491 QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
492 QObject::tr(CORBA::string_dup(S_ex.details.text)) );
495 _parent->AddBoundaryAn(_Name);
500 QMessageBox::warning( 0, QObject::tr("HOM_WARNING"),
501 QObject::tr("HOM_SELECT_OBJECT_4") );
504 MESSAGE("Fin de CreateOrUpdateBoundaryAn");
506 // ------------------------------------------------------------------------
507 void SMESH_CreateBoundaryAn::PushOnOK()
508 // ------------------------------------------------------------------------
510 if (PushOnApply()) this->close();
512 // ------------------------------------------------------------------------
513 void SMESH_CreateBoundaryAn::PushOnHelp()
514 // ------------------------------------------------------------------------
516 SMESH::ShowHelpFile(QString("gui_create_boundary.html"));
517 //std::string LanguageShort = myHomardGen->GetLanguageShort();
518 //HOMARD_UTILS::PushOnHelp(QString("gui_create_boundary.html"), QString("un-cylindre"), QString(LanguageShort.c_str()));
521 // -----------------------------------
522 void SMESH_CreateBoundaryAn::SetNewName()
523 // -----------------------------------
525 // Recherche d'un nom par defaut qui n'existe pas encore
527 SMESHHOMARD::listeBoundarys_var MyObjects = myHomardGen->GetAllBoundarysName();
528 int num = 0; QString aName="";
531 aName.setNum(num+1) ;
532 aName.insert(0, QString("Boun_")) ;
533 for ( int i=0; i<MyObjects->length(); i++)
535 if ( aName == QString(MyObjects[i]))
543 LEName->setText(aName);
545 // ------------------------------------------------------------------------
546 void SMESH_CreateBoundaryAn::SetCylinder()
547 // ------------------------------------------------------------------------
549 MESSAGE("Debut de SetCylinder")
550 gBCylindre->setVisible(1);
551 gBSphere->setVisible(0);
552 gBCone->setVisible(0);
553 gBTore->setVisible(0);
558 // MESSAGE("Fin de SetCylinder")
560 // ------------------------------------------------------------------------
561 void SMESH_CreateBoundaryAn::SetSphere()
562 // ------------------------------------------------------------------------
564 MESSAGE("Debut de SetSphere")
565 gBCylindre->setVisible(0);
566 gBSphere->setVisible(1);
567 gBCone->setVisible(0);
568 gBTore->setVisible(0);
573 // MESSAGE("Fin de SetSphere")
575 // ------------------------------------------------------------------------
576 void SMESH_CreateBoundaryAn::SetConeR()
577 // ------------------------------------------------------------------------
579 MESSAGE("Debut de SetConeR")
581 // Stockage et conversion des valeurs si elles ont change
582 if ((_BoundaryAnXaxisCone != SpinBox_Cone_X1->value()) ||
583 (_BoundaryAnYaxisCone != SpinBox_Cone_Y1->value()) ||
584 (_BoundaryAnZaxisCone != SpinBox_Cone_Z1->value()) ||
585 (_BoundaryAnXorigCone != SpinBox_Cone_X2->value()) ||
586 (_BoundaryAnYorigCone != SpinBox_Cone_Y2->value()) ||
587 (_BoundaryAnZorigCone != SpinBox_Cone_Z2->value()) ||
588 (_BoundaryAngle != SpinBox_Cone_V1->value()) )
590 MESSAGE("Stockage et conversion")
591 _BoundaryAnXaxisCone = SpinBox_Cone_X1->value() ;
592 _BoundaryAnYaxisCone = SpinBox_Cone_Y1->value() ;
593 _BoundaryAnZaxisCone = SpinBox_Cone_Z1->value() ;
594 _BoundaryAnXorigCone = SpinBox_Cone_X2->value() ;
595 _BoundaryAnYorigCone = SpinBox_Cone_Y2->value() ;
596 _BoundaryAnZorigCone = SpinBox_Cone_Z2->value() ;
597 _BoundaryAngle = SpinBox_Cone_V1->value() ;
598 convertRayonAngle(-1) ;
603 TLCone_X1->setText(QApplication::translate("CreateBoundaryAn", "X centre 1", 0));
604 SpinBox_Cone_X1->setValue(_BoundaryAnXcone1);
605 TLCone_Y1->setText(QApplication::translate("CreateBoundaryAn", "Y centre 1", 0));
606 SpinBox_Cone_Y1->setValue(_BoundaryAnYcone1);
607 TLCone_Z1->setText(QApplication::translate("CreateBoundaryAn", "Z centre 1", 0));
608 SpinBox_Cone_Z1->setValue(_BoundaryAnZcone1);
610 TLCone_V1->setText(QApplication::translate("CreateBoundaryAn", "Radius 1", 0));
611 SpinBox_Cone_V1->setSingleStep(_Rayon/10.);
612 SpinBox_Cone_V1->setMaximum(100000.*_DMax);
613 SpinBox_Cone_V1->setValue(_BoundaryAnRayon1);
615 TLCone_X2->setText(QApplication::translate("CreateBoundaryAn", "X centre 2", 0));
616 SpinBox_Cone_X2->setValue(_BoundaryAnXcone2);
617 TLCone_Y2->setText(QApplication::translate("CreateBoundaryAn", "Y centre 2", 0));
618 SpinBox_Cone_Y2->setValue(_BoundaryAnYcone2);
619 TLCone_Z2->setText(QApplication::translate("CreateBoundaryAn", "Z centre 2", 0));
620 SpinBox_Cone_Z2->setValue(_BoundaryAnZcone2);
622 TLCone_V2->setVisible(1);
623 SpinBox_Cone_V2->setVisible(1);
624 TLCone_V2->setText(QApplication::translate("CreateBoundaryAn", "Radius 2", 0));
625 SpinBox_Cone_V2->setValue(_BoundaryAnRayon2);
627 // MESSAGE("Fin de SetConeR")
629 // ------------------------------------------------------------------------
630 void SMESH_CreateBoundaryAn::SetConeA()
631 // ------------------------------------------------------------------------
633 MESSAGE("Debut de SetConeA")
634 // Stockage et conversion des valeurs si elles ont change
635 if ((_BoundaryAnXcone1 != SpinBox_Cone_X1->value()) ||
636 (_BoundaryAnYcone1 != SpinBox_Cone_Y1->value()) ||
637 (_BoundaryAnZcone1 != SpinBox_Cone_Z1->value()) ||
638 (_BoundaryAnRayon1 != SpinBox_Cone_V1->value()) ||
639 (_BoundaryAnXcone2 != SpinBox_Cone_X2->value()) ||
640 (_BoundaryAnYcone2 != SpinBox_Cone_Y2->value()) ||
641 (_BoundaryAnZcone2 != SpinBox_Cone_Z2->value()) ||
642 (_BoundaryAnRayon2 != SpinBox_Cone_V2->value()) )
644 MESSAGE("Stockage et conversion")
645 _BoundaryAnXcone1 = SpinBox_Cone_X1->value() ;
646 _BoundaryAnYcone1 = SpinBox_Cone_Y1->value() ;
647 _BoundaryAnZcone1 = SpinBox_Cone_Z1->value() ;
648 _BoundaryAnRayon1 = SpinBox_Cone_V1->value() ;
649 _BoundaryAnXcone2 = SpinBox_Cone_X2->value() ;
650 _BoundaryAnYcone2 = SpinBox_Cone_Y2->value() ;
651 _BoundaryAnZcone2 = SpinBox_Cone_Z2->value() ;
652 _BoundaryAnRayon2 = SpinBox_Cone_V2->value() ;
653 convertRayonAngle(1) ;
658 TLCone_X1->setText(QApplication::translate("CreateBoundaryAn", "X axis", 0));
659 SpinBox_Cone_X1->setValue(_BoundaryAnXaxisCone);
660 TLCone_Y1->setText(QApplication::translate("CreateBoundaryAn", "Y axis", 0));
661 SpinBox_Cone_Y1->setValue(_BoundaryAnYaxisCone);
662 TLCone_Z1->setText(QApplication::translate("CreateBoundaryAn", "Z axis", 0));
663 SpinBox_Cone_Z1->setValue(_BoundaryAnZaxisCone);
665 TLCone_X2->setText(QApplication::translate("CreateBoundaryAn", "X centre", 0));
666 SpinBox_Cone_X2->setValue(_BoundaryAnXorigCone);
667 TLCone_Y2->setText(QApplication::translate("CreateBoundaryAn", "Y centre", 0));
668 SpinBox_Cone_Y2->setValue(_BoundaryAnYorigCone);
669 TLCone_Z2->setText(QApplication::translate("CreateBoundaryAn", "Z centre", 0));
670 SpinBox_Cone_Z2->setValue(_BoundaryAnZorigCone);
672 TLCone_V1->setText(QApplication::translate("CreateBoundaryAn", "Angle", 0));
673 SpinBox_Cone_V1->setValue(_BoundaryAngle);
674 SpinBox_Cone_V1->setSingleStep(1.);
675 SpinBox_Cone_V1->setMaximum(90.);
677 TLCone_V2->setVisible(0);
678 SpinBox_Cone_V2->setVisible(0);
679 // MESSAGE("Fin de SetConeA")
683 // ------------------------------------------------------------------------
684 void SMESH_CreateBoundaryAn::SetCone()
685 // ------------------------------------------------------------------------
687 MESSAGE("Debut de SetCone")
688 gBCylindre->setVisible(0);
689 gBSphere->setVisible(0);
690 gBCone->setVisible(1);
691 gBTore->setVisible(0);
693 if ( RB_Def_radius->isChecked() )
703 // MESSAGE("Fin de SetCone")
705 // ------------------------------------------------------------------------
706 void SMESH_CreateBoundaryAn::SetTore()
707 // ------------------------------------------------------------------------
709 MESSAGE("Debut de SetTore")
710 gBCylindre->setVisible(0);
711 gBSphere->setVisible(0);
712 gBCone->setVisible(0);
713 gBTore->setVisible(1);
718 // MESSAGE("Fin de SetTore")
720 // ------------------------------------------------------------------------
721 void SMESH_CreateBoundaryAn::convertRayonAngle(int option)
722 // ------------------------------------------------------------------------
723 // Conversion entre les deux formulations du cone :
724 // par deux rayons ou avec un axe et un angle.
725 // Voir sfcoi1 de HOMARD
727 MESSAGE("Debut de convertRayonAngle, option = "<<option)
736 // A----------------B----------O
738 // Thales : RA/RB = AO/BO ==> BO = AB*RB/(RA-RB)
739 // Angle : tg(alpha) = RA/AO
742 // De rayon vers angle :
745 double xa, ya, za, ra ;
746 double xb, yb, zb, rb ;
747 // Positionnement de A vers B, avec RA>RB
748 if ( _BoundaryAnRayon1 > _BoundaryAnRayon2 )
750 xa = _BoundaryAnXcone1 ;
751 ya = _BoundaryAnYcone1 ;
752 za = _BoundaryAnZcone1 ;
753 ra = _BoundaryAnRayon1 ;
754 xb = _BoundaryAnXcone2 ;
755 yb = _BoundaryAnYcone2 ;
756 zb = _BoundaryAnZcone2 ;
757 rb = _BoundaryAnRayon2 ;
761 xa = _BoundaryAnXcone2 ;
762 ya = _BoundaryAnYcone2 ;
763 za = _BoundaryAnZcone2 ;
764 ra = _BoundaryAnRayon2 ;
765 xb = _BoundaryAnXcone1 ;
766 yb = _BoundaryAnYcone1 ;
767 zb = _BoundaryAnZcone1 ;
768 rb = _BoundaryAnRayon1 ;
770 // Axe : relie les deux centres, de A vers B. L'axe est normalise
771 _BoundaryAnXaxisCone = xb - xa ;
772 _BoundaryAnYaxisCone = yb - ya ;
773 _BoundaryAnZaxisCone = zb - za ;
774 daux = sqrt ( _BoundaryAnXaxisCone*_BoundaryAnXaxisCone + _BoundaryAnYaxisCone*_BoundaryAnYaxisCone + _BoundaryAnZaxisCone*_BoundaryAnZaxisCone ) ;
775 _BoundaryAnXaxisCone = _BoundaryAnXaxisCone/daux ;
776 _BoundaryAnYaxisCone = _BoundaryAnYaxisCone/daux ;
777 _BoundaryAnZaxisCone = _BoundaryAnZaxisCone/daux ;
779 daux = daux * rb / (ra-rb) ;
780 _BoundaryAnXorigCone = xb + daux*_BoundaryAnXaxisCone ;
781 _BoundaryAnYorigCone = yb + daux*_BoundaryAnYaxisCone ;
782 _BoundaryAnZorigCone = zb + daux*_BoundaryAnZaxisCone ;
784 daux = ra / sqrt((_BoundaryAnXorigCone-xa)*(_BoundaryAnXorigCone-xa) + (_BoundaryAnYorigCone-ya)*(_BoundaryAnYorigCone-ya) + (_BoundaryAnZorigCone-za)*(_BoundaryAnZorigCone-za) ) ;
785 _BoundaryAngle = atan(daux)*180./PI ;
787 // D'angle vers rayon :
790 double xax, yax, zax ;
791 // L'axe est normalise
792 daux = sqrt ( _BoundaryAnXaxisCone*_BoundaryAnXaxisCone + _BoundaryAnYaxisCone*_BoundaryAnYaxisCone + _BoundaryAnZaxisCone*_BoundaryAnZaxisCone ) ;
793 xax = _BoundaryAnXaxisCone/daux ;
794 yax = _BoundaryAnYaxisCone/daux ;
795 zax = _BoundaryAnZaxisCone/daux ;
796 // Centre 1 : l'origine
797 _BoundaryAnXcone1 = _BoundaryAnXorigCone ;
798 _BoundaryAnYcone1 = _BoundaryAnYorigCone ;
799 _BoundaryAnZcone1 = _BoundaryAnZorigCone ;
801 _BoundaryAnRayon1 = 0. ;
802 // Centre 2 : l'origine decalee d'une longueur arbitraire le long de l'axe
803 _BoundaryAnXcone2 = _BoundaryAnXorigCone + _DMax*xax ;
804 _BoundaryAnYcone2 = _BoundaryAnYorigCone + _DMax*yax ;
805 _BoundaryAnZcone2 = _BoundaryAnZorigCone + _DMax*zax ;
806 // Rayon 2 : a calculer
807 _BoundaryAnRayon2 = _DMax*tan(_BoundaryAngle*PI/180.) ;
809 // MESSAGE("Fin de convertRayonAngle")
812 // -------------------------------------------------------------------------------
813 SMESH_CreateBoundaryCAO::SMESH_CreateBoundaryCAO(SMESHGUI_HomardAdaptDlg* parent, bool modal,
814 SMESHHOMARD::HOMARD_Gen_var myHomardGen0,
815 QString caseName, QString aName)
816 // ---------------------------------------------------------------------------------
817 /* Constructs a SMESH_CreateBoundaryCAO */
819 QDialog(0), SMESH_Ui_CreateBoundaryCAO(),
820 _parent(parent), _aName(aName),
821 myHomardGen(SMESHHOMARD::HOMARD_Gen::_duplicate(myHomardGen0)),
824 MESSAGE("Constructeur") ;
829 if ( _aName == QString("") ) {SetNewName();};
832 // ------------------------------------------------------------------------
833 SMESH_CreateBoundaryCAO::~SMESH_CreateBoundaryCAO()
834 // ------------------------------------------------------------------------
836 // no need to delete child widgets, Qt does it all for us
838 // ------------------------------------------------------------------------
839 void SMESH_CreateBoundaryCAO::InitConnect()
840 // ------------------------------------------------------------------------
842 connect( PushFichier, SIGNAL(pressed()), this, SLOT(SetCAOFile()));
843 connect( buttonOk, SIGNAL(pressed()), this, SLOT( PushOnOK()));
844 connect( buttonApply, SIGNAL(pressed()), this, SLOT( PushOnApply()));
845 connect( buttonCancel, SIGNAL(pressed()), this, SLOT(close()));
846 connect( buttonHelp, SIGNAL(pressed()), this, SLOT( PushOnHelp()));
847 connect( CBGroupe, SIGNAL(stateChanged(int)), this, SLOT( SetFiltrage()));
850 // ------------------------------------------------------------------------
851 bool SMESH_CreateBoundaryCAO::PushOnApply()
852 // ------------------------------------------------------------------------
853 // Appele lorsque l'un des boutons Ok ou Apply est presse
858 QString aName=LEName->text().trimmed();
860 QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
861 QObject::tr("HOM_BOUN_NAME") );
866 QString aCAOFile=LEFileName->text().trimmed();
867 if (aCAOFile ==QString(""))
869 QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
870 QObject::tr("HOM_BOUN_CAO") );
874 // Creation de l'objet CORBA si ce n'est pas deja fait sous le meme nom
875 if ( _aName != aName )
880 aBoundary=myHomardGen->CreateBoundaryCAO(CORBA::string_dup(_aName.toStdString().c_str()), aCAOFile.toStdString().c_str());
881 _parent->AddBoundaryCAO(_aName);
882 aBoundary->SetCaseCreation(_aCaseName.toStdString().c_str());
884 catch( SALOME::SALOME_Exception& S_ex )
886 QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
887 QObject::tr(CORBA::string_dup(S_ex.details.text)) );
895 //HOMARD_UTILS::updateObjBrowser();
900 // ------------------------------------------------------------------------
901 void SMESH_CreateBoundaryCAO::PushOnOK()
902 // ------------------------------------------------------------------------
904 if (PushOnApply()) this->close();
905 if ( _parent ) { _parent->raise(); _parent->activateWindow(); };
907 // ------------------------------------------------------------------------
908 void SMESH_CreateBoundaryCAO::PushOnHelp()
909 // ------------------------------------------------------------------------
911 SMESH::ShowHelpFile(QString("gui_create_boundary.html"));
912 //std::string LanguageShort = myHomardGen->GetLanguageShort();
913 //HOMARD_UTILS::PushOnHelp(QString("gui_create_boundary.html"), QString("CAO"), QString(LanguageShort.c_str()));
915 // ------------------------------------------------------------------------
916 void SMESH_CreateBoundaryCAO::AssocieLesGroupes()
917 // ------------------------------------------------------------------------
919 SMESHHOMARD::ListGroupType_var aSeqGroupe = new SMESHHOMARD::ListGroupType;
920 aSeqGroupe->length(_listeGroupesBoundary.size());
921 QStringList::const_iterator it;
923 for (it = _listeGroupesBoundary.constBegin(); it != _listeGroupesBoundary.constEnd(); it++)
924 aSeqGroupe[i++]=(*it).toStdString().c_str();
925 aBoundary->SetGroups(aSeqGroupe);
929 // -------------------------------------------------
930 void SMESH_CreateBoundaryCAO::SetNewName()
931 // --------------------------------------------------
934 SMESHHOMARD::listeBoundarys_var MyObjects = myHomardGen->GetAllBoundarysName();
935 int num = 0; QString aName="";
936 while (aName == QString("") )
938 aName.setNum(num+1) ;
939 aName.insert(0, QString("Boun_")) ;
940 for ( int i=0; i<MyObjects->length(); i++)
942 if ( aName == QString(MyObjects[i]))
950 LEName->setText(aName);
952 // ------------------------------------------------------------------------
953 void SMESH_CreateBoundaryCAO::SetCAOFile()
954 // ------------------------------------------------------------------------
956 QString aCAOFile = SMESH_HOMARD_QT_COMMUN::PushNomFichier( false, QString("xao") );
957 if (!(aCAOFile.isEmpty())) LEFileName->setText(aCAOFile);
960 // ------------------------------------------------------------------------
961 void SMESH_CreateBoundaryCAO::setGroups (QStringList listGroup)
962 // ------------------------------------------------------------------------
964 _listeGroupesBoundary = listGroup;
966 // ------------------------------------------------------------------------
967 void SMESH_CreateBoundaryCAO::SetFiltrage()
968 // // ------------------------------------------------------------------------
970 if (!CBGroupe->isChecked()) return;
971 if (_aCaseName.toStdString().c_str() == QString()) {
972 QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
973 QObject::tr("HOM_BOUN_CASE") );
977 SMESH_CreateListGroupCAO *aDlg = new SMESH_CreateListGroupCAO(this, true, SMESHHOMARD::HOMARD_Gen::_duplicate(myHomardGen),
978 _aCaseName, _listeGroupesBoundary) ;
982 // -------------------------------------------------------------------------------
983 SMESH_CreateBoundaryDi::SMESH_CreateBoundaryDi(SMESHGUI_HomardAdaptDlg* parent, bool modal,
984 SMESHHOMARD::HOMARD_Gen_var myHomardGen0,
985 QString caseName, QString aName)
986 // ---------------------------------------------------------------------------------
987 /* Constructs a SMESH_CreateBoundaryDi */
989 QDialog(0), SMESH_Ui_CreateBoundaryDi(),
990 _parent(parent), _aName(aName),
991 myHomardGen(SMESHHOMARD::HOMARD_Gen::_duplicate(myHomardGen0)),
994 MESSAGE("Constructeur") ;
999 if ( _aName == QString("") ) {SetNewName();};
1002 // ------------------------------------------------------------------------
1003 SMESH_CreateBoundaryDi::~SMESH_CreateBoundaryDi()
1004 // ------------------------------------------------------------------------
1006 // no need to delete child widgets, Qt does it all for us
1008 // ------------------------------------------------------------------------
1009 void SMESH_CreateBoundaryDi::InitConnect()
1010 // ------------------------------------------------------------------------
1012 connect( PushFichier, SIGNAL(pressed()), this, SLOT(SetMeshFile()));
1013 connect( buttonOk, SIGNAL(pressed()), this, SLOT( PushOnOK()));
1014 connect( buttonApply, SIGNAL(pressed()), this, SLOT( PushOnApply()));
1015 connect( buttonCancel, SIGNAL(pressed()), this, SLOT(close()));
1016 connect( buttonHelp, SIGNAL(pressed()), this, SLOT( PushOnHelp()));
1017 connect( CBGroupe, SIGNAL(stateChanged(int)), this, SLOT( SetFiltrage()));
1020 // ------------------------------------------------------------------------
1021 bool SMESH_CreateBoundaryDi::PushOnApply()
1022 // ------------------------------------------------------------------------
1023 // Appele lorsque l'un des boutons Ok ou Apply est presse
1028 QString aName=LEName->text().trimmed();
1030 QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
1031 QObject::tr("HOM_BOUN_NAME") );
1035 // Le maillage de la frontiere discrete
1036 QString aMeshFile=LEFileName->text().trimmed();
1037 if (aMeshFile ==QString(""))
1039 QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
1040 QObject::tr("HOM_BOUN_MESH") );
1044 // Le nom du maillage de la frontiere discrete
1045 QString aMeshName = SMESH_HOMARD_QT_COMMUN::LireNomMaillage(aMeshFile);
1046 if (aMeshName == "" )
1048 QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
1049 QObject::tr("HOM_MED_FILE_2") );
1053 // Creation de l'objet CORBA si ce n'est pas deja fait sous le meme nom
1054 if ( _aName != aName )
1059 aBoundary=myHomardGen->CreateBoundaryDi(CORBA::string_dup(_aName.toStdString().c_str()), aMeshName.toStdString().c_str(), aMeshFile.toStdString().c_str());
1060 _parent->AddBoundaryDi(_aName);
1061 aBoundary->SetCaseCreation(_aCaseName.toStdString().c_str());
1063 catch( SALOME::SALOME_Exception& S_ex )
1065 QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
1066 QObject::tr(CORBA::string_dup(S_ex.details.text)) );
1072 AssocieLesGroupes();
1074 //HOMARD_UTILS::updateObjBrowser();
1079 // ------------------------------------------------------------------------
1080 void SMESH_CreateBoundaryDi::PushOnOK()
1081 // ------------------------------------------------------------------------
1083 if (PushOnApply()) this->close();
1084 if ( _parent ) { _parent->raise(); _parent->activateWindow(); };
1086 // ------------------------------------------------------------------------
1087 void SMESH_CreateBoundaryDi::PushOnHelp()
1088 // ------------------------------------------------------------------------
1090 SMESH::ShowHelpFile(QString("gui_create_boundary.html"));
1091 //std::string LanguageShort = myHomardGen->GetLanguageShort();
1092 //HOMARD_UTILS::PushOnHelp(QString("gui_create_boundary.html"), QString("frontiere-discrete"), QString(LanguageShort.c_str()));
1094 // ------------------------------------------------------------------------
1095 void SMESH_CreateBoundaryDi::AssocieLesGroupes()
1096 // ------------------------------------------------------------------------
1098 SMESHHOMARD::ListGroupType_var aSeqGroupe = new SMESHHOMARD::ListGroupType;
1099 aSeqGroupe->length(_listeGroupesBoundary.size());
1100 QStringList::const_iterator it;
1102 for (it = _listeGroupesBoundary.constBegin(); it != _listeGroupesBoundary.constEnd(); it++)
1103 aSeqGroupe[i++]=(*it).toStdString().c_str();
1104 aBoundary->SetGroups(aSeqGroupe);
1108 // -------------------------------------------------
1109 void SMESH_CreateBoundaryDi::SetNewName()
1110 // --------------------------------------------------
1113 SMESHHOMARD::listeBoundarys_var MyObjects = myHomardGen->GetAllBoundarysName();
1114 int num = 0; QString aName="";
1115 while (aName == QString("") )
1117 aName.setNum(num+1) ;
1118 aName.insert(0, QString("Boun_")) ;
1119 for ( int i=0; i<MyObjects->length(); i++)
1121 if ( aName == QString(MyObjects[i]))
1129 LEName->setText(aName);
1131 // ------------------------------------------------------------------------
1132 void SMESH_CreateBoundaryDi::SetMeshFile()
1133 // ------------------------------------------------------------------------
1135 QString aMeshFile = SMESH_HOMARD_QT_COMMUN::PushNomFichier( false, QString("med") );
1136 if (!(aMeshFile.isEmpty())) LEFileName->setText(aMeshFile);
1139 // ------------------------------------------------------------------------
1140 void SMESH_CreateBoundaryDi::setGroups (QStringList listGroup)
1141 // ------------------------------------------------------------------------
1143 _listeGroupesBoundary = listGroup;
1145 // ------------------------------------------------------------------------
1146 void SMESH_CreateBoundaryDi::SetFiltrage()
1147 // // ------------------------------------------------------------------------
1149 if (!CBGroupe->isChecked()) return;
1150 if (_aCaseName.toStdString().c_str() == QString()) {
1151 QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
1152 QObject::tr("HOM_BOUN_CASE") );
1156 SMESH_CreateListGroup *aDlg = new SMESH_CreateListGroup
1157 (this, true, SMESHHOMARD::HOMARD_Gen::_duplicate(myHomardGen),
1158 _aCaseName, _listeGroupesBoundary);
1162 // ------------------------------------------------------------------------
1163 SMESH_EditBoundaryAn::SMESH_EditBoundaryAn( SMESHGUI_HomardAdaptDlg* parent, bool modal,
1164 SMESHHOMARD::HOMARD_Gen_var myHomardGen,
1165 QString caseName, QString Name ):
1166 // ------------------------------------------------------------------------
1167 /* Constructs a SMESH_EditBoundaryAn
1168 herite de SMESH_CreateBoundaryAn
1170 SMESH_CreateBoundaryAn(parent, myHomardGen, caseName)
1172 MESSAGE("Debut de SMESH_EditBoundaryAn pour " << Name.toStdString().c_str());
1173 setWindowTitle(QObject::tr("HOM_BOUN_A_EDIT_WINDOW_TITLE"));
1175 aBoundaryAn = myHomardGen->GetBoundary(_Name.toStdString().c_str());
1178 // ------------------------------------------------------------------------
1179 SMESH_EditBoundaryAn::~SMESH_EditBoundaryAn()
1180 // ------------------------------------------------------------------------
1182 // no need to delete child widgets, Qt does it all for us
1184 // ------------------------------------------------------------------------
1185 void SMESH_EditBoundaryAn::InitValEdit()
1186 // ------------------------------------------------------------------------
1188 LEName->setText(_Name);
1189 LEName->setReadOnly(true);
1190 _Type = aBoundaryAn->GetType();
1191 MESSAGE("_Type : "<<_Type);
1192 InitValBoundaryAnLimit();
1193 if (_aCaseName != QString("")) InitValBoundaryAn();
1196 case 1 : // il s agit d un cylindre
1198 InitValBoundaryAnCylindre();
1202 case 2: // il s agit d une sphere
1204 InitValBoundaryAnSphere();
1208 case 3: // il s agit d un cone defini par un axe et un angle
1210 InitValBoundaryAnConeA();
1214 case 4: // il s agit d un cone defini par les 2 rayons
1216 InitValBoundaryAnConeR();
1220 case 5: // il s agit d un tore
1222 InitValBoundaryAnTore();
1228 // ------------------------------------------------------------------------
1229 void SMESH_EditBoundaryAn::InitValBoundaryAnLimit()
1230 // ------------------------------------------------------------------------
1232 SMESHHOMARD::double_array_var mesCoordLimits = aBoundaryAn->GetLimit();
1233 ASSERT(mesCoordLimits->length() == 3 );
1234 _Xincr=mesCoordLimits[0];
1235 _Yincr=mesCoordLimits[1];
1236 _Zincr=mesCoordLimits[2];
1238 // ------------------------------------------------------------------------
1239 void SMESH_EditBoundaryAn::InitValBoundaryAnCylindre()
1240 // ------------------------------------------------------------------------
1242 SMESHHOMARD::double_array_var mesCoordBoundary = aBoundaryAn->GetCoords();
1243 ASSERT(mesCoordBoundary->length() == 7 );
1244 _BoundaryAnXcentre=mesCoordBoundary[0];
1245 _BoundaryAnYcentre=mesCoordBoundary[1];
1246 _BoundaryAnZcentre=mesCoordBoundary[2];
1247 _BoundaryAnXaxis=mesCoordBoundary[3];
1248 _BoundaryAnYaxis=mesCoordBoundary[4];
1249 _BoundaryAnZaxis=mesCoordBoundary[5];
1250 _BoundaryAnRayon=mesCoordBoundary[6];
1252 // ------------------------------------------------------------------------
1253 void SMESH_EditBoundaryAn::InitValBoundaryAnSphere()
1254 // ------------------------------------------------------------------------
1256 SMESHHOMARD::double_array_var mesCoordBoundary = aBoundaryAn->GetCoords();
1257 ASSERT(mesCoordBoundary->length() == 4 );
1258 _BoundaryAnXcentre=mesCoordBoundary[0];
1259 _BoundaryAnYcentre=mesCoordBoundary[1];
1260 _BoundaryAnZcentre=mesCoordBoundary[2];
1261 _BoundaryAnRayon=mesCoordBoundary[3];
1263 // ------------------------------------------------------------------------
1264 void SMESH_EditBoundaryAn::InitValBoundaryAnConeA()
1265 // ------------------------------------------------------------------------
1267 SMESHHOMARD::double_array_var mesCoordBoundary = aBoundaryAn->GetCoords();
1268 ASSERT(mesCoordBoundary->length() == 7 );
1269 _BoundaryAnXaxisCone=mesCoordBoundary[0];
1270 _BoundaryAnYaxisCone=mesCoordBoundary[1];
1271 _BoundaryAnZaxisCone=mesCoordBoundary[2];
1272 _BoundaryAngle=mesCoordBoundary[3];
1273 _BoundaryAnXorigCone=mesCoordBoundary[4];
1274 _BoundaryAnYorigCone=mesCoordBoundary[5];
1275 _BoundaryAnZorigCone=mesCoordBoundary[6];
1276 convertRayonAngle(-1) ;
1278 // ------------------------------------------------------------------------
1279 void SMESH_EditBoundaryAn::InitValBoundaryAnConeR()
1280 // ------------------------------------------------------------------------
1282 SMESHHOMARD::double_array_var mesCoordBoundary = aBoundaryAn->GetCoords();
1283 ASSERT(mesCoordBoundary->length() == 8 );
1284 _BoundaryAnXcone1=mesCoordBoundary[0];
1285 _BoundaryAnYcone1=mesCoordBoundary[1];
1286 _BoundaryAnZcone1=mesCoordBoundary[2];
1287 _BoundaryAnRayon1=mesCoordBoundary[3];
1288 _BoundaryAnXcone2=mesCoordBoundary[4];
1289 _BoundaryAnYcone2=mesCoordBoundary[5];
1290 _BoundaryAnZcone2=mesCoordBoundary[6];
1291 _BoundaryAnRayon2=mesCoordBoundary[7];
1292 convertRayonAngle(1) ;
1294 // ------------------------------------------------------------------------
1295 void SMESH_EditBoundaryAn::InitValBoundaryAnTore()
1296 // ------------------------------------------------------------------------
1298 SMESHHOMARD::double_array_var mesCoordBoundary = aBoundaryAn->GetCoords();
1299 ASSERT(mesCoordBoundary->length() == 8 );
1300 _BoundaryAnXcentre=mesCoordBoundary[0];
1301 _BoundaryAnYcentre=mesCoordBoundary[1];
1302 _BoundaryAnZcentre=mesCoordBoundary[2];
1303 _BoundaryAnXaxis=mesCoordBoundary[3];
1304 _BoundaryAnYaxis=mesCoordBoundary[4];
1305 _BoundaryAnZaxis=mesCoordBoundary[5];
1306 _BoundaryAnRayon1=mesCoordBoundary[6];
1307 _BoundaryAnRayon2=mesCoordBoundary[7];
1309 // ------------------------------------------------------------------------
1310 void SMESH_EditBoundaryAn::SetCylinder()
1311 // ------------------------------------------------------------------------
1313 gBCylindre->setVisible(1);
1314 gBSphere->setVisible(0);
1315 gBCone->setVisible(0);
1316 gBTore->setVisible(0);
1317 RBCylindre->setChecked(1);
1319 RBSphere->setDisabled(true);
1320 RBCone->setDisabled(true);
1321 RBTore->setDisabled(true);
1323 SpinBox_Xcent->setValue(_BoundaryAnXcentre);
1324 SpinBox_Ycent->setValue(_BoundaryAnYcentre);
1325 SpinBox_Zcent->setValue(_BoundaryAnZcentre);
1327 SpinBox_Xaxis->setValue(_BoundaryAnXaxis);
1328 SpinBox_Yaxis->setValue(_BoundaryAnYaxis);
1329 SpinBox_Zaxis->setValue(_BoundaryAnZaxis);
1332 SpinBox_Xaxis->setSingleStep(0.1);
1333 SpinBox_Xcentre->setSingleStep(_Xincr);
1334 SpinBox_Yaxis->setSingleStep(0.1);
1335 SpinBox_Ycentre->setSingleStep(_Yincr);
1336 SpinBox_Zaxis->setSingleStep(0.1);
1337 SpinBox_Zcentre->setSingleStep(_Zincr);
1339 SpinBox_Radius->setValue(_BoundaryAnRayon);
1340 SpinBox_Radius->setSingleStep(_BoundaryAnRayon/10.);
1344 // ------------------------------------------------------------------------
1345 void SMESH_EditBoundaryAn::SetSphere()
1346 // ------------------------------------------------------------------------
1348 gBCylindre->setVisible(0);
1349 gBSphere->setVisible(1);
1350 RBSphere->setChecked(1);
1351 gBCone->setVisible(0);
1352 gBTore->setVisible(0);
1353 RBCylindre->setDisabled(true);
1354 RBCone->setDisabled(true);
1355 RBTore->setDisabled(true);
1358 SpinBox_Xcentre->setValue(_BoundaryAnXcentre);
1359 if ( _Xincr > 0) { SpinBox_Xcentre->setSingleStep(_Xincr); }
1360 else { SpinBox_Xcentre->setSingleStep(1) ; }
1362 SpinBox_Ycentre->setValue(_BoundaryAnYcentre);
1363 if ( _Yincr > 0) { SpinBox_Ycentre->setSingleStep(_Yincr); }
1364 else { SpinBox_Ycentre->setSingleStep(1) ; }
1366 SpinBox_Zcentre->setValue(_BoundaryAnZcentre);
1367 if ( _Zincr > 0) { SpinBox_Zcentre->setSingleStep(_Zincr); }
1368 else { SpinBox_Zcentre->setSingleStep(1);}
1370 SpinBox_Rayon->setValue(_BoundaryAnRayon);
1374 // ------------------------------------------------------------------------
1375 void SMESH_EditBoundaryAn::SetConeA()
1376 // ------------------------------------------------------------------------
1378 gBCylindre->setVisible(0);
1379 gBSphere->setVisible(0);
1380 gBCone->setVisible(1);
1381 RBCone->setChecked(1);
1382 gBTore->setVisible(0);
1383 RB_Def_angle->setChecked(1);
1384 RBCylindre->setDisabled(true);
1385 RBSphere->setDisabled(true);
1386 RBTore->setDisabled(true);
1389 TLCone_X1->setText(QApplication::translate("CreateBoundaryAn", "X axis", 0));
1390 SpinBox_Cone_X1->setValue(_BoundaryAnXaxisCone);
1391 TLCone_Y1->setText(QApplication::translate("CreateBoundaryAn", "Y axis", 0));
1392 SpinBox_Cone_Y1->setValue(_BoundaryAnYaxisCone);
1393 TLCone_Z1->setText(QApplication::translate("CreateBoundaryAn", "Z axis", 0));
1394 SpinBox_Cone_Z1->setValue(_BoundaryAnZaxisCone);
1396 TLCone_X2->setText(QApplication::translate("CreateBoundaryAn", "X centre", 0));
1397 SpinBox_Cone_X2->setValue(_BoundaryAnXorigCone);
1398 TLCone_Y2->setText(QApplication::translate("CreateBoundaryAn", "Y centre", 0));
1399 SpinBox_Cone_Y2->setValue(_BoundaryAnYorigCone);
1400 TLCone_Z2->setText(QApplication::translate("CreateBoundaryAn", "Z centre", 0));
1401 SpinBox_Cone_Z2->setValue(_BoundaryAnZorigCone);
1403 TLCone_V1->setText(QApplication::translate("CreateBoundaryAn", "Angle", 0));
1404 SpinBox_Cone_V1->setValue(_BoundaryAngle);
1405 SpinBox_Cone_V1->setSingleStep(1.);
1406 SpinBox_Cone_V1->setMaximum(90.);
1408 TLCone_V2->setVisible(0);
1409 SpinBox_Cone_V2->setVisible(0);
1413 // ------------------------------------------------------------------------
1414 void SMESH_EditBoundaryAn::SetConeR()
1415 // ------------------------------------------------------------------------
1417 gBCylindre->setVisible(0);
1418 gBSphere->setVisible(0);
1419 gBCone->setVisible(1);
1420 gBTore->setVisible(0);
1421 RBCone->setChecked(1);
1422 RB_Def_radius->setChecked(1);
1423 RBCylindre->setDisabled(true);
1424 RBSphere->setDisabled(true);
1425 RBTore->setDisabled(true);
1428 TLCone_X1->setText(QApplication::translate("CreateBoundaryAn", "X centre 1", 0));
1429 SpinBox_Cone_X1->setValue(_BoundaryAnXcone1);
1430 TLCone_Y1->setText(QApplication::translate("CreateBoundaryAn", "Y centre 1", 0));
1431 SpinBox_Cone_Y1->setValue(_BoundaryAnYcone1);
1432 TLCone_Z1->setText(QApplication::translate("CreateBoundaryAn", "Z centre 1", 0));
1433 SpinBox_Cone_Z1->setValue(_BoundaryAnZcone1);
1435 TLCone_V1->setText(QApplication::translate("CreateBoundaryAn", "Radius 1", 0));
1436 SpinBox_Cone_V1->setSingleStep(_Rayon/10.);
1437 SpinBox_Cone_V1->setMaximum(100000.*_DMax);
1438 SpinBox_Cone_V1->setValue(_BoundaryAnRayon1);
1440 TLCone_X2->setText(QApplication::translate("CreateBoundaryAn", "X centre 2", 0));
1441 SpinBox_Cone_X2->setValue(_BoundaryAnXcone2);
1442 TLCone_Y2->setText(QApplication::translate("CreateBoundaryAn", "Y centre 2", 0));
1443 SpinBox_Cone_Y2->setValue(_BoundaryAnYcone2);
1444 TLCone_Z2->setText(QApplication::translate("CreateBoundaryAn", "Z centre 2", 0));
1445 SpinBox_Cone_Z2->setValue(_BoundaryAnZcone2);
1447 TLCone_V2->setVisible(1);
1448 SpinBox_Cone_V2->setVisible(1);
1449 TLCone_V2->setText(QApplication::translate("CreateBoundaryAn", "Radius 2", 0));
1450 SpinBox_Cone_V2->setValue(_BoundaryAnRayon2);
1454 // ------------------------------------------------------------------------
1455 void SMESH_EditBoundaryAn::SetTore()
1456 // ------------------------------------------------------------------------
1458 gBCylindre->setVisible(0);
1459 gBSphere->setVisible(0);
1460 gBCone->setVisible(0);
1461 gBTore->setVisible(1);
1462 RBTore->setChecked(1);
1464 RBCylindre->setDisabled(true);
1465 RBSphere->setDisabled(true);
1466 RBCone->setDisabled(true);
1468 SpinBoxToreXcent->setValue(_BoundaryAnXcentre);
1469 SpinBoxToreYcent->setValue(_BoundaryAnYcentre);
1470 SpinBoxToreZcent->setValue(_BoundaryAnZcentre);
1472 SpinBoxToreXaxe->setValue(_BoundaryAnXaxis);
1473 SpinBoxToreYaxe->setValue(_BoundaryAnYaxis);
1474 SpinBoxToreZaxe->setValue(_BoundaryAnZaxis);
1477 SpinBoxToreXaxe->setSingleStep(0.1);
1478 SpinBoxToreXcent->setSingleStep(_Xincr);
1479 SpinBoxToreYaxe->setSingleStep(0.1);
1480 SpinBoxToreYcent->setSingleStep(_Yincr);
1481 SpinBoxToreZaxe->setSingleStep(0.1);
1482 SpinBoxToreZcent->setSingleStep(_Zincr);
1483 // Rayon de revolution
1484 SpinBoxToreRRev->setValue(_BoundaryAnRayon1);
1485 SpinBoxToreRRev->setSingleStep(_BoundaryAnRayon1/10.);
1487 SpinBoxToreRPri->setValue(_BoundaryAnRayon2);
1488 SpinBoxToreRPri->setSingleStep(_BoundaryAnRayon2/10.);
1492 // ---------------------------------------------------
1493 bool SMESH_EditBoundaryAn::CreateOrUpdateBoundaryAn()
1494 //----------------------------------------------------
1495 // Mise a jour des attributs de la BoundaryAn
1499 case 1 : // il s agit d un cylindre
1501 aBoundaryAn->SetCylinder(_BoundaryAnXcentre, _BoundaryAnYcentre, _BoundaryAnZcentre, _BoundaryAnXaxis, _BoundaryAnYaxis, _BoundaryAnZaxis, _BoundaryAnRayon );
1504 case 2 : // il s agit d une sphere
1506 aBoundaryAn->SetSphere(_BoundaryAnXcentre, _BoundaryAnYcentre, _BoundaryAnZcentre, _BoundaryAnRayon);
1509 case 3 : // il s agit d un cone defini par un axe et un angle
1511 aBoundaryAn = myHomardGen->CreateBoundaryConeA(CORBA::string_dup(_Name.toStdString().c_str()), \
1512 _BoundaryAnXaxisCone, _BoundaryAnYaxisCone, _BoundaryAnZaxisCone, _BoundaryAngle, \
1513 _BoundaryAnXorigCone, _BoundaryAnYorigCone, _BoundaryAnYorigCone);
1516 case 4 : // il s agit d un cone defini par les 2 rayons
1518 aBoundaryAn = myHomardGen->CreateBoundaryConeR(CORBA::string_dup(_Name.toStdString().c_str()), \
1519 _BoundaryAnXcone1, _BoundaryAnYcone1, _BoundaryAnZcone1, _BoundaryAnRayon1, \
1520 _BoundaryAnXcone2, _BoundaryAnYcone2, _BoundaryAnZcone2, _BoundaryAnRayon2);
1523 case 5 : // il s agit d un tore
1525 aBoundaryAn->SetTorus(_BoundaryAnXcentre, _BoundaryAnYcentre, _BoundaryAnZcentre, _BoundaryAnXaxis, _BoundaryAnYaxis, _BoundaryAnZaxis, _BoundaryAnRayon1, _BoundaryAnRayon2 );
1529 if (Chgt) myHomardGen->InvalideBoundary(_Name.toStdString().c_str());
1530 //HOMARD_UTILS::updateObjBrowser();
1534 // --------------------------------------------------------------------------------------
1535 /* Constructs a SMESH_EditBoundaryCAO
1536 herite de SMESH_CreateBoundaryCAO
1538 // --------------------------------------------------------------------------------------
1539 SMESH_EditBoundaryCAO::SMESH_EditBoundaryCAO( SMESHGUI_HomardAdaptDlg* parent, bool modal,
1540 SMESHHOMARD::HOMARD_Gen_var myHomardGen,
1541 QString caseName, QString Name):
1542 SMESH_CreateBoundaryCAO(parent, modal, myHomardGen, caseName, Name)
1544 MESSAGE("Debut de Boundary pour " << Name.toStdString().c_str());
1545 setWindowTitle(QObject::tr("HOM_BOUN_C_EDIT_WINDOW_TITLE"));
1548 aBoundary=myHomardGen->GetBoundary(CORBA::string_dup(_aName.toStdString().c_str()));
1549 if (caseName==QString("")) { _aCaseName=aBoundary->GetCaseCreation();}
1552 catch( SALOME::SALOME_Exception& S_ex )
1554 QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
1555 QObject::tr(CORBA::string_dup(S_ex.details.text)) );
1559 SMESHHOMARD::ListGroupType_var maListe = aBoundary->GetGroups();
1560 for ( int i = 0; i < maListe->length(); i++ )
1561 _listeGroupesBoundary << QString(maListe[i]);
1564 // ------------------------------
1565 SMESH_EditBoundaryCAO::~SMESH_EditBoundaryCAO()
1566 // ------------------------------
1569 // ------------------------------
1570 void SMESH_EditBoundaryCAO::InitValEdit()
1571 // ------------------------------
1573 LEName->setText(_aName);
1574 LEName->setReadOnly(true);
1576 QString aDataFile = aBoundary->GetDataFile();
1577 LEFileName->setText(aDataFile);
1578 LEFileName->setReadOnly(1);
1579 PushFichier->setVisible(0);
1583 // ------------------------------
1584 bool SMESH_EditBoundaryCAO::PushOnApply()
1585 // ------------------------------
1589 // ------------------------------------------------------------------------
1590 void SMESH_EditBoundaryCAO::SetFiltrage()
1591 // // ------------------------------------------------------------------------
1593 if (!CBGroupe->isChecked()) return;
1594 if (_aCaseName.toStdString().c_str() == QString())
1596 QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
1597 QObject::tr("HOM_BOUN_CASE") );
1600 SMESHHOMARD::HOMARD_Cas_var monCas= myHomardGen->GetCase(_aCaseName.toStdString().c_str());
1601 SMESHHOMARD::ListGroupType_var _listeGroupesCas = monCas->GetGroups();
1603 SMESH_EditListGroupCAO *aDlg = new SMESH_EditListGroupCAO
1604 (this, true, SMESHHOMARD::HOMARD_Gen::_duplicate(myHomardGen),
1605 _aCaseName, _listeGroupesBoundary) ;
1609 // -------------------------------------------------------------------------------------------------------------------------------------
1610 SMESH_EditBoundaryDi::SMESH_EditBoundaryDi( SMESHGUI_HomardAdaptDlg* parent, bool modal,
1611 SMESHHOMARD::HOMARD_Gen_var myHomardGen,
1612 QString caseName, QString Name):
1613 // -------------------------------------------------------------------------------------------------------------------------------------
1614 /* Constructs a SMESH_EditBoundaryDi
1615 herite de SMESH_CreateBoundaryDi
1617 SMESH_CreateBoundaryDi(parent, modal, myHomardGen, caseName, Name)
1619 MESSAGE("Debut de Boundary pour " << Name.toStdString().c_str());
1620 setWindowTitle(QObject::tr("HOM_BOUN_D_EDIT_WINDOW_TITLE"));
1623 aBoundary=myHomardGen->GetBoundary(CORBA::string_dup(_aName.toStdString().c_str()));
1624 if (caseName==QString("")) { _aCaseName=aBoundary->GetCaseCreation();}
1627 catch( SALOME::SALOME_Exception& S_ex )
1629 QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
1630 QObject::tr(CORBA::string_dup(S_ex.details.text)) );
1634 SMESHHOMARD::ListGroupType_var maListe = aBoundary->GetGroups();
1635 for ( int i = 0; i < maListe->length(); i++ )
1636 _listeGroupesBoundary << QString(maListe[i]);
1639 // ------------------------------
1640 SMESH_EditBoundaryDi::~SMESH_EditBoundaryDi()
1641 // ------------------------------
1644 // ------------------------------
1645 void SMESH_EditBoundaryDi::InitValEdit()
1646 // ------------------------------
1648 LEName->setText(_aName);
1649 LEName->setReadOnly(true);
1651 QString aDataFile = aBoundary->GetDataFile();
1652 LEFileName->setText(aDataFile);
1653 LEFileName->setReadOnly(1);
1654 PushFichier->setVisible(0);
1658 // ------------------------------
1659 bool SMESH_EditBoundaryDi::PushOnApply()
1660 // ------------------------------
1664 // ------------------------------------------------------------------------
1665 void SMESH_EditBoundaryDi::SetFiltrage()
1666 // // ------------------------------------------------------------------------
1668 if (!CBGroupe->isChecked()) return;
1669 if (_aCaseName.toStdString().c_str() == QString())
1671 QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
1672 QObject::tr("HOM_BOUN_CASE") );
1675 SMESHHOMARD::HOMARD_Cas_var monCas= myHomardGen->GetCase(_aCaseName.toStdString().c_str());
1676 SMESHHOMARD::ListGroupType_var _listeGroupesCas = monCas->GetGroups();
1678 SMESH_EditListGroup *aDlg = new SMESH_EditListGroup
1679 (this, true, SMESHHOMARD::HOMARD_Gen::_duplicate(myHomardGen),
1680 _aCaseName, _listeGroupesBoundary);