Anti-Grain Geometry Tutorial
agg_conv_smooth_poly1.h
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 //----------------------------------------------------------------------------
15 //
16 // Smooth polygon generator
17 //
18 //----------------------------------------------------------------------------
19 #ifndef AGG_CONV_SMOOTH_POLY1_INCLUDED
20 #define AGG_CONV_SMOOTH_POLY1_INCLUDED
21 
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"
26 
27 
28 namespace agg
29 {
30 
31  //-------------------------------------------------------conv_smooth_poly1
32  template<class VertexSource>
34  public conv_adaptor_vcgen<VertexSource, vcgen_smooth_poly1>
35  {
37 
38  conv_smooth_poly1(VertexSource& vs) :
40  {
41  }
42 
43  void smooth_value(double v) { base_type::generator().smooth_value(v); }
44  double smooth_value() const { return base_type::generator().smooth_value(); }
45 
46  private:
49  operator = (const conv_smooth_poly1<VertexSource>&);
50  };
51 
52 
53 
54  //-------------------------------------------------conv_smooth_poly1_curve
55  template<class VertexSource>
57  public conv_curve<conv_smooth_poly1<VertexSource> >
58  {
59  conv_smooth_poly1_curve(VertexSource& vs) :
61  m_smooth(vs)
62  {
63  }
64 
65  void smooth_value(double v) { m_smooth.generator().smooth_value(v); }
66  double smooth_value() const { return m_smooth.generator().smooth_value(); }
67 
68  private:
71  operator = (const conv_smooth_poly1_curve<VertexSource>&);
72 
74  };
75 
76 }
77 
78 
79 #endif
80 
Definition: agg_arc.cpp:24