36 #include <ringmesh/ringmesh_tests_config.h> 52 template < index_t DIMENSION >
55 std::string input_model_file_name( ringmesh_test_data_path );
56 input_model_file_name += filename;
58 bool loaded_model_is_valid =
geomodel_load( in, input_model_file_name );
60 if( !loaded_model_is_valid )
63 "Failed when loading model ", in.
name(),
64 ": the loaded model is not valid." );
68 template < index_t DIMENSION >
71 std::string output_model_file_name( ringmesh_test_output_path );
72 output_model_file_name +=
"modelA1_saved_out.gm";
76 bool reloaded_model_is_valid =
79 if( !reloaded_model_is_valid )
82 "Failed when reloading model ", in2.
name(),
83 ": the reloaded model is not valid." );
86 std::string output_model_file_name_bis( ringmesh_test_output_path );
87 output_model_file_name_bis +=
"modelA1_saved_out_bis.gm";
91 output_model_file_name, output_model_file_name_bis ) )
97 template < index_t DIMENSION >
98 void test_file(
const std::string& filename )
102 save_and_compare_geomodels( in );
114 Logger::out(
"TEST",
"Test IO for a GeoModel in .gm" );
116 test_file< 3 >(
"modelA1_version0.gm" );
117 test_file< 3 >(
"modelA1_version1.gm" );
118 test_file< 3 >(
"modelA1_version2.gm" );
119 test_file< 2 >(
"model_2d_version2.gm" );
126 catch(
const std::exception& e )
const std::string & name() const
Gets the name of the GeoModel.
bool geomodel_load(GeoModel< DIMENSION > &geomodel, const std::string &filename)
static void err(const std::string &feature, const Args &... args)
static void out(const std::string &feature, const Args &... args)
void geomodel_save(const GeoModel< DIMENSION > &geomodel, const std::string &filename)
void load_geomodel(GeoModel3D &geomodel)
const std::string & category() const
bool RINGMESH_API compare_files(const std::string &f1, const std::string &f2)
Classes to build GeoModel from various inputs.
void RINGMESH_API default_configure()