Anti-Grain Geometry Tutorial
agg_vpgen_segmentator.h
1 //----------------------------------------------------------------------------
2 // Anti-Grain Geometry - Version 2.4
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 //----------------------------------------------------------------------------
15 
16 #ifndef AGG_VPGEN_SEGMENTATOR_INCLUDED
17 #define AGG_VPGEN_SEGMENTATOR_INCLUDED
18 
19 #include "agg_basics.h"
20 
21 namespace agg
22 {
23 
24  //=======================================================vpgen_segmentator
25  //
26  // See Implementation agg_vpgen_segmentator.cpp
27  //
29  {
30  public:
31  vpgen_segmentator() : m_approximation_scale(1.0) {}
32 
33  void approximation_scale(double s) { m_approximation_scale = s; }
34  double approximation_scale() const { return m_approximation_scale; }
35 
36  static bool auto_close() { return false; }
37  static bool auto_unclose() { return false; }
38 
39  void reset() { m_cmd = path_cmd_stop; }
40  void move_to(double x, double y);
41  void line_to(double x, double y);
42  unsigned vertex(double* x, double* y);
43 
44  private:
45  double m_approximation_scale;
46  double m_x1;
47  double m_y1;
48  double m_dx;
49  double m_dy;
50  double m_dl;
51  double m_ddl;
52  unsigned m_cmd;
53  };
54 
55 
56 
57 }
58 
59 #endif
60 
Definition: agg_arc.cpp:24