36 lines
1.2 KiB
C
36 lines
1.2 KiB
C
#ifndef _fencer_shape_h
|
|
#define _fencer_shape_h
|
|
|
|
#include "vmath.h"
|
|
#include "transform.h"
|
|
#include "list.h"
|
|
|
|
typedef struct Shape Shape;
|
|
|
|
extern Shape* shape_new(const Vector* points, size_t points_len);
|
|
extern Shape* shape_new_square(Vector size);
|
|
extern Shape* shape_clone(const Shape* source);
|
|
extern void shape_destroy(Shape* self);
|
|
|
|
extern Vector* shape_get_start(Shape* self);
|
|
extern Vector* shape_get_end(Shape* self);
|
|
|
|
extern size_t shape_get_points_count(const Shape* self);
|
|
extern Vector shape_get_point(Shape* self, size_t at);
|
|
extern Vector shape_get_point_transformed(Shape* self, size_t at, Transform transform);
|
|
|
|
extern void shape_set_point(Shape* self, size_t at, Vector point);
|
|
extern void shape_add_point(Shape* self, Vector point);
|
|
extern void shape_insert_point(Shape* self, size_t at, Vector point);
|
|
extern List* shape_get_points(Shape* self);
|
|
extern Vector shape_remove_point(Shape* self, size_t at);
|
|
|
|
extern Vector shape_get_median_point(Shape* self);
|
|
extern int shape_is_convex(Shape* self);
|
|
extern void shape_draw(Shape* self, Transform transform);
|
|
|
|
extern Vector shape_get_min_extent(Shape* self, Transform* transform);
|
|
extern Vector shape_get_max_extent(Shape* self, Transform* transform);
|
|
|
|
#endif // !_fencer_shape_h
|