btrfs: [] on the end of a struct field is a variable length array.
[haiku.git] / headers / libs / agg / agg_vcgen_stroke.h
blob778223fe40e0f04418e1fb273f9586c82c9763ee
1 //----------------------------------------------------------------------------
2 // Anti-Grain Geometry - Version 2.4
3 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
4 //
5 // Permission to copy, use, modify, sell and distribute this software
6 // is granted provided this copyright notice appears in all copies.
7 // This software is provided "as is" without express or implied
8 // warranty, and with no claim as to its suitability for any purpose.
9 //
10 //----------------------------------------------------------------------------
11 // Contact: mcseem@antigrain.com
12 // mcseemagg@yahoo.com
13 // http://www.antigrain.com
14 //----------------------------------------------------------------------------
16 #ifndef AGG_VCGEN_STROKE_INCLUDED
17 #define AGG_VCGEN_STROKE_INCLUDED
19 #include "agg_math_stroke.h"
22 namespace agg
25 //============================================================vcgen_stroke
27 // See Implementation agg_vcgen_stroke.cpp
28 // Stroke generator
30 //------------------------------------------------------------------------
31 class vcgen_stroke
33 enum status_e
35 initial,
36 ready,
37 cap1,
38 cap2,
39 outline1,
40 close_first,
41 outline2,
42 out_vertices,
43 end_poly1,
44 end_poly2,
45 stop
48 public:
49 typedef vertex_sequence<vertex_dist, 6> vertex_storage;
50 typedef pod_bvector<point_d, 6> coord_storage;
52 vcgen_stroke();
54 void line_cap(line_cap_e lc) { m_stroker.line_cap(lc); }
55 void line_join(line_join_e lj) { m_stroker.line_join(lj); }
56 void inner_join(inner_join_e ij) { m_stroker.inner_join(ij); }
58 line_cap_e line_cap() const { return m_stroker.line_cap(); }
59 line_join_e line_join() const { return m_stroker.line_join(); }
60 inner_join_e inner_join() const { return m_stroker.inner_join(); }
62 void width(double w) { m_stroker.width(w); }
63 void miter_limit(double ml) { m_stroker.miter_limit(ml); }
64 void miter_limit_theta(double t) { m_stroker.miter_limit_theta(t); }
65 void inner_miter_limit(double ml) { m_stroker.inner_miter_limit(ml); }
66 void approximation_scale(double as) { m_stroker.approximation_scale(as); }
68 double width() const { return m_stroker.width(); }
69 double miter_limit() const { return m_stroker.miter_limit(); }
70 double inner_miter_limit() const { return m_stroker.inner_miter_limit(); }
71 double approximation_scale() const { return m_stroker.approximation_scale(); }
73 void shorten(double s) { m_shorten = s; }
74 double shorten() const { return m_shorten; }
76 // Vertex Generator Interface
77 void remove_all();
78 void add_vertex(double x, double y, unsigned cmd);
80 // Vertex Source Interface
81 void rewind(unsigned path_id);
82 unsigned vertex(double* x, double* y);
84 private:
85 vcgen_stroke(const vcgen_stroke&);
86 const vcgen_stroke& operator = (const vcgen_stroke&);
88 math_stroke<coord_storage> m_stroker;
89 vertex_storage m_src_vertices;
90 coord_storage m_out_vertices;
91 double m_shorten;
92 unsigned m_closed;
93 status_e m_status;
94 status_e m_prev_status;
95 unsigned m_src_vertex;
96 unsigned m_out_vertex;
102 #endif