set_window.c 1.0 KB

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