set_window.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*!
  2. * \file gis/set_window.c
  3. *
  4. * \brief GIS Library - Set window (map region)
  5. *
  6. * (C) 2001-2009 by the GRASS Development Team
  7. *
  8. * This program is free software under the GNU General Public License
  9. * (>=v2). Read the file COPYING that comes with GRASS for details.
  10. *
  11. * \author Original author CERL
  12. */
  13. #include <grass/gis.h>
  14. #include <grass/glocale.h>
  15. #include "G.h"
  16. /*!
  17. * \brief Get the current working window (region)
  18. *
  19. * The current working window values are returned in the structure
  20. * <i>window</i>.
  21. *
  22. * \param[in,out] window window structure to be set
  23. */
  24. void G_get_set_window(struct Cell_head *window)
  25. {
  26. G__init_window();
  27. *window = G__.window;
  28. }
  29. /*!
  30. * \brief Establishes 'window' as the current working window.
  31. *
  32. * \param window window to become operative window
  33. *
  34. * \return -1 on error
  35. * \return 1 on success
  36. */
  37. void G_set_window(struct Cell_head *window)
  38. {
  39. /* adjust window, check for valid window */
  40. G_adjust_Cell_head(window, 0, 0);
  41. /* copy the window to the current window */
  42. G__.window = *window;
  43. G__.window_set = 1;
  44. }