gmio/benchs/bench_occ/main.cpp

39 lines
955 B
C++
Raw Normal View History

2012-02-29 03:27:32 +08:00
#include <OSD_Path.hxx>
#include <RWStl.hxx>
#include <StlMesh_Mesh.hxx>
#include <gmio_core/error.h>
#include <gmio_stl/stl_io.h>
#include <gmio_support/stl_occ.h>
#include "../commons/bench_tools.h"
static void bench_occ_RWStl_ReadFile(const char* filepath)
2012-02-29 03:27:32 +08:00
{
2015-03-30 22:43:26 +08:00
RWStl::ReadFile(OSD_Path(filepath));
2013-02-20 19:29:34 +08:00
}
2012-02-29 03:27:32 +08:00
static void bench_gmio_stl_read(const char* filepath)
2013-02-20 19:29:34 +08:00
{
Handle_StlMesh_Mesh mesh = new StlMesh_Mesh;
gmio_stl_mesh_creator_t mesh_creator = gmio_stl_occmesh_creator(mesh);
int error = gmio_stl_read_file(filepath, &mesh_creator, NULL);
if (error != GMIO_ERROR_OK)
printf("GeomIO error: 0x%X\n", error);
2013-02-20 19:29:34 +08:00
}
2012-02-29 03:27:32 +08:00
int main(int argc, char** argv)
{
2015-03-30 22:43:26 +08:00
if (argc > 1) {
benchmark(&bench_occ_RWStl_ReadFile,
"RWStl::ReadFile()",
argc - 1, argv + 1);
2015-03-30 22:43:26 +08:00
benchmark(&bench_gmio_stl_read,
"gmio_stl_read()",
argc - 1, argv + 1);
}
2012-02-29 03:27:32 +08:00
2015-03-30 22:43:26 +08:00
return 0;
2012-02-29 03:27:32 +08:00
}