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 // Smooth polygon generator
18 //----------------------------------------------------------------------------
19 #ifndef AGG_CONV_SMOOTH_POLY1_INCLUDED
20 #define AGG_CONV_SMOOTH_POLY1_INCLUDED
22 #include "agg_basics.h"
23 #include "agg_vcgen_smooth_poly1.h"
24 #include "agg_conv_adaptor_vcgen.h"
25 #include "agg_conv_curve.h"
31 //-------------------------------------------------------conv_smooth_poly1
32 template<class VertexSource
>
33 struct conv_smooth_poly1
:
34 public conv_adaptor_vcgen
<VertexSource
, vcgen_smooth_poly1
>
36 typedef conv_adaptor_vcgen
<VertexSource
, vcgen_smooth_poly1
> base_type
;
38 conv_smooth_poly1(VertexSource
& vs
) :
39 conv_adaptor_vcgen
<VertexSource
, vcgen_smooth_poly1
>(vs
)
43 void smooth_value(double v
) { base_type::generator().smooth_value(v
); }
44 double smooth_value() const { return base_type::generator().smooth_value(); }
47 conv_smooth_poly1(const conv_smooth_poly1
<VertexSource
>&);
48 const conv_smooth_poly1
<VertexSource
>&
49 operator = (const conv_smooth_poly1
<VertexSource
>&);
54 //-------------------------------------------------conv_smooth_poly1_curve
55 template<class VertexSource
>
56 struct conv_smooth_poly1_curve
:
57 public conv_curve
<conv_smooth_poly1
<VertexSource
> >
59 conv_smooth_poly1_curve(VertexSource
& vs
) :
60 conv_curve
<conv_smooth_poly1
<VertexSource
> >(m_smooth
),
65 void smooth_value(double v
) { m_smooth
.generator().smooth_value(v
); }
66 double smooth_value() const { return m_smooth
.generator().smooth_value(); }
69 conv_smooth_poly1_curve(const conv_smooth_poly1_curve
<VertexSource
>&);
70 const conv_smooth_poly1_curve
<VertexSource
>&
71 operator = (const conv_smooth_poly1_curve
<VertexSource
>&);
73 conv_smooth_poly1
<VertexSource
> m_smooth
;