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-03-05 08:04:29 +08:00
|
|
|
#include "../error.h"
|
2013-01-11 01:48:46 +08:00
|
|
|
#include "../stream.h"
|
|
|
|
#include "../task_control.h"
|
|
|
|
|
2013-03-05 23:46:42 +08:00
|
|
|
/* foug_stlb_read() */
|
|
|
|
typedef struct foug_stlb_read_args foug_stlb_read_args_t;
|
|
|
|
|
|
|
|
FOUG_DATAX_LIBSTL_EXPORT int foug_stlb_read(foug_stlb_read_args_t* args);
|
|
|
|
|
|
|
|
/* 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-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;
|
2013-02-21 21:53:41 +08:00
|
|
|
void (*process_header_func)(foug_stlb_geom_input_t*, const uint8_t*);
|
|
|
|
void (*begin_triangles_func)(foug_stlb_geom_input_t*, uint32_t);
|
|
|
|
void (*process_next_triangle_func)(foug_stlb_geom_input_t*, const foug_stlb_triangle_t*);
|
|
|
|
void (*end_triangles_func)(foug_stlb_geom_input_t*);
|
2013-03-03 04:51:08 +08:00
|
|
|
};
|
2013-01-11 01:48:46 +08:00
|
|
|
|
2013-02-21 21:53:41 +08:00
|
|
|
/* foug_stlb_read_args */
|
2013-03-05 23:46:42 +08:00
|
|
|
struct foug_stlb_read_args
|
2013-01-15 02:30:42 +08:00
|
|
|
{
|
2013-03-03 04:51:08 +08:00
|
|
|
foug_stlb_geom_input_t geom_input;
|
|
|
|
foug_stream_t stream;
|
|
|
|
foug_task_control_t task_control;
|
2013-02-05 19:24:13 +08:00
|
|
|
uint8_t* buffer;
|
2013-01-15 02:30:42 +08:00
|
|
|
uint32_t buffer_size;
|
2013-03-05 23:46:42 +08:00
|
|
|
};
|
2013-01-11 01:48:46 +08:00
|
|
|
|
2013-03-06 17:27:37 +08:00
|
|
|
#endif /* FOUG_DATAX_C_LIBSTL_STLB_READ_H */
|