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_SMOOTH_POLY1_INCLUDED
17 #define AGG_VCGEN_SMOOTH_POLY1_INCLUDED
19 #include "agg_basics.h"
20 #include "agg_vertex_sequence.h"
26 //======================================================vcgen_smooth_poly1
28 // See Implementation agg_vcgen_smooth_poly1.cpp
29 // Smooth polygon generator
31 //------------------------------------------------------------------------
32 class vcgen_smooth_poly1
48 typedef vertex_sequence
<vertex_dist
, 6> vertex_storage
;
52 void smooth_value(double v
) { m_smooth_value
= v
* 0.5; }
53 double smooth_value() const { return m_smooth_value
* 2.0; }
55 // Vertex Generator Interface
57 void add_vertex(double x
, double y
, unsigned cmd
);
59 // Vertex Source Interface
60 void rewind(unsigned id
);
61 unsigned vertex(double* x
, double* y
);
64 vcgen_smooth_poly1(const vcgen_smooth_poly1
&);
65 const vcgen_smooth_poly1
& operator = (const vcgen_smooth_poly1
&);
67 void calculate(const vertex_dist
& v0
,
68 const vertex_dist
& v1
,
69 const vertex_dist
& v2
,
70 const vertex_dist
& v3
);
72 vertex_storage m_src_vertices
;
73 double m_smooth_value
;
76 unsigned m_src_vertex
;