gmio/benchs/bench_occ/main.cpp
2015-04-02 10:53:52 +02:00

41 lines
1.0 KiB
C++

#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)
{
RWStl::ReadFile(OSD_Path(filepath));
}
static void bench_gmio_stl_read(const char* filepath)
{
gmio_buffer_t buffer = gmio_buffer_malloc(256 * 1024);
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, &buffer, &mesh_creator);
if (error != GMIO_ERROR_OK)
printf("GeomIO error: 0x%X\n", error);
gmio_buffer_deallocate(&buffer);
}
int main(int argc, char** argv)
{
if (argc > 1) {
benchmark(&bench_occ_RWStl_ReadFile,
"RWStl::ReadFile()",
argc - 1, argv + 1);
benchmark(&bench_gmio_stl_read,
"gmio_stl_read()",
argc - 1, argv + 1);
}
return 0;
}