complete_reg.c 554 B

1234567891011121314151617181920212223
  1. #include <grass/gis.h>
  2. #include <grass/glocale.h>
  3. #include "globals.h"
  4. #include "local_proto.h"
  5. /* This routine completes the region by adding a line from the last
  6. point to the first point. */
  7. int complete_region(void)
  8. {
  9. if (Region.npoints < 3)
  10. G_warning(_("Too few points for region. Must have at least 3 points."));
  11. else if (Region.area.completed)
  12. G_warning(_("Area already completed."));
  13. else {
  14. add_point(Region.point[0].x, Region.point[0].y);
  15. Region.area.completed = 1;
  16. save_region();
  17. }
  18. Menu_msg("");
  19. return (0);
  20. }