X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHOMARD%2FHOMARD_Boundary.cxx;h=eb431c4b6be9f82875918a648276c707d08a9118;hb=refs%2Ftags%2FV9_13_0b1;hp=24db564af733db58add2db43e9f7ce4b509013cf;hpb=9e58f253ace5b07462140dc8e3b2d1aea1d366a6;p=modules%2Fhomard.git diff --git a/src/HOMARD/HOMARD_Boundary.cxx b/src/HOMARD/HOMARD_Boundary.cxx index 24db564a..eb431c4b 100644 --- a/src/HOMARD/HOMARD_Boundary.cxx +++ b/src/HOMARD/HOMARD_Boundary.cxx @@ -1,11 +1,11 @@ // HOMARD HOMARD : implementation of HOMARD idl descriptions // -// Copyright (C) 2011-2013 CEA/DEN, EDF R&D +// Copyright (C) 2011-2024 CEA, EDF // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -19,7 +19,7 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File : HOMARD_Boundary.cxx -// Author : Paul RASCLE, EDF +// Author : Gerald NICOLAS, EDF // Module : HOMARD // // Remarques : @@ -77,12 +77,19 @@ std::string HOMARD_Boundary::GetDumpPython() const // switch (_Type) { + case -1: + { + aScript << "CAO boundary " << _Name << "\n"; + aScript << "\t" << _Name << " = homard.CreateBoundaryCAO(\"" << _Name << "\", "; + aScript << "\"" << _DataFile << "\")\n"; + break ; + } case 0: { aScript << "discrete boundary " << _Name << "\n"; aScript << "\t" << _Name << " = homard.CreateBoundaryDi(\"" << _Name << "\", "; aScript << "\"" << _MeshName << "\", "; - aScript << "\"" << _MeshFile << "\")\n"; + aScript << "\"" << _DataFile << "\")\n"; break ; } case 1: @@ -113,6 +120,13 @@ std::string HOMARD_Boundary::GetDumpPython() const aScript << _Xcentre1 << ", " << _Ycentre1 << ", " << _Zcentre1 << ", " << _Rayon1 << ", " << _Xcentre2 << ", " << _Ycentre2 << ", " << _Zcentre2 << ", " << _Rayon2 << ")\n"; break ; } + case 5: + { + aScript << "tore " << _Name << "\n"; + aScript << "\t" << _Name << " = homard.CreateBoundaryTorus(\"" << _Name << "\", "; + aScript << _Xcentre << ", " << _Ycentre << ", " << _Zcentre << ", " << _Xaxe << ", " << _Yaxe << ", " << _Zaxe << ", " << _Rayon1 << ", " << _Rayon2 << ")\n"; + break ; + } } return aScript.str(); @@ -142,14 +156,14 @@ std::string HOMARD_Boundary::GetMeshName() const return _MeshName; } //============================================================================= -void HOMARD_Boundary::SetMeshFile( const char* MeshFile ) +void HOMARD_Boundary::SetDataFile( const char* DataFile ) { - _MeshFile = std::string( MeshFile ); + _DataFile = std::string( DataFile ); } //============================================================================= -std::string HOMARD_Boundary::GetMeshFile() const +std::string HOMARD_Boundary::GetDataFile() const { - return _MeshFile; + return _DataFile; } //======================================================================================= void HOMARD_Boundary::SetCylinder( double X0, double X1, double X2, @@ -183,6 +197,15 @@ void HOMARD_Boundary::SetConeA( double Xaxe, double Yaxe, double Zaxe, double An _Xcentre = Xcentre; _Ycentre = Ycentre; _Zcentre = Zcentre; } //======================================================================================= +void HOMARD_Boundary::SetTorus( double X0, double X1, double X2, + double X3, double X4, double X5, double X6, double X7 ) +{ + _Xcentre = X0; _Ycentre = X1; _Zcentre = X2; + _Xaxe = X3; _Yaxe = X4; _Zaxe = X5; + _Rayon1 = X6; + _Rayon2 = X7; +} +//======================================================================================= std::vector HOMARD_Boundary::GetCoords() const { std::vector mesCoor; @@ -235,7 +258,20 @@ std::vector HOMARD_Boundary::GetCoords() const mesCoor.push_back( _Rayon2 ); break ; } - VERIFICATION( (_Type>=1) and (_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; }