agg_conv_dash.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. // conv_dash
  17. //
  18. //----------------------------------------------------------------------------
  19. #ifndef AGG_CONV_DASH_INCLUDED
  20. #define AGG_CONV_DASH_INCLUDED
  21. #include "agg_basics.h"
  22. #include "agg_vcgen_dash.h"
  23. #include "agg_conv_adaptor_vcgen.h"
  24. namespace agg
  25. {
  26. //---------------------------------------------------------------conv_dash
  27. template<class VertexSource, class Markers=null_markers>
  28. struct conv_dash : public conv_adaptor_vcgen<VertexSource, vcgen_dash, Markers>
  29. {
  30. typedef Markers marker_type;
  31. typedef conv_adaptor_vcgen<VertexSource, vcgen_dash, Markers> base_type;
  32. conv_dash(VertexSource& vs) :
  33. conv_adaptor_vcgen<VertexSource, vcgen_dash, Markers>(vs)
  34. {
  35. }
  36. void remove_all_dashes()
  37. {
  38. base_type::generator().remove_all_dashes();
  39. }
  40. void add_dash(double dash_len, double gap_len)
  41. {
  42. base_type::generator().add_dash(dash_len, gap_len);
  43. }
  44. void dash_start(double ds)
  45. {
  46. base_type::generator().dash_start(ds);
  47. }
  48. void shorten(double s) { base_type::generator().shorten(s); }
  49. double shorten() const { return base_type::generator().shorten(); }
  50. private:
  51. conv_dash(const conv_dash<VertexSource, Markers>&);
  52. const conv_dash<VertexSource, Markers>&
  53. operator = (const conv_dash<VertexSource, Markers>&);
  54. };
  55. }
  56. #endif