X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHOMARDGUI%2FMonCreateZone.cxx;h=e2a6495e4fd2d59932d825e776c111880ce6bc82;hb=31086b2b08730cab7973f016edd2aaafee1eabbb;hp=87446b017ac89c2315dbe4a075ffa9c6254d462f;hpb=e5c2d8cbf11e58e93bab0d869064f6ea72190c3f;p=modules%2Fhomard.git diff --git a/src/HOMARDGUI/MonCreateZone.cxx b/src/HOMARDGUI/MonCreateZone.cxx index 87446b01..e2a6495e 100644 --- a/src/HOMARDGUI/MonCreateZone.cxx +++ b/src/HOMARDGUI/MonCreateZone.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2011-2015 CEA/DEN, EDF R&D +// Copyright (C) 2011-2023 CEA, EDF // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -469,6 +469,9 @@ bool MonCreateZone::PushOnApply() return false; } } +// +// Création ou mise à jour de la zone +// bool bOK = CreateOrUpdateZone() ; if ( bOK ) { HOMARD_UTILS::updateObjBrowser() ; } @@ -477,11 +480,12 @@ bool MonCreateZone::PushOnApply() } // --------------------------------------------------- -bool MonCreateZone:: CreateOrUpdateZone() +bool MonCreateZone::CreateOrUpdateZone() //---------------------------------------------------- // Creation de la zone { - MESSAGE("CreateOrUpdateZone _Type ="<<_Type); + MESSAGE("Debut de CreateOrUpdateZone avec _Type ="<<_Type<<", _Name ="<<_Name.toStdString().c_str()<<" et LEName ="<text().trimmed().toStdString().c_str()); +// if (_Name != LEName->text().trimmed()) { _Name = LEName->text().trimmed() ; @@ -489,17 +493,17 @@ bool MonCreateZone:: CreateOrUpdateZone() { switch (_Type) { - case 11 : // il s agit d un rectangle + case 11 : // il s agit d un rectangle, dans le plan (X,Y) { aZone = myHomardGen->CreateZoneBox2D(CORBA::string_dup(_Name.toStdString().c_str()), \ _ZoneXmin, _ZoneXmax, _ZoneYmin, _ZoneYmax, _Orient ); break; } - case 12 : // il s agit d un rectangle + case 12 : // il s agit d un rectangle, dans le plan (Y,Z) { aZone = myHomardGen->CreateZoneBox2D(CORBA::string_dup(_Name.toStdString().c_str()), \ _ZoneYmin, _ZoneYmax, _ZoneZmin, _ZoneZmax, _Orient ); break; } - case 13 : // il s agit d un rectangle + case 13 : // il s agit d un rectangle, dans le plan (Z,X) { aZone = myHomardGen->CreateZoneBox2D(CORBA::string_dup(_Name.toStdString().c_str()), \ _ZoneZmin, _ZoneZmax, _ZoneXmin, _ZoneXmax, _Orient ); break; @@ -514,17 +518,17 @@ bool MonCreateZone:: CreateOrUpdateZone() _ZoneXcentre, _ZoneYcentre, _ZoneZcentre, _ZoneRayon ); break; } - case 31 : // il s agit d un disque issu d'un cylindre + case 31 : // il s agit d un disque issu d'un cylindre, dans le plan (X,Y) { aZone = myHomardGen->CreateZoneDisk(CORBA::string_dup(_Name.toStdString().c_str()), \ _ZoneXcentre, _ZoneYcentre, _ZoneRayon, _Orient ); break; } - case 32 : // il s agit d un disque issu d'un cylindre + case 32 : // il s agit d un disque issu d'un cylindre, dans le plan (Y,Z) { aZone = myHomardGen->CreateZoneDisk(CORBA::string_dup(_Name.toStdString().c_str()), \ _ZoneYcentre, _ZoneZcentre, _ZoneRayon, _Orient ); break; } - case 33 : // il s agit d un disque issu d'un cylindre + case 33 : // il s agit d un disque issu d'un cylindre, dans le plan (Z,X) { aZone = myHomardGen->CreateZoneDisk(CORBA::string_dup(_Name.toStdString().c_str()), \ _ZoneZcentre, _ZoneXcentre, _ZoneRayon, _Orient ); break; @@ -534,26 +538,26 @@ bool MonCreateZone:: CreateOrUpdateZone() _ZoneXcentre, _ZoneYcentre, _ZoneZcentre, _ZoneXaxis, _ZoneYaxis, _ZoneZaxis, _ZoneRayon, _ZoneHaut ); break; } - case 61 : // il s agit d un disque avec trou + case 61 : // il s agit d un disque avec trou, dans le plan (X,Y) { aZone = myHomardGen->CreateZoneDiskWithHole(CORBA::string_dup(_Name.toStdString().c_str()), \ _ZoneXcentre, _ZoneYcentre, _ZoneRayon, _ZoneRayonInt, _Orient ); break; - } - case 62 : // il s agit d un disque avec trou + } + case 62 : // il s agit d un disque avec trou, dans le plan (Y,Z) { aZone = myHomardGen->CreateZoneDiskWithHole(CORBA::string_dup(_Name.toStdString().c_str()), \ _ZoneYcentre, _ZoneZcentre, _ZoneRayon, _ZoneRayonInt, _Orient ); break; - } - case 63 : // il s agit d un disque avec trou + } + case 63 : // il s agit d un disque avec trou, dans le plan (Z,X) { aZone = myHomardGen->CreateZoneDiskWithHole(CORBA::string_dup(_Name.toStdString().c_str()), \ _ZoneZcentre, _ZoneXcentre, _ZoneRayon, _ZoneRayonInt, _Orient ); break; - } + } case 7 : // il s agit d un tuyau { aZone = myHomardGen->CreateZonePipe(CORBA::string_dup(_Name.toStdString().c_str()), \ _ZoneXcentre, _ZoneYcentre, _ZoneZcentre, _ZoneXaxis, _ZoneYaxis, _ZoneZaxis, _ZoneRayon, _ZoneHaut, _ZoneRayonInt ); break; - } + } } } catch( SALOME::SALOME_Exception& S_ex ) @@ -568,13 +572,18 @@ bool MonCreateZone:: CreateOrUpdateZone() return true; } - else { return false ; } + else { + QMessageBox::warning( 0, QObject::tr("HOM_WARNING"), + QObject::tr("HOM_SELECT_OBJECT_4") ); + return false ; + } + MESSAGE("Fin de CreateOrUpdateZone"); } // ------------------------------------------------------------------------ void MonCreateZone::PushOnOK() // ------------------------------------------------------------------------ { - if (PushOnApply()) this->close() ; + if (PushOnApply()) this->close() ; } // ------------------------------------------------------------------------ void MonCreateZone::PushOnHelp() @@ -588,6 +597,7 @@ void MonCreateZone::PushOnHelp() void MonCreateZone::SetNewName() // ----------------------------------- { + MESSAGE("SetNewName"); // Recherche d'un nom par defaut qui n'existe pas encore HOMARD::listeZones_var MyObjects = myHomardGen->GetAllZonesName() ; @@ -607,11 +617,13 @@ void MonCreateZone::SetNewName() } } LEName->setText(aName); + MESSAGE("SetNewName aName ="<setVisible(1) ; gBSphere->setVisible(0) ; gBCylindre->setVisible(0) ; @@ -629,12 +641,13 @@ void MonCreateZone::SetBox() if ( _Zincr > 0 ) { SpinBox_Zmini->setValue(_Zcentre-10*_Zincr) ; SpinBox_Zmaxi->setValue(_Zcentre+10*_Zincr) ; } else { _Type=11 ; } + MESSAGE("Fin de SetBox"); } // ------------------------------------------------------------------------ void MonCreateZone::SetSphere() // ------------------------------------------------------------------------ { - MESSAGE("Debut de SetSphere") + MESSAGE("Debut de SetSphere"); gBBox->setVisible(0) ; gBSphere->setVisible(1) ; gBCylindre->setVisible(0) ; @@ -645,13 +658,13 @@ void MonCreateZone::SetSphere() SpinBox_Ycentre->setValue(_Ycentre) ; SpinBox_Zcentre->setValue(_Zcentre) ; SpinBox_Rayon->setValue(_Rayon) ; - MESSAGE("Fin de SetSphere") + MESSAGE("Fin de SetSphere"); } // ------------------------------------------------------------------------ void MonCreateZone::SetCylinder() // ------------------------------------------------------------------------ { - MESSAGE("Debut de SetCylinder") + MESSAGE("Debut de SetCylinder"); gBBox->setVisible(0) ; gBSphere->setVisible(0) ; gBCylindre->setVisible(1) ; @@ -669,13 +682,13 @@ void MonCreateZone::SetCylinder() else { _Type=31 ; } SpinBox_Radius->setValue(_Rayon) ; SpinBox_Haut->setValue(_Haut) ; - MESSAGE("Fin de SetCylinder") + MESSAGE("Fin de SetCylinder"); } // ------------------------------------------------------------------------ void MonCreateZone::SetPipe() // ------------------------------------------------------------------------ { - MESSAGE("Debut de SetPipe") + MESSAGE("Debut de SetPipe"); gBBox->setVisible(0) ; gBSphere->setVisible(0) ; gBCylindre->setVisible(0) ; @@ -694,7 +707,7 @@ void MonCreateZone::SetPipe() SpinBox_Radius_int->setValue(_RayonInt) ; SpinBox_Radius_ext->setValue(_Rayon) ; SpinBox_Haut_p->setValue(_Haut) ; - MESSAGE("Fin de SetPipe") + MESSAGE("Fin de SetPipe"); }