xref: /haiku/headers/libs/agg/agg_arrowhead.h (revision 4f00613311d0bd6b70fa82ce19931c41f071ea4e)
1 //----------------------------------------------------------------------------
2 // Anti-Grain Geometry - Version 2.2
3 // Copyright (C) 2002-2004 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 // Simple arrowhead/arrowtail generator
17 //
18 //----------------------------------------------------------------------------
19 #ifndef AGG_ARROWHEAD_INCLUDED
20 #define AGG_ARROWHEAD_INCLUDED
21 
22 #include "agg_basics.h"
23 
24 namespace agg
25 {
26 
27     //===============================================================arrowhead
28     //
29     // See implementation agg_arrowhead.cpp
30     //
31     class arrowhead
32     {
33     public:
34         arrowhead();
35 
36         void head(double d1, double d2, double d3, double d4)
37         {
38             m_head_d1 = d1;
39             m_head_d2 = d2;
40             m_head_d3 = d3;
41             m_head_d4 = d4;
42             m_head_flag = true;
43         }
44 
45         void head()    { m_head_flag = true; }
46         void no_head() { m_head_flag = false; }
47 
48         void tail(double d1, double d2, double d3, double d4)
49         {
50             m_tail_d1 = d1;
51             m_tail_d2 = d2;
52             m_tail_d3 = d3;
53             m_tail_d4 = d4;
54             m_tail_flag = true;
55         }
56 
57         void tail()    { m_tail_flag = true;  }
58         void no_tail() { m_tail_flag = false; }
59 
60         void rewind(unsigned id);
61         unsigned vertex(double* x, double* y);
62 
63     private:
64         double   m_head_d1;
65         double   m_head_d2;
66         double   m_head_d3;
67         double   m_head_d4;
68         double   m_tail_d1;
69         double   m_tail_d2;
70         double   m_tail_d3;
71         double   m_tail_d4;
72         bool     m_head_flag;
73         bool     m_tail_flag;
74         double   m_coord[16];
75         unsigned m_cmd[8];
76         unsigned m_curr_id;
77         unsigned m_curr_coord;
78     };
79 
80 }
81 
82 #endif
83