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_CONV_UNCLOSE_POLYGON_INCLUDED
17 #define AGG_CONV_UNCLOSE_POLYGON_INCLUDED
19 #include "agg_basics.h"
23 //====================================================conv_unclose_polygon
24 template<class VertexSource
> class conv_unclose_polygon
27 conv_unclose_polygon(VertexSource
& vs
) : m_source(&vs
) {}
28 void attach(VertexSource
& source
) { m_source
= &source
; }
30 void rewind(unsigned path_id
)
32 m_source
->rewind(path_id
);
35 unsigned vertex(double* x
, double* y
)
37 unsigned cmd
= m_source
->vertex(x
, y
);
38 if(is_end_poly(cmd
)) cmd
&= ~path_flags_close
;
43 conv_unclose_polygon(const conv_unclose_polygon
<VertexSource
>&);
44 const conv_unclose_polygon
<VertexSource
>&
45 operator = (const conv_unclose_polygon
<VertexSource
>&);
47 VertexSource
* m_source
;