p_point.c 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* This file is part of the GNU plotutils package. Copyright (C) 1995,
  2. 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc.
  3. The GNU plotutils package is free software. You may redistribute it
  4. and/or modify it under the terms of the GNU General Public License as
  5. published by the Free Software foundation; either version 2, or (at your
  6. option) any later version.
  7. The GNU plotutils package is distributed in the hope that it will be
  8. useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. General Public License for more details.
  11. You should have received a copy of the GNU General Public License along
  12. with the GNU plotutils package; see the file COPYING. If not, write to
  13. the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor,
  14. Boston, MA 02110-1301, USA. */
  15. /* The internal point-drawing function, which point() is a wrapper around.
  16. It draws a point at the current location. There is no standard
  17. definition of `point', so any Plotter is free to implement this as it
  18. sees fit. */
  19. /* In the PSPlotter class, a `point' is displayed as a small filled circle
  20. (one of libplot's standard marker symbols). */
  21. #include "sys-defines.h"
  22. #include "extern.h"
  23. void
  24. _pl_p_paint_point (S___(Plotter *_plotter))
  25. {
  26. double norm;
  27. if (_plotter->drawstate->pen_type != 0)
  28. /* have a pen to draw with */
  29. {
  30. /* compute size of a `point' in user coordinates */
  31. norm = _matrix_norm (_plotter->drawstate->transform.m);
  32. if (norm != 0.0)
  33. {
  34. double user_size;
  35. user_size = PS_SIZE_OF_POINT / _matrix_norm (_plotter->drawstate->transform.m);
  36. _plotter->paint_marker (R___(_plotter)
  37. (int)M_FILLED_CIRCLE, user_size);
  38. }
  39. }
  40. }