]> SALOME platform Git repositories - modules/homard.git/blobdiff - src/HOMARD/HOMARD_Boundary.cxx
Salome HOME
Merge from V6_main_20120808 08Aug12
[modules/homard.git] / src / HOMARD / HOMARD_Boundary.cxx
index d819555aace2ffc9089b45ca7a1130a7dffac0df..6414f6bc7c50cb3c2faa890f16c3a78fb926de03 100644 (file)
@@ -1,25 +1,22 @@
 //  HOMARD HOMARD : implementaion of HOMARD idl descriptions
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2011-2012  CEA/DEN, EDF R&D
 //
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU Lesser General Public
-//  License as published by the Free Software Foundation; either
-//  version 2.1 of the License.
+// 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.
 //
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
 //
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : HOMARD_Boundary.cxx
 //  Author : Paul RASCLE, EDF
@@ -67,45 +64,32 @@ std::string HOMARD_Boundary::GetDumpPython() const
 {
   std::ostringstream aScript;
   aScript << "\n# Creation of the ";
-  if ( _BoundaryType == 0 ) { aScript << "discrete boundary " << _NomBoundary << "\n";}
-  if ( _BoundaryType == 1 ) { aScript << "cylinder " << _NomBoundary << "\n";}
-  if ( _BoundaryType == 2 ) { aScript << "sphere " << _NomBoundary << "\n"; }
-
-  aScript << "\t" << _NomBoundary << " = homard.CreateBoundary('" << _NomBoundary ;
-  aScript << "', " << _BoundaryType << ")\n";
 //
   switch (_BoundaryType)
   {
     case 0:
     {
-      aScript << "\t" <<_NomBoundary << ".SetMeshFile('";
-      aScript << _MeshFile << "')\n";
-      aScript << "\t" <<_NomBoundary << ".SetMeshName('";
-      aScript << _MeshName << "')\n";
-      break;
+      aScript << "discrete boundary " << _NomBoundary << "\n";
+      aScript << "\t" << _NomBoundary << " = homard.CreateBoundaryDi(\"" << _NomBoundary << "\", ";
+      aScript << "\"" << _MeshName << "\", ";
+      aScript << "\"" << _MeshFile << "\")\n";
+      break ;
     }
-
     case 1:
     {
-      aScript << "\t" << _NomBoundary << ".SetCylinder(" ;
+      aScript << "cylinder " << _NomBoundary << "\n";
+      aScript << "\t" << _NomBoundary << " = homard.CreateBoundaryCylinder(\"" << _NomBoundary << "\", ";
       aScript << _Xcentre << ", " << _Ycentre << ", " << _Zcentre << ", " << _Xaxe << ", " << _Yaxe << ", " << _Zaxe << ", " << _rayon << ")\n";
-      break;
+      break ;
     }
-
     case 2:
     {
-      aScript << "\t" << _NomBoundary << ".SetSphere(" ;
+      aScript << "sphere" << _NomBoundary << "\n";
+      aScript << "\t" << _NomBoundary << " = homard.CreateBoundarySphere(\"" << _NomBoundary << "\", ";
       aScript << _Xcentre << ", " << _Ycentre << ", " << _Zcentre << ", " << _rayon << ")\n";
-      break;
+      break ;
     }
   }
-  aScript << "\t" <<_NomBoundary << ".SetCaseCreation('";
-  aScript << _NomCasCreation << "')\n";
-
-  std::list<std::string>::const_iterator it;
-  for ( it=_ListGroupSelected.begin(); it!=_ListGroupSelected.end();it++)
-       aScript << "\t" << _NomBoundary << ".AddGroup('"  << (*it) <<  "')\n" ;
-
 
   return aScript.str();
 }
@@ -177,27 +161,35 @@ std::vector<double> HOMARD_Boundary::GetLimit() const
 }
 
 //=======================================================================================
-std::vector<double> HOMARD_Boundary::GetCylinder() const
+std::vector<double> HOMARD_Boundary::GetCoords() const
 {
   std::vector<double> mesCoor;
-  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( _rayon );
-  return mesCoor;
-}
-
-//=======================================================================================
-std::vector<double> HOMARD_Boundary::GetSphere() const
-{
-  std::vector<double> mesCoor;
-  mesCoor.push_back( _Xcentre );
-  mesCoor.push_back( _Ycentre );
-  mesCoor.push_back( _Zcentre );
-  mesCoor.push_back( _rayon );
+//
+  switch (_BoundaryType)
+  {
+//  Cylindre
+    case 1:
+    {
+      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( _rayon );
+      break ;
+    }
+//  Sphere
+    case 2:
+    {
+      mesCoor.push_back( _Xcentre );
+      mesCoor.push_back( _Ycentre );
+      mesCoor.push_back( _Zcentre );
+      mesCoor.push_back( _rayon );
+      break ;
+    }
+    ASSERT ( _BoundaryType == -1 ) ;
+  }
   return mesCoor;
 }
 //=============================================================================