2013-03-06 17:27:37 +08:00
|
|
|
#ifndef FOUG_DATAX_C_LIBSTL_STLB_READ_H
|
|
|
|
#define FOUG_DATAX_C_LIBSTL_STLB_READ_H
|
2013-01-11 01:48:46 +08:00
|
|
|
|
2013-01-15 23:45:01 +08:00
|
|
|
#include "stl_global.h"
|
2013-02-21 21:53:41 +08:00
|
|
|
#include "stlb_triangle.h"
|
2013-04-27 06:16:38 +08:00
|
|
|
#include "../endian.h"
|
2013-03-06 18:49:53 +08:00
|
|
|
#include "../transfer.h"
|
2013-03-05 23:46:42 +08:00
|
|
|
|
2013-03-03 04:51:08 +08:00
|
|
|
/* foug_stlb_geom_input */
|
2014-01-27 22:03:50 +08:00
|
|
|
typedef struct
|
2013-01-11 01:48:46 +08:00
|
|
|
{
|
2013-03-03 04:51:08 +08:00
|
|
|
void* cookie;
|
2014-01-27 22:03:50 +08:00
|
|
|
/* All function pointers can be safely set to NULL */
|
|
|
|
void (*process_header_func) (void*, const uint8_t*);
|
|
|
|
void (*begin_triangles_func) (void*, uint32_t);
|
|
|
|
void (*process_triangle_func)(void*, uint32_t, const foug_stl_triangle_t*, uint16_t);
|
|
|
|
void (*end_triangles_func) (void*);
|
|
|
|
} foug_stlb_geom_input_t;
|
|
|
|
typedef void (*foug_stlb_begin_triangles_func_t)(void*, uint32_t);
|
|
|
|
typedef void (*foug_stlb_process_triangle_func_t)(void*, uint32_t, const foug_stl_triangle_t*, uint16_t);
|
2013-01-11 01:48:46 +08:00
|
|
|
|
2013-03-06 18:49:53 +08:00
|
|
|
/* foug_stlb_read() */
|
|
|
|
FOUG_DATAX_LIBSTL_EXPORT int foug_stlb_read(foug_stlb_geom_input_t* geom,
|
2013-04-29 17:47:15 +08:00
|
|
|
foug_transfer_t* trsf,
|
|
|
|
foug_endianness_t byte_order);
|
2013-03-06 18:49:53 +08:00
|
|
|
|
|
|
|
/* Specific error codes returned by foug_stlb_read() */
|
|
|
|
#define FOUG_STLB_READ_HEADER_WRONG_SIZE_ERROR 1
|
|
|
|
#define FOUG_STLB_READ_FACET_COUNT_ERROR 2
|
2013-04-27 06:16:38 +08:00
|
|
|
#define FOUG_STLB_READ_UNSUPPORTED_BYTE_ORDER 3
|
2013-01-11 01:48:46 +08:00
|
|
|
|
2013-03-06 17:27:37 +08:00
|
|
|
#endif /* FOUG_DATAX_C_LIBSTL_STLB_READ_H */
|