-// 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
#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>
#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>
if (( mesh = SMESH_Hypothesis::GetMeshByPersistentID( enfMesh._meshID )))
{
mesh->Load();
+ if ( mesh->NbEdges() == 0 )
+ GetGen()->Compute( *mesh, mesh->GetShapeToMesh(), /*flags=*/0 );
switch( enfMesh._type )
{
std::ostringstream hpStream;
boost::archive::text_oarchive( hpStream ) << _hyperPatchEntriesList;
std::string hpString = hpStream.str();
- SMESHDS_Hypothesis::SaveString( save, hpString );
+ SMESHDS_Hypothesis::SaveStringToStream( save, hpString );
// Enforced meshes
std::ostringstream enfMStream;
boost::archive::text_oarchive( enfMStream ) << _enforcedMeshes;
std::string enfMString = enfMStream.str();
- SMESHDS_Hypothesis::SaveString( save, enfMString );
+ SMESHDS_Hypothesis::SaveStringToStream( save, enfMString );
return save;
}
// hyper-patches as entries (issue bos #20543)
std::string buffer;
- if ( SMESHDS_Hypothesis::LoadString( load, 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 );
}
// Enforced meshes (issue bos $16292)
buffer.clear();
- if ( SMESHDS_Hypothesis::LoadString( load, buffer ))
+ 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 );
}