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 */
|
|
|
|
typedef struct foug_stlb_geom_input foug_stlb_geom_input_t;
|
|
|
|
struct foug_stlb_geom_input
|
2013-01-11 01:48:46 +08:00
|
|
|
{
|
2013-03-03 04:51:08 +08:00
|
|
|
void* cookie;
|
2014-01-21 17:51:23 +08:00
|
|
|
void (*process_header_func) (foug_stlb_geom_input_t*, const uint8_t*); /* Optional */
|
|
|
|
void (*begin_triangles_func) (foug_stlb_geom_input_t*, uint32_t); /* Optional */
|
2013-04-29 17:47:15 +08:00
|
|
|
void (*process_next_triangle_func)(foug_stlb_geom_input_t*, const foug_stlb_triangle_t*);
|
2014-01-21 17:51:23 +08:00
|
|
|
void (*end_triangles_func) (foug_stlb_geom_input_t*); /* Optional */
|
2013-03-03 04:51:08 +08:00
|
|
|
};
|
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 */
|