Salome HOME
Updated copyright comment
[plugins/blsurfplugin.git] / src / BLSURFPlugin / BLSURFPlugin_Hypothesis.cxx
index f583e989244b40f46f5b434805154f00e06e5e32..773db4dd20249b1b921abee1cbeec2b95228edb8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2021  CEA/DEN, EDF R&D
+// Copyright (C) 2007-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
@@ -29,6 +29,7 @@
 
 #include <SMESHDS_Group.hxx>
 #include <SMESHDS_Mesh.hxx>
+#include <SMESH_BoostTxtArchive.hxx>
 #include <SMESH_Gen_i.hxx>
 #include <SMESH_Group.hxx>
 #include <SMESH_TryCatch.hxx>
@@ -47,7 +48,6 @@
 #define MESHGEMS_VERSION_HEX (MESHGEMS_VERSION_MAJOR << 16 | MESHGEMS_VERSION_MINOR << 8 | MESHGEMS_VERSION_PATCH)
 
 #include <boost/archive/text_oarchive.hpp>
-#include <boost/archive/text_iarchive.hpp>
 #include <boost/serialization/set.hpp>
 #include <boost/serialization/vector.hpp>
 #include <boost/serialization/string.hpp>
@@ -1001,6 +1001,8 @@ BLSURFPlugin_Hypothesis::GetEnforcedSegments( const EnforcedMesh& enfMesh,
   if (( mesh = SMESH_Hypothesis::GetMeshByPersistentID( enfMesh._meshID )))
   {
     mesh->Load();
+    if ( mesh->NbEdges() == 0 )
+      GetGen()->Compute( *mesh, mesh->GetShapeToMesh(), /*flags=*/0 );
 
     switch( enfMesh._type )
     {
@@ -3395,10 +3397,8 @@ std::istream & BLSURFPlugin_Hypothesis::LoadFrom(std::istream & load)
   std::string buffer;
   if ( SMESHDS_Hypothesis::LoadStringFromStream( load, buffer ))
   {
-    std::istringstream istream( buffer.data() );
-    boost::archive::text_iarchive archive( istream );
     SMESH_TRY;
-    archive >> _hyperPatchEntriesList;
+    SMESHUtils::BoostTxtArchive( buffer ) >> _hyperPatchEntriesList;
     SMESH_CATCH( SMESH::printErrorInDebugMode );
   }
 
@@ -3406,10 +3406,8 @@ std::istream & BLSURFPlugin_Hypothesis::LoadFrom(std::istream & load)
   buffer.clear();
   if ( SMESHDS_Hypothesis::LoadStringFromStream( load, buffer ))
   {
-    std::istringstream istream( buffer.data() );
-    boost::archive::text_iarchive archive( istream );
     SMESH_TRY;
-    archive >> _enforcedMeshes;
+    SMESHUtils::BoostTxtArchive( buffer ) >> _enforcedMeshes;
     SMESH_CATCH( SMESH::printErrorInDebugMode );
   }