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_CONTOUR_INCLUDED
17 #define AGG_VCGEN_CONTOUR_INCLUDED
19 #include "agg_math_stroke.h"
24 //----------------------------------------------------------vcgen_contour
26 // See Implementation agg_vcgen_contour.cpp
41 typedef vertex_sequence
<vertex_dist
, 6> vertex_storage
;
42 typedef pod_bvector
<point_d
, 6> coord_storage
;
46 void line_cap(line_cap_e lc
) { m_stroker
.line_cap(lc
); }
47 void line_join(line_join_e lj
) { m_stroker
.line_join(lj
); }
48 void inner_join(inner_join_e ij
) { m_stroker
.inner_join(ij
); }
50 line_cap_e
line_cap() const { return m_stroker
.line_cap(); }
51 line_join_e
line_join() const { return m_stroker
.line_join(); }
52 inner_join_e
inner_join() const { return m_stroker
.inner_join(); }
54 void width(double w
) { m_stroker
.width(m_width
= w
); }
55 void miter_limit(double ml
) { m_stroker
.miter_limit(ml
); }
56 void miter_limit_theta(double t
) { m_stroker
.miter_limit_theta(t
); }
57 void inner_miter_limit(double ml
) { m_stroker
.inner_miter_limit(ml
); }
58 void approximation_scale(double as
) { m_stroker
.approximation_scale(as
); }
60 double width() const { return m_width
; }
61 double miter_limit() const { return m_stroker
.miter_limit(); }
62 double inner_miter_limit() const { return m_stroker
.inner_miter_limit(); }
63 double approximation_scale() const { return m_stroker
.approximation_scale(); }
65 void auto_detect_orientation(bool v
) { m_auto_detect
= v
; }
66 bool auto_detect_orientation() const { return m_auto_detect
; }
68 // Generator interface
70 void add_vertex(double x
, double y
, unsigned cmd
);
72 // Vertex Source Interface
73 void rewind(unsigned path_id
);
74 unsigned vertex(double* x
, double* y
);
77 vcgen_contour(const vcgen_contour
&);
78 const vcgen_contour
& operator = (const vcgen_contour
&);
80 math_stroke
<coord_storage
> m_stroker
;
82 vertex_storage m_src_vertices
;
83 coord_storage m_out_vertices
;
85 unsigned m_src_vertex
;
86 unsigned m_out_vertex
;
88 unsigned m_orientation
;