OLD | NEW |
1 | 1 |
2 //---------------------------------------------------------------------------- | 2 //---------------------------------------------------------------------------- |
3 // Anti-Grain Geometry - Version 2.3 | 3 // Anti-Grain Geometry - Version 2.3 |
4 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com) | 4 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com) |
5 // Copyright (C) 2005 Tony Juricic (tonygeek@yahoo.com) | 5 // Copyright (C) 2005 Tony Juricic (tonygeek@yahoo.com) |
6 // | 6 // |
7 // Permission to copy, use, modify, sell and distribute this software | 7 // Permission to copy, use, modify, sell and distribute this software |
8 // is granted provided this copyright notice appears in all copies. | 8 // is granted provided this copyright notice appears in all copies. |
9 // This software is provided "as is" without express or implied | 9 // This software is provided "as is" without express or implied |
10 // warranty, and with no claim as to its suitability for any purpose. | 10 // warranty, and with no claim as to its suitability for any purpose. |
11 // | 11 // |
12 //---------------------------------------------------------------------------- | 12 //---------------------------------------------------------------------------- |
13 // Contact: mcseem@antigrain.com | 13 // Contact: mcseem@antigrain.com |
14 // mcseemagg@yahoo.com | 14 // mcseemagg@yahoo.com |
15 // http://www.antigrain.com | 15 // http://www.antigrain.com |
16 //---------------------------------------------------------------------------- | 16 //---------------------------------------------------------------------------- |
17 #ifndef AGG_CURVES_INCLUDED | 17 #ifndef AGG_CURVES_INCLUDED |
18 #define AGG_CURVES_INCLUDED | 18 #define AGG_CURVES_INCLUDED |
19 #include "agg_array.h" | 19 #include "agg_array.h" |
20 namespace agg | 20 namespace agg |
21 { | 21 { |
22 struct curve4_points : public CFX_Object { | 22 struct curve4_points { |
23 FX_FLOAT cp[8]; | 23 FX_FLOAT cp[8]; |
24 curve4_points() {} | 24 curve4_points() {} |
25 curve4_points(FX_FLOAT x1, FX_FLOAT y1, | 25 curve4_points(FX_FLOAT x1, FX_FLOAT y1, |
26 FX_FLOAT x2, FX_FLOAT y2, | 26 FX_FLOAT x2, FX_FLOAT y2, |
27 FX_FLOAT x3, FX_FLOAT y3, | 27 FX_FLOAT x3, FX_FLOAT y3, |
28 FX_FLOAT x4, FX_FLOAT y4) | 28 FX_FLOAT x4, FX_FLOAT y4) |
29 { | 29 { |
30 cp[0] = x1; | 30 cp[0] = x1; |
31 cp[1] = y1; | 31 cp[1] = y1; |
32 cp[2] = x2; | 32 cp[2] = x2; |
(...skipping 19 matching lines...) Expand all Loading... |
52 } | 52 } |
53 FX_FLOAT operator [] (unsigned i) const | 53 FX_FLOAT operator [] (unsigned i) const |
54 { | 54 { |
55 return cp[i]; | 55 return cp[i]; |
56 } | 56 } |
57 FX_FLOAT& operator [] (unsigned i) | 57 FX_FLOAT& operator [] (unsigned i) |
58 { | 58 { |
59 return cp[i]; | 59 return cp[i]; |
60 } | 60 } |
61 }; | 61 }; |
62 class curve4_div : public CFX_Object | 62 class curve4_div |
63 { | 63 { |
64 public: | 64 public: |
65 curve4_div() : | 65 curve4_div() : |
66 m_count(0) | 66 m_count(0) |
67 {} | 67 {} |
68 curve4_div(FX_FLOAT x1, FX_FLOAT y1, | 68 curve4_div(FX_FLOAT x1, FX_FLOAT y1, |
69 FX_FLOAT x2, FX_FLOAT y2, | 69 FX_FLOAT x2, FX_FLOAT y2, |
70 FX_FLOAT x3, FX_FLOAT y3, | 70 FX_FLOAT x3, FX_FLOAT y3, |
71 FX_FLOAT x4, FX_FLOAT y4) : | 71 FX_FLOAT x4, FX_FLOAT y4) : |
72 m_count(0) | 72 m_count(0) |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 void recursive_bezier(FX_FLOAT x1, FX_FLOAT y1, | 128 void recursive_bezier(FX_FLOAT x1, FX_FLOAT y1, |
129 FX_FLOAT x2, FX_FLOAT y2, | 129 FX_FLOAT x2, FX_FLOAT y2, |
130 FX_FLOAT x3, FX_FLOAT y3, | 130 FX_FLOAT x3, FX_FLOAT y3, |
131 FX_FLOAT x4, FX_FLOAT y4, | 131 FX_FLOAT x4, FX_FLOAT y4, |
132 unsigned level); | 132 unsigned level); |
133 FX_FLOAT m_distance_tolerance_square; | 133 FX_FLOAT m_distance_tolerance_square; |
134 FX_FLOAT m_distance_tolerance_manhattan; | 134 FX_FLOAT m_distance_tolerance_manhattan; |
135 unsigned m_count; | 135 unsigned m_count; |
136 pod_deque<point_type> m_points; | 136 pod_deque<point_type> m_points; |
137 }; | 137 }; |
138 class curve4 : public CFX_Object | 138 class curve4 |
139 { | 139 { |
140 public: | 140 public: |
141 curve4() {} | 141 curve4() {} |
142 curve4(FX_FLOAT x1, FX_FLOAT y1, | 142 curve4(FX_FLOAT x1, FX_FLOAT y1, |
143 FX_FLOAT x2, FX_FLOAT y2, | 143 FX_FLOAT x2, FX_FLOAT y2, |
144 FX_FLOAT x3, FX_FLOAT y3, | 144 FX_FLOAT x3, FX_FLOAT y3, |
145 FX_FLOAT x4, FX_FLOAT y4) | 145 FX_FLOAT x4, FX_FLOAT y4) |
146 { | 146 { |
147 init(x1, y1, x2, y2, x3, y3, x4, y4); | 147 init(x1, y1, x2, y2, x3, y3, x4, y4); |
148 } | 148 } |
(...skipping 30 matching lines...) Expand all Loading... |
179 } | 179 } |
180 int count() | 180 int count() |
181 { | 181 { |
182 return m_curve_div.count(); | 182 return m_curve_div.count(); |
183 } | 183 } |
184 private: | 184 private: |
185 curve4_div m_curve_div; | 185 curve4_div m_curve_div; |
186 }; | 186 }; |
187 } | 187 } |
188 #endif | 188 #endif |
OLD | NEW |