update dev300-m58
[ooovba.git] / agg / inc / agg_vcgen_smooth_poly1.h
blob80f56d8046e1a35b507eb4a5acc4410a9a2aa260
1 //----------------------------------------------------------------------------
2 // Anti-Grain Geometry - Version 2.3
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 //----------------------------------------------------------------------------
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"
23 namespace agg
26 //======================================================vcgen_smooth_poly1
28 // See Implementation agg_vcgen_smooth_poly1.cpp
29 // Smooth polygon generator
31 //------------------------------------------------------------------------
32 class vcgen_smooth_poly1
34 enum status_e
36 initial,
37 ready,
38 polygon,
39 ctrl_b,
40 ctrl_e,
41 ctrl1,
42 ctrl2,
43 end_poly,
44 stop
47 public:
48 typedef vertex_sequence<vertex_dist, 6> vertex_storage;
50 vcgen_smooth_poly1();
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
56 void remove_all();
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);
63 private:
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;
74 unsigned m_closed;
75 status_e m_status;
76 unsigned m_src_vertex;
77 double m_ctrl1_x;
78 double m_ctrl1_y;
79 double m_ctrl2_x;
80 double m_ctrl2_y;
86 #endif