| 1 |
/* |
| 2 |
* graphic interface |
| 3 |
*/ |
| 4 |
|
| 5 |
#ifndef INTERFACE_H |
| 6 |
#define INTERFACE_H |
| 7 |
|
| 8 |
#include "attr.h" |
| 9 |
#include "util.h" |
| 10 |
#include "matrix.h" |
| 11 |
|
| 12 |
#include <utility> |
| 13 |
|
| 14 |
struct point : module_vec { |
| 15 |
vec v, n; // vertex, normal |
| 16 |
attribute_set attr; // attributes |
| 17 |
|
| 18 |
point(const module_vec &v, const vec &pos, const vec &up, const attribute_set &as) t_no |
| 19 |
: module_vec(v), v(pos), n(up), attr(as) {}; |
| 20 |
}; |
| 21 |
|
| 22 |
typedef vector<point> points; |
| 23 |
|
| 24 |
// <0 cw, >0 ccw |
| 25 |
double winding (const points &v) t_no; |
| 26 |
|
| 27 |
struct gfx_int { |
| 28 |
virtual ~gfx_int () t_no {}; |
| 29 |
|
| 30 |
virtual void begin_fig() t_no {}; |
| 31 |
virtual void end_fig() t_no {}; |
| 32 |
|
| 33 |
virtual void segment (const point &, const point &) t_err abstract; |
| 34 |
virtual void object (const points &) t_err abstract; |
| 35 |
}; |
| 36 |
|
| 37 |
#endif |