1 //----------------------------------------------------------------------------
2 // Anti-Grain Geometry - Version 2.3
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"
20 #include "agg_vertex_iterator.h"
25 //----------------------------------------------------------vcgen_contour
27 // See Implementation agg_vcgen_contour.cpp
42 typedef vertex_sequence
<vertex_dist
, 6> vertex_storage
;
43 typedef pod_deque
<point_type
, 6> coord_storage
;
47 void line_join(line_join_e lj
) { m_line_join
= lj
; }
48 void inner_line_join(line_join_e lj
) { m_inner_line_join
= lj
; }
49 void width(double w
) { m_width
= w
* 0.5; }
50 void miter_limit(double ml
) { m_miter_limit
= ml
; }
51 void miter_limit_theta(double t
);
52 void inner_miter_limit(double ml
) { m_inner_miter_limit
= ml
; }
53 void approximation_scale(double as
) { m_approx_scale
= as
; }
54 void auto_detect_orientation(bool v
) { m_auto_detect
= v
; }
56 line_join_e
line_join() const { return m_line_join
; }
57 line_join_e
inner_line_join() const { return m_inner_line_join
; }
58 double width() const { return m_width
* 2.0; }
59 double miter_limit() const { return m_miter_limit
; }
60 double inner_miter_limit() const { return m_inner_miter_limit
; }
61 double approximation_scale() const { return m_approx_scale
; }
62 bool auto_detect_orientation() const { return m_auto_detect
; }
64 // Generator interface
66 void add_vertex(double x
, double y
, unsigned cmd
);
68 // Vertex Source Interface
69 void rewind(unsigned id
);
70 unsigned vertex(double* x
, double* y
);
73 vcgen_contour(const vcgen_contour
&);
74 const vcgen_contour
& operator = (const vcgen_contour
&);
76 vertex_storage m_src_vertices
;
77 coord_storage m_out_vertices
;
79 line_join_e m_line_join
;
80 line_join_e m_inner_line_join
;
81 double m_approx_scale
;
83 double m_signed_width
;
85 double m_inner_miter_limit
;
87 unsigned m_src_vertex
;
88 unsigned m_out_vertex
;
90 unsigned m_orientation
;