update dev300-m58
[ooovba.git] / agg / inc / agg_arc.h
blobe681718c180de58763c8b26edb2b3e8a9d8b52e3
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 // Arc vertex generator
18 //----------------------------------------------------------------------------
20 #ifndef AGG_ARC_INCLUDED
21 #define AGG_ARC_INCLUDED
23 #include <math.h>
24 #include "agg_basics.h"
26 namespace agg
29 //=====================================================================arc
31 // See Implementation agg_arc.cpp
33 class arc
35 public:
36 arc() : m_scale(1.0), m_initialized(false) {}
37 arc(double x, double y,
38 double rx, double ry,
39 double a1, double a2,
40 bool ccw=true);
42 void init(double x, double y,
43 double rx, double ry,
44 double a1, double a2,
45 bool ccw=true);
47 void approximation_scale(double s);
48 double approximation_scale() const { return m_scale; }
50 void rewind(unsigned);
51 unsigned vertex(double* x, double* y);
53 private:
54 void normalize(double a1, double a2, bool ccw);
56 double m_x;
57 double m_y;
58 double m_rx;
59 double m_ry;
60 double m_angle;
61 double m_start;
62 double m_end;
63 double m_scale;
64 double m_da;
65 bool m_ccw;
66 bool m_initialized;
67 unsigned m_path_cmd;
74 #endif