1 //----------------------------------------------------------------------------
2 // Anti-Grain Geometry - Version 2.4
3 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
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.
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"
25 //============================================================vcgen_stroke
27 // See Implementation agg_vcgen_stroke.cpp
30 //------------------------------------------------------------------------
49 typedef vertex_sequence
<vertex_dist
, 6> vertex_storage
;
50 typedef pod_bvector
<point_d
, 6> coord_storage
;
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
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
);
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
;
94 status_e m_prev_status
;
95 unsigned m_src_vertex
;
96 unsigned m_out_vertex
;