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 // classes curve3 and curve4
18 //----------------------------------------------------------------------------
20 #ifndef AGG_CURVES_INCLUDED
21 #define AGG_CURVES_INCLUDED
23 #include "agg_basics.h"
24 #include "agg_vertex_iterator.h"
29 // See Implemantation agg_curves.cpp
32 //------------------------------------------------------------------curve3
37 m_num_steps(0), m_step(0), m_scale(1.0) { }
39 curve3(double x1
, double y1
,
41 double x3
, double y3
) :
42 m_num_steps(0), m_step(0), m_scale(1.0)
44 init(x1
, y1
, x2
, y2
, x3
, y3
);
47 void reset() { m_num_steps
= 0; m_step
= -1; }
48 void init(double x1
, double y1
,
50 double x3
, double y3
);
51 void approximation_scale(double s
) { m_scale
= s
; }
52 double approximation_scale() const { return m_scale
; }
54 void rewind(unsigned id
);
55 unsigned vertex(double* x
, double* y
);
57 typedef curve3 source_type
;
58 typedef vertex_iterator
<source_type
> iterator
;
59 iterator
begin(unsigned id
) { return iterator(*this, id
); }
60 iterator
end() { return iterator(path_cmd_stop
); }
88 //-----------------------------------------------------------------curve4
93 m_num_steps(0), m_step(0), m_scale(1.0) { }
95 curve4(double x1
, double y1
,
98 double x4
, double y4
) :
99 m_num_steps(0), m_step(0), m_scale(1.0)
101 init(x1
, y1
, x2
, y2
, x3
, y3
, x4
, y4
);
104 void reset() { m_num_steps
= 0; m_step
= -1; }
105 void init(double x1
, double y1
,
106 double x2
, double y2
,
107 double x3
, double y3
,
108 double x4
, double y4
);
110 void approximation_scale(double s
) { m_scale
= s
; }
111 double approximation_scale() const { return m_scale
; }
113 void rewind(unsigned id
);
114 unsigned vertex(double* x
, double* y
);
116 typedef curve4 source_type
;
117 typedef vertex_iterator
<source_type
> iterator
;
118 iterator
begin(unsigned id
) { return iterator(*this, id
); }
119 iterator
end() { return iterator(path_cmd_stop
); }