agg_arrowhead.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. // Simple arrowhead/arrowtail generator
  17. //
  18. //----------------------------------------------------------------------------
  19. #ifndef AGG_ARROWHEAD_INCLUDED
  20. #define AGG_ARROWHEAD_INCLUDED
  21. #include "agg_basics.h"
  22. namespace agg
  23. {
  24. //===============================================================arrowhead
  25. //
  26. // See implementation agg_arrowhead.cpp
  27. //
  28. class arrowhead
  29. {
  30. public:
  31. arrowhead();
  32. void head(double d1, double d2, double d3, double d4)
  33. {
  34. m_head_d1 = d1;
  35. m_head_d2 = d2;
  36. m_head_d3 = d3;
  37. m_head_d4 = d4;
  38. m_head_flag = true;
  39. }
  40. void head() { m_head_flag = true; }
  41. void no_head() { m_head_flag = false; }
  42. void tail(double d1, double d2, double d3, double d4)
  43. {
  44. m_tail_d1 = d1;
  45. m_tail_d2 = d2;
  46. m_tail_d3 = d3;
  47. m_tail_d4 = d4;
  48. m_tail_flag = true;
  49. }
  50. void tail() { m_tail_flag = true; }
  51. void no_tail() { m_tail_flag = false; }
  52. void rewind(unsigned path_id);
  53. unsigned vertex(double* x, double* y);
  54. private:
  55. double m_head_d1;
  56. double m_head_d2;
  57. double m_head_d3;
  58. double m_head_d4;
  59. double m_tail_d1;
  60. double m_tail_d2;
  61. double m_tail_d3;
  62. double m_tail_d4;
  63. bool m_head_flag;
  64. bool m_tail_flag;
  65. double m_coord[16];
  66. unsigned m_cmd[8];
  67. unsigned m_curr_id;
  68. unsigned m_curr_coord;
  69. };
  70. }
  71. #endif