From 27c6e3b847bd0f6caca399c9d8841ac8d36a8ed1 Mon Sep 17 00:00:00 2001 From: nicolas Date: Wed, 15 Jan 2014 13:50:37 +0000 Subject: [PATCH] =?utf8?q?Fronti=C3=83=C2=A8re=20analytique=20torique?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- idl/HOMARD_Boundary.idl | 4 + idl/HOMARD_Gen.idl | 5 + resources/CMakeLists.txt | 1 + resources/toruspointvector.png | Bin 0 -> 1165 bytes src/HOMARD/HOMARD_Boundary.cxx | 31 ++- src/HOMARD/HOMARD_Boundary.hxx | 2 + src/HOMARD/HomardDriver.cxx | 41 ++++ src/HOMARDGUI/CreateBoundaryAn.h | 220 ++++++++++++++++++-- src/HOMARDGUI/CreateBoundaryAn.ui | 286 +++++++++++++++++++++++++- src/HOMARDGUI/CreateZone.h | 8 +- src/HOMARDGUI/CreateZone.ui | 8 +- src/HOMARDGUI/HOMARD_msg_fr.ts | 12 ++ src/HOMARDGUI/MonCreateBoundaryAn.cxx | 124 +++++++++-- src/HOMARDGUI/MonCreateBoundaryAn.h | 4 + src/HOMARDGUI/MonCreateZone.cxx | 6 - src/HOMARDGUI/MonEditBoundaryAn.cxx | 75 ++++++- src/HOMARDGUI/MonEditBoundaryAn.h | 2 + src/HOMARDGUI/MonEditZone.cxx | 4 - src/HOMARD_I/HOMARD_Boundary_i.cxx | 6 + src/HOMARD_I/HOMARD_Boundary_i.hxx | 3 + src/HOMARD_I/HOMARD_Gen_i.cxx | 39 ++++ src/HOMARD_I/HOMARD_Gen_i.hxx | 4 + 22 files changed, 821 insertions(+), 64 deletions(-) create mode 100644 resources/toruspointvector.png diff --git a/idl/HOMARD_Boundary.idl b/idl/HOMARD_Boundary.idl index da4c0093..81115039 100644 --- a/idl/HOMARD_Boundary.idl +++ b/idl/HOMARD_Boundary.idl @@ -74,6 +74,10 @@ module HOMARD in double Xcentre,in double Ycentre,in double ZCentre) raises (SALOME::SALOME_Exception); + void SetTorus (in double Xcentre, in double Ycentre, in double Zcentre, + in double Xaxe, in double Yaxe, in double Zaxe, in double rayonRev, in double rayonPri) + raises (SALOME::SALOME_Exception); + HOMARD::double_array GetCoords() raises (SALOME::SALOME_Exception); diff --git a/idl/HOMARD_Gen.idl b/idl/HOMARD_Gen.idl index 827d53fe..8ae213db 100644 --- a/idl/HOMARD_Gen.idl +++ b/idl/HOMARD_Gen.idl @@ -70,6 +70,11 @@ module HOMARD in double Xaxis, in double Yaxis, in double Zaxis, in double Angle, in double Xcentre, in double Ycentre, in double Zcentre) raises(SALOME::SALOME_Exception); + HOMARD_Boundary CreateBoundaryTorus (in string BoundaryName, + in double Xcentre, in double Ycentre, in double Zcentre, + in double Xaxis, in double Yaxis, in double Zaxis, + in double RadiusRev, in double RadiusPri) + raises (SALOME::SALOME_Exception); HOMARD_Cas CreateCase(in string CaseName, in string MeshName, in string FileName ) raises(SALOME::SALOME_Exception); HOMARD_Cas CreateCaseFromIteration(in string CaseName, in string DirNameStart ) diff --git a/resources/CMakeLists.txt b/resources/CMakeLists.txt index 58bf62b2..e4fa9f63 100755 --- a/resources/CMakeLists.txt +++ b/resources/CMakeLists.txt @@ -65,6 +65,7 @@ SET(HOMARD_RESOURCES_FILES table_view.png texte.png texte_2.png + toruspointvector.png triangle.png whatis.png write.png diff --git a/resources/toruspointvector.png b/resources/toruspointvector.png new file mode 100644 index 0000000000000000000000000000000000000000..138b52042d4fde5102e7492ebd13262a10c2b3c7 GIT binary patch literal 1165 zcmV;81akX{P)z@;j(q!3lK=n!AY({UO#lFTB>(_`g8%^e{{R4h=>PzA zFaQARU;qF*m;eA5Z<1fdMgRZ=14%?dRCwBA{Qv(y12q9a05LI882|(jBQA;Z^78+G z{`_J1_3IZy=9)DOUGDA--@kun`1uaOwjHAQoH(Nn6D+{QUiw;Rg^i01cFK z$Y%Ka??1z@KmQoaU%&qUP@cMPs|7Xvh@c^a2!pr~&Ab1$&<>mdCvrA(5 z@bx#ti}&9c?!WlLaO24bhTBixfaM>)c+c?c?H7i(pMC-@`~!43(50D+7`V8&z5u1U zVdek?5ZJ)<^z{Go4yg>EfG&CsblIaraet-K2bEOJE05QFO{Tk?1NR0jf#wa5&DlIeTfqe%u0O&Fg5C=$uytKgF+&slL zV>$yUfBpUao#FTQ&kSGRJ%M{0Ab=Q!goOTEO@STwZoQOeX$G=~|wDpw`X7dWfBynw@*~)#phW!l_Ya0gC)dKf2{Y^h$cG>rAb^ld3uHq>zh$VoS2aAC)`8!arUVxQ200D%ppyY-cqylxR1Qs HOMARD_Boundary::GetCoords() const { std::vector mesCoor; @@ -235,7 +251,20 @@ std::vector HOMARD_Boundary::GetCoords() const mesCoor.push_back( _Rayon2 ); break ; } - VERIFICATION( (_Type>=1) && (_Type<=4) ) ; +// Tore + case 5: + { + mesCoor.push_back( _Xcentre ); + mesCoor.push_back( _Ycentre ); + mesCoor.push_back( _Zcentre ); + mesCoor.push_back( _Xaxe ); + mesCoor.push_back( _Yaxe ); + mesCoor.push_back( _Zaxe ); + mesCoor.push_back( _Rayon1 ); + mesCoor.push_back( _Rayon2 ); + break ; + } + VERIFICATION( (_Type>=1) && (_Type<=5) ) ; } return mesCoor; } diff --git a/src/HOMARD/HOMARD_Boundary.hxx b/src/HOMARD/HOMARD_Boundary.hxx index df94e5e6..164044a7 100644 --- a/src/HOMARD/HOMARD_Boundary.hxx +++ b/src/HOMARD/HOMARD_Boundary.hxx @@ -73,6 +73,8 @@ public: double Xcentre2, double Ycentre2, double Zcentre2, double Rayon2); void SetConeA( double Xaxe, double Yaxe, double Zaxe, double Angle, double Xcentre, double Ycentre, double ZCentre); + void SetTorus( double X0, double X1, double X2, double X3, + double X4, double X5, double X6, double X7 ); std::vector GetCoords() const; diff --git a/src/HOMARD/HomardDriver.cxx b/src/HOMARD/HomardDriver.cxx index 4589c24a..12f70941 100644 --- a/src/HOMARD/HomardDriver.cxx +++ b/src/HOMARD/HomardDriver.cxx @@ -657,6 +657,8 @@ void HomardDriver::TexteBoundaryAn( const std::string NameBoundary, int NumeBoun { saux += "# Sphere\n" ; } if ( BoundaryType == 3 || BoundaryType == 4 ) { saux += "# Cone\n" ; } + if ( BoundaryType == 5 ) + { saux += "# Tore\n" ; } // // Le nom de la frontiere // @@ -800,6 +802,45 @@ void HomardDriver::TexteBoundaryAn( const std::string NameBoundary, int NumeBoun saux += "FARayon2 " + saux1.str() + "\n" ; } } +// +// Cas du tore +// + if ( BoundaryType == 5 ) + { + { std::stringstream saux1 ; + saux1 << NumeBoundary << " " << x0 ; + saux2 = saux1.str() ; + saux += "FAXCen " + saux1.str() + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeBoundary << " " << x1 ; + saux += "FAYCen " + saux1.str() + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeBoundary << " " << x2 ; + saux += "FAZCen " + saux1.str() + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeBoundary << " " << x3 ; + saux += "FAXAxe " + saux1.str() + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeBoundary << " " << x4 ; + saux += "FAYAxe " + saux1.str() + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeBoundary << " " << x5 ; + saux += "FAZAxe " + saux1.str() + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeBoundary << " " << x6 ; + saux += "FARayon " + saux1.str() + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeBoundary << " " << x7 ; + saux += "FARayon2 " + saux1.str() + "\n" ; + } + } // _Texte += saux + "#\n" ; // diff --git a/src/HOMARDGUI/CreateBoundaryAn.h b/src/HOMARDGUI/CreateBoundaryAn.h index 48778fdd..60cc12b7 100644 --- a/src/HOMARDGUI/CreateBoundaryAn.h +++ b/src/HOMARDGUI/CreateBoundaryAn.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'CreateBoundaryAn.ui' ** -** Created: Tue Sep 17 14:08:40 2013 +** Created: Wed Jan 15 11:19:06 2014 ** by: Qt User Interface Compiler version 4.6.3 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! @@ -29,7 +29,7 @@ QT_BEGIN_NAMESPACE class Ui_CreateBoundaryAn { public: - QGridLayout *gridLayout_4; + QGridLayout *gridLayout_5; QLabel *Name; QLineEdit *LEName; QGroupBox *TypeBoundary; @@ -37,6 +37,7 @@ public: QRadioButton *RBCylindre; QRadioButton *RBSphere; QRadioButton *RBCone; + QRadioButton *RBTore; QGroupBox *gBCylindre; QGridLayout *gridLayout1; QDoubleSpinBox *SpinBox_Xcent; @@ -85,6 +86,24 @@ public: QDoubleSpinBox *SpinBox_Cone_V1; QLabel *TLCone_V2; QDoubleSpinBox *SpinBox_Cone_V2; + QGroupBox *gBTore; + QGridLayout *gridLayout_4; + QLabel *TLToreXcent; + QDoubleSpinBox *SpinBoxToreXcent; + QLabel *TLToreXaxe; + QDoubleSpinBox *SpinBoxToreXaxe; + QLabel *TLToreYcent; + QDoubleSpinBox *SpinBoxToreYcent; + QLabel *TLToreYaxe; + QDoubleSpinBox *SpinBoxToreYaxe; + QLabel *TLToreZcent; + QDoubleSpinBox *SpinBoxToreZcent; + QLabel *TLToreZaxe; + QDoubleSpinBox *SpinBoxToreZaxe; + QLabel *TLToreRayRev; + QDoubleSpinBox *SpinBoxToreRRev; + QLabel *TLToreRayPri; + QDoubleSpinBox *SpinBoxToreRPri; QGroupBox *GBButtons; QGridLayout *gridLayout3; QPushButton *buttonHelp; @@ -96,21 +115,21 @@ public: { if (CreateBoundaryAn->objectName().isEmpty()) CreateBoundaryAn->setObjectName(QString::fromUtf8("CreateBoundaryAn")); - CreateBoundaryAn->resize(527, 701); + CreateBoundaryAn->resize(522, 835); CreateBoundaryAn->setAutoFillBackground(true); CreateBoundaryAn->setSizeGripEnabled(true); - gridLayout_4 = new QGridLayout(CreateBoundaryAn); - gridLayout_4->setObjectName(QString::fromUtf8("gridLayout_4")); + gridLayout_5 = new QGridLayout(CreateBoundaryAn); + gridLayout_5->setObjectName(QString::fromUtf8("gridLayout_5")); Name = new QLabel(CreateBoundaryAn); Name->setObjectName(QString::fromUtf8("Name")); - gridLayout_4->addWidget(Name, 0, 0, 1, 1); + gridLayout_5->addWidget(Name, 0, 0, 1, 1); LEName = new QLineEdit(CreateBoundaryAn); LEName->setObjectName(QString::fromUtf8("LEName")); LEName->setMaxLength(32); - gridLayout_4->addWidget(LEName, 0, 1, 1, 1); + gridLayout_5->addWidget(LEName, 0, 1, 1, 1); TypeBoundary = new QGroupBox(CreateBoundaryAn); TypeBoundary->setObjectName(QString::fromUtf8("TypeBoundary")); @@ -148,8 +167,18 @@ public: gridLayout->addWidget(RBCone, 0, 2, 1, 1); + RBTore = new QRadioButton(TypeBoundary); + RBTore->setObjectName(QString::fromUtf8("RBTore")); + QIcon icon3; + icon3.addFile(QString::fromUtf8("../../resources/toruspointvector.png"), QSize(), QIcon::Normal, QIcon::Off); + RBTore->setIcon(icon3); + RBTore->setCheckable(true); + RBTore->setChecked(false); + + gridLayout->addWidget(RBTore, 0, 3, 1, 1); - gridLayout_4->addWidget(TypeBoundary, 1, 0, 1, 2); + + gridLayout_5->addWidget(TypeBoundary, 1, 0, 1, 2); gBCylindre = new QGroupBox(CreateBoundaryAn); gBCylindre->setObjectName(QString::fromUtf8("gBCylindre")); @@ -281,7 +310,7 @@ public: gridLayout1->addWidget(SpinBox_Xaxis, 0, 3, 1, 1); - gridLayout_4->addWidget(gBCylindre, 2, 0, 1, 2); + gridLayout_5->addWidget(gBCylindre, 2, 0, 1, 2); gBSphere = new QGroupBox(CreateBoundaryAn); gBSphere->setObjectName(QString::fromUtf8("gBSphere")); @@ -364,7 +393,7 @@ public: gridLayout2->addWidget(TLXcentre, 0, 0, 1, 1); - gridLayout_4->addWidget(gBSphere, 3, 0, 1, 2); + gridLayout_5->addWidget(gBSphere, 3, 0, 1, 2); gBCone = new QGroupBox(CreateBoundaryAn); gBCone->setObjectName(QString::fromUtf8("gBCone")); @@ -378,18 +407,18 @@ public: gridLayout_2->setObjectName(QString::fromUtf8("gridLayout_2")); RB_Def_radius = new QRadioButton(groupBox); RB_Def_radius->setObjectName(QString::fromUtf8("RB_Def_radius")); - QIcon icon3; - icon3.addFile(QString::fromUtf8("../../resources/conedxyz.png"), QSize(), QIcon::Normal, QIcon::Off); - RB_Def_radius->setIcon(icon3); + QIcon icon4; + icon4.addFile(QString::fromUtf8("../../resources/conedxyz.png"), QSize(), QIcon::Normal, QIcon::Off); + RB_Def_radius->setIcon(icon4); RB_Def_radius->setChecked(true); gridLayout_2->addWidget(RB_Def_radius, 0, 0, 1, 1); RB_Def_angle = new QRadioButton(groupBox); RB_Def_angle->setObjectName(QString::fromUtf8("RB_Def_angle")); - QIcon icon4; - icon4.addFile(QString::fromUtf8("../../resources/conepointvector.png"), QSize(), QIcon::Normal, QIcon::Off); - RB_Def_angle->setIcon(icon4); + QIcon icon5; + icon5.addFile(QString::fromUtf8("../../resources/conepointvector.png"), QSize(), QIcon::Normal, QIcon::Off); + RB_Def_angle->setIcon(icon5); gridLayout_2->addWidget(RB_Def_angle, 0, 1, 1, 1); @@ -508,7 +537,7 @@ public: SpinBox_Cone_V1 = new QDoubleSpinBox(gBCone); SpinBox_Cone_V1->setObjectName(QString::fromUtf8("SpinBox_Cone_V1")); - SpinBox_Cone_V1->setDecimals(14); + SpinBox_Cone_V1->setDecimals(5); SpinBox_Cone_V1->setMaximum(1e+09); gridLayout_3->addWidget(SpinBox_Cone_V1, 4, 1, 1, 1); @@ -523,13 +552,154 @@ public: SpinBox_Cone_V2 = new QDoubleSpinBox(gBCone); SpinBox_Cone_V2->setObjectName(QString::fromUtf8("SpinBox_Cone_V2")); - SpinBox_Cone_V2->setDecimals(14); + SpinBox_Cone_V2->setDecimals(5); SpinBox_Cone_V2->setMaximum(1e+09); gridLayout_3->addWidget(SpinBox_Cone_V2, 4, 3, 1, 1); - gridLayout_4->addWidget(gBCone, 4, 0, 1, 2); + gridLayout_5->addWidget(gBCone, 4, 0, 1, 2); + + gBTore = new QGroupBox(CreateBoundaryAn); + gBTore->setObjectName(QString::fromUtf8("gBTore")); + sizePolicy.setHeightForWidth(gBTore->sizePolicy().hasHeightForWidth()); + gBTore->setSizePolicy(sizePolicy); + gridLayout_4 = new QGridLayout(gBTore); + gridLayout_4->setObjectName(QString::fromUtf8("gridLayout_4")); + TLToreXcent = new QLabel(gBTore); + TLToreXcent->setObjectName(QString::fromUtf8("TLToreXcent")); + sizePolicy.setHeightForWidth(TLToreXcent->sizePolicy().hasHeightForWidth()); + TLToreXcent->setSizePolicy(sizePolicy); + TLToreXcent->setWordWrap(false); + + gridLayout_4->addWidget(TLToreXcent, 0, 0, 1, 1); + + SpinBoxToreXcent = new QDoubleSpinBox(gBTore); + SpinBoxToreXcent->setObjectName(QString::fromUtf8("SpinBoxToreXcent")); + SpinBoxToreXcent->setDecimals(5); + SpinBoxToreXcent->setMinimum(-1e+09); + SpinBoxToreXcent->setMaximum(1e+09); + SpinBoxToreXcent->setValue(0); + + gridLayout_4->addWidget(SpinBoxToreXcent, 0, 1, 1, 1); + + TLToreXaxe = new QLabel(gBTore); + TLToreXaxe->setObjectName(QString::fromUtf8("TLToreXaxe")); + sizePolicy.setHeightForWidth(TLToreXaxe->sizePolicy().hasHeightForWidth()); + TLToreXaxe->setSizePolicy(sizePolicy); + TLToreXaxe->setWordWrap(false); + + gridLayout_4->addWidget(TLToreXaxe, 0, 2, 1, 1); + + SpinBoxToreXaxe = new QDoubleSpinBox(gBTore); + SpinBoxToreXaxe->setObjectName(QString::fromUtf8("SpinBoxToreXaxe")); + SpinBoxToreXaxe->setDecimals(5); + SpinBoxToreXaxe->setMinimum(-1e+09); + SpinBoxToreXaxe->setMaximum(1e+09); + SpinBoxToreXaxe->setValue(0); + + gridLayout_4->addWidget(SpinBoxToreXaxe, 0, 3, 1, 1); + + TLToreYcent = new QLabel(gBTore); + TLToreYcent->setObjectName(QString::fromUtf8("TLToreYcent")); + sizePolicy.setHeightForWidth(TLToreYcent->sizePolicy().hasHeightForWidth()); + TLToreYcent->setSizePolicy(sizePolicy); + TLToreYcent->setWordWrap(false); + + gridLayout_4->addWidget(TLToreYcent, 1, 0, 1, 1); + + SpinBoxToreYcent = new QDoubleSpinBox(gBTore); + SpinBoxToreYcent->setObjectName(QString::fromUtf8("SpinBoxToreYcent")); + SpinBoxToreYcent->setDecimals(5); + SpinBoxToreYcent->setMinimum(-1e+09); + SpinBoxToreYcent->setMaximum(1e+09); + SpinBoxToreYcent->setValue(0); + + gridLayout_4->addWidget(SpinBoxToreYcent, 1, 1, 1, 1); + + TLToreYaxe = new QLabel(gBTore); + TLToreYaxe->setObjectName(QString::fromUtf8("TLToreYaxe")); + sizePolicy.setHeightForWidth(TLToreYaxe->sizePolicy().hasHeightForWidth()); + TLToreYaxe->setSizePolicy(sizePolicy); + TLToreYaxe->setWordWrap(false); + + gridLayout_4->addWidget(TLToreYaxe, 1, 2, 1, 1); + + SpinBoxToreYaxe = new QDoubleSpinBox(gBTore); + SpinBoxToreYaxe->setObjectName(QString::fromUtf8("SpinBoxToreYaxe")); + SpinBoxToreYaxe->setDecimals(5); + SpinBoxToreYaxe->setMinimum(-1e+09); + SpinBoxToreYaxe->setMaximum(1e+09); + SpinBoxToreYaxe->setValue(0); + + gridLayout_4->addWidget(SpinBoxToreYaxe, 1, 3, 1, 1); + + TLToreZcent = new QLabel(gBTore); + TLToreZcent->setObjectName(QString::fromUtf8("TLToreZcent")); + sizePolicy.setHeightForWidth(TLToreZcent->sizePolicy().hasHeightForWidth()); + TLToreZcent->setSizePolicy(sizePolicy); + TLToreZcent->setWordWrap(false); + + gridLayout_4->addWidget(TLToreZcent, 2, 0, 1, 1); + + SpinBoxToreZcent = new QDoubleSpinBox(gBTore); + SpinBoxToreZcent->setObjectName(QString::fromUtf8("SpinBoxToreZcent")); + SpinBoxToreZcent->setDecimals(5); + SpinBoxToreZcent->setMinimum(-1e+09); + SpinBoxToreZcent->setMaximum(1e+09); + SpinBoxToreZcent->setValue(0); + + gridLayout_4->addWidget(SpinBoxToreZcent, 2, 1, 1, 1); + + TLToreZaxe = new QLabel(gBTore); + TLToreZaxe->setObjectName(QString::fromUtf8("TLToreZaxe")); + sizePolicy.setHeightForWidth(TLToreZaxe->sizePolicy().hasHeightForWidth()); + TLToreZaxe->setSizePolicy(sizePolicy); + TLToreZaxe->setWordWrap(false); + + gridLayout_4->addWidget(TLToreZaxe, 2, 2, 1, 1); + + SpinBoxToreZaxe = new QDoubleSpinBox(gBTore); + SpinBoxToreZaxe->setObjectName(QString::fromUtf8("SpinBoxToreZaxe")); + SpinBoxToreZaxe->setDecimals(5); + SpinBoxToreZaxe->setMinimum(-1e+09); + SpinBoxToreZaxe->setMaximum(1e+09); + SpinBoxToreZaxe->setValue(0); + + gridLayout_4->addWidget(SpinBoxToreZaxe, 2, 3, 1, 1); + + TLToreRayRev = new QLabel(gBTore); + TLToreRayRev->setObjectName(QString::fromUtf8("TLToreRayRev")); + sizePolicy.setHeightForWidth(TLToreRayRev->sizePolicy().hasHeightForWidth()); + TLToreRayRev->setSizePolicy(sizePolicy); + TLToreRayRev->setWordWrap(false); + + gridLayout_4->addWidget(TLToreRayRev, 3, 0, 1, 1); + + SpinBoxToreRRev = new QDoubleSpinBox(gBTore); + SpinBoxToreRRev->setObjectName(QString::fromUtf8("SpinBoxToreRRev")); + SpinBoxToreRRev->setDecimals(5); + SpinBoxToreRRev->setMaximum(1e+09); + + gridLayout_4->addWidget(SpinBoxToreRRev, 3, 1, 1, 1); + + TLToreRayPri = new QLabel(gBTore); + TLToreRayPri->setObjectName(QString::fromUtf8("TLToreRayPri")); + sizePolicy.setHeightForWidth(TLToreRayPri->sizePolicy().hasHeightForWidth()); + TLToreRayPri->setSizePolicy(sizePolicy); + TLToreRayPri->setWordWrap(false); + + gridLayout_4->addWidget(TLToreRayPri, 3, 2, 1, 1); + + SpinBoxToreRPri = new QDoubleSpinBox(gBTore); + SpinBoxToreRPri->setObjectName(QString::fromUtf8("SpinBoxToreRPri")); + SpinBoxToreRPri->setDecimals(5); + SpinBoxToreRPri->setMaximum(1e+09); + + gridLayout_4->addWidget(SpinBoxToreRPri, 3, 3, 1, 1); + + + gridLayout_5->addWidget(gBTore, 5, 0, 1, 2); GBButtons = new QGroupBox(CreateBoundaryAn); GBButtons->setObjectName(QString::fromUtf8("GBButtons")); @@ -564,7 +734,7 @@ public: gridLayout3->addWidget(buttonOk, 0, 0, 1, 1); - gridLayout_4->addWidget(GBButtons, 5, 0, 1, 2); + gridLayout_5->addWidget(GBButtons, 6, 0, 1, 2); retranslateUi(CreateBoundaryAn); @@ -580,6 +750,7 @@ public: RBCylindre->setText(QApplication::translate("CreateBoundaryAn", "Cylinder", 0, QApplication::UnicodeUTF8)); RBSphere->setText(QApplication::translate("CreateBoundaryAn", "Sphere", 0, QApplication::UnicodeUTF8)); RBCone->setText(QApplication::translate("CreateBoundaryAn", "Cone", 0, QApplication::UnicodeUTF8)); + RBTore->setText(QApplication::translate("CreateBoundaryAn", "Torus", 0, QApplication::UnicodeUTF8)); gBCylindre->setTitle(QApplication::translate("CreateBoundaryAn", "Coordinates", 0, QApplication::UnicodeUTF8)); TLXcent->setText(QApplication::translate("CreateBoundaryAn", "X centre", 0, QApplication::UnicodeUTF8)); TLradius->setText(QApplication::translate("CreateBoundaryAn", "Radius", 0, QApplication::UnicodeUTF8)); @@ -605,6 +776,15 @@ public: TLCone_Z2->setText(QApplication::translate("CreateBoundaryAn", "Z 2", 0, QApplication::UnicodeUTF8)); TLCone_V1->setText(QApplication::translate("CreateBoundaryAn", "V 1", 0, QApplication::UnicodeUTF8)); TLCone_V2->setText(QApplication::translate("CreateBoundaryAn", "V 2", 0, QApplication::UnicodeUTF8)); + gBTore->setTitle(QApplication::translate("CreateBoundaryAn", "Coordinates", 0, QApplication::UnicodeUTF8)); + TLToreXcent->setText(QApplication::translate("CreateBoundaryAn", "X centre", 0, QApplication::UnicodeUTF8)); + TLToreXaxe->setText(QApplication::translate("CreateBoundaryAn", "X axis", 0, QApplication::UnicodeUTF8)); + TLToreYcent->setText(QApplication::translate("CreateBoundaryAn", "Y centre", 0, QApplication::UnicodeUTF8)); + TLToreYaxe->setText(QApplication::translate("CreateBoundaryAn", "Y axis", 0, QApplication::UnicodeUTF8)); + TLToreZcent->setText(QApplication::translate("CreateBoundaryAn", "Z centre", 0, QApplication::UnicodeUTF8)); + TLToreZaxe->setText(QApplication::translate("CreateBoundaryAn", "Z axis", 0, QApplication::UnicodeUTF8)); + TLToreRayRev->setText(QApplication::translate("CreateBoundaryAn", "R revolution", 0, QApplication::UnicodeUTF8)); + TLToreRayPri->setText(QApplication::translate("CreateBoundaryAn", "Primary R", 0, QApplication::UnicodeUTF8)); GBButtons->setTitle(QString()); buttonHelp->setText(QApplication::translate("CreateBoundaryAn", "Help", 0, QApplication::UnicodeUTF8)); buttonCancel->setText(QApplication::translate("CreateBoundaryAn", "Cancel", 0, QApplication::UnicodeUTF8)); diff --git a/src/HOMARDGUI/CreateBoundaryAn.ui b/src/HOMARDGUI/CreateBoundaryAn.ui index 30eecf63..ac291082 100644 --- a/src/HOMARDGUI/CreateBoundaryAn.ui +++ b/src/HOMARDGUI/CreateBoundaryAn.ui @@ -6,8 +6,8 @@ 0 0 - 527 - 701 + 522 + 835 @@ -19,7 +19,7 @@ true - + @@ -91,6 +91,23 @@ + + + + Torus + + + + ../../resources/toruspointvector.png../../resources/toruspointvector.png + + + true + + + false + + + @@ -739,7 +756,7 @@ - 14 + 5 1000000000.000000000000000 @@ -765,7 +782,7 @@ - 14 + 5 1000000000.000000000000000 @@ -776,6 +793,265 @@ + + + + 0 + 0 + + + + Coordinates + + + + + + + 0 + 0 + + + + X centre + + + false + + + + + + + 5 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + + 0 + 0 + + + + X axis + + + false + + + + + + + 5 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + + 0 + 0 + + + + Y centre + + + false + + + + + + + 5 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + + 0 + 0 + + + + Y axis + + + false + + + + + + + 5 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + + 0 + 0 + + + + Z centre + + + false + + + + + + + 5 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + + 0 + 0 + + + + Z axis + + + false + + + + + + + 5 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + + 0 + 0 + + + + R revolution + + + false + + + + + + + 5 + + + 1000000000.000000000000000 + + + + + + + + 0 + 0 + + + + Primary R + + + false + + + + + + + 5 + + + 1000000000.000000000000000 + + + + + + + diff --git a/src/HOMARDGUI/CreateZone.h b/src/HOMARDGUI/CreateZone.h index 5a968248..74f50886 100644 --- a/src/HOMARDGUI/CreateZone.h +++ b/src/HOMARDGUI/CreateZone.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'CreateZone.ui' ** -** Created: Wed Jan 15 08:42:10 2014 +** Created: Wed Jan 15 14:45:55 2014 ** by: Qt User Interface Compiler version 4.6.3 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! @@ -115,7 +115,7 @@ public: { if (CreateZone->objectName().isEmpty()) CreateZone->setObjectName(QString::fromUtf8("CreateZone")); - CreateZone->resize(550, 770); + CreateZone->resize(545, 778); CreateZone->setSizeIncrement(QSize(1, 1)); CreateZone->setBaseSize(QSize(550, 400)); CreateZone->setAutoFillBackground(true); @@ -368,7 +368,7 @@ public: SpinBox_Rayon = new QDoubleSpinBox(gBSphere); SpinBox_Rayon->setObjectName(QString::fromUtf8("SpinBox_Rayon")); SpinBox_Rayon->setDecimals(5); - SpinBox_Rayon->setMinimum(-1e+09); + SpinBox_Rayon->setMinimum(0); SpinBox_Rayon->setMaximum(1e+09); SpinBox_Rayon->setValue(0); @@ -741,7 +741,7 @@ public: horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - gridLayout->addItem(horizontalSpacer, 6, 3, 1, 1); + gridLayout->addItem(horizontalSpacer, 6, 3, 1, 2); retranslateUi(CreateZone); diff --git a/src/HOMARDGUI/CreateZone.ui b/src/HOMARDGUI/CreateZone.ui index 7ac07232..84a60751 100644 --- a/src/HOMARDGUI/CreateZone.ui +++ b/src/HOMARDGUI/CreateZone.ui @@ -6,8 +6,8 @@ 0 0 - 550 - 770 + 545 + 778 @@ -466,7 +466,7 @@ 5 - -999999999.000000000000000 + 0.000000000000000 999999999.000000000000000 @@ -1119,7 +1119,7 @@ - + Qt::Horizontal diff --git a/src/HOMARDGUI/HOMARD_msg_fr.ts b/src/HOMARDGUI/HOMARD_msg_fr.ts index 71295cf1..28b90c82 100644 --- a/src/HOMARDGUI/HOMARD_msg_fr.ts +++ b/src/HOMARDGUI/HOMARD_msg_fr.ts @@ -755,6 +755,10 @@ Type of boundary Type de la frontière + + Torus + Tore + Radius Rayon @@ -791,6 +795,14 @@ Z axis Z axe + + R revolution + R révolution + + + Primary R + R primaire + HOM_BOUN_NAME Il faut donner un nom à la frontière. diff --git a/src/HOMARDGUI/MonCreateBoundaryAn.cxx b/src/HOMARDGUI/MonCreateBoundaryAn.cxx index 993f5400..194569cb 100644 --- a/src/HOMARDGUI/MonCreateBoundaryAn.cxx +++ b/src/HOMARDGUI/MonCreateBoundaryAn.cxx @@ -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() @@ -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); @@ -491,6 +561,7 @@ void MonCreateBoundaryAn::SetCylinder() gBCylindre->setVisible(1); gBSphere->setVisible(0); gBCone->setVisible(0); + gBTore->setVisible(0); // _Type=1; // @@ -505,6 +576,7 @@ void MonCreateBoundaryAn::SetSphere() gBCylindre->setVisible(0); gBSphere->setVisible(1); gBCone->setVisible(0); + gBTore->setVisible(0); // _Type=2; // @@ -627,6 +699,7 @@ void MonCreateBoundaryAn::SetCone() gBCylindre->setVisible(0); gBSphere->setVisible(0); gBCone->setVisible(1); + gBTore->setVisible(0); // if ( RB_Def_radius->isChecked() ) { @@ -641,6 +714,21 @@ void MonCreateBoundaryAn::SetCone() // 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 : diff --git a/src/HOMARDGUI/MonCreateBoundaryAn.h b/src/HOMARDGUI/MonCreateBoundaryAn.h index e7476f28..fc8dab45 100644 --- a/src/HOMARDGUI/MonCreateBoundaryAn.h +++ b/src/HOMARDGUI/MonCreateBoundaryAn.h @@ -63,6 +63,9 @@ protected : double _BoundaryAnXaxisCone, _BoundaryAnYaxisCone, _BoundaryAnZaxisCone; double _BoundaryAnXorigCone, _BoundaryAnYorigCone, _BoundaryAnZorigCone; double _BoundaryAngle; + double _BoundaryAnToreXcentre, _BoundaryAnToreYcentre, _BoundaryAnToreZcentre; + double _BoundaryAnToreXaxe, _BoundaryAnToreYaxe, _BoundaryAnToreZaxe; + double _BoundaryAnToreRRev, _BoundaryAnToreRPri; bool Chgt; @@ -83,6 +86,7 @@ public slots: virtual void SetCone(); virtual void SetConeR(); virtual void SetConeA(); + virtual void SetTore(); virtual void PushOnOK(); virtual bool PushOnApply(); virtual void PushOnHelp(); diff --git a/src/HOMARDGUI/MonCreateZone.cxx b/src/HOMARDGUI/MonCreateZone.cxx index 33aac925..372459ae 100644 --- a/src/HOMARDGUI/MonCreateZone.cxx +++ b/src/HOMARDGUI/MonCreateZone.cxx @@ -287,13 +287,9 @@ void MonCreateZone::InitMinMax() } // Rayons SpinBox_Rayon->setSingleStep(_Rayon/10.) ; - SpinBox_Rayon->setMinimum(0.) ; SpinBox_Radius->setSingleStep(_Rayon/10.) ; - SpinBox_Radius->setMinimum(0.) ; SpinBox_Radius_int->setSingleStep(_Rayon/20.) ; - SpinBox_Radius_int->setMinimum(0.) ; SpinBox_Radius_ext->setSingleStep(_Rayon/10.) ; - SpinBox_Radius_ext->setMinimum(0.) ; // Axe et hauteur // Si une coordonnee est constante, inutile de demander l'axe et la hauteur if ( _Orient > 0) { @@ -315,9 +311,7 @@ void MonCreateZone::InitMinMax() TLHaut_p->setVisible(0) ; } else { - SpinBox_Haut->setMinimum(0.) ; SpinBox_Haut->setSingleStep(_Rayon/10.) ; - SpinBox_Haut_p->setMinimum(0.) ; SpinBox_Haut_p->setSingleStep(_Rayon/10.) ; } } diff --git a/src/HOMARDGUI/MonEditBoundaryAn.cxx b/src/HOMARDGUI/MonEditBoundaryAn.cxx index 58e154d2..d17d128b 100644 --- a/src/HOMARDGUI/MonEditBoundaryAn.cxx +++ b/src/HOMARDGUI/MonEditBoundaryAn.cxx @@ -83,6 +83,12 @@ void MonEditBoundaryAn::InitValEdit() SetConeR(); break; } + case 5: // il s agit d un tore + { + InitValBoundaryAnTore(); + SetTore(); + break; + } }; } // ------------------------------------------------------------------------ @@ -152,16 +158,33 @@ void MonEditBoundaryAn::InitValBoundaryAnConeR() convertRayonAngle(1) ; } // ------------------------------------------------------------------------ +void MonEditBoundaryAn::InitValBoundaryAnTore() +// ------------------------------------------------------------------------ +{ + HOMARD::double_array_var mesCoordBoundary = aBoundaryAn->GetCoords(); + ASSERT(mesCoordBoundary->length() == 8 ); + _BoundaryAnXcentre=mesCoordBoundary[0]; + _BoundaryAnYcentre=mesCoordBoundary[1]; + _BoundaryAnZcentre=mesCoordBoundary[2]; + _BoundaryAnXaxis=mesCoordBoundary[3]; + _BoundaryAnYaxis=mesCoordBoundary[4]; + _BoundaryAnZaxis=mesCoordBoundary[5]; + _BoundaryAnRayon1=mesCoordBoundary[6]; + _BoundaryAnRayon2=mesCoordBoundary[7]; +} +// ------------------------------------------------------------------------ void MonEditBoundaryAn::SetCylinder() // ------------------------------------------------------------------------ { gBCylindre->setVisible(1); gBSphere->setVisible(0); gBCone->setVisible(0); + gBTore->setVisible(0); RBCylindre->setChecked(1); _Type=1; RBSphere->setDisabled(true); RBCone->setDisabled(true); + RBTore->setDisabled(true); SpinBox_Xcent->setValue(_BoundaryAnXcentre); SpinBox_Ycent->setValue(_BoundaryAnYcentre); @@ -192,8 +215,10 @@ void MonEditBoundaryAn::SetSphere() gBSphere->setVisible(1); RBSphere->setChecked(1); gBCone->setVisible(0); + gBTore->setVisible(0); RBCylindre->setDisabled(true); RBCone->setDisabled(true); + RBTore->setDisabled(true); _Type=2 ; SpinBox_Xcentre->setValue(_BoundaryAnXcentre); @@ -208,7 +233,6 @@ void MonEditBoundaryAn::SetSphere() if ( _Zincr > 0) { SpinBox_Zcentre->setSingleStep(_Zincr); } else { SpinBox_Zcentre->setSingleStep(1);} - SpinBox_Rayon->setMinimum(0.); SpinBox_Rayon->setValue(_BoundaryAnRayon); // adjustSize(); @@ -221,9 +245,11 @@ void MonEditBoundaryAn::SetConeA() gBSphere->setVisible(0); gBCone->setVisible(1); RBCone->setChecked(1); + gBTore->setVisible(0); RB_Def_angle->setChecked(1); RBCylindre->setDisabled(true); RBSphere->setDisabled(true); + RBTore->setDisabled(true); _Type=3; // TLCone_X1->setText(QApplication::translate("CreateBoundaryAn", "X axis", 0, QApplication::UnicodeUTF8)); @@ -257,10 +283,12 @@ void MonEditBoundaryAn::SetConeR() gBCylindre->setVisible(0); gBSphere->setVisible(0); gBCone->setVisible(1); + gBTore->setVisible(0); RBCone->setChecked(1); RB_Def_radius->setChecked(1); RBCylindre->setDisabled(true); RBSphere->setDisabled(true); + RBTore->setDisabled(true); _Type=4; // TLCone_X1->setText(QApplication::translate("CreateBoundaryAn", "X centre 1", 0, QApplication::UnicodeUTF8)); @@ -289,6 +317,44 @@ void MonEditBoundaryAn::SetConeR() // adjustSize(); } +// ------------------------------------------------------------------------ +void MonEditBoundaryAn::SetTore() +// ------------------------------------------------------------------------ +{ + gBCylindre->setVisible(0); + gBSphere->setVisible(0); + gBCone->setVisible(0); + gBTore->setVisible(1); + RBTore->setChecked(1); + _Type=5; + RBCylindre->setDisabled(true); + RBSphere->setDisabled(true); + RBCone->setDisabled(true); + + SpinBoxToreXcent->setValue(_BoundaryAnXcentre); + SpinBoxToreYcent->setValue(_BoundaryAnYcentre); + SpinBoxToreZcent->setValue(_BoundaryAnZcentre); + + SpinBoxToreXaxe->setValue(_BoundaryAnXaxis); + SpinBoxToreYaxe->setValue(_BoundaryAnYaxis); + SpinBoxToreZaxe->setValue(_BoundaryAnZaxis); + + + SpinBoxToreXaxe->setSingleStep(0.1); + SpinBoxToreXcent->setSingleStep(_Xincr); + SpinBoxToreYaxe->setSingleStep(0.1); + SpinBoxToreYcent->setSingleStep(_Yincr); + SpinBoxToreZaxe->setSingleStep(0.1); + SpinBoxToreZcent->setSingleStep(_Zincr); +// Rayon de revolution + SpinBoxToreRRev->setValue(_BoundaryAnRayon1); + SpinBoxToreRRev->setSingleStep(_BoundaryAnRayon1/10.); +// Rayon primaire + SpinBoxToreRPri->setValue(_BoundaryAnRayon2); + SpinBoxToreRPri->setSingleStep(_BoundaryAnRayon2/10.); +// + adjustSize(); +} // --------------------------------------------------- bool MonEditBoundaryAn::CreateOrUpdateBoundaryAn() //---------------------------------------------------- @@ -314,12 +380,17 @@ bool MonEditBoundaryAn::CreateOrUpdateBoundaryAn() break; } case 4 : // il s agit d un cone defini par les 2 rayons - { + { aBoundaryAn = myHomardGen->CreateBoundaryConeR(CORBA::string_dup(_aName.toStdString().c_str()), \ _BoundaryAnXcone1, _BoundaryAnYcone1, _BoundaryAnZcone1, _BoundaryAnRayon1, \ _BoundaryAnXcone2, _BoundaryAnYcone2, _BoundaryAnZcone2, _BoundaryAnRayon2); break; } + case 5 : // il s agit d un tore + { + aBoundaryAn->SetTorus(_BoundaryAnXcentre, _BoundaryAnYcentre, _BoundaryAnZcentre, _BoundaryAnXaxis, _BoundaryAnYaxis, _BoundaryAnZaxis, _BoundaryAnRayon1, _BoundaryAnRayon2 ); + break; + } } if (Chgt) myHomardGen->InvalideBoundary(_aName.toStdString().c_str()); HOMARD_UTILS::updateObjBrowser(); diff --git a/src/HOMARDGUI/MonEditBoundaryAn.h b/src/HOMARDGUI/MonEditBoundaryAn.h index 532c4940..ada2a06b 100644 --- a/src/HOMARDGUI/MonEditBoundaryAn.h +++ b/src/HOMARDGUI/MonEditBoundaryAn.h @@ -47,10 +47,12 @@ protected : void SetSphere(); void SetConeR(); void SetConeA(); + void SetTore(); void InitValBoundaryAnCylindre(); void InitValBoundaryAnSphere(); void InitValBoundaryAnConeR(); void InitValBoundaryAnConeA(); + void InitValBoundaryAnTore(); public slots: diff --git a/src/HOMARDGUI/MonEditZone.cxx b/src/HOMARDGUI/MonEditZone.cxx index 50905a89..01de4ac2 100644 --- a/src/HOMARDGUI/MonEditZone.cxx +++ b/src/HOMARDGUI/MonEditZone.cxx @@ -252,7 +252,6 @@ void MonEditZone::SetSphere() if ( _Zincr > 0) { SpinBox_Zcentre->setSingleStep(_Zincr); } else { SpinBox_Zcentre->setSingleStep(1);} - SpinBox_Rayon->setMinimum(0.); SpinBox_Rayon->setValue(_ZoneRayon); } // ------------------------------------------------------------------------ @@ -292,7 +291,6 @@ void MonEditZone::SetCylinder() if ( _Zincr > 0) { SpinBox_Zbase->setSingleStep(_Zincr); } else { SpinBox_Zbase->setSingleStep(1) ;} - SpinBox_Radius->setMinimum(0.); SpinBox_Radius->setValue(_ZoneRayon); if ( _Type == 5 ) @@ -352,9 +350,7 @@ void MonEditZone::SetPipe() if ( _Zincr > 0) { SpinBox_Zbase_p->setSingleStep(_Zincr); } else { SpinBox_Zbase_p->setSingleStep(1) ;} - SpinBox_Radius_int->setMinimum(0.); SpinBox_Radius_int->setValue(_ZoneRayonInt); - SpinBox_Radius_ext->setMinimum(0.); SpinBox_Radius_ext->setValue(_ZoneRayon); if ( _Type == 7 ) diff --git a/src/HOMARD_I/HOMARD_Boundary_i.cxx b/src/HOMARD_I/HOMARD_Boundary_i.cxx index 45a73a8b..a504b5a0 100644 --- a/src/HOMARD_I/HOMARD_Boundary_i.cxx +++ b/src/HOMARD_I/HOMARD_Boundary_i.cxx @@ -171,6 +171,12 @@ void HOMARD_Boundary_i::SetConeA( double Xaxe, double Yaxe, double Zaxe, double myHomardBoundary->SetConeA( Xaxe, Yaxe, Zaxe, Angle, Xcentre, Ycentre, Zcentre ); } //============================================================================= +void HOMARD_Boundary_i::SetTorus( double X0, double X1, double X2, double X3, double X4, double X5, double X6, double X7 ) +{ + ASSERT( myHomardBoundary ); + myHomardBoundary->SetTorus( X0, X1, X2, X3, X4, X5, X6, X7 ); +} +//============================================================================= HOMARD::double_array* HOMARD_Boundary_i::GetCoords() { ASSERT( myHomardBoundary ); diff --git a/src/HOMARD_I/HOMARD_Boundary_i.hxx b/src/HOMARD_I/HOMARD_Boundary_i.hxx index 791e586e..00493359 100644 --- a/src/HOMARD_I/HOMARD_Boundary_i.hxx +++ b/src/HOMARD_I/HOMARD_Boundary_i.hxx @@ -83,6 +83,9 @@ public: double Xcentre2, double Ycentre2, double Zcentre2, double Rayon2); void SetConeA( double Xaxe, double Yaxe, double Zaxe, double Angle, double Xcentre, double Ycentre, double ZCentre); + void SetTorus( double Xcentre, double Ycentre, double ZCentre, + double Xaxe, double Yaxe, double Zaxe, + double rayonRev, double rayonPri ); HOMARD::double_array* GetCoords(); diff --git a/src/HOMARD_I/HOMARD_Gen_i.cxx b/src/HOMARD_I/HOMARD_Gen_i.cxx index 4169a8c4..53f174f1 100755 --- a/src/HOMARD_I/HOMARD_Gen_i.cxx +++ b/src/HOMARD_I/HOMARD_Gen_i.cxx @@ -2041,6 +2041,35 @@ HOMARD::HOMARD_Boundary_ptr HOMARD_Gen_i::CreateBoundaryConeR(const char* Bounda return HOMARD::HOMARD_Boundary::_duplicate(myBoundary) ; } //============================================================================= +HOMARD::HOMARD_Boundary_ptr HOMARD_Gen_i::CreateBoundaryTorus(const char* BoundaryName, + CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, + CORBA::Double Xaxe, CORBA::Double Yaxe, CORBA::Double Zaxe, + CORBA::Double RayonRev, CORBA::Double RayonPri) +{ + INFOS ("CreateBoundaryTorus : BoundaryName = " << BoundaryName ) ; +// + SALOME::ExceptionStruct es; + int error = 0 ; + if ( ( RayonRev <= 0.0 ) || ( RayonPri <= 0.0 ) ) + { es.text = "The radius must be positive." ; + error = 1 ; } + double daux = fabs(Xaxe) + fabs(Yaxe) + fabs(Zaxe) ; + if ( daux < 0.0000001 ) + { es.text = "The axis must be a non 0 vector." ; + error = 2 ; } + if ( error != 0 ) + { + es.type = SALOME::BAD_PARAM; + throw SALOME::SALOME_Exception(es); + return 0; + }; +// + HOMARD::HOMARD_Boundary_var myBoundary = CreateBoundary(BoundaryName, 5) ; + myBoundary->SetTorus( Xcentre, Ycentre, Zcentre, Xaxe, Yaxe, Zaxe, RayonRev, RayonPri ) ; + + return HOMARD::HOMARD_Boundary::_duplicate(myBoundary) ; +} +//============================================================================= HOMARD::HOMARD_Zone_ptr HOMARD_Gen_i::CreateZone(const char* ZoneName, CORBA::Long ZoneType) { MESSAGE ("CreateZone : ZoneName = " << ZoneName << ", ZoneType = " << ZoneType); @@ -3147,6 +3176,11 @@ void HOMARD_Gen_i::DriverTexteBoundary(HOMARD::HOMARD_Cas_var myCase, HomardDriv myDriver->TexteBoundaryAn(BoundaryName, NumBoundaryAnalytical, BoundaryType, (*coor)[0], (*coor)[1], (*coor)[2], (*coor)[3], (*coor)[4], (*coor)[5], (*coor)[6], (*coor)[7]); if ( BoundaryOption % 3 != 0 ) { BoundaryOption = BoundaryOption*3 ; } } + else if (BoundaryType == 5) // Cas d un tore + { + myDriver->TexteBoundaryAn(BoundaryName, NumBoundaryAnalytical, BoundaryType, (*coor)[0], (*coor)[1], (*coor)[2], (*coor)[3], (*coor)[4], (*coor)[5], (*coor)[6], (*coor)[7]); + if ( BoundaryOption % 3 != 0 ) { BoundaryOption = BoundaryOption*3 ; } + } } // 2.2.3. Memorisation du traitement ListeBoundaryTraitees.push_back( BoundaryName ); @@ -3396,6 +3430,11 @@ SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishBoundaryInStudy(SALOMEDS::Study_ptr t icone = "conedxyz.png" ; break; } + case 5 : + { value = "BoundaryAnHomard" ; + icone = "toruspointvector.png" ; + break; + } } aResultSO = aStudyBuilder->NewObject(aSObject); PublishInStudyAttr(aStudyBuilder, aResultSO, theName, value.c_str(), icone.c_str(), _orb->object_to_string(theObject)); diff --git a/src/HOMARD_I/HOMARD_Gen_i.hxx b/src/HOMARD_I/HOMARD_Gen_i.hxx index 3ec90d91..13ac21f9 100644 --- a/src/HOMARD_I/HOMARD_Gen_i.hxx +++ b/src/HOMARD_I/HOMARD_Gen_i.hxx @@ -75,6 +75,10 @@ public: HOMARD::HOMARD_Boundary_ptr CreateBoundaryConeA (const char* nomBoundary, CORBA::Double Xaxis, CORBA::Double Yaxis, CORBA::Double Zaxis, CORBA::Double Angle, CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre); + HOMARD::HOMARD_Boundary_ptr CreateBoundaryTorus (const char* nomBoundary, + CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, + CORBA::Double Xaxis, CORBA::Double Yaxis, CORBA::Double Zaxis, + CORBA::Double RayonRev, CORBA::Double RayonPri); HOMARD::HOMARD_Cas_ptr CreateCase (const char* nomCas, const char* MeshName, const char* FileName); HOMARD::HOMARD_Cas_ptr CreateCaseFromIteration (const char* nomCas, const char* DirNameStart); -- 2.30.2