diff --git a/benchs/bench_assimp/main.cpp b/benchs/bench_assimp/main.cpp index a349ad7..f4f2d81 100644 --- a/benchs/bench_assimp/main.cpp +++ b/benchs/bench_assimp/main.cpp @@ -153,7 +153,7 @@ static void bench_gmio_stl_read(const char* filepath) mesh_creator.add_triangle_func = gmio_assimp_add_triangle; mesh_creator.end_solid_func = gmio_assimp_end_solid; - int error = gmio_stl_read_file(filepath, &mesh_creator); + int error = gmio_stl_read_file(filepath, &mesh_creator, NULL); if (error != GMIO_ERROR_OK) printf("GeomIO error: 0x%X\n", error); } diff --git a/benchs/bench_gmio/main.c b/benchs/bench_gmio/main.c index 6ecf9dc..8698528 100644 --- a/benchs/bench_gmio/main.c +++ b/benchs/bench_gmio/main.c @@ -25,7 +25,7 @@ static void bench_gmio_stl_read(const char* filepath) mesh_creator.cookie = &cookie; mesh_creator.add_triangle_func = dummy_process_triangle; - error = gmio_stl_read_file(filepath, &mesh_creator); + error = gmio_stl_read_file(filepath, &mesh_creator, NULL); if (error != GMIO_ERROR_OK) printf("GeomIO error: 0x%X\n", error); } diff --git a/benchs/bench_occ/main.cpp b/benchs/bench_occ/main.cpp index 624b5ca..6ebf1bb 100644 --- a/benchs/bench_occ/main.cpp +++ b/benchs/bench_occ/main.cpp @@ -17,7 +17,7 @@ static void bench_gmio_stl_read(const char* filepath) { 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); + int error = gmio_stl_read_file(filepath, &mesh_creator, NULL); if (error != GMIO_ERROR_OK) printf("GeomIO error: 0x%X\n", error); } diff --git a/src/gmio_stl/stl_io.c b/src/gmio_stl/stl_io.c index ba95391..17c2f7c 100644 --- a/src/gmio_stl/stl_io.c +++ b/src/gmio_stl/stl_io.c @@ -24,7 +24,8 @@ int gmio_stl_read_file( const char* filepath, - gmio_stl_mesh_creator_t* creator) + gmio_stl_mesh_creator_t* creator, + gmio_task_iface_t* task_iface) { int error = GMIO_ERROR_OK; FILE* file = NULL; @@ -34,6 +35,8 @@ int gmio_stl_read_file( gmio_transfer_t trsf = { 0 }; trsf.stream = gmio_stream_stdio(file); trsf.buffer = gmio_buffer_default(); + if (task_iface != NULL) + trsf.task_iface = *task_iface; error = gmio_stl_read(&trsf, creator); fclose(file); diff --git a/src/gmio_stl/stl_io.h b/src/gmio_stl/stl_io.h index 7876a4c..2359165 100644 --- a/src/gmio_stl/stl_io.h +++ b/src/gmio_stl/stl_io.h @@ -35,6 +35,8 @@ GMIO_C_LINKAGE_BEGIN * \param filepath Path to the STL file. A stream is opened with fopen() so * the string has to be encoded using the system's charset (locale-8bit) * \param creator Defines the callbacks for the mesh creation + * \param task_iface The interface object by which the read operation can be + * controlled. Optional, can be safely set to NULL * * Internally, it uses: * \li the builtin stream wrapper around FILE* (see gmio_stream_stdio()) @@ -46,7 +48,8 @@ GMIO_C_LINKAGE_BEGIN GMIO_LIBSTL_EXPORT int gmio_stl_read_file( const char* filepath, - gmio_stl_mesh_creator_t* creator); + gmio_stl_mesh_creator_t* creator, + gmio_task_iface_t* task_iface); /*! Reads STL data from stream, format is automatically guessed *