update dev300-m58
[ooovba.git] / agg / inc / agg_vpgen_clip_polygon.h
blobd0bcd466a88f7a6a66e1b4cd0d220b047f191296
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_VPGEN_CLIP_POLYGON_INCLUDED
17 #define AGG_VPGEN_CLIP_POLYGON_INCLUDED
19 #include "agg_basics.h"
21 namespace agg
24 //======================================================vpgen_clip_polygon
26 // See Implementation agg_vpgen_clip_polygon.cpp
28 class vpgen_clip_polygon
30 public:
31 vpgen_clip_polygon() :
32 m_clip_box(0, 0, 1, 1),
33 m_x1(0),
34 m_y1(0),
35 m_clip_flags(0),
36 m_num_vertices(0),
37 m_vertex(0),
38 m_cmd(path_cmd_move_to)
42 void clip_box(double _x1, double _y1, double _x2, double _y2)
44 m_clip_box.x1 = _x1;
45 m_clip_box.y1 = _y1;
46 m_clip_box.x2 = _x2;
47 m_clip_box.y2 = _y2;
48 m_clip_box.normalize();
52 double x1() const { return m_clip_box.x1; }
53 double y1() const { return m_clip_box.y1; }
54 double x2() const { return m_clip_box.x2; }
55 double y2() const { return m_clip_box.y2; }
57 static bool auto_close() { return true; }
58 static bool auto_unclose() { return false; }
60 void reset();
61 void move_to(double x, double y);
62 void line_to(double x, double y);
63 unsigned vertex(double* x, double* y);
65 private:
66 unsigned clipping_flags(double x, double y);
68 private:
69 rect_d m_clip_box;
70 double m_x1;
71 double m_y1;
72 unsigned m_clip_flags;
73 double m_x[4];
74 double m_y[4];
75 unsigned m_num_vertices;
76 unsigned m_vertex;
77 unsigned m_cmd;
83 #endif