Przeglądaj źródła

unused i.points + i.vpoints removed: replaced by g.gui.gcp (trunk, https://trac.osgeo.org/grass/changeset/62555)

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@62556 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler 10 lat temu
rodzic
commit
a77f941d21
93 zmienionych plików z 81 dodań i 10494 usunięć
  1. 7 1
      TODO
  2. 1 1
      doc/projectionintro.html
  3. 3 2
      gui/wxpython/gcp/g.gui.gcp.html
  4. 1 0
      gui/wxpython/gcp/g.gui.gcp.py
  5. 2 2
      imagery/i.group/i.group.html
  6. 15 0
      imagery/i.ortho.photo/lib/TODO
  7. 0 10
      imagery/i.points/Makefile
  8. 0 568
      imagery/i.points/analyze.c
  9. 0 389
      imagery/i.points/ask.c
  10. 0 164
      imagery/i.points/ask_mag.c
  11. 0 57
      imagery/i.points/call.c
  12. 0 89
      imagery/i.points/cell.c
  13. 0 23
      imagery/i.points/cellhd.c
  14. 0 6
      imagery/i.points/colors.c
  15. 0 49
      imagery/i.points/conv.c
  16. 0 267
      imagery/i.points/curses.c
  17. 0 12
      imagery/i.points/debug.c
  18. 0 62
      imagery/i.points/defs.h
  19. 0 119
      imagery/i.points/digit.c
  20. 0 56
      imagery/i.points/dot.c
  21. 0 70
      imagery/i.points/drawcell.c
  22. 0 51
      imagery/i.points/driver.c
  23. 0 10
      imagery/i.points/equ.c
  24. 0 21
      imagery/i.points/find.c
  25. 0 63
      imagery/i.points/globals.h
  26. 0 136
      imagery/i.points/graphics.c
  27. 0 71
      imagery/i.points/group.c
  28. 0 410
      imagery/i.points/i.points.html
  29. 0 263
      imagery/i.points/input.c
  30. 0 134
      imagery/i.points/local_proto.h
  31. 0 262
      imagery/i.points/main.c
  32. 0 197
      imagery/i.points/mark.c
  33. 0 56
      imagery/i.points/mouse.c
  34. 0 58
      imagery/i.points/points.c
  35. 0 66
      imagery/i.points/target.c
  36. 0 49
      imagery/i.points/title.c
  37. 0 50
      imagery/i.points/view.c
  38. 0 68
      imagery/i.points/where.c
  39. 0 26
      imagery/i.points/zoom.c
  40. 0 182
      imagery/i.points/zoom_box.c
  41. 0 191
      imagery/i.points/zoom_pnt.c
  42. 1 1
      imagery/i.rectify/main.c
  43. 10 6
      imagery/i.target/i.target.html
  44. 0 12
      imagery/i.vpoints/Makefile
  45. 0 766
      imagery/i.vpoints/analyze.c
  46. 0 386
      imagery/i.vpoints/ask.c
  47. 0 164
      imagery/i.vpoints/ask_mag.c
  48. 0 57
      imagery/i.vpoints/call.c
  49. 0 89
      imagery/i.vpoints/cell.c
  50. 0 31
      imagery/i.vpoints/cellhd.c
  51. 0 236
      imagery/i.vpoints/colors.c
  52. 0 49
      imagery/i.vpoints/conv.c
  53. 0 711
      imagery/i.vpoints/crs.c
  54. 0 39
      imagery/i.vpoints/crs.h
  55. 0 267
      imagery/i.vpoints/curses.c
  56. 0 11
      imagery/i.vpoints/debug.c
  57. 0 71
      imagery/i.vpoints/defs.h
  58. 0 118
      imagery/i.vpoints/digit.c
  59. 0 57
      imagery/i.vpoints/dot.c
  60. 0 109
      imagery/i.vpoints/drawcell.c
  61. 0 319
      imagery/i.vpoints/drawvect.c
  62. 0 76
      imagery/i.vpoints/driver.c
  63. 0 21
      imagery/i.vpoints/equ.c
  64. 0 21
      imagery/i.vpoints/find.c
  65. 0 219
      imagery/i.vpoints/globals.h
  66. 0 123
      imagery/i.vpoints/graphics.c
  67. 0 69
      imagery/i.vpoints/group.c
  68. 0 314
      imagery/i.vpoints/i.vpoints.html
  69. 0 263
      imagery/i.vpoints/input.c
  70. 0 269
      imagery/i.vpoints/main.c
  71. 0 197
      imagery/i.vpoints/mark.c
  72. 0 56
      imagery/i.vpoints/mouse.c
  73. 0 161
      imagery/i.vpoints/plot.c
  74. 0 60
      imagery/i.vpoints/points.c
  75. 0 70
      imagery/i.vpoints/setup.c
  76. 0 69
      imagery/i.vpoints/target.c
  77. 0 48
      imagery/i.vpoints/title.c
  78. 0 4
      imagery/i.vpoints/vectpoints.h
  79. 0 49
      imagery/i.vpoints/view.c
  80. 0 73
      imagery/i.vpoints/where.c
  81. 0 24
      imagery/i.vpoints/zoom.c
  82. 0 197
      imagery/i.vpoints/zoom_box.c
  83. 0 263
      imagery/i.vpoints/zoom_pnt.c
  84. 2 2
      imagery/imageryintro.html
  85. 1 1
      lib/imagery/group.c
  86. 3 3
      lib/imagery/imagerylib.dox
  87. 1 1
      lib/imagery/target.c
  88. 5 1
      misc/m.transform/m.transform.html
  89. 9 9
      scripts/g.extension/g.extension.html
  90. 0 2
      tools/dep_tree2sql.sh
  91. 1 1
      vector/v.rectify/main.c
  92. 17 16
      vector/v.rectify/v.rectify.html
  93. 2 2
      vector/v.transform/v.transform.html

+ 7 - 1
TODO

@@ -26,8 +26,9 @@ Imagery
     - lib/image3/: never finished improvement which integrated the standard lib and
     - lib/image3/: never finished improvement which integrated the standard lib and
                    the ortho lib. Seems to provide also ortho rectification for
                    the ortho lib. Seems to provide also ortho rectification for
                    satellite data (i.points3, i.rectify3)
                    satellite data (i.points3, i.rectify3)
+- See
+  http://grasswiki.osgeo.org/wiki/Image_processing#Ideas_collection_for_improving_GRASS.27_Image_processing_capabilities
 - image modules:
 - image modules:
-    - merge of i.points, i.vpoints, i.points3
     - merge of i.rectify and i.rectify3
     - merge of i.rectify and i.rectify3
     - addition of new resampling algorithms such as bilinear, cubic convolution
     - addition of new resampling algorithms such as bilinear, cubic convolution
       (take from r.proj?)
       (take from r.proj?)
@@ -35,3 +36,8 @@ Imagery
     - implement/finish linewise ortho-rectification of satellite data
     - implement/finish linewise ortho-rectification of satellite data
     - Add support for > 8bit colors (only 0-255 supported currently)
     - Add support for > 8bit colors (only 0-255 supported currently)
 
 
+-----------------
+See also
+
+http://trac.osgeo.org/grass/wiki/Grass7Planning
+

+ 1 - 1
doc/projectionintro.html

@@ -23,7 +23,7 @@ location (or another XY location), a forward transformation is performed.
 The unreferenced map is geocoded within the XY location by defining 
 The unreferenced map is geocoded within the XY location by defining 
 four corner points or by seeking several ground control points
 four corner points or by seeking several ground control points
 (<a href="i.group.html">i.group</a>, <a href="i.target.html">i.target</a>,
 (<a href="i.group.html">i.group</a>, <a href="i.target.html">i.target</a>,
- <a href="i.points.html">i.points</a>) and then transformed into the
+ <a href="g.gui.gcp.html">g.gui.gcp</a>) and then transformed into the
 target location (<a href="i.rectify.html">i.rectify</a>). Polynomial
 target location (<a href="i.rectify.html">i.rectify</a>). Polynomial
 transformation of 1st, 2nd and 3rd order are supported.
 transformation of 1st, 2nd and 3rd order are supported.
 <p>
 <p>

+ 3 - 2
gui/wxpython/gcp/g.gui.gcp.html

@@ -299,8 +299,9 @@ error is displayed.
 
 
 <p>
 <p>
 <em>
 <em>
-  <a href="i.rectify.html">i.rectify</a>,
-  <a href="m.transform.html">m.transform</a>
+<a href="i.rectify.html">i.rectify</a>,
+<a href="m.transform.html">m.transform</a>,
+<a href="v.rectify.html">v.rectify</a>
 </em>
 </em>
 
 
 <p>
 <p>

+ 1 - 0
gui/wxpython/gcp/g.gui.gcp.py

@@ -24,6 +24,7 @@
 #% keywords: general
 #% keywords: general
 #% keywords: GUI
 #% keywords: GUI
 #% keywords: georectification
 #% keywords: georectification
+#% keywords: GCP
 #%end
 #%end
 
 
 """
 """

+ 2 - 2
imagery/i.group/i.group.html

@@ -5,7 +5,7 @@ group by assigning them to user-named subgroups or other groups. This
 enables the user to run analyses on any combination of the raster map layers
 enables the user to run analyses on any combination of the raster map layers
 in a group.  The user creates the groups and subgroups and selects the
 in a group.  The user creates the groups and subgroups and selects the
 raster map layers that are to reside in them. Imagery analysis programs like
 raster map layers that are to reside in them. Imagery analysis programs like
-<em><a href="i.points.html">i.points</a></em>, 
+<em><a href="g.gui.gcp.html">g.gui.gcp</a></em>, 
 <em><a href="i.rectify.html">i.rectify</a></em>,
 <em><a href="i.rectify.html">i.rectify</a></em>,
 <em><a href="i.ortho.photo.html">i.ortho.photo</a></em> and
 <em><a href="i.ortho.photo.html">i.ortho.photo</a></em> and
 others ask the user for the name of an imagery group whose data are to be
 others ask the user for the name of an imagery group whose data are to be
@@ -30,9 +30,9 @@ The GRASS 4 <em>
 Processing manual</a></em>
 Processing manual</a></em>
 
 
 <p><em>
 <p><em>
+<a href="g.gui.gcp.html">g.gui.gcp</a>,
 <a href="i.cluster.html">i.cluster</a>,
 <a href="i.cluster.html">i.cluster</a>,
 <a href="i.maxlik.html">i.maxlik</a>,
 <a href="i.maxlik.html">i.maxlik</a>,
-<a href="i.points.html">i.points</a>,
 <a href="i.rectify.html">i.rectify</a>,
 <a href="i.rectify.html">i.rectify</a>,
 <a href="i.ortho.photo.html">i.ortho.photo</a>
 <a href="i.ortho.photo.html">i.ortho.photo</a>
 </em>
 </em>

+ 15 - 0
imagery/i.ortho.photo/lib/TODO

@@ -6,6 +6,7 @@ Subject: Re: Re: i.ortho.photo
 
 
 >From grass64/TODO:
 >From grass64/TODO:
 
 
+- merge of image libraries:
   A)
   A)
     - lib/imagery/: standard lib, in use (i.* except for i.points3, i.rectify3)
     - lib/imagery/: standard lib, in use (i.* except for i.points3, i.rectify3)
     - imagery/i.ortho.photo/libes/: standard lib, in use (i.ortho.photo, photo.*)
     - imagery/i.ortho.photo/libes/: standard lib, in use (i.ortho.photo, photo.*)
@@ -16,3 +17,17 @@ Subject: Re: Re: i.ortho.photo
 
 
 Possibly a lot is already done in lib/image3/ ?
 Possibly a lot is already done in lib/image3/ ?
 
 
+- See
+  http://grasswiki.osgeo.org/wiki/Image_processing#Ideas_collection_for_improving_GRASS.27_Image_processing_capabilities
+- image modules:
+    - merge of i.rectify and i.rectify3
+    - addition of new resampling algorithms such as bilinear, cubic convolution
+      (take from r.proj?)
+    - add other warping methods (maybe thin splines from GDAL?)
+    - implement/finish linewise ortho-rectification of satellite data
+    - Add support for > 8bit colors (only 0-255 supported currently)
+
+-----------------
+See also
+
+http://trac.osgeo.org/grass/wiki/Grass7Planning

+ 0 - 10
imagery/i.points/Makefile

@@ -1,10 +0,0 @@
-MODULE_TOPDIR = ../..
-
-PGM = i.points
-
-LIBES     = $(IMAGERYLIB) $(DISPLAYLIB) $(GMATHLIB) $(GISLIB) $(CURSES)
-DEPENDENCIES= $(IMAGERYDEP) $(DISPLAYDEP) $(GMATHDEP) $(GISDEP)
-
-include $(MODULE_TOPDIR)/include/Make/Module.make
-
-default: cmd

+ 0 - 568
imagery/i.points/analyze.c

@@ -1,568 +0,0 @@
-#include <string.h>
-#include <unistd.h>
-#include <math.h>
-#include <stdlib.h>
-#include <grass/gis.h>
-#include <grass/display.h>
-#include "globals.h"
-#include "local_proto.h"
-
-#define NLINES 18
-
-struct box
-{
-    int top, bottom, left, right;
-};
-
-static int uparrow(struct box *, int);
-static int downarrow(struct box *, int);
-static int pick(int, int);
-static int done(void);
-static int cancel_which(void);
-static int inbox(struct box *, int, int);
-static int dotext(char *, int, int, int, int, int, int);
-static int compute_transformation(void);
-static int to_file(void);
-static int askfile(void);
-static int to_printer(void);
-static int do_report(FILE *);
-static int printcentered(FILE *, char *, int);
-static int show_point(int, int);
-
-static int which;
-static struct box more, less, report;
-static int height, size, edge, nlines;
-static int curp, first_point;
-static double rms;
-static double *xres, *yres, *gnd;
-static int pager;
-static int xmax, ymax, gmax;
-static char buf[300];
-
-#define FMT0(buf,n) \
-	sprintf (buf, "%3d ", n)
-#define FMT1(buf,xres,yres,gnd) \
-	sprintf (buf, "%5.1f %5.1f %6.1f ", xres,yres,gnd)
-#define LHEAD1 "        error          "
-#define LHEAD2 "  #   col   row  target"
-
-#define FMT2(buf,e1,n1,e2,n2) \
-	sprintf (buf, "%9.1f %9.1f %9.1f %9.1f ", e1,n1,e2,n2)
-#define RHEAD1 "         image              target"
-#define RHEAD2 "    east     north      east     north"
-
-#define BACKGROUND GREY
-
-int analyze(void)
-{
-    static int use = 1;
-    static Objects objects[] = {
-	MENU("DONE", done, &use),
-	MENU("PRINT", to_printer, &use),
-	MENU("FILE", to_file, &use),
-	INFO(" Double click on point to be included/excluded ", &use),
-	OTHER(pick, &use),
-	{0}
-    };
-
-    int color;
-    int tsize;
-    int cury;
-    int len;
-    int line;
-    int top, bottom, left, right, width, middle, nums;
-
-    /* to give user a response of some sort */
-    Menu_msg("Preparing analysis ...");
-
-    /*
-     * build a popup window at center of the screen.
-     * 35% the height and wide enough to hold the report
-     *
-     */
-
-    /* height of 1 line, based on NLINES taking up 35% vertical space */
-    height = (.35 * (SCREEN_BOTTOM - SCREEN_TOP)) / NLINES + 1;
-
-    /* size of text, 80% of line height */
-    tsize = .8 * height;
-    size = tsize - 2;		/* fudge for computing pixels width of text */
-
-    /* indent for the text */
-    edge = .1 * height + 1;
-
-    /* determine the length, in chars, of printed line */
-    FMT0(buf, 0);
-    nums = strlen(buf) * size;
-    FMT1(buf, 0.0, 0.0, 0.0);
-    len = strlen(buf);
-    middle = len * size;
-    FMT2(buf, 0.0, 0.0, 0.0, 0.0);
-    len += strlen(buf);
-
-    /* width is for max chars plus sidecar for more/less */
-    width = len * size + nums + 2 * height;
-    if ((SCREEN_RIGHT - SCREEN_LEFT) < width)
-	width = SCREEN_RIGHT - SCREEN_LEFT;
-
-
-    /* define the window */
-    bottom = VIEW_MENU->top - 1;
-    top = bottom - height * NLINES;
-
-
-    left = SCREEN_LEFT;
-    right = left + width;
-    middle += left + nums;
-    nums += left;
-
-    /* save what is under this area, so it can be restored */
-    R_panel_save(tempfile1, top, bottom + 1, left, right + 1);
-
-
-    /* fill it with white */
-    R_standard_color(BACKGROUND);
-    R_box_abs(left, top, right, bottom);
-
-    right -= 2 * height;	/* reduce it to exclude sidecar */
-
-    /* print messages in message area */
-    R_text_size(tsize, tsize);
-
-
-    /* setup the more/less boxes in the sidecar */
-    R_standard_color(BLACK);
-    less.top = top;
-    less.bottom = top + 2 * height;
-    less.left = right;
-    less.right = right + 2 * height;
-    Outline_box(less.top, less.bottom, less.left, less.right);
-
-    more.top = bottom - 2 * height;
-    more.bottom = bottom;
-    more.left = right;
-    more.right = right + 2 * height;
-    Outline_box(more.top, more.bottom, more.left, more.right);
-
-    /*
-     * top two lines are for column labels
-     * last two line is for overall rms error.
-     */
-    nlines = NLINES - 3;
-    first_point = 0;
-
-    /* allocate predicted values */
-    xres = (double *)G_calloc(group.points.count, sizeof(double));
-    yres = (double *)G_calloc(group.points.count, sizeof(double));
-    gnd = (double *)G_calloc(group.points.count, sizeof(double));
-
-    /* compute transformation for the first time */
-    compute_transformation();
-
-
-    /* put head on the report */
-    cury = top;
-    dotext(LHEAD1, cury, cury + height, left, middle, 0, BLACK);
-    dotext(RHEAD1, cury, cury + height, middle, right - 1, 0, BLACK);
-    cury += height;
-    dotext(LHEAD2, cury, cury + height, left, middle, 0, BLACK);
-    dotext(RHEAD2, cury, cury + height, middle, right - 1, 0, BLACK);
-    cury += height;
-    R_move_abs(left, cury - 1);
-    R_cont_abs(right, cury - 1);
-
-    /* isolate the sidecar */
-    R_move_abs(right, top);
-    R_cont_abs(right, bottom);
-
-    /* define report box */
-    report.top = cury;
-    report.left = left;
-    report.right = right;
-
-    /* lets do it */
-    pager = 1;
-    while (1) {
-	R_text_size(tsize, tsize);
-	line = 0;
-	curp = first_point;
-	cury = top + 2 * height;
-	while (1) {
-	    if (line >= nlines || curp >= group.points.count)
-		break;
-	    line++;
-	    if (group.equation_stat > 0 && group.points.status[curp] > 0) {
-		color = BLACK;
-		FMT1(buf, xres[curp], yres[curp], gnd[curp]);
-		if (curp == xmax || curp == ymax || curp == gmax)
-		    color = RED;
-		dotext(buf, cury, cury + height, nums, middle, 0, color);
-	    }
-	    else if (group.points.status[curp] > 0)
-		dotext("?", cury, cury + height, nums, middle, 1, BLACK);
-	    else
-		dotext("not used", cury, cury + height, nums, middle, 1,
-		       BLACK);
-	    if (pager) {
-		FMT0(buf, curp + 1);
-		dotext(buf, cury, cury + height, left, nums, 0, BLACK);
-		FMT2(buf,
-		     group.points.e1[curp],
-		     group.points.n1[curp],
-		     group.points.e2[curp], group.points.n2[curp]);
-		dotext(buf, cury, cury + height, middle, right - 1, 0, BLACK);
-	    }
-	    cury += height;
-	    curp++;
-	}
-	report.bottom = cury;
-	downarrow(&more, curp < group.points.count ? BLACK : BACKGROUND);
-	uparrow(&less, first_point > 0 ? BLACK : BACKGROUND);
-	R_standard_color(BACKGROUND);
-	R_box_abs(left, cury, right - 1, bottom);
-	if (group.equation_stat < 0) {
-	    color = RED;
-	    strcpy(buf, "Poorly placed control points");
-	}
-	else if (group.equation_stat == 0) {
-	    color = RED;
-	    strcpy(buf, "No active control points");
-	}
-	else {
-	    color = BLACK;
-	    sprintf(buf, "Overall rms error: %.2f", rms);
-	}
-	dotext(buf, bottom - height, bottom, left, right - 1, 0, color);
-	R_standard_color(BLACK);
-	R_move_abs(left, bottom - height);
-	R_cont_abs(right - 1, bottom - height);
-
-	pager = 0;
-	which = -1;
-	if (Input_pointer(objects) < 0)
-	    break;
-    }
-
-    /* all done. restore what was under the window */
-    right += 2 * height;	/* move it back over the sidecar */
-    R_standard_color(BACKGROUND);
-    R_box_abs(left, top, right, bottom);
-    R_panel_restore(tempfile1);
-    R_panel_delete(tempfile1);
-    R_flush();
-
-    G_free(xres);
-    G_free(yres);
-    G_free(gnd);
-    I_put_control_points(group.name, &group.points);
-    display_points(1);
-    return 0;			/* return but don't QUIT */
-}
-
-
-static int uparrow(struct box *box, int color)
-{
-    R_standard_color(color);
-    Uparrow(box->top + edge, box->bottom - edge, box->left + edge,
-	    box->right - edge);
-
-    return 0;
-}
-
-static int downarrow(struct box *box, int color)
-{
-    R_standard_color(color);
-    Downarrow(box->top + edge, box->bottom - edge, box->left + edge,
-	      box->right - edge);
-
-    return 0;
-}
-
-static int pick(int x, int y)
-{
-    int n;
-    int cur;
-
-    cur = which;
-    cancel_which();
-    if (inbox(&more, x, y)) {
-	if (curp >= group.points.count)
-	    return 0;
-	first_point = curp;
-	pager = 1;
-	return 1;
-    }
-    if (inbox(&less, x, y)) {
-	if (first_point == 0)
-	    return 0;
-	first_point -= nlines;
-	if (first_point < 0)
-	    first_point = 0;
-	pager = 1;
-	return 1;
-    }
-    if (!inbox(&report, x, y)) {
-	return 0;
-    }
-
-    n = (y - report.top) / height;
-    if (n == cur) {		/* second click! */
-	group.points.status[first_point + n] =
-	    !group.points.status[first_point + n];
-	compute_transformation();
-	show_point(first_point + n, 1);
-	return 1;
-    }
-
-    /* first click */
-    which = n;
-    show_point(first_point + n, 0);
-    R_standard_color(RED);
-    Outline_box((report.top + n * height) + 1, report.top + (n + 1) * height,
-		report.left, report.right - 1);
-    R_flush();
-
-    return 0;			/* ignore first click */
-
-}
-
-static int done(void)
-{
-    cancel_which();
-    return -1;
-}
-
-static int cancel_which(void)
-{
-    if (which >= 0) {
-	R_standard_color(BACKGROUND);
-	Outline_box((report.top + which * height) + 1,
-		    report.top + (which + 1) * height, report.left,
-		    report.right - 1);
-	show_point(first_point + which, 1);
-    }
-    which = -1;
-
-    return 0;
-}
-
-static int inbox(struct box *box, int x, int y)
-{
-    return (x > box->left && x < box->right && y > box->top &&
-	    y < box->bottom);
-}
-
-static int dotext(char *text,
-		  int top, int bottom, int left, int right, int centered,
-		  int color)
-{
-    R_standard_color(BACKGROUND);
-    R_box_abs(left, top, right, bottom);
-    R_standard_color(color);
-    R_move_abs(left + 1 + edge, bottom - 1 - edge);
-    if (centered)
-	R_move_rel((right - left - strlen(text) * size) / 2, 0);
-    R_set_window(top, bottom, left, right);	/* for text clipping */
-    R_text(text);
-    R_set_window(SCREEN_TOP, SCREEN_BOTTOM, SCREEN_LEFT, SCREEN_RIGHT);
-
-    return 0;
-}
-
-static int compute_transformation(void)
-{
-    int n, count;
-    double d, d1, d2, sum;
-    double e1, e2, n1, n2;
-    double xval, yval, gval;
-
-    xmax = ymax = gmax = 0;
-    xval = yval = gval = 0.0;
-
-    Compute_equation();
-    if (group.equation_stat <= 0)
-	return 1;
-
-    /* compute the row,col error plus ground error 
-     * keep track of largest and second largest error
-     */
-    sum = 0.0;
-    rms = 0.0;
-    count = 0;
-    for (n = 0; n < group.points.count; n++) {
-	if (group.points.status[n] <= 0)
-	    continue;
-	count++;
-	I_georef(group.points.e2[n], group.points.n2[n], &e1, &n1, group.E21,
-		 group.N21);
-	I_georef(group.points.e1[n], group.points.n1[n], &e2, &n2, group.E12,
-		 group.N12);
-
-	if ((d = xres[n] = e1 - group.points.e1[n]) < 0)
-	    d = -d;
-	if (d > xval) {
-	    xmax = n;
-	    xval = d;
-	}
-
-	if ((d = yres[n] = n1 - group.points.n1[n]) < 0)
-	    d = -d;
-	if (d > yval) {
-	    ymax = n;
-	    yval = d;
-	}
-
-	/* compute ground error (ie along diagonal) */
-	d1 = e2 - group.points.e2[n];
-	d2 = n2 - group.points.n2[n];
-	d = d1 * d1 + d2 * d2;
-	sum += d;		/* add it to rms sum, before taking sqrt */
-	d = sqrt(d);
-	gnd[n] = d;
-	if (d > gval) {		/* is this one the max? */
-	    gmax = n;
-	    gval = d;
-	}
-    }
-
-    /* compute overall rms error */
-    if (count)
-	rms = sqrt(sum / count);
-
-    return 0;
-}
-
-static int to_file(void)
-{
-    FILE *fd;
-    char msg[1024];
-
-    cancel_which();
-    if (Input_other(askfile, "Keyboard") < 0) {
-	return 0;
-    }
-
-    fd = fopen(buf, "w");
-    if (fd == NULL) {
-	sprintf(msg, "** Unable to create file %s\n", buf);
-	Beep();
-	Curses_write_window(PROMPT_WINDOW, 2, 1, msg);
-    }
-    else {
-	do_report(fd);
-	fclose(fd);
-	sprintf(msg, "Report saved in file %s\n", buf);
-	Curses_write_window(PROMPT_WINDOW, 2, 1, msg);
-    }
-    return 0;
-}
-
-static int askfile(void)
-{
-    char file[GNAME_MAX];
-
-    while (1) {
-	Curses_prompt_gets("Enter file to hold report: ", file);
-	G_strip(file);
-	if (*file == 0)
-	    return -1;
-	if (G_index(file, '/'))
-	    strcpy(buf, file);
-	else
-	    sprintf(buf, "%s/%s", G_home(), file);
-	if (access(buf, 0) != 0)
-	    return 1;
-	sprintf(buf, "** %s already exists. choose another file", file);
-	Beep();
-	Curses_write_window(PROMPT_WINDOW, 2, 1, buf);
-    }
-
-    return 0;
-}
-
-static int to_printer(void)
-{
-    FILE *fd;
-
-    cancel_which();
-    Menu_msg("sending report to printer ...");
-
-    fd = popen("lpr", "w");
-    do_report(fd);
-    pclose(fd);
-    return 0;
-}
-
-static int do_report(FILE * fd)
-{
-    char buf[GNAME_MAX];
-    int n;
-    int width;
-
-    fprintf(fd, "LOCATION: %-20s GROUP: %-20s MAPSET: %s\n\n",
-	    G_location(), group.name, G_mapset());
-    fprintf(fd, "%15sAnalysis of control point registration\n\n", "");
-    fprintf(fd, "%s   %s\n", LHEAD1, RHEAD1);
-    fprintf(fd, "%s   %s\n", LHEAD2, RHEAD2);
-
-    FMT1(buf, 0.0, 0.0, 0.0);
-    width = strlen(buf);
-
-    for (n = 0; n < group.points.count; n++) {
-	FMT0(buf, n + 1);
-	fprintf(fd, "%s", buf);
-	if (group.equation_stat > 0 && group.points.status[n] > 0) {
-	    FMT1(buf, xres[n], yres[n], gnd[n]);
-	    fprintf(fd, "%s", buf);
-	}
-	else if (group.points.status[n] > 0)
-	    printcentered(fd, "?", width);
-	else
-	    printcentered(fd, "not used", width);
-	FMT2(buf,
-	     group.points.e1[n],
-	     group.points.n1[n], group.points.e2[n], group.points.n2[n]);
-	fprintf(fd, "   %s\n", buf);
-    }
-    fprintf(fd, "\n");
-    if (group.equation_stat < 0)
-	fprintf(fd, "Poorly place control points\n");
-    else if (group.equation_stat == 0)
-	fprintf(fd, "No active control points\n");
-    else
-	fprintf(fd, "Overall rms error: %.2f\n", rms);
-
-    return 0;
-}
-
-static int printcentered(FILE * fd, char *buf, int width)
-{
-    int len;
-    int n;
-    int i;
-
-    len = strlen(buf);
-    n = (width - len) / 2;
-
-    for (i = 0; i < n; i++)
-	fprintf(fd, " ");
-    fprintf(fd, "%s", buf);
-    i += len;
-    while (i++ < width)
-	fprintf(fd, " ");
-
-    return 0;
-}
-
-static int show_point(int n, int true_color)
-{
-    if (!true_color)
-	R_standard_color(ORANGE);
-    else if (group.points.status[n])
-	R_standard_color(GREEN);
-    else
-	R_standard_color(RED);
-    display_one_point(VIEW_MAP1, group.points.e1[n], group.points.n1[n]);
-
-    return 0;
-}

+ 0 - 389
imagery/i.points/ask.c

@@ -1,389 +0,0 @@
-#include <string.h>
-#include <stdlib.h>
-#include <grass/gis.h>
-#include <grass/display.h>
-#include "globals.h"
-#include "local_proto.h"
-#define NLINES 18
-
-struct box
-{
-    int top, bottom, left, right;
-};
-
-static int pick(int, int, int);
-static int downarrow(struct box *, int);
-static int uparrow(struct box *, int);
-static int dobox(struct box *, char *, int, int, int, int, int);
-static int dotext(char *, int, int, int, int, int);
-static int inbox(struct box *, int, int);
-static int cancel_which(void);
-
-static int text_size;
-static int which;
-static struct box cancel, more, less;
-static int height, size, edge, count;
-static int page, npages;
-static struct
-{
-    char name[GNAME_MAX], mapset[GMAPSET_MAX];
-    struct box box;
-} list[NLINES * 2];
-
-int
-ask_gis_files(char *type, char *file, char *xname, char *xmapset,
-	      int position)
-{
-    static int use = 1;
-    static Objects objects[] = {
-	OTHER(pick, &use),
-	{0}
-    };
-
-    char msg[100];
-    FILE *fd;
-    int width;
-    int len1, len2, len;
-    long offset;
-    long *page_offset;
-    int col, nlist;
-    int line;
-    int stat;
-    char buf[100];
-    int top, bottom, left, right, center;
-    int topx, bottomx, leftx, rightx, widthx;
-    char name[GNAME_MAX], mapset[GMAPSET_MAX], cur_mapset[GMAPSET_MAX];
-    int new_mapset;
-
-    Menu_msg("");
-
-    fd = fopen(file, "r");
-    if (fd == NULL)
-	G_fatal_error("ask_gis_files: can't read tempfile");
-    if (fread(&len1, sizeof(len1), 1, fd) != 1
-	|| fread(&len2, sizeof(len2), 1, fd) != 1 || len1 <= 0 || len2 <= 0) {
-	fclose(fd);
-	return 0;
-    }
-
-    sprintf(msg, "Double click on %s file to be plotted", type);
-
-    /*
-     * build a popup window at center of the screen.
-     * 35% the height and wide enough to hold 2 columms of file names
-     *
-     * the window is for choosing file names and will be laid out in 2 columns
-     *
-     *             ------------------------------------------
-     *             |     CANCEL           | (MORE) | (LESS) | 
-     *             ------------------------------------------
-     *             |             mapset                     |
-     *             ------------------------------------------
-     *             |      name1        |   name2            |
-     *             ------------------------------------------
-     *             |      name3        |   name4            |
-     *             ------------------------------------------
-     *             |      name5        |   name6            |
-     *             |                   .                    |
-     *             |                   .                    |
-     *             |                   .                    |
-     *             ------------------------------------------
-     */
-
-    /* height of 1 line, based on NLINES taking up 35% vertical space */
-    height = (.35 * (SCREEN_BOTTOM - SCREEN_TOP)) / NLINES + 1;
-
-    /* size of text, 80% of line height */
-    text_size = .8 * height;
-    size = text_size - 1;	/* fudge for computing pixels width of text */
-
-    /* indent for the text */
-    edge = .1 * height + 1;
-
-    /* this is a fudge to determine the length of the largest text */
-    len1 = 2 * len1;		/* name in 2 columns */
-    len2 += strlen("mapset ");
-    len = (len1 > len2 ? len1 : len2);
-
-    /* width is for max chars plus sidecar for more/less */
-    width = len * size + height;
-    widthx = strlen(msg) * size;
-    if (widthx < width)
-	widthx = width;
-
-    /* define the window */
-    top = (SCREEN_TOP + SCREEN_BOTTOM - height * NLINES) / 2;
-    bottom = top + height * NLINES;
-
-    center = (SCREEN_LEFT + SCREEN_RIGHT) / 2;
-    if (position > 0) {
-	right = (center + SCREEN_RIGHT + width) / 2;
-	if (right >= SCREEN_RIGHT)
-	    right = SCREEN_RIGHT - 1;
-	left = right - width;
-    }
-    else if (position < 0) {
-	left = (center + SCREEN_LEFT - width) / 2;
-	if (left <= SCREEN_LEFT)
-	    left = SCREEN_LEFT + 1;
-	right = left + width;
-    }
-    else {
-	left = center + width / 2;
-	right = left + width;
-    }
-
-    topx = top - 3 * height;
-    bottomx = topx + 2 * height;
-    leftx = (left + right - widthx) / 2;
-    if (leftx < SCREEN_LEFT)
-	leftx = SCREEN_LEFT;
-    rightx = leftx + widthx;
-
-    /* save what is under these areas, so they can be restored */
-    R_panel_save(tempfile1, top, bottom + 1, left, right + 1);
-    R_panel_save(tempfile2, topx, bottomx + 1, leftx, rightx + 1);
-
-    /* fill it top with GREY, pick area with white */
-    R_standard_color(WHITE);
-    R_box_abs(left, top, right, bottom);
-    R_standard_color(GREY);
-    R_box_abs(leftx, topx, rightx, bottomx);
-
-    R_standard_color(BLACK);
-    Outline_box(top, bottom, left, right);
-    right -= height;		/* reduce it to exclude sidecar */
-    Outline_box(top, bottom, left, right);
-
-    /* print messages above the files */
-    dotext(msg, topx, topx + height, leftx, rightx, 1);
-    dotext("Double click here to cancel", topx + height, bottomx, leftx,
-	   rightx, 1);
-    cancel.top = topx;
-    cancel.bottom = bottomx;
-    cancel.left = leftx;
-    cancel.right = rightx;
-
-    /* start the mouse in the cancel box */
-    Set_mouse_xy((leftx + rightx) / 2, (topx + bottomx) / 2);
-
-    dobox(&less, "", WHITE, top, right, right + height, 0);
-    dobox(&more, "", WHITE, bottom - height, right, right + height, 0);
-
-    /* as we read the file of names, keep track of pages so we can
-     * page backward
-     */
-    page = 0;
-    page_offset = (long *)G_calloc(npages = 1, sizeof(long));
-    *page_offset = G_ftell(fd);
-
-    nlist = sizeof(list) / sizeof(list[0]);
-    for (stat = -1; stat < 0;) {
-	line = 0;
-	count = 0;
-	*cur_mapset = 0;
-	col = 0;
-	while (1) {
-	    offset = G_ftell(fd);
-	    if (fgets(buf, sizeof buf, fd) == NULL
-		|| sscanf(buf, "%s %s", name, mapset) != 2)
-		break;
-	    if (new_mapset = (strcmp(cur_mapset, mapset) != 0)) {
-		if (line)
-		    line++;
-		if (col)
-		    line++;
-		col = 0;
-	    }
-	    if (count >= nlist || line + new_mapset >= NLINES) {
-		if (page + 1 == npages) {
-		    npages++;
-		    page_offset =
-			(long *)G_realloc(page_offset, npages * sizeof(long));
-		    page_offset[npages - 1] = offset;
-		}
-		break;
-	    }
-	    if (new_mapset) {
-		struct box dummy;
-		char label[GMAPSET_MAX + 7];
-
-		strcpy(cur_mapset, mapset);
-		sprintf(label, "Mapset %s", mapset);
-		dobox(&dummy, label, WHITE, top + line * height, left, right,
-		      0);
-		line++;
-	    }
-	    if (col) {
-		dobox(&list[count].box, name, GREY, top + line * height,
-		      left + width / 2, right, 0);
-		line++;
-		col = 0;
-	    }
-	    else {
-		dobox(&list[count].box, name, GREY, top + line * height, left,
-		      left + width / 2, 0);
-		col = 1;
-	    }
-	    strcpy(list[count].name, name);
-	    strcpy(list[count].mapset, mapset);
-	    count++;
-	}
-	downarrow(&more, page + 1 < npages ? BLACK : WHITE);
-	uparrow(&less, page > 0 ? BLACK : WHITE);
-	which = -1;
-	switch (Input_pointer(objects)) {
-	case -1:		/* more or less */
-	    break;
-	case -2:		/* cancel */
-	    stat = 0;
-	    continue;
-	default:		/* file picked */
-	    strcpy(xname, list[which].name);
-	    strcpy(xmapset, list[which].mapset);
-	    stat = 1;
-	    continue;
-	}
-	G_fseek(fd, page_offset[page], 0);
-	R_standard_color(WHITE);
-	R_box_abs(left + 1, top + 1, right - 1, bottom - 1);
-    }
-
-    /* all done. restore what was under the window */
-    right += height;		/* move it back over the sidecar */
-    R_standard_color(WHITE);
-    R_box_abs(left, top, right, bottom);
-    R_panel_restore(tempfile1);
-    R_panel_restore(tempfile2);
-    R_panel_delete(tempfile1);
-    R_panel_delete(tempfile2);
-    R_flush();
-
-    G_free(page_offset);
-    return stat;
-}
-
-static int dobox(struct box *box, char *text, int color, int top, int left,
-		 int right, int centered)
-{
-    int bottom;
-
-    bottom = top + height;
-    /* fill inside of box with color */
-    R_standard_color(color);
-    R_box_abs(left + 1, top + 1, right - 1, bottom - 1);
-
-    /* draw box outline and text in black */
-    R_standard_color(BLACK);
-    Outline_box(top, bottom, left, right);
-    dotext(text, top, bottom, left, right, centered);
-    R_flush();
-
-    box->top = top;
-    box->bottom = bottom;
-    box->left = left;
-    box->right = right;
-
-    return 0;
-}
-
-static int uparrow(struct box *box, int color)
-{
-    R_standard_color(color);
-    Uparrow(box->top + edge, box->bottom - edge, box->left + edge,
-	    box->right - edge);
-
-    return 0;
-}
-
-static int downarrow(struct box *box, int color)
-{
-    R_standard_color(color);
-    Downarrow(box->top + edge, box->bottom - edge, box->left + edge,
-	      box->right - edge);
-
-    return 0;
-}
-
-static int pick(int x, int y, int button)
-{
-    int n;
-
-    if (inbox(&more, x, y)) {
-	cancel_which();
-	if (page + 1 >= npages)
-	    return 0;
-	page++;
-	return -1;
-    }
-    if (inbox(&less, x, y)) {
-	cancel_which();
-	if (page == 0)
-	    return 0;
-	page--;
-	return -1;
-    }
-    if (inbox(&cancel, x, y)) {
-	if (which == -2)
-	    return -2;
-	cancel_which();
-	which = -2;
-	R_standard_color(RED);
-	Outline_box(cancel.top, cancel.bottom, cancel.left, cancel.right);
-	R_flush();
-	return 0;
-    }
-    /* search name list. handle double click */
-    for (n = 0; n < count; n++)
-	if (inbox(&list[n].box, x, y)) {
-	    if (n == which)	/* second click! */
-		return 1;
-	    cancel_which();
-	    which = n;
-	    R_standard_color(RED);
-	    Outline_box(list[n].box.top, list[n].box.bottom,
-			list[n].box.left, list[n].box.right);
-	    R_flush();
-	    return 0;		/* ignore first click */
-	}
-
-    cancel_which();
-    return 0;
-}
-
-static int cancel_which(void)
-{
-    if (which == -2) {
-	R_standard_color(BLACK);
-	Outline_box(cancel.top, cancel.bottom, cancel.left, cancel.right);
-    }
-    else if (which >= 0) {
-	R_standard_color(BLACK);
-	Outline_box(list[which].box.top, list[which].box.bottom,
-		    list[which].box.left, list[which].box.right);
-    }
-    which = -1;
-    R_flush();
-
-    return 0;
-}
-
-static int inbox(struct box *box, int x, int y)
-{
-    return (x > box->left && x < box->right && y > box->top &&
-	    y < box->bottom);
-}
-
-static int dotext(char *text, int top, int bottom, int left, int right,
-		  int centered)
-{
-    R_text_size(text_size, text_size);
-    R_move_abs(left + 1 + edge, bottom - 1 - edge);
-    if (centered)
-	R_move_rel((right - left - strlen(text) * size) / 2, 0);
-    R_set_window(top, bottom, left, right);	/* for text clipping */
-    R_text(text);
-    R_set_window(SCREEN_TOP, SCREEN_BOTTOM, SCREEN_LEFT, SCREEN_RIGHT);
-
-    return 0;
-}

+ 0 - 164
imagery/i.points/ask_mag.c

@@ -1,164 +0,0 @@
-#include "globals.h"
-#include "local_proto.h"
-#include <grass/display.h>
-
-struct box
-{
-    int top, bottom, left, right;
-};
-
-static struct box plus, minus, value;
-static struct box cancel, accept;
-static int mag;
-static int inbox(struct box *, int, int);
-static int dotext(char *, int, int, int, int, int);
-static int incr(int, int);
-
-int ask_magnification(int *magnification)
-{
-    static int use = 1;
-    int x, y;
-    int height;
-    int stat;
-    int width;
-    int top, bottom, left, right;
-
-    static Objects objects[] = {
-	OTHER(incr, &use),
-	{0}
-    };
-
-    Menu_msg("");
-
-    mag = *magnification;
-    if (mag < 1)
-	mag = 1;
-
-    height = VIEW_MENU->nrows;
-    R_text_size(height - 4, height - 4);
-
-
-    Get_mouse_xy(&x, &y);
-    top = y - height / 2;
-    if (top < SCREEN_TOP)
-	top = SCREEN_TOP;
-    bottom = top + 4 * height;
-    if (bottom >= VIEW_MENU->top) {
-	top -= bottom - (VIEW_MENU->top - 1);
-	bottom = VIEW_MENU->top - 1;
-    }
-    width = Text_width("MAGNIFICATION") + 4;
-    left = x - width / 2;
-    if (left < SCREEN_LEFT)
-	left = SCREEN_LEFT;
-    right = left + width;
-    if (right > SCREEN_RIGHT) {
-	left -= right - SCREEN_RIGHT;
-	right = SCREEN_RIGHT;
-    }
-
-    R_panel_save(tempfile1, top, bottom, left, right);
-    R_standard_color(WHITE);
-    R_box_abs(left, top, right, bottom);
-    R_standard_color(BLACK);
-    Outline_box(top, bottom, left, right);
-
-    plus.top = top + height;
-    plus.bottom = plus.top + height;
-    plus.left = left;
-    plus.right = plus.left + Text_width("++") + 4;
-    Outline_box(plus.top, plus.bottom, plus.left, plus.right);
-
-    minus.top = top + height;
-    minus.bottom = minus.top + height;
-    minus.right = right;
-    minus.left = minus.right - Text_width("--") - 4;
-    Outline_box(minus.top, minus.bottom, minus.left, minus.right);
-
-    value.top = top + height;
-    value.bottom = value.top + height;
-    value.left = plus.right;
-    value.right = minus.left;
-    Outline_box(value.top, value.bottom, value.left, value.right);
-
-    accept.top = value.bottom;
-    accept.bottom = accept.top + height;
-    accept.left = left;
-    accept.right = right;
-    Outline_box(accept.top, accept.bottom, accept.left, accept.right);
-
-    cancel.top = accept.bottom;
-    cancel.bottom = cancel.top + height;
-    cancel.left = left;
-    cancel.right = right;
-    Outline_box(cancel.top, cancel.bottom, cancel.left, cancel.right);
-
-    dotext("MAGNIFICATION", top, top + height, left, right, WHITE);
-    dotext("+", plus.top, plus.bottom, plus.left, plus.right, GREY);
-    dotext("-", minus.top, minus.bottom, minus.left, minus.right, GREY);
-    dotext("ACCEPT", accept.top, accept.bottom, accept.left, accept.right,
-	   GREY);
-    dotext("CANCEL", cancel.top, cancel.bottom, cancel.left, cancel.right,
-	   GREY);
-    draw_mag();
-
-    stat = Input_pointer(objects);
-
-    /* to respond to user */
-    R_standard_color(WHITE);
-    R_box_abs(left, top, right, bottom);
-    R_flush();
-
-    R_panel_restore(tempfile1);
-    R_panel_delete(tempfile1);
-
-    *magnification = mag;
-    return stat > 0;
-}
-
-int draw_mag(void)
-{
-    char buf[10];
-
-    sprintf(buf, "%d", mag);
-    dotext(buf, value.top, value.bottom, value.left, value.right, WHITE);
-
-    return 0;
-}
-
-static int incr(int x, int y)
-{
-    if (inbox(&accept, x, y))
-	return 1;
-    if (inbox(&cancel, x, y))
-	return -1;
-    if (inbox(&plus, x, y)) {
-	mag++;
-	draw_mag();
-    }
-    else if (inbox(&minus, x, y) && mag > 1) {
-	mag--;
-	draw_mag();
-    }
-    return 0;
-}
-
-static int dotext(char *text, int top, int bottom, int left, int right,
-		  int background)
-{
-    R_standard_color(background);
-    R_box_abs(left + 1, top + 1, right - 1, bottom - 1);
-    R_standard_color(BLACK);
-    /* center the text */
-    left = (left + right - Text_width(text)) / 2;
-    Text(text, top, bottom, left, right, 2);
-    R_flush();
-
-    return 0;
-}
-
-static int inbox(struct box *box, int x, int y)
-{
-    return (x > box->left && x < box->right && y > box->top &&
-	    y < box->bottom);
-}

+ 0 - 57
imagery/i.points/call.c

@@ -1,57 +0,0 @@
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/types.h>
-#ifdef __MINGW32__
-#include <process.h>
-#else
-#include <sys/wait.h>
-#endif
-#include "globals.h"
-#include "local_proto.h"
-#include <grass/display.h>
-/*
- * call a subroutine, but as a child process
- * allowing interrupts for the child
- */
-#include <signal.h>
-
-int call(int (*function) (), char *msg)
-{
-    int pid;
-    int w, status;
-    char i_msg[80];
-
-    /*
-     * build interrupt msg
-     */
-    sprintf(i_msg, "Hit %s %s\n", G_unctrl(interrupt_char), msg);
-    /*
-     * make sure all graphics have gotten to the monitor
-     */
-    R_stabilize();
-
-    /* fork to create child */
-    pid = fork();
-    if (pid < 0) {
-	End_curses();
-	perror("Can't fork");
-	exit(1);
-    }
-
-    /* parent just waits for child */
-    Curses_allow_interrupts(1);
-    if (pid) {
-	Curses_write_window(PROMPT_WINDOW, 1, 1, i_msg);
-	while ((w = wait(&status)) != pid && w != -1) ;
-	Curses_allow_interrupts(0);
-	Curses_write_window(PROMPT_WINDOW, 1, 1, "\n");
-    }
-
-    /* child turns on interrupts and calls the function */
-    else {
-	signal(SIGINT, SIG_DFL);
-	(*function) ();
-	exit(0);
-    }
-    return 0;
-}

+ 0 - 89
imagery/i.points/cell.c

@@ -1,89 +0,0 @@
-#include <unistd.h>
-#include <grass/gis.h>
-#include "globals.h"
-#include "local_proto.h"
-
-static int use = 1;
-static int choose_cellfile(char *, char *);
-static int plot(int, int);
-static int cancel(void);
-
-int plotcell(int x, int y)
-{
-    static Objects objects[] = {
-	MENU("CANCEL", cancel, &use),
-	INFO("Indicate which side should be plotted", &use),
-	OTHER(plot, &use),
-	{0}
-    };
-    /*
-     * if the target raster map list is ready, ask the user which side
-     * should be plotted, otherwise can only plot group files
-     */
-    if (access(cell_list, 0) == 0)
-	Input_pointer(objects);
-    else
-	plot(VIEW_MAP1->left + 1, 0);
-    return 0;
-}
-
-static int cancel(void)
-{
-    return 1;
-}
-
-
-static int plot(int x, int y)
-{
-    char name[GNAME_MAX], mapset[GMAPSET_MAX];
-    struct Cell_head cellhd;
-
-    if (x > VIEW_MAP1->left && x < VIEW_MAP1->right) {
-	if (!choose_groupfile(name, mapset))
-	    return 1;
-	Rast_get_cellhd(name, mapset, &cellhd);
-
-	Erase_view(VIEW_MAP1_ZOOM);
-	VIEW_MAP1_ZOOM->cell.configured = 0;
-
-	G_adjust_window_to_box(&cellhd, &VIEW_MAP1->cell.head,
-			       VIEW_MAP1->nrows, VIEW_MAP1->ncols);
-	Configure_view(VIEW_MAP1, name, mapset, cellhd.ns_res, cellhd.ew_res);
-	drawcell(VIEW_MAP1);
-    }
-    else if (x > VIEW_MAP2->left && x < VIEW_MAP2->right) {
-	if (!choose_cellfile(name, mapset))
-	    return 1;
-	select_target_env();
-
-	Rast_get_cellhd(name, mapset, &cellhd);
-
-	Erase_view(VIEW_MAP2_ZOOM);
-	VIEW_MAP2_ZOOM->cell.configured = 0;
-
-	G_adjust_window_to_box(&cellhd, &VIEW_MAP2->cell.head,
-			       VIEW_MAP2->nrows, VIEW_MAP2->ncols);
-	Configure_view(VIEW_MAP2, name, mapset, cellhd.ns_res, cellhd.ew_res);
-	select_target_env();
-	drawcell(VIEW_MAP2);
-	select_current_env();
-	if (from_screen < 0) {
-	    from_flag = 1;
-	    from_screen = 0;
-	    if (from_keyboard < 0) {
-		from_keyboard = 0;
-		from_screen = 1;
-	    }
-	}
-    }
-    else
-	return 0;		/* ignore mouse click */
-
-    display_points(1);
-    return 1;
-}
-
-static int choose_cellfile(char *name, char *mapset)
-{
-    return ask_gis_files("raster", cell_list, name, mapset, 1);
-}

+ 0 - 23
imagery/i.points/cellhd.c

@@ -1,23 +0,0 @@
-#include "globals.h"
-#include "local_proto.h"
-int Outline_cellhd(View * view, struct Cell_head *cellhd)
-{
-    int row, col;
-    int top, bottom, left, right;
-
-    row = northing_to_row(&view->cell.head, cellhd->north) + .5;
-    top = row_to_view(view, row);
-
-    col = easting_to_col(&view->cell.head, cellhd->west) + .5;
-    left = col_to_view(view, col);
-
-    row = northing_to_row(&view->cell.head, cellhd->south) + .5;
-    bottom = row_to_view(view, row);
-
-    col = easting_to_col(&view->cell.head, cellhd->east) + .5;
-    right = col_to_view(view, col);
-
-    Outline_box(top, bottom, left, right);
-
-    return 0;
-}

+ 0 - 6
imagery/i.points/colors.c

@@ -1,6 +0,0 @@
-#include <grass/gis.h>
-#include <grass/display.h>
-int set_colors(struct Colors *colors)
-{
-    return 0;
-}

+ 0 - 49
imagery/i.points/conv.c

@@ -1,49 +0,0 @@
-#include "globals.h"
-/* conversion routines to convert from view x,y to cell col,row
- * as well as cell col,row to cell east,north
- */
-int view_to_col(View * view, int x)
-{
-    return x - view->cell.left;
-}
-
-int view_to_row(View * view, int y)
-{
-    return y - view->cell.top;
-}
-
-int col_to_view(View * view, int col)
-{
-    return view->cell.left + col;
-}
-
-int row_to_view(View * view, int row)
-{
-    return view->cell.top + row;
-}
-
-/* in these next 2 routines, location determines if we are
- * converting from center of the cell (location == .5)
- * top or left edge (location == 0.0)
- * bottom or right edge (location == 1.0)
- */
-
-double row_to_northing(struct Cell_head *cellhd, int row, double location)
-{
-    return cellhd->north - (row + location) * cellhd->ns_res;
-}
-
-double col_to_easting(struct Cell_head *cellhd, int col, double location)
-{
-    return cellhd->west + (col + location) * cellhd->ew_res;
-}
-
-double northing_to_row(struct Cell_head *cellhd, double north)
-{
-    return (cellhd->north - north) / cellhd->ns_res;
-}
-
-double easting_to_col(struct Cell_head *cellhd, double east)
-{
-    return (east - cellhd->west) / cellhd->ew_res;
-}

+ 0 - 267
imagery/i.points/curses.c

@@ -1,267 +0,0 @@
-#include <stdlib.h>
-#include <unistd.h>
-#include "globals.h"
-#include "local_proto.h"
-
-static int inited = 0;
-
-static WINDOW *save;
-WINDOW *newwin();
-
-static Window *make_window(int top, int bottom, int left, int right)
-{
-    Window *window;
-
-    if (top < 0 || bottom >= LINES || left < 0 || right >= COLS
-	|| bottom - top <= 1 || right - left <= 1) {
-	End_curses();
-	fprintf(stderr, "make_window(%d,%d,%d,%d): illegal screen values\n",
-		top, bottom, left, right);
-	G_sleep(3);
-	exit(1);
-    }
-    window = (Window *) G_malloc(sizeof(Window));
-    window->top = top;
-    window->bottom = bottom;
-    window->left = left;
-    window->right = right;
-    Curses_clear_window(window);
-    return window;
-}
-
-int Begin_curses(void)
-{
-    /* should only be called once at program outset */
-
-    initscr();			/* initialize curses standard screens   */
-    raw();			/* set tty modes via curses calls       */
-    noecho();
-    nonl();
-
-    inited = 1;
-
-    /* make a window to save stdscr */
-    save = newwin(LINES, COLS, 0, 0);
-
-    /* make_window (nrows, ncols, start_row, start_col) */
-    INFO_WINDOW = make_window(0, LINES - 4, COLS / 2, COLS - 1);
-    MENU_WINDOW = make_window(0, LINES - 4, 0, COLS / 2);
-    PROMPT_WINDOW = make_window(LINES - 4, LINES - 1, 0, COLS - 1);
-    refresh();
-
-
-    return 0;
-}
-
-int End_curses(void)
-{
-    /* should only be called upon program exit */
-
-    clear();			/* clear the screen */
-    refresh();
-    endwin();			/* let curses reset the tty now */
-
-    return 0;
-}
-
-int Suspend_curses(void)
-{
-    overwrite(stdscr, save);
-    clear();
-    refresh();
-    endwin();
-
-    return 0;
-}
-
-int Resume_curses(void)
-{
-    clear();
-    refresh();
-    overwrite(save, stdscr);
-    refresh();
-
-    return 0;
-}
-
-int Curses_allow_interrupts(int ok)
-{
-    refresh();
-    if (ok)
-	noraw();
-    else
-	raw();
-
-    return 0;
-}
-
-int Curses_clear_window(Window * window)
-{
-    int y, x;
-
-    if (!inited)
-	return 1;
-    for (y = window->top + 1; y < window->bottom; y++) {
-	move(y, x = window->left + 1);
-	while (x++ < window->right)
-	    addch(' ');
-    }
-    Curses_outline_window(window);
-    refresh();
-
-    return 0;
-}
-
-int Curses_outline_window(Window * window)
-{
-    int x, y;
-
-    move(window->top, x = window->left + 1);
-    while (x++ < window->right)
-	addch('-');
-    move(window->bottom, x = window->left + 1);
-    while (x++ < window->right)
-	addch('-');
-    for (y = window->top + 1; y < window->bottom; y++) {
-	move(y, window->left);
-	addch('|');
-	move(y, window->right);
-	addch('|');
-    }
-    move(window->top, window->left);
-    addch('+');
-    move(window->top, window->right);
-    addch('+');
-    move(window->bottom, window->left);
-    addch('+');
-    if (window->bottom < LINES - 1 || window->right < COLS - 1) {
-	move(window->bottom, window->right);
-	addch('+');
-    }
-
-    return 0;
-}
-
-int Curses_write_window(Window * window, int line, int col, char *message)
-{
-    int y, x, i;
-
-    if (!inited) {
-	fprintf(stderr, "%s\n", message);
-	return 1;
-    }
-    if (line <= 0 || line >= window->bottom - window->top)
-	return 1;
-    if (col <= 0 || col >= window->right - window->left)
-	return 1;
-    move(y = window->top + line, x = window->left + col);
-    while (*message != 0 && *message != '\n' && x < window->right) {
-	addch(*message);
-	message++;
-	x++;
-    }
-    if (*message == '\n')
-	for (i = x; i < window->right; i++)
-	    addch(' ');
-    move(y, x);
-    refresh();
-
-    return 0;
-}
-
-
-int Curses_replot_screen(void)
-{
-    int x, y;
-
-    getyx(stdscr, y, x);
-    wrefresh(curscr);
-    move(y, x);
-    refresh();
-
-    return 0;
-}
-
-int Curses_prompt_gets(char *prompt, char *answer)
-{
-    char c;
-    int n;
-    int y, x;
-
-    *answer = 0;
-    n = 0;
-
-    Curses_write_window(PROMPT_WINDOW, 1, 1, "\n");
-    Curses_write_window(PROMPT_WINDOW, 1, 1, prompt);
-
-    for (;;) {
-	refresh();
-	c = Curses_getch(0);
-	if (c == '\n' || c == '\r')
-	    break;
-
-	getyx(stdscr, y, x);
-	if (c > '\037' && c < '\177') {	/* octal codes: accept space to '~' */
-	    if (x < PROMPT_WINDOW->right) {
-		*answer++ = c;
-		*answer = 0;
-		addch(c);
-		n++;
-	    }
-	    continue;
-	}
-	if (c == '\b' || c == '\177') {	/* backspace or DEL (decimal 8,127) */
-	    if (n > 0) {
-		answer--;
-		*answer = 0;
-		move(y, x - 1);
-		addch(' ');
-		move(y, x - 1);
-		n--;
-	    }
-	    continue;
-	}
-	Beep();
-    }
-
-    return 0;
-}
-
-int Beep(void)
-{
-    putchar('\7');
-    fflush(stdout);
-
-    return 0;
-}
-
-int Curses_getch(int with_echo)
-{
-    char achar;
-    int c;
-    int kill;
-
-    if (!inited)
-	return 0;
-    kill = 0;
-    while (1) {
-	c = getch() & 0177;
-	if (c == interrupt_char) {
-	    if (kill++ >= 3) {
-		End_curses();
-		exit(0);
-	    }
-	    continue;
-	}
-	kill = 0;
-	if (c != 18)
-	    break;
-	Curses_replot_screen();
-    }
-    if (with_echo) {
-	achar = c;
-	addch(achar);
-	refresh();
-    }
-    return c;
-}

+ 0 - 12
imagery/i.points/debug.c

@@ -1,12 +0,0 @@
-
-#include "globals.h"
-#include "local_proto.h"
-#include <grass/display.h>
-int debug(char *msg)
-{
-    R_stabilize();
-    Curses_write_window(PROMPT_WINDOW, 1, 1, msg);
-    Curses_getch(0);
-
-    return 0;
-}

+ 0 - 62
imagery/i.points/defs.h

@@ -1,62 +0,0 @@
-#include <grass/config.h>
-#include <curses.h>
-#include <grass/gis.h>
-#include <grass/imagery.h>
-
-/* this is a curses structure */
-typedef struct
-{
-    int top, left, bottom, right;
-} Window;
-
-/* this is a graphics structure */
-typedef struct
-{
-    int top, bottom, left, right;
-    int nrows, ncols;
-    struct
-    {
-	int configured;
-	struct Cell_head head;
-	struct Colors colors;
-	char name[GNAME_MAX];
-	char mapset[GMAPSET_MAX];
-	int top, bottom, left, right;
-	double ew_res, ns_res;	/* original map resolution */
-    } cell;
-} View;
-
-
-typedef struct
-{
-    char name[GNAME_MAX];
-    struct Ref ref;
-    struct Control_Points points;
-    double E12[3], N12[3], E21[3], N21[3];
-    int equation_stat;
-} Group;
-
-typedef struct
-{
-    int type;			/* object type */
-    int (*handler) ();		/* routine to handle the event */
-    char *label;		/* label to display if MENU or OPTION */
-    int binding;		/* OPTION bindings */
-    int *status;		/* MENU,OPTION status */
-    int top, bottom, left, right;
-} Objects;
-
-#define MENU_OBJECT 1
-#define OPTION_OBJECT 2
-#define INFO_OBJECT 3
-#define OTHER_OBJECT 4
-
-
-#define MENU(label,handler,status) \
-	{MENU_OBJECT,handler,label,0,status,0,0,0,0}
-#define OPTION(label,binding,status) \
-	{OPTION_OBJECT,NULL,label,binding,status,0,0,0,0}
-#define INFO(label,status) \
-	{INFO_OBJECT,NULL,label,0,status,0,0,0,0}
-#define OTHER(handler,status) \
-	{OTHER_OBJECT,handler,NULL,0,status,0,0,0,0}

+ 0 - 119
imagery/i.points/digit.c

@@ -1,119 +0,0 @@
-#include "globals.h"
-#include "local_proto.h"
-#include <unistd.h>
-#include <stdlib.h>
-
-static int setup(void);
-static int oops(void);
-static int yes(void);
-static int no(void);
-
-int setup_digitizer(void)
-{
-    static int use = 1;
-    static Objects objects[] = {
-	INFO("Do you wish to use the digitizer?  ", &use),
-	MENU("YES", yes, &use),
-	MENU("NO", no, &use),
-	{0}
-    };
-    char command[1024];
-
-    use_digitizer = 0;
-    /*
-     * test to see if we have a digitizer (geo.quest)
-     * make sure this program has execute permission first.
-     * then run the program and check its exit status
-     *  0 means can use digitizer, other means can't
-     */
-    sprintf(command, "%s/etc/geo.quest", G_gisbase());
-    if (access(command, 1) != 0)
-	return 0;
-    if (system(command))
-	return 0;
-
-
-    /*
-     * ask the user if he/she wishes to use it
-     */
-    Start_mouse_in_menu();
-    Input_pointer(objects);
-    if (use_digitizer)
-	Input_other(setup, "Keyboard");
-
-    return 0;
-}
-
-static int setup(void)
-{
-    char command[1024];
-
-    /*
-     * setup the digitizer. system() call must exit with 0 to indicate
-     * everything went fine
-     */
-    sprintf(command, "%s/etc/geo.reg %s %d",
-	    G_gisbase(), digit_points, getpid());
-    Suspend_curses();
-    if (system(command)) {
-	use_digitizer = 0;
-	G_sleep(3);
-    }
-    Resume_curses();
-
-    return 0;
-}
-
-int digitizer_point(double *east, double *north)
-{
-    char command[1024];
-    FILE *fd;
-    int stat;
-
-    /* make sure digitzer is to be used */
-    if (!use_digitizer)
-	return 0;
-
-    sprintf(command, "%s/etc/geo.point %s %s",
-	    G_gisbase(), digit_points, digit_results);
-
-    Suspend_curses();
-    if (system(command)) {
-	G_sleep(3);
-	Resume_curses();
-	oops();
-	return 0;
-    }
-    Resume_curses();
-    fd = fopen(digit_results, "r");
-    if (fd == NULL) {
-	oops();
-	return 0;
-    }
-    stat = (fscanf(fd, "%lf %lf", east, north) == 2);
-    fclose(fd);
-
-    if (stat == 0)
-	oops();
-    return stat;
-}
-
-static int oops(void)
-{
-    Curses_clear_window(MENU_WINDOW);
-    Curses_write_window(MENU_WINDOW, 3, 2, "Can't get data from digitizer");
-
-    return 0;
-}
-
-static int no(void)
-{
-    use_digitizer = 0;
-    return 1;
-}
-
-static int yes(void)
-{
-    use_digitizer = 1;
-    return 1;
-}

+ 0 - 56
imagery/i.points/dot.c

@@ -1,56 +0,0 @@
-#include "globals.h"
-#include <grass/display.h>
-int dot(int x, int y)
-{
-    double vx[5], vy[5];
-
-    vx[0] = x;
-    vy[0] = y - dotsize;
-    vx[1] = x - dotsize;
-    vy[1] = y;
-    vx[2] = x;
-    vy[2] = y + dotsize;
-    vx[3] = x + dotsize;
-    vy[3] = y;
-    vx[4] = x;
-    vy[4] = y - dotsize;
-
-    R_polygon_abs(vx, vy, 5);
-    /*
-       int i;
-
-       for (i = 0; i < dotsize; i++)
-       {
-       R_move_abs (x-i, y+i-dotsize);
-       R_cont_rel (i+i,0);
-       R_move_abs (x-i, y+dotsize-i);
-       R_cont_rel (i+i,0);
-       }
-       R_move_abs (x-dotsize, y);
-       R_cont_rel (dotsize+dotsize, 0);
-     */
-
-    return 0;
-}
-
-int save_under_dot(int x, int y)
-{
-    R_panel_save(tempfile1, y - dotsize, y + dotsize, x - dotsize,
-		 x + dotsize);
-
-    return 0;
-}
-
-int restore_under_dot(void)
-{
-    R_panel_restore(tempfile1);
-
-    return 0;
-}
-
-int release_under_dot(void)
-{
-    R_panel_delete(tempfile1);
-
-    return 0;
-}

+ 0 - 70
imagery/i.points/drawcell.c

@@ -1,70 +0,0 @@
-#include <stdlib.h>
-#include <grass/gis.h>
-#include "globals.h"
-#include <grass/display.h>
-#include "local_proto.h"
-
-int drawcell(View * view)
-{
-    int fd;
-    int left, top;
-    int ncols, nrows;
-    int row;
-    DCELL *dcell;
-    struct Colors *colors;
-    int read_colors;
-    char msg[GNAME_MAX];
-
-
-    if (!view->cell.configured)
-	return 0;
-    if (view == VIEW_MAP1 || view == VIEW_MAP1_ZOOM) {
-	colors = &VIEW_MAP1->cell.colors;
-	read_colors = view == VIEW_MAP1;
-    }
-    else {
-	colors = &VIEW_MAP2->cell.colors;
-	read_colors = view == VIEW_MAP2;
-    }
-    if (read_colors) {
-	Rast_free_colors(colors);
-	if (Rast_read_colors(view->cell.name, view->cell.mapset, colors) < 0)
-	    return 0;
-    }
-
-    display_title(view);
-
-    set_colors(colors);
-
-    Rast_set_window(&view->cell.head);
-    nrows = Rast_window_rows();
-    ncols = Rast_window_cols();
-
-    left = view->cell.left;
-    top = view->cell.top;
-
-    R_standard_color(BLUE);
-    Outline_box(top, top + nrows - 1, left, left + ncols - 1);
-
-    if (getenv("NO_DRAW"))
-	return 1;
-
-    fd = Rast_open_old(view->cell.name, view->cell.mapset);
-    dcell = Rast_allocate_d_buf();
-
-    sprintf(msg, "Plotting %s ...", view->cell.name);
-    Menu_msg(msg);
-
-    D_cell_draw_setup(top, top + nrows, left, left + ncols);
-    for (row = 0; row < nrows; row++) {
-	Rast_get_d_row_nomask(fd, dcell, row);
-	D_draw_d_raster(row, dcell, colors);
-    }
-    D_cell_draw_end();
-    Rast_close(fd);
-    G_free(dcell);
-    if (colors != &VIEW_MAP1->cell.colors)
-	set_colors(&VIEW_MAP1->cell.colors);
-
-    return row == nrows;
-}

+ 0 - 51
imagery/i.points/driver.c

@@ -1,51 +0,0 @@
-#include "globals.h"
-#include "local_proto.h"
-
-static int use = 1;
-static int stop(void);
-static int dont_stop(void);
-static int really_quit(void);
-
-int driver(void)
-{
-    static Objects objects[] = {
-	MENU("QUIT", really_quit, &use),
-	MENU("ZOOM", zoom, &use),
-	MENU("PLOT RASTER", plotcell, &use),
-	MENU("ANALYZE", analyze, &use),
-	INFO("  Input method -> ", &from_flag),
-	/*	OPTION("DIGITIZER", 2, &from_digitizer), */
-	OPTION("KEYBOARD", 2, &from_keyboard),
-	OPTION("SCREEN", 2, &from_screen),
-	OTHER(mark, &use),
-	{0}
-    };
-
-    Input_pointer(objects);
-    Menu_msg("");
-
-    return 0;
-}
-
-static int really_quit(void)
-{
-    static Objects objects[] = {
-	INFO("really quit? ", &use),
-	MENU("NO", dont_stop, &use),
-	MENU("YES", stop, &use),
-	{0}
-    };
-    if (Input_pointer(objects) < 0)
-	return -1;
-    return 0;			/* don't quit */
-}
-
-static int dont_stop(void)
-{
-    return 1;
-}
-
-static int stop(void)
-{
-    return -1;
-}

+ 0 - 10
imagery/i.points/equ.c

@@ -1,10 +0,0 @@
-#include "globals.h"
-
-int Compute_equation(void)
-{
-    group.equation_stat = I_compute_georef_equations(&group.points,
-						     group.E12, group.N12,
-						     group.E21, group.N21);
-
-    return 0;
-}

+ 0 - 21
imagery/i.points/find.c

@@ -1,21 +0,0 @@
-#include <stdlib.h>
-#include "globals.h"
-#include "local_proto.h"
-
-/*
- * run etc/i.find command find all cell, vect files
- * in the target location.
- */
-int find_target_files(void)
-{
-    char command[1024];
-
-    select_target_env();
-    sprintf(command, "%s/etc/i.find %s %s cell %s dig %s",
-	    G_gisbase(), G_location(), G_mapset(), cell_list, vect_list);
-    select_current_env();
-
-    system(command);
-
-    return 0;
-}

+ 0 - 63
imagery/i.points/globals.h

@@ -1,63 +0,0 @@
-#include "defs.h"
-
-extern int SCREEN_TOP;
-extern int SCREEN_BOTTOM;
-extern int SCREEN_LEFT;
-extern int SCREEN_RIGHT;
-
-extern Window *INFO_WINDOW;
-extern Window *MENU_WINDOW;
-extern Window *PROMPT_WINDOW;
-
-extern View *VIEW_MAP1;
-extern View *VIEW_TITLE1;
-extern View *VIEW_MAP1_ZOOM;
-extern View *VIEW_TITLE1_ZOOM;
-
-extern View *VIEW_MAP2;
-extern View *VIEW_TITLE2;
-extern View *VIEW_MAP2_ZOOM;
-extern View *VIEW_TITLE2_ZOOM;
-
-extern View *VIEW_MENU;
-
-extern Group group;
-
-extern char interrupt_char;
-extern char *tempfile1;
-extern char *tempfile2;
-extern char *digit_points;	/* digitizer control points */
-extern char *digit_results;	/* digitizer results */
-extern int use_digitizer;	/* is there a digitizer out there? */
-
-/* group file list, target cell,vector files */
-extern char *group_list;
-extern char *cell_list;
-extern char *vect_list;
-
-extern int from_keyboard;	/* input method */
-extern int from_digitizer;
-extern int from_screen;
-extern int from_flag;
-
-extern int dotsize;
-
-extern int THE_COLORS[10];
-
-#define BLACK	THE_COLORS[0]
-#define BLUE	THE_COLORS[1]
-#define BROWN	THE_COLORS[2]
-#define GREEN	THE_COLORS[3]
-#define GREY	THE_COLORS[4]
-#define ORANGE	THE_COLORS[5]
-#define PURPLE	THE_COLORS[6]
-#define RED	THE_COLORS[7]
-#define WHITE	THE_COLORS[8]
-#define YELLOW	THE_COLORS[9]
-
-double row_to_northing();
-double col_to_easting();
-double northing_to_row();
-double easting_to_col();
-
-#undef INIT

+ 0 - 136
imagery/i.points/graphics.c

@@ -1,136 +0,0 @@
-#include "globals.h"
-#include "local_proto.h"
-#include <grass/display.h>
-
-static View *makeview(double bottom, double top, double left, double right)
-{
-    View *view;
-
-    view = (View *) G_malloc(sizeof(View));
-
-    top = 100 - top;
-    bottom = 100 - bottom;
-
-    view->top = SCREEN_TOP + (SCREEN_BOTTOM - SCREEN_TOP) * top / 100.0;
-    view->bottom = SCREEN_TOP + (SCREEN_BOTTOM - SCREEN_TOP) * bottom / 100.0;
-    view->left = SCREEN_LEFT + (SCREEN_RIGHT - SCREEN_LEFT) * left / 100.0;
-    view->right = SCREEN_LEFT + (SCREEN_RIGHT - SCREEN_LEFT) * right / 100.0;
-
-    if (view->top < SCREEN_TOP)
-	view->top = SCREEN_TOP;
-    if (view->bottom > SCREEN_BOTTOM)
-	view->bottom = SCREEN_BOTTOM;
-    if (view->left < SCREEN_LEFT)
-	view->left = SCREEN_LEFT;
-    if (view->right > SCREEN_RIGHT)
-	view->right = SCREEN_RIGHT;
-
-    Outline_box(view->top, view->bottom, view->left, view->right);
-
-    view->top++;
-    view->bottom--;
-    view->left++;
-    view->right--;
-
-    view->nrows = view->bottom - view->top + 1;
-    view->ncols = view->right - view->left + 1;
-    view->cell.configured = 0;
-
-    return view;
-}
-
-int Init_graphics(void)
-{
-    D_full_screen();
-
-
-    SCREEN_TOP = R_screen_top();
-    SCREEN_BOTTOM = R_screen_bot();
-    SCREEN_LEFT = R_screen_left();
-    SCREEN_RIGHT = R_screen_rite();
-
-
-    BLACK = D_translate_color("black");
-    BLUE = D_translate_color("blue");
-    BROWN = D_translate_color("brown");
-    GREEN = D_translate_color("green");
-    GREY = D_translate_color("grey");
-    ORANGE = D_translate_color("orange");
-    PURPLE = D_translate_color("purple");
-    RED = D_translate_color("red");
-    WHITE = D_translate_color("white");
-    YELLOW = D_translate_color("yellow");
-
-    R_standard_color(WHITE);
-
-    VIEW_TITLE1 = makeview(97.5, 100.0, 0.0, 50.0);
-    VIEW_TITLE2 = makeview(97.5, 100.0, 50.0, 100.0);
-    VIEW_MAP1 = makeview(51.0, 97.5, 0.0, 50.0);
-    VIEW_MAP2 = makeview(51.0, 97.5, 50.0, 100.0);
-    VIEW_TITLE1_ZOOM = makeview(47.5, 51.0, 0.0, 50.0);
-    VIEW_TITLE2_ZOOM = makeview(47.5, 51.0, 50.0, 100.0);
-    VIEW_MAP1_ZOOM = makeview(2.5, 47.5, 0.0, 50.0);
-    VIEW_MAP2_ZOOM = makeview(2.5, 47.5, 50.0, 100.0);
-    VIEW_MENU = makeview(0.0, 2.5, 0.0, 100.0);
-
-    Rast_init_colors(&VIEW_MAP1->cell.colors);
-    Rast_init_colors(&VIEW_MAP2->cell.colors);
-
-    return 0;
-}
-
-int Outline_box(int top, int bottom, int left, int right)
-{
-    R_move_abs(left, top);
-    R_cont_abs(left, bottom);
-    R_cont_abs(right, bottom);
-    R_cont_abs(right, top);
-    R_cont_abs(left, top);
-
-    return 0;
-}
-
-
-int Text_width(char *text)
-{
-    double top, bottom, left, right;
-
-    R_get_text_box(text, &top, &bottom, &left, &right);
-
-    if (right > left)
-	return right - left + 1;
-    else
-	return left - right + 1;
-}
-
-int Text(char *text, int top, int bottom, int left, int right, int edge)
-{
-    R_set_window(top, bottom, left, right);
-    R_move_abs(left + edge, bottom - edge);
-    R_text(text);
-    R_set_window(SCREEN_TOP, SCREEN_BOTTOM, SCREEN_LEFT, SCREEN_RIGHT);
-
-    return 0;
-}
-
-int Uparrow(int top, int bottom, int left, int right)
-{
-    R_move_abs((left + right) / 2, bottom);
-    R_cont_abs((left + right) / 2, top);
-    R_cont_rel((left - right) / 2, (bottom - top) / 2);
-    R_move_abs((left + right) / 2, top);
-    R_cont_rel((right - left) / 2, (bottom - top) / 2);
-
-    return 0;
-}
-
-int Downarrow(int top, int bottom, int left, int right)
-{
-    R_move_abs((left + right) / 2, top);
-    R_cont_abs((left + right) / 2, bottom);
-    R_cont_rel((left - right) / 2, (top - bottom) / 2);
-    R_move_abs((left + right) / 2, bottom);
-    R_cont_rel((right - left) / 2, (top - bottom) / 2);
-
-    return 0;
-}

+ 0 - 71
imagery/i.points/group.c

@@ -1,71 +0,0 @@
-#include <string.h>
-#include <stdlib.h>
-#include <grass/gis.h>
-#include "globals.h"
-#include "local_proto.h"
-
-static int cmp(const void *, const void *);
-
-int prepare_group_list(void)
-{
-    FILE *fd;
-    int *idx;
-    int n;
-    int len, len1, len2;
-
-    /* open file to store group file names */
-    fd = fopen(group_list, "w");
-    if (fd == NULL)
-	G_fatal_error("Can't open any tempfiles");
-
-    /*
-     * build sorted index into group files
-     * so that all raster maps for a mapset to appear together
-     */
-    idx = (int *)G_calloc(group.ref.nfiles, sizeof(int));
-    for (n = 0; n < group.ref.nfiles; n++)
-	idx[n] = n;
-    qsort(idx, group.ref.nfiles, sizeof(int), cmp);
-
-    /* determine length of longest mapset name, and longest raster map name */
-    len1 = len2 = 0;
-    for (n = 0; n < group.ref.nfiles; n++) {
-	len = strlen(group.ref.file[n].name);
-	if (len > len1)
-	    len1 = len;
-	len = strlen(group.ref.file[n].mapset);
-	if (len > len2)
-	    len2 = len;
-    }
-
-    /* write lengths, names to file */
-    fwrite(&len1, sizeof(len1), 1, fd);
-    fwrite(&len2, sizeof(len2), 1, fd);
-    for (n = 0; n < group.ref.nfiles; n++)
-	fprintf(fd, "%s %s\n", group.ref.file[idx[n]].name,
-		group.ref.file[idx[n]].mapset);
-    fclose(fd);
-
-    G_free(idx);
-
-    return 0;
-}
-
-static int cmp(const void *aa, const void *bb)
-{
-    const int *a = aa, *b = bb;
-    int n;
-
-    if (n = strcmp(group.ref.file[*a].mapset, group.ref.file[*b].mapset))
-	return n;
-    return strcmp(group.ref.file[*a].name, group.ref.file[*b].name);
-}
-
-/* ask the user to pick a file */
-int choose_groupfile(char *name, char *mapset)
-{
-    int stat;
-
-    stat = ask_gis_files("raster", group_list, name, mapset, -1);
-    return (stat);
-}

+ 0 - 410
imagery/i.points/i.points.html

@@ -1,410 +0,0 @@
-<h2>DESCRIPTION</h2>
-
-<em>i.points</em> is an
-<a href="imagery.html">imagery</a> function that enables
-the user to mark points on a (raster) image to be rectified
-and then input the geographic coordinates of each point for
-calculation of a coordinate transformation matrix.
-<em>i.points</em> must be followed by use of the GRASS
-program <em><a href="i.rectify.html">i.rectify</a></em>, which
-rectifies the image using the transformation matrix
-coefficients calculated by <em>i.points</em>.
-
-<p>
-<em>Rectification</em> is the mapping (transformation) of
-an image from one coordinate system to another.  The
-geometry of an image extracted into a GRASS LOCATION having
-an x,y coordinate system is not planimetric.  To create a
-planimetric image, that is, to convert the x,y coordinate
-system into a standard coordinate system (for example, the
-UTM coordinate system or the State Plane coordinate
-system), points from a map having the standard coordinates
-must be associated with the same points on the image to be
-rectified.  <em>i.points</em> enables the user to mark
-points on an image and input the standard coordinates for
-that point.  <em>i.points</em> then calculates a least
-squares regression using the two coordinate systems (x,y
-and standard) for the marked points.  A matrix containing
-transformation coefficients is the output file for
-<em>i.points</em>.
-
-<p>During the process of marking points and entering map
-coordinates, the user can compute the RMS (root mean
-square) error for each point entered.  <em>i.points</em>
-does this by calculating the transformation equation (the
-same one that is calculated in the GRASS program <em>
-<a href="i.rectify.html">i.rectify</a></em>), and then
-plugging these results into an equation for RMS error.
-
-<p><em>i.points</em> offers a zoom option to locate precisely
-the point to be marked on an image.  This program also
-offers the user the option of acquiring standard
-coordinates for a marked point from a map layer in the
-target data base.
-
-<p><em><a href="i.target.html">i.target</a></em> must be
-run before running <em>i.points</em> to enable the PLOT
-RASTER option to be used and to identify a target data base
-LOCATION_NAME and MAPSET for the rectified image.  To run
-<em>i.points</em>, a graphics monitor is required.
-
-<p>The procedure for marking points, entering coordinates, and
-calculating RMS error is described below.
-
-<p>The first prompt in the program asks the user for the 
-<a href="i.group.html">imagery group</a> to be
-registered.  Note that if 
-<em><a href="i.target.html">i.target</a></em> is not run
-before <em>i.points</em>, the <em>i.points</em> program
-will display the following error message:
-
-<pre>
-ERROR: Target information for group [spot] missing
-       Please run i.target for group [spot]
-</pre>
-
-After entering the group to be registered the terminal screen
-displays the message: 
-
-<pre>
-      Use mouse now...
-</pre>
-
-The graphics monitor displays the following screen:
-
-<pre>
- ______________________________________________________________
-| imagery  filename  (mag)        |  target  filename  (mag)  |
-|_________________________________|___________________________|
-|                                 |                           |
-|                                 |                           |
-|                                 |                           |
-|                                 |                           |
-|                                 |                           |
-|                                 |                           |
-|                                 |                           |
-|_________________________________|___________________________|
-|                                 |                           |
-|                                 |                           |
-|                                 |                           |
-|                                 |                           |
-|                                 |                           |
-|                                 |                           |
-|                                 |                           |
-|_________________________________|___________________________|
-| QUIT  ZOOM  PLOT RASTER  ANALYZE|                           |
-|_________________________________|___________________________|
-</pre>
-
-A pop-down menu like that shown below will be superimposed on the
-left half of the screen:
-
-
-<pre>
-        __________________________________
-       | Double click on raster map layer|
-       |          to be plotted          |
-       |   Double click here to cancel   |
-       |_________________________________|
-
-               ____________________
-              |    Mapset demo    |
-              |___________________|
-              | spotclass|  spot.1|
-              |__________|________|
-              | composite|  spot.2|
-              |__________|________|
-              | spot.3   |        |
-              |__________|________|
-</pre>
-
-Any single raster map layer in the 
-
-<a href="i.group.html">imagery group</a> may be used on
-
-which to mark points, and the user can mark points on more
-than one raster map layer in the 
-
-<a href="i.group.html">imagery group</a> to accumulate the
-
-suggested minimum number of 12 points.  Any raster map
-layer in the <a href="i.group.html">imagery group</a>
-can be rectified (using 
-
-<em><a href="i.rectify.html">i.rectify</a></em>) based on the
-transformation matrix computed from these points.
-
-
-<p>
-The imagery file chosen by
-the user is displayed in the upper left quadrant of the
-screen.
-
-<h3>ZOOM</h3>
-
-To magnify the displayed file, the user must
-place the mouse cross hairs on the word ZOOM.  The following menu
-will then be displayed at the bottom of the screen:
-
-<pre>
-   ____________________________________________
-  | Cancel|  Box|  Point|  Select type of ZOOM|
-  |_______|_____|_______|_____________________|
-</pre>
- 
-
-The user has the option of identifying the zoom region
-either by using the mouse to make a box, or by using the
-mouse to mark the two diagonal points of the desired
-region.  The terminal screen will display a mouse button
-menu to guide the user in identifying the corner points of
-the region.
-
-<h3>MARKING POINTS</h3>
-
-To mark the points on the image that correspond to the
-points on a standard coordinate system map, the user must
-place the mouse cross hairs on the corresponding location
-on the image to be marked and press the left hand button on
-the mouse.  A diamond shaped symbol will be marked on the
-image.  The user's terminal will display the following
-menu:
-
-
-<pre>
- ___________________________________________________________
-| Point 1 marked on the image at|                          |
-| East: 1023.77                 |                          |
-| North: -164.41                |                          |
-|                               |                          |
-|                               |                          |
-|                               |                          |
-|                               |                          |
-|                               |                          |
-|__________________________________________________________|
-| Enter coordinates as east north:                         |
-|__________________________________________________________|
-</pre>
-
-The user then enters the easting and northing (separated by
-a space) for the point marked on the image.  If the user
-wishes not to enter a coordinate, he or she may simply hit
-RETURN to return control to the mouse;  the marked point
-then disappears.
-
-<h3>PLOT RASTER</h3>
-
-In addition to acquiring reference points from a standard
-map, the user has the option of acquiring the reference
-points from a raster map layer in the target data base
-LOCATION_NAME.  The data base raster map layer is displayed
-by placing the mouse cross hairs on the words PLOT RASTER.
-The following line is then displayed at the bottom of the
-graphics monitor:
-
-
-<pre>
-       ________________________________________________
-      | Cancel|  Indicate which side should be plotted|
-      |_______|_______________________________________|
-</pre>
-
-Which side of the graphics monitor is to be plotted
-is indicated by placing the mouse cross hairs on the 
-half of the graphics monitor screen that the user would like to use,
-and pressing the left mouse button.  The following pop-down
-menu will be superimposed on the half of the screen that was chosen:
-
-
-<pre>
-    _________________________________________
-   | Double click on raster (cell) map layer|
-   |              to be plotted             |
-   |       Double click here to cancel      |
-   |________________________________________|
-
-          ______________________________
-         |         Mapset demo         |
-         |_____________________________|
-         | tm.rectified |              |
-         |______________|______________|
-         | tm.classified|              |
-         |_____________________________|
-         |       Mapset PERMANENT      |
-         |_____________________________|
-         | elevation    |  geology     |
-         |______________|______________|
-         | slope        |  soils       |
-         |______________|______________|
-         | aspect       |              |
-         |______________|______________|
-         | roads        |              |
-         |______________|______________|
-</pre>
-
-After the raster map layer is displayed the following message appears
-at the bottom of the graphics monitor:
-
-
-<pre>
-     ______________________________________
-     | input method --&gt;|  keyboard|  screen|
-     |_________________|__________|________|
-</pre>
-
-If the user wishes to use the plotted raster map layer only
-as a comparative reference, then the keyboard can be chosen
-as the means to input coordinates corresponding to the
-marked points on the image.  This is done by placing the
-mouse cross hairs on the word KEYBOARD and pressing the
-left button on the mouse.
-
-
-<p>
-If the user selects the SCREEN option, then points marked
-on the image will automatically be associated with the
-coordinates from the corresponding points on the target
-data base map layer.  In this option, when the user marks a
-point on the image, the following menu is displayed at the
-terminal:
-
-
-<pre>
-___________________________________________________________
-| Point 5 marked on the image at|                          |
-| East: 1023.77                 |                          |
-| North: -164.41                |                          |
-|                               |                          |
-|                               |                          |
-| Point located at              |                          |
-| East: 679132.57               |                          |
-| North: 4351080.67             |                          |
-|                               |                          |
-|                               |                          |
-|                               |                          |
-|                               |                          |
-|                               |                          |
-|__________________________________________________________|
-| use mouse now...                                         |
-|__________________________________________________________|
-</pre>
-
-
-The user then uses the mouse to mark a corresponding point
-on the displayed image from the target data base.  The
-coordinates for the target data base map layer are
-automatically saved as the coordinates corresponding to the
-marked point on the image.
-
-<h3>ANALYZE</h3>
-
-After a number of points have been marked (4 to 7), the
-user can check the RMS error of the points marked on the
-image.  This is done by placing the mouse cross hairs on
-the word ANALYZE at the bottom of the graphics monitor.  An
-error report resembling that shown below is superimposed on
-the graphics monitor:
-
-
-<pre>
-______________________________________________________________________
-|         error                 image                 target         |
-|#     row     col    target    east    north      east       north  |
-|____________________________________________________________________|
-|1     0.0     -0.9    1.0     1048.5   -144.8   679132.5   4351080.6|
-|2     0.4     1.0     1.3     2153.1   -567.2   684314.7   4399001.4|
-|3    -1.2     -0.5     .6     1452.8   -476.5   567841.4   3457682.8|
-|4     1.1     0.5     1.3     1034.0   -109.2   677573.8   4352626.4|
-|5    -2.7     14.0    14.2    1048.6   -144.9   679132.6   4351080.7|
-|                                                                    |
-|____________________________________________________________________|
-|    overall   rms    error:   4.46                                  |
-|____________________________________________________________________|
-</pre>
- 
-The following menu then appears at the bottom of the graphics monitor:
-
-<pre>
- ____________________________________________________________________
-| DONE|  PRINT FILE|   Double click on point to be included/excluded|
-|_____|____________|________________________________________________|
-</pre>
-
-The RMS error for the image is given under the column
-TITLEd "error" and subTITLEd "row" and "col".  In the above
-report, point number 1 is 0.0 rows and -0.9 columns from
-the predicted location calculated from the transformation
-equation.  The RMS error for the target raster map layer is
-listed under the heading "target".  This is the RMS error
-for the east and north coordinates of the target map layer,
-but it is presented in the table using one general value.
-The overall RMS error is displayed at the bottom of the
-screen in meters.  Points that create high RMS error are
-displayed in red on the graphics monitor (represented here
-in italics).
-
-<p>The location of the point marked on the 
-<a href="i.group.html">imagery group</a> file is given
-under the heading "image" and the subheadings "east" and
-"north".  The location of the point in the target data base
-is given under the heading "target" and the subheadings
-"east" and "north".  If the user would like to exclude or
-include a point, this can be accomplished by placing the
-mouse cross hairs on the point number to be included (if
-the point is absent) or excluded (if the point is
-displayed) and pressing the left button on the mouse
-twice.  When a point is excluded, it is not afterwards
-included in the calculation of the RMS error, or included
-in the final transformation matrix.  However, it can be
-retrieved within <em>i.points</em> at any time by double
-clicking with the mouse as described above.
-
-<h3>QUIT</h3>
-
-To end the <em>i.points</em> program place the mouse cross
-hairs on the word QUIT;  the marked points (including
-coordinates) will be saved.
-
-
-<h2>NOTES</h2>
-
-A good rule of thumb is to mark at least 12 to 15 points
-which are evenly distributed over the entire 
-<a href="i.group.html">imagery group</a> file in order to
-obtain an accurate transformation equation for the
-rectification process.  The RMS error may increase with
-more points added, but the transformation equation will be
-more accurate.
-
-<p>An RMS error of less than or equal to approximately one
-resolution unit (pixel or cell) for the image being
-rectified is generally considered acceptable.
-
-<p>In order to use a digitizer with <em>i.points</em>, at
-least one digitizer driver besides "none" (the on-screen
-digitizer) must be available in the digitcap file.
-
-<p>This program is interactive.
-
-
-<h2>SEE ALSO</h2>
-
-The GRASS 4 <em>
-<a href="http://grass.itc.it/gdp/imagery/grass4_image_processing.pdf">Image
-Processing manual</a></em>
-
-<p><em>
-<a href="g.mapsets.html">g.mapsets</a><br>
-<a href="i.group.html">i.group</a><br>
-<a href="i.rectify.html">i.rectify</a><br>
-<a href="i.target.html">i.target</a><br>
-<a href="i.vpoints.html">i.vpoints</a>
-</em><br>
-<em><a href="gm_georect.html">gis.m: GEORECTIFY TOOL</a></em>
-
-
-<h2>AUTHOR</h2>
-
-Michael Shapiro,
-U.S.Army Construction Engineering Research Laboratory
-<p><i>Last changed: $Date$</i>

+ 0 - 263
imagery/i.points/input.c

@@ -1,263 +0,0 @@
-#include "globals.h"
-#include "local_proto.h"
-#include <grass/display.h>
-
-static int active = 0;
-static int replot;
-static int mouse(Objects *, int, int, int);
-static int use_mouse_msg(void);
-static int draw_objects(Objects *);
-static Objects *find(Objects *, int, int);
-static int select_option(Objects *, Objects *);
-static int draw_option_boxes(Objects *);
-static int visible(Objects *);
-
-#define TEXT_COLOR BLACK
-#define FILL_COLOR GREY
-#define OUTLINE_COLOR WHITE
-
-/* Input: drive mouse. returns status of handler that returns != 0 */
-int Input_pointer(Objects * objects)
-{
-    return mouse(objects, 0, 0, 0);
-}
-
-int Input_box(Objects * objects, int ax, int ay)
-{
-    return mouse(objects, ax, ay, 1);
-}
-
-int Input_other(int (*function) (), char *type)
-{
-    int stat;
-    char msg[1024];
-
-    sprintf(msg, "%s input required", type);
-    Menu_msg(msg);
-
-    stat = (*function) ();
-    if (active) {
-	use_mouse_msg();
-    }
-
-    Menu_msg("");
-    return stat;
-}
-
-static int mouse(Objects * objects, int ax, int ay, int box)
-{
-    int first;
-    int stat;
-    int x, y, button;
-    Objects *obj;
-
-    first = !active;
-    active = 1;
-    if (first)
-	use_mouse_msg();
-
-    if (box) {
-	x = ax + 20;
-	y = ay + 20;
-    }
-    stat = 0;
-    replot = 1;
-    while (stat == 0) {
-	if (replot) {
-	    replot = 0;
-	    draw_objects(objects);
-	}
-	if (box)
-	    Mouse_box_anchored(ax, ay, &x, &y, &button);
-	else
-	    Mouse_pointer(&x, &y, &button);
-
-	if (!(obj = find(objects, x, y)))
-	    continue;
-
-	switch (obj->type) {
-	case MENU_OBJECT:
-	case OTHER_OBJECT:
-	    stat = (*obj->handler) (x, y, button);
-	    break;
-	case OPTION_OBJECT:
-	    select_option(objects, obj);
-	    draw_option_boxes(objects);
-	    break;
-	}
-    }
-
-    /* if we are first call, mark not active
-     * indicate that objects above use must be replotted.
-     */
-    if (first)
-	active = 0;
-    Menu_msg("");
-
-    return stat;
-}
-
-
-static int use_mouse_msg(void)
-{
-    Curses_write_window(PROMPT_WINDOW, 1, 1, "Use mouse now ...\n");
-
-    return 0;
-}
-
-static int draw_objects(Objects * objects)
-{
-    Objects *obj;
-    int top, bottom, left, right;
-    int size, edge;
-
-
-    /* erase the menu window */
-    Erase_view(VIEW_MENU);
-    R_flush();
-
-    /* determine sizes and text indentation */
-    size = VIEW_MENU->nrows - 4;
-    edge = 2;
-
-    R_text_size(size, size);
-
-    left = VIEW_MENU->left;
-    top = VIEW_MENU->top;
-    bottom = VIEW_MENU->bottom;
-
-
-    /* put the (boxed) text on the menu view */
-    for (obj = objects; obj->type; obj++) {
-	if (!visible(obj))
-	    continue;
-	switch (obj->type) {
-	case OPTION_OBJECT:
-	case MENU_OBJECT:
-	    right = left + 2 * edge + Text_width(obj->label);
-	    obj->left = left;
-	    obj->right = right;
-	    obj->top = top;
-	    obj->bottom = bottom;
-
-	    R_standard_color(FILL_COLOR);
-	    R_box_abs(left, top, right, bottom);
-
-	    R_standard_color(TEXT_COLOR);
-	    Text(obj->label, top, bottom, left, right, edge);
-
-	    R_standard_color(OUTLINE_COLOR);
-	    Outline_box(top, bottom, left, right);
-
-	    left = right;
-	    break;
-
-	case INFO_OBJECT:
-	    if (*obj->label == 0)
-		break;
-	    if (*obj->status < 0)
-		break;
-	    right = left + 2 * edge + Text_width(obj->label);
-	    R_standard_color(WHITE);
-	    Text(obj->label, top, bottom, left, right, edge);
-
-	    left = right;
-	    break;
-	}
-    }
-    draw_option_boxes(objects);
-    R_flush();
-
-    return 0;
-}
-
-static Objects *find(Objects * objects, int x, int y)
-{
-    Objects *other;
-
-    other = NULL;
-    for (; objects->type; objects++) {
-	if (!visible(objects))
-	    continue;
-	switch (objects->type) {
-	case MENU_OBJECT:
-	case OPTION_OBJECT:
-	    if (x >= objects->left && x <= objects->right
-		&& y >= objects->top && y <= objects->bottom)
-		return objects;
-	    break;
-	case OTHER_OBJECT:
-	    other = objects;
-	    break;
-	}
-    }
-    return other;
-}
-
-static int select_option(Objects * objects, Objects * obj)
-{
-    while (objects->type) {
-	if (objects->type == OPTION_OBJECT && *objects->status >= 0 &&
-	    objects->binding == obj->binding)
-	    *objects->status = 0;
-	objects++;
-    }
-    *obj->status = 1;
-
-    return 0;
-}
-
-static int draw_option_boxes(Objects * objects)
-{
-    Objects *x;
-
-    R_standard_color(OUTLINE_COLOR);
-    for (x = objects; x->type; x++) {
-	if (x->type == OPTION_OBJECT && *x->status == 0)
-	    Outline_box(x->top + 1, x->bottom, x->left, x->right - 1);
-    }
-    R_standard_color(GREEN);
-    for (x = objects; x->type; x++) {
-	if (x->type == OPTION_OBJECT && *x->status > 0)
-	    Outline_box(x->top + 1, x->bottom, x->left, x->right - 1);
-    }
-    R_flush();
-
-    return 0;
-}
-
-static int visible(Objects * object)
-{
-    if (object->type == OPTION_OBJECT)
-	return (*object->status >= 0);
-    return (*object->status > 0);
-}
-
-int Menu_msg(char *msg)
-{
-    int size, edge;
-
-    size = VIEW_MENU->nrows - 4;
-    edge = 2;
-
-    Erase_view(VIEW_MENU);
-
-    if (*msg) {
-	R_text_size(size, size);
-	R_standard_color(WHITE);
-	Text(msg, VIEW_MENU->top, VIEW_MENU->bottom,
-	     VIEW_MENU->left, VIEW_MENU->right, edge);
-    }
-    R_flush();
-    replot = 1;
-
-    return 0;
-}
-
-int Start_mouse_in_menu(void)
-{
-    Set_mouse_xy((VIEW_MENU->left + 2 * VIEW_MENU->right) / 3,
-		 (VIEW_MENU->top + VIEW_MENU->bottom) / 2);
-
-    return 0;
-}

+ 0 - 134
imagery/i.points/local_proto.h

@@ -1,134 +0,0 @@
-/* analyze.c */
-int analyze(void);
-
-/* ask.c */
-int ask_gis_files(char *, char *, char *, char *, int);
-
-/* ask_mag.c */
-int ask_magnification(int *);
-int draw_mag(void);
-
-/* call.c */
-int call(int (*)(), char *);
-
-/* cell.c */
-int plotcell(int, int);
-
-/* cellhd.c */
-int Outline_cellhd(View *, struct Cell_head *);
-
-/* colors.c */
-int set_colors(struct Colors *);
-
-/* conv.c */
-int view_to_col(View *, int);
-int view_to_row(View *, int);
-int col_to_view(View *, int);
-int row_to_view(View *, int);
-double row_to_northing(struct Cell_head *, int, double);
-double col_to_easting(struct Cell_head *, int, double);
-double northing_to_row(struct Cell_head *, double);
-double easting_to_col(struct Cell_head *, double);
-
-/* curses.c */
-int Begin_curses(void);
-int End_curses(void);
-int Suspend_curses(void);
-int Resume_curses(void);
-int Curses_allow_interrupts(int);
-int Curses_clear_window(Window *);
-int Curses_outline_window(Window *);
-int Curses_write_window(Window *, int, int, char *);
-int Curses_replot_screen(void);
-int Curses_prompt_gets(char *, char *);
-int Beep(void);
-int Curses_getch(int);
-
-/* debug.c */
-int debug(char *);
-
-/* digit.c */
-int setup_digitizer(void);
-int digitizer_point(double *, double *);
-
-/* dot.c */
-int dot(int, int);
-int save_under_dot(int, int);
-int restore_under_dot(void);
-int release_under_dot(void);
-
-/* drawcell.c */
-int drawcell(View *);
-
-/* driver.c */
-int driver(void);
-
-/* equ.c */
-int Compute_equation(void);
-
-/* find.c */
-int find_target_files(void);
-
-/* graphics.c */
-int Init_graphics(void);
-int Outline_box(int, int, int, int);
-int Text_width(char *);
-int Text(char *, int, int, int, int, int);
-int Uparrow(int, int, int, int);
-int Downarrow(int, int, int, int);
-
-/* group.c */
-int prepare_group_list(void);
-int choose_groupfile(char *, char *);
-
-/* input.c */
-int Input_pointer(Objects *);
-int Input_box(Objects *, int, int);
-int Input_other(int (*)(), char *);
-int Menu_msg(char *);
-int Start_mouse_in_menu(void);
-
-/* main.c */
-int quit(int);
-int error(const char *, int);
-
-/* mark.c */
-int mark(int, int, int);
-int mark_point(View *, int, int);
-
-/* mouse.c */
-int Mouse_pointer(int *, int *, int *);
-int Mouse_box_anchored(int, int, int *, int *, int *);
-int Get_mouse_xy(int *, int *);
-int Set_mouse_xy(int, int);
-
-/* points.c */
-int display_points(int);
-int display_points_in_view(View *, int, double *, double *, int *, int);
-int display_one_point(View *, double, double);
-
-/* target.c */
-int get_target(void);
-int select_current_env(void);
-int select_target_env(void);
-
-/* title.c */
-int display_title(View *);
-
-/* view.c */
-int Configure_view(View *, char *, char *, double, double);
-int In_view(View *, int, int);
-int Erase_view(View *);
-double magnification(View *);
-
-/* where.c */
-int where(int, int);
-
-/* zoom.c */
-int zoom(void);
-
-/* zoom_box.c */
-int zoom_box(void);
-
-/* zoom_pnt.c */
-int zoom_point(void);

+ 0 - 262
imagery/i.points/main.c

@@ -1,262 +0,0 @@
-
-/****************************************************************************
- *
- * MODULE:       i.points
- * AUTHOR(S):    Michael Shapiro, USACERL (original contributor)
- *               Markus Neteler <neteler itc.it>,
- *               Eric Mitchell,
- *               Bernhard Reiter <bernhard intevation.de>, 
- *               Glynn Clements <glynn gclements.plus.com>, 
- *               Hamish Bowman <hamish_b yahoo.com>
- * PURPOSE:      enables user to mark points on (raster) image to be rectified,
- *               and then input the geographic coordinates of each point for
- *               calculation of a coordinate transformation matrix
- * COPYRIGHT:    (C) 1999-2007 by the GRASS Development Team
- *
- *               This program is free software under the GNU General Public
- *               License (>=v2). Read the file COPYING that comes with GRASS
- *               for details.
- *
- *****************************************************************************/
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <signal.h>
-#include <grass/gis.h>
-#include <grass/display.h>
-#include <grass/glocale.h>
-
-#include "globals.h"
-#include "local_proto.h"
-
-int SCREEN_TOP;
-int SCREEN_BOTTOM;
-int SCREEN_LEFT;
-int SCREEN_RIGHT;
-
-Window *INFO_WINDOW;
-Window *MENU_WINDOW;
-Window *PROMPT_WINDOW;
-
-View *VIEW_MAP1;
-View *VIEW_TITLE1;
-View *VIEW_MAP1_ZOOM;
-View *VIEW_TITLE1_ZOOM;
-
-View *VIEW_MAP2;
-View *VIEW_TITLE2;
-View *VIEW_MAP2_ZOOM;
-View *VIEW_TITLE2_ZOOM;
-
-View *VIEW_MENU;
-
-Group group;
-
-char interrupt_char;
-char *tempfile1;
-char *tempfile2;
-char *digit_points;	/* digitizer control points */
-char *digit_results;	/* digitizer results */
-int use_digitizer;	/* is there a digitizer out there? */
-
-/* group file list, target cell,vector files */
-char *group_list;
-char *cell_list;
-char *vect_list;
-
-int from_keyboard = -1;	/* input method */
-int from_digitizer = -1;
-int from_screen = -1;
-int from_flag;
-
-int dotsize = 4;
-
-int THE_COLORS[10];
-
-
-#ifdef __GNUC_MINOR__
-int quit(int) __attribute__ ((__noreturn__));
-#else
-int quit(int);
-#endif
-
-int main(int argc, char *argv[])
-{
-    char name[GNAME_MAX], mapset[GMAPSET_MAX], xmapset[GMAPSET_MAX];
-    struct Cell_head cellhd;
-    struct GModule *module;
-    struct Option *grp;
-
-    /* must run in a term window */
-    G_putenv("GRASS_UI_TERM", "1");
-
-    G_gisinit(argv[0]);
-
-    module = G_define_module();
-    G_add_keyword(_("imagery"));
-    G_add_keyword(_("geometry"));
-    module->description =
-	_("Mark ground control points on image to be rectified.");
-
-    grp = G_define_option();
-    grp->key = "group";
-    grp->type = TYPE_STRING;
-    grp->required = YES;
-    grp->gisprompt = "old,group,group";
-    grp->description = _("Name of imagery group to be registered");
-
-    if (G_parser(argc, argv))
-	exit(EXIT_FAILURE);
-
-
-    Rast_suppress_masking();	/* need to do this for target location */
-
-    interrupt_char = G_intr_char();
-    tempfile1 = G_tempfile();
-    tempfile2 = G_tempfile();
-    cell_list = G_tempfile();
-    vect_list = G_tempfile();
-    group_list = G_tempfile();
-    digit_points = G_tempfile();
-    digit_results = G_tempfile();
-
-    if (R_open_driver() != 0)
-	G_fatal_error(_("No graphics device selected"));
-
-
-    /* parse group name */
-    /* only enforce local-mapset-only due to I_get_group_ref() not liking "@mapset" */
-    if (G_name_is_fully_qualified(grp->answer, group.name, xmapset)) {
-	if (0 != strcmp(G_mapset(), xmapset))
-	    G_fatal_error(_("[%s] Only local groups may be used"),
-			  grp->answer);
-    }
-    else {
-	strncpy(group.name, grp->answer, GNAME_MAX - 1);
-	group.name[GNAME_MAX - 1] = '\0';	/* strncpy() doesn't null terminate on overflow */
-    }
-
-    if (!I_get_group_ref(group.name, &group.ref))
-	G_fatal_error(_("Group [%s] contains no maps, run i.group"),
-		      group.name);
-
-    if (group.ref.nfiles <= 0)
-	G_fatal_error(_("Group [%s] contains no maps, run i.group"),
-		      group.name);
-
-    /* write group files to group list file */
-    prepare_group_list();
-
-    /* get target info and environment */
-    get_target();
-    find_target_files();
-
-    /* read group control points, if any */
-    G_suppress_warnings(1);
-    if (!I_get_control_points(group.name, &group.points))
-	group.points.count = 0;
-    G_suppress_warnings(0);
-
-    /* determine transformation equation */
-    Compute_equation();
-
-
-    signal(SIGINT, SIG_IGN);
-    /*  signal (SIGQUIT, SIG_IGN); */
-
-    Init_graphics();
-    display_title(VIEW_MAP1);
-    select_target_env();
-    display_title(VIEW_MAP2);
-    select_current_env();
-
-    Begin_curses();
-    G_set_error_routine(error);
-
-    /*
-       #ifdef SIGTSTP
-       signal (SIGTSTP, SIG_IGN);
-       #endif
-     */
-
-
-    /* ask user for group file to be displayed */
-    do {
-	if (!choose_groupfile(name, mapset))
-	    quit(0);
-	/* display this file in "map1" */
-    }
-    while (!G_find_raster2(name, mapset));
-    Rast_get_cellhd(name, mapset, &cellhd);
-    G_adjust_window_to_box(&cellhd, &VIEW_MAP1->cell.head, VIEW_MAP1->nrows,
-			   VIEW_MAP1->ncols);
-    Configure_view(VIEW_MAP1, name, mapset, cellhd.ns_res, cellhd.ew_res);
-
-    drawcell(VIEW_MAP1);
-    display_points(1);
-
-    Curses_clear_window(PROMPT_WINDOW);
-
-    /* determine initial input method. */
-    setup_digitizer();
-    if (use_digitizer) {
-	from_digitizer = 1;
-	from_keyboard = 0;
-	from_flag = 1;
-    }
-
-    /* go do the work */
-    driver();
-
-    quit(0);
-}
-
-int quit(int n)
-{
-    char command[1024];
-
-    End_curses();
-    R_close_driver();
-    if (use_digitizer) {
-	sprintf(command, "%s/etc/geo.unlock %s", G_gisbase(), digit_points);
-	system(command);
-    }
-    unlink(tempfile1);
-    unlink(tempfile2);
-    unlink(cell_list);
-    unlink(group_list);
-    unlink(vect_list);
-    unlink(digit_points);
-    unlink(digit_results);
-
-    system("d.frame -e");
-
-    exit(n);
-}
-
-int error(const char *msg, int fatal)
-{
-    char buf[200];
-    int x, y, button;
-
-    Curses_clear_window(PROMPT_WINDOW);
-    Curses_write_window(PROMPT_WINDOW, 1, 1, "LOCATION:\n");
-    Curses_write_window(PROMPT_WINDOW, 1, 12, G_location());
-    Curses_write_window(PROMPT_WINDOW, 2, 1, "MAPSET:\n");
-    Curses_write_window(PROMPT_WINDOW, 2, 12, G_location());
-
-    Beep();
-    if (fatal)
-	sprintf(buf, _("ERROR: %s"), msg);
-    else
-	sprintf(buf, _("WARNING: %s (click mouse to continue)"), msg);
-    Menu_msg(buf);
-
-    if (fatal)
-	quit(1);
-
-    Mouse_pointer(&x, &y, &button);
-    Curses_clear_window(PROMPT_WINDOW);
-
-    return 0;
-}

+ 0 - 197
imagery/i.points/mark.c

@@ -1,197 +0,0 @@
-#include "globals.h"
-#include "local_proto.h"
-#include <grass/display.h>
-
-static int get_point2(double *, double *);
-static int keyboard(void);
-static int _keyboard(void);
-static int screen(int, int, int);
-static int digitizer(void);
-static int cancel(void);
-
-int mark(int x, int y, int button)
-{
-    if (button != 1)
-	return where(x, y);
-
-    if (VIEW_MAP1->cell.configured && In_view(VIEW_MAP1, x, y))
-	mark_point(VIEW_MAP1, x, y);
-    else if (VIEW_MAP1_ZOOM->cell.configured && In_view(VIEW_MAP1_ZOOM, x, y))
-	mark_point(VIEW_MAP1_ZOOM, x, y);
-    return 0;			/* return but don't quit */
-}
-
-int mark_point(View * view, int x, int y)
-{
-    double e1, n1;
-    double e2, n2;
-    int row, col;
-
-    char buf[100];
-
-    /* convert x,y to east,north at center of cell */
-    col = view_to_col(view, x);
-    e1 = col_to_easting(&view->cell.head, col, 0.5);
-    row = view_to_row(view, y);
-    n1 = row_to_northing(&view->cell.head, row, 0.5);
-
-    Curses_clear_window(MENU_WINDOW);
-    sprintf(buf, "Point %d marked on image at", group.points.count + 1);
-    Curses_write_window(MENU_WINDOW, 1, 1, buf);
-    sprintf(buf, "East:  %10.2f", e1);
-    Curses_write_window(MENU_WINDOW, 3, 3, buf);
-    sprintf(buf, "North: %10.2f", n1);
-    Curses_write_window(MENU_WINDOW, 4, 3, buf);
-    Curses_clear_window(INFO_WINDOW);
-
-    R_standard_color(ORANGE);
-    save_under_dot(x, y);
-    dot(x, y);
-
-    if (!get_point2(&e2, &n2)) {
-	Curses_clear_window(MENU_WINDOW);
-	restore_under_dot();
-    }
-    else {
-	Curses_write_window(MENU_WINDOW, 7, 1, "Point located at");
-	sprintf(buf, "East:  %10.2f", e2);
-	Curses_write_window(MENU_WINDOW, 9, 3, buf);
-	sprintf(buf, "North: %10.2f", n2);
-	Curses_write_window(MENU_WINDOW, 10, 3, buf);
-	I_new_control_point(&group.points, e1, n1, e2, n2, 1);
-	I_put_control_points(group.name, &group.points);
-	Compute_equation();
-	display_points(1);
-    }
-    release_under_dot();
-
-    return 0;
-}
-
-static double N, E;
-
-static int get_point2(double *east, double *north)
-{
-    int stat;
-    static int use = 1;
-    static Objects objects[] = {
-	MENU("CANCEL", cancel, &use),
-	INFO("Mark point on target image", &use),
-	OTHER(screen, &use),
-	{0}
-    };
-
-    if (from_digitizer > 0) {
-	stat = Input_other(digitizer, "Digitizer");
-    }
-    else if (from_screen > 0) {
-	set_colors(&VIEW_MAP2->cell.colors);
-	stat = Input_pointer(objects) > 0;
-	set_colors(&VIEW_MAP1->cell.colors);
-    }
-    else
-	stat = Input_other(keyboard, "Keyboard");
-
-    if (stat) {
-	*east = E;
-	*north = N;
-    }
-
-    return stat;
-}
-
-static int keyboard(void)
-{
-    int ok;
-
-    Curses_clear_window(INFO_WINDOW);
-    ok = _keyboard();
-    Curses_clear_window(INFO_WINDOW);
-    return ok;
-}
-
-static int _keyboard(void)
-{
-    char buf[100], buf1[100], buf2[100];
-
-    while (1) {
-	Curses_prompt_gets("Enter coordinates as east north: ", buf);
-	G_strip(buf);
-	if (*buf == 0) {
-	    return 0;
-	}
-
-	if (sscanf(buf, "%s %s", buf1, buf2) != 2) {
-	    Beep();
-	    continue;
-	}
-	/* scan for lat/lon string first as "123E 45S" passes the %lf test but is wrong */
-	if (!(G_lon_scan(buf1, &E) && G_lat_scan(buf2, &N))) {
-	    if (sscanf(buf, "%lf %lf", &E, &N) != 2) {
-		Beep();
-		continue;
-	    }
-	}
-
-	Curses_clear_window(INFO_WINDOW);
-	sprintf(buf, "East:   %f\n", E);
-	Curses_write_window(INFO_WINDOW, 2, 2, buf);
-	sprintf(buf, "North:  %f\n", N);
-	Curses_write_window(INFO_WINDOW, 3, 2, buf);
-	Curses_write_window(INFO_WINDOW, 5, 1, "Look ok? (y/n) ");
-
-	while (1) {
-	    int c;
-
-	    c = Curses_getch(0);
-	    if (c == 'y' || c == 'Y')
-		return 1;
-	    if (c == 'n' || c == 'N')
-		break;
-	    Beep();
-	}
-    }
-
-    return 0;
-}
-
-static int digitizer(void)
-{
-    return digitizer_point(&E, &N);
-}
-
-
-static int screen(int x, int y, int button)
-{
-    int row, col;
-    char buf[50];
-
-    View *view;
-
-    if (In_view(VIEW_MAP2, x, y) && VIEW_MAP2->cell.configured)
-	view = VIEW_MAP2;
-    else if (In_view(VIEW_MAP2_ZOOM, x, y) && VIEW_MAP2_ZOOM->cell.configured)
-	view = VIEW_MAP2_ZOOM;
-    else
-	return 0;		/* ignore mouse event */
-
-    col = view_to_col(view, x);
-    E = col_to_easting(&view->cell.head, col, 0.5);
-    row = view_to_row(view, y);
-    N = row_to_northing(&view->cell.head, row, 0.5);
-
-    if (button == 1)
-	return 1;
-
-    sprintf(buf, "East:   %10.2f\n", E);
-    Curses_write_window(INFO_WINDOW, 2, 2, buf);
-    sprintf(buf, "North:  %10.2f\n", N);
-    Curses_write_window(INFO_WINDOW, 3, 2, buf);
-
-    return 0;
-}
-
-static int cancel(void)
-{
-    return -1;
-}

+ 0 - 56
imagery/i.points/mouse.c

@@ -1,56 +0,0 @@
-#include "globals.h"
-#include <grass/display.h>
-
-static int first = 1;
-static int curx, cury;
-
-int Mouse_pointer(int *x, int *y, int *button)
-{
-    if (first) {
-	curx = (SCREEN_LEFT + SCREEN_RIGHT) / 2;
-	cury = (SCREEN_TOP + SCREEN_BOTTOM) / 2;
-	first = 0;
-    }
-    R_get_location_with_pointer(&curx, &cury, button);
-    *x = curx;
-    *y = cury;
-
-#ifdef BUTTON3
-    if (*button == 3)
-	quit(0);
-#endif
-
-    return 0;
-}
-
-int Mouse_box_anchored(int x1, int y1, int *x2, int *y2, int *button)
-{
-    R_get_location_with_box(x1, y1, x2, y2, button);
-    curx = *x2;
-    cury = *y2;
-    first = 0;
-
-#ifdef BUTTON3
-    if (*button == 3)
-	quit(0);
-#endif
-
-    return 0;
-}
-
-int Get_mouse_xy(int *x, int *y)
-{
-    *x = curx;
-    *y = cury;
-
-    return 0;
-}
-
-int Set_mouse_xy(int x, int y)
-{
-    first = 0;
-    curx = x;
-    cury = y;
-
-    return 0;
-}

+ 0 - 58
imagery/i.points/points.c

@@ -1,58 +0,0 @@
-#include "globals.h"
-#include "local_proto.h"
-#include <grass/display.h>
-
-int display_points(int in_color)
-{
-    display_points_in_view(VIEW_MAP1, in_color,
-			   group.points.e1, group.points.n1,
-			   group.points.status, group.points.count);
-
-    display_points_in_view(VIEW_MAP1_ZOOM, in_color,
-			   group.points.e1, group.points.n1,
-			   group.points.status, group.points.count);
-
-    display_points_in_view(VIEW_MAP2, in_color,
-			   group.points.e2, group.points.n2,
-			   group.points.status, group.points.count);
-
-    display_points_in_view(VIEW_MAP2_ZOOM, in_color,
-			   group.points.e2, group.points.n2,
-			   group.points.status, group.points.count);
-
-    return 0;
-}
-
-int display_points_in_view(View * view, int in_color,
-			   double *east, double *north, int *status,
-			   int count)
-{
-    if (!view->cell.configured)
-	return 1;
-    while (count-- > 0) {
-	if (in_color && (*status > 0))
-	    R_standard_color(GREEN);
-	else if (in_color && (*status == 0))
-	    R_standard_color(RED);
-	else
-	    R_standard_color(GREY);
-	status++;
-	display_one_point(view, *east++, *north++);
-    }
-
-    return 0;
-}
-
-int display_one_point(View * view, double east, double north)
-{
-    int row, col, x, y;
-
-    row = northing_to_row(&view->cell.head, north) + .5;
-    col = easting_to_col(&view->cell.head, east) + .5;
-    y = row_to_view(view, row);
-    x = col_to_view(view, col);
-    if (In_view(view, x, y))
-	dot(x, y);
-
-    return 0;
-}

+ 0 - 66
imagery/i.points/target.c

@@ -1,66 +0,0 @@
-#include <unistd.h>
-#include <string.h>
-#include <grass/gis.h>
-#include "globals.h"
-/* read the target for the group and cast it into the alternate GRASS env */
-
-static int which_env;
-
-int get_target(void)
-{
-    char location[GNAME_MAX];
-    char mapset[GMAPSET_MAX];
-    char buf[1024];
-    int stat;
-
-    if (!I_get_target(group.name, location, mapset)) {
-	sprintf(buf, "Target information for group [%s] missing\n",
-		group.name);
-	goto error;
-    }
-
-    sprintf(buf, "%s/%s", G_gisdbase(), location);
-    if (access(buf, 0) != 0) {
-	sprintf(buf, "Target location [%s] not found\n", location);
-	goto error;
-    }
-    G_create_alt_env();
-    G__setenv("LOCATION_NAME", location);
-    stat = G__mapset_permissions(mapset);
-    if (stat > 0) {
-	G__setenv("MAPSET", mapset);
-	G_create_alt_search_path();
-	G_switch_env();
-	G_switch_search_path();
-	which_env = 0;
-	return 1;
-    }
-    sprintf(buf, "Mapset [%s] in target location [%s] - ", mapset, location);
-    strcat(buf, stat == 0 ? "permission denied\n" : "not found\n");
-  error:
-    strcat(buf, "Please run i.target for group ");
-    strcat(buf, group.name);
-    G_fatal_error(buf);
-}
-
-int select_current_env(void)
-{
-    if (which_env != 0) {
-	G_switch_env();
-	G_switch_search_path();
-	which_env = 0;
-    }
-
-    return 0;
-}
-
-int select_target_env(void)
-{
-    if (which_env != 1) {
-	G_switch_env();
-	G_switch_search_path();
-	which_env = 1;
-    }
-
-    return 0;
-}

+ 0 - 49
imagery/i.points/title.c

@@ -1,49 +0,0 @@
-#include "globals.h"
-#include "local_proto.h"
-#include <grass/display.h>
-
-int display_title(View * view)
-{
-    View *title;
-    char left[100], center[100];
-    int size;
-    double magnification();
-
-    *left = 0;
-    *center = 0;
-
-    if (view->cell.configured) {
-	sprintf(center, "%s (mag %.1f)",
-		view->cell.name, magnification(view));
-    }
-
-    if (view == VIEW_MAP1) {
-	sprintf(left, "%s", G_location());
-	title = VIEW_TITLE1;
-    }
-    else if (view == VIEW_MAP1_ZOOM) {
-	title = VIEW_TITLE1_ZOOM;
-    }
-
-    if (view == VIEW_MAP2) {
-	sprintf(left, "%s", G_location());
-	title = VIEW_TITLE2;
-    }
-    else if (view == VIEW_MAP2_ZOOM) {
-	title = VIEW_TITLE2_ZOOM;
-    }
-
-    Erase_view(title);
-    R_standard_color(WHITE);
-    size = title->nrows - 4;
-    R_text_size(size, size);
-    Text(left, title->top, title->bottom, title->left, title->right, 2);
-    if (*center) {
-	R_standard_color(YELLOW);
-	Text(center, title->top, title->bottom,
-	     (title->left + title->right - Text_width(center)) / 2,
-	     title->right, 2);
-    }
-
-    return 0;
-}

+ 0 - 50
imagery/i.points/view.c

@@ -1,50 +0,0 @@
-#include <string.h>
-#include <grass/display.h>
-#include "globals.h"
-#include "local_proto.h"
-
-int Configure_view(View * view, char *name, char *mapset, double ns_res, double ew_res	/* original map resolution */
-    )
-{
-    Erase_view(view);
-    view->cell.configured = 0;
-
-    /* copy the cell name into the view */
-    strcpy(view->cell.name, name);
-    strcpy(view->cell.mapset, mapset);
-
-    /* determine the map edges */
-    view->cell.left = view->left + (view->ncols - view->cell.head.cols) / 2;
-    view->cell.right = view->cell.left + view->cell.head.cols - 1;
-    view->cell.top = view->top + (view->nrows - view->cell.head.rows) / 2;
-    view->cell.bottom = view->cell.top + view->cell.head.rows - 1;
-
-    /* remember original resolutions */
-    view->cell.ns_res = ns_res;
-    view->cell.ew_res = ew_res;
-
-    view->cell.configured = 1;
-
-    return 0;
-}
-
-int In_view(View * view, int x, int y)
-{
-    return (x >= view->left && x <= view->right && y >= view->top &&
-	    y <= view->bottom);
-}
-
-int Erase_view(View * view)
-{
-    R_standard_color(BLACK);
-    R_box_abs(view->left, view->top, view->right, view->bottom);
-
-    return 0;
-}
-
-double magnification(View * view)
-{
-    if (!view->cell.configured)
-	return ((double)0.0);
-    return (view->cell.ew_res / view->cell.head.ew_res);
-}

+ 0 - 68
imagery/i.points/where.c

@@ -1,68 +0,0 @@
-#include "globals.h"
-#include "local_proto.h"
-
-static int where_12(View *, int, int);
-static int where_21(View *, int, int);
-static int where_am_i(View *, int, int, Window *, double *, double *,
-		      Window *);
-
-int where(int x, int y)
-{
-    if (VIEW_MAP1->cell.configured && In_view(VIEW_MAP1, x, y))
-	where_12(VIEW_MAP1, x, y);
-    else if (VIEW_MAP1_ZOOM->cell.configured && In_view(VIEW_MAP1_ZOOM, x, y))
-	where_12(VIEW_MAP1_ZOOM, x, y);
-    else if (VIEW_MAP2->cell.configured && In_view(VIEW_MAP2, x, y))
-	where_21(VIEW_MAP2, x, y);
-    else if (VIEW_MAP2_ZOOM->cell.configured && In_view(VIEW_MAP2_ZOOM, x, y))
-	where_21(VIEW_MAP2_ZOOM, x, y);
-    return 0;			/* return but don't quit */
-}
-
-static int where_12(View * view, int x, int y)
-{
-    where_am_i(view, x, y, MENU_WINDOW, group.E12, group.N12, INFO_WINDOW);
-
-    return 0;
-}
-
-static int where_21(View * view, int x, int y)
-{
-    where_am_i(view, x, y, INFO_WINDOW, group.E21, group.N21, MENU_WINDOW);
-
-    return 0;
-}
-
-static int where_am_i(View * view, int x, int y, Window * w1,
-		      double *E, double *N, Window * w2)
-{
-    double e1, n1, e2, n2;
-    int row, col;
-
-    char buf[100];
-
-    /* convert x,y to east,north at center of cell */
-    col = view_to_col(view, x);
-    e1 = col_to_easting(&view->cell.head, col, 0.5);
-    row = view_to_row(view, y);
-    n1 = row_to_northing(&view->cell.head, row, 0.5);
-
-    Curses_clear_window(w1);
-    sprintf(buf, "East:  %10.2f", e1);
-    Curses_write_window(w1, 3, 3, buf);
-    sprintf(buf, "North: %10.2f", n1);
-    Curses_write_window(w1, 4, 3, buf);
-
-    /* if transformation equation is useable, determine point via equation */
-    if (group.equation_stat <= 0)
-	return 1;
-
-    I_georef(e1, n1, &e2, &n2, E, N);
-    Curses_clear_window(w2);
-    sprintf(buf, "East:  %10.2f", e2);
-    Curses_write_window(w2, 3, 3, buf);
-    sprintf(buf, "North: %10.2f", n2);
-    Curses_write_window(w2, 4, 3, buf);
-
-    return 0;
-}

+ 0 - 26
imagery/i.points/zoom.c

@@ -1,26 +0,0 @@
-#include "globals.h"
-#include "local_proto.h"
-
-static int cancel(void);
-
-int zoom(void)
-{
-    static int use = 1;
-
-
-    static Objects objects[] = {
-	MENU("CANCEL", cancel, &use),
-	MENU("BOX", zoom_box, &use),
-	MENU("POINT", zoom_point, &use),
-	INFO("Select type of zoom", &use),
-	{0}
-    };
-
-    Input_pointer(objects);
-    return 0;			/* return, but don't QUIT */
-}
-
-static int cancel(void)
-{
-    return -1;
-}

+ 0 - 182
imagery/i.points/zoom_box.c

@@ -1,182 +0,0 @@
-#include "globals.h"
-#include "local_proto.h"
-#include <grass/display.h>
-
-static int zoom1(int, int);
-static int zoom2(int, int);
-static int cancel(void);
-
-static int x1, y1, x2, y2;
-static View *pick_view, *zoom_view, *main_view;
-static int target_flag;
-
-int zoom_box(void)
-{
-    static int use = 1;
-
-    static Objects objects[] = {
-	MENU("CANCEL", cancel, &use),
-	INFO(" Mark first corner of region ", &use),
-	OTHER(zoom1, &use),
-	{0}
-    };
-
-    Input_pointer(objects);
-    return 1;
-}
-
-static int zoom1(int x, int y)
-{				/* called by Input_pointer */
-    static int use = 1;
-
-    static Objects objects[] = {
-	MENU("CANCEL", cancel, &use),
-	INFO(" Define the region ", &use),
-	OTHER(zoom2, &use),
-	{0}
-    };
-
-    /* 
-     * user has marked first corner 
-     * this determines which view is being zoomed
-     */
-    x1 = x;
-    y1 = y;
-
-    if (In_view(pick_view = VIEW_MAP1, x1, y1)) {
-	main_view = VIEW_MAP1;
-	zoom_view = VIEW_MAP1_ZOOM;
-	target_flag = 0;
-    }
-    else if (In_view(pick_view = VIEW_MAP2, x1, y1)) {
-	if (!pick_view->cell.configured)
-	    return 0;		/* ignore the mouse event */
-	main_view = VIEW_MAP2;
-	zoom_view = VIEW_MAP2_ZOOM;
-	target_flag = 1;
-    }
-    else if (In_view(pick_view = VIEW_MAP1_ZOOM, x1, y1)) {
-	if (!pick_view->cell.configured)
-	    return 0;		/* ignore the mouse event */
-	main_view = VIEW_MAP1;
-	zoom_view = VIEW_MAP1_ZOOM;
-	target_flag = 0;
-    }
-    else if (In_view(pick_view = VIEW_MAP2_ZOOM, x1, y1)) {
-	if (!pick_view->cell.configured)
-	    return 0;		/* ignore the mouse event */
-	main_view = VIEW_MAP2;
-	zoom_view = VIEW_MAP2_ZOOM;
-	target_flag = 1;
-    }
-    else
-	return 0;		/* ignore the mouse event */
-    if (!pick_view->cell.configured)
-	return 0;		/* just to be sure */
-
-    return Input_box(objects, x, y);
-}
-
-static int zoom2(int x, int y)
-{
-    int top, bottom, left, right;
-    int row, col;
-    struct Cell_head cellhd;
-
-    x2 = x;
-    y2 = y;
-    /* 
-     * user has completed the zoom window.
-     * must be in same view as first corner
-     */
-    if (x1 == x2 || y1 == y2)
-	return 0;		/* ignore event */
-    if (!In_view(pick_view, x2, y2))
-	return 0;
-    /*
-     * ok, erase menu messages
-     */
-    Menu_msg("");
-
-    /*
-     * assign window coordinates to top,bottom,left,right
-     */
-    if (x1 < x2) {
-	left = x1;
-	right = x2;
-    }
-    else {
-	left = x2;
-	right = x1;
-    }
-    if (y1 < y2) {
-	top = y1;
-	bottom = y2;
-    }
-    else {
-	top = y2;
-	bottom = y1;
-    }
-
-    /* 
-     * Determine the the zoom window (ie, cellhd)
-     * must copy the current view cellhd first, to preserve header info
-     * (such as projection, zone, and other items.)
-     * compute zoom window northings,eastings, rows, cols, and resolution
-     */
-
-    G_copy(&cellhd, &pick_view->cell.head, sizeof(cellhd));
-
-    /* convert top to northing at top edge of cell
-     * left to easting at left edge
-     */
-    col = view_to_col(pick_view, left);
-    row = view_to_row(pick_view, top);
-    cellhd.north = row_to_northing(&pick_view->cell.head, row, 0.0);
-    cellhd.west = col_to_easting(&pick_view->cell.head, col, 0.0);
-
-    /* convert bottom to northing at bottom edge of cell
-     * right to easting at right edge
-     */
-    col = view_to_col(pick_view, right);
-    row = view_to_row(pick_view, bottom);
-    cellhd.south = row_to_northing(&pick_view->cell.head, row, 1.0);
-    cellhd.east = col_to_easting(&pick_view->cell.head, col, 1.0);
-
-
-    cellhd.rows = bottom - top + 1;
-    cellhd.cols = right - left + 1;
-    cellhd.ns_res = (cellhd.north - cellhd.south) / cellhd.rows;
-    cellhd.ew_res = (cellhd.east - cellhd.west) / cellhd.cols;
-
-    /*
-     * Outline the zoom window on the main map
-     * Turn previous one to grey.
-     */
-    if (zoom_view->cell.configured) {
-	R_standard_color(GREY);
-	Outline_cellhd(main_view, &zoom_view->cell.head);
-    }
-    R_standard_color(RED);
-    Outline_cellhd(main_view, &cellhd);
-
-
-    /*
-     * zoom
-     */
-    if (target_flag)
-	select_target_env();
-    G_adjust_window_to_box(&cellhd, &zoom_view->cell.head, zoom_view->nrows,
-			   zoom_view->ncols);
-    Configure_view(zoom_view, pick_view->cell.name, pick_view->cell.mapset,
-		   pick_view->cell.ns_res, pick_view->cell.ew_res);
-    drawcell(zoom_view);
-    select_current_env();
-    display_points(1);
-    return 1;			/* pop back */
-}
-
-static int cancel(void)
-{
-    return -1;
-}

+ 0 - 191
imagery/i.points/zoom_pnt.c

@@ -1,191 +0,0 @@
-#include "globals.h"
-#include "local_proto.h"
-#include <grass/display.h>
-
-static int zoom1(int, int);
-static int cancel(void);
-
-static View *pick_view, *zoom_view, *main_view;
-static int target_flag;
-double ceil();
-double floor();
-
-int zoom_point(void)
-{
-    static int use = 1;
-
-    static Objects objects[] = {
-	MENU("CANCEL", cancel, &use),
-	INFO(" Mark center of area to be zoomed ", &use),
-	OTHER(zoom1, &use),
-	{0}
-    };
-
-    Input_pointer(objects);
-    return 1;
-}
-
-static int zoom1(int x, int y)
-{				/* called by Input_pointer */
-    int top, bottom, left, right;
-    int n, row, col;
-    int nrows, ncols;
-    struct Cell_head cellhd;
-    int mag;
-    double magnification();
-    double north, south, east, west;
-
-    if (In_view(pick_view = VIEW_MAP1, x, y)) {
-	main_view = VIEW_MAP1;
-	zoom_view = VIEW_MAP1_ZOOM;
-	target_flag = 0;
-    }
-    else if (In_view(pick_view = VIEW_MAP2, x, y)) {
-	if (!pick_view->cell.configured)
-	    return 0;		/* ignore the mouse event */
-	main_view = VIEW_MAP2;
-	zoom_view = VIEW_MAP2_ZOOM;
-	target_flag = 1;
-    }
-    else if (In_view(pick_view = VIEW_MAP1_ZOOM, x, y)) {
-	if (!pick_view->cell.configured)
-	    return 0;		/* ignore the mouse event */
-	main_view = VIEW_MAP1;
-	zoom_view = VIEW_MAP1_ZOOM;
-	target_flag = 0;
-    }
-    else if (In_view(pick_view = VIEW_MAP2_ZOOM, x, y)) {
-	if (!pick_view->cell.configured)
-	    return 0;		/* ignore the mouse event */
-	main_view = VIEW_MAP2;
-	zoom_view = VIEW_MAP2_ZOOM;
-	target_flag = 1;
-    }
-    else
-	return 0;		/* ignore the mouse event */
-    if (!pick_view->cell.configured)
-	return 0;		/* just to be sure */
-    /*
-     * make sure point is within edges of image as well
-     */
-    if (x <= pick_view->cell.left)
-	return 0;
-    if (x >= pick_view->cell.right)
-	return 0;
-    if (y <= pick_view->cell.top)
-	return 0;
-    if (y >= pick_view->cell.bottom)
-	return 0;
-
-
-    /*
-     * ok, erase menu messages
-     */
-    Menu_msg("");
-
-    /* determine magnification of zoom */
-    if (zoom_view->cell.configured) {
-	if (zoom_view == pick_view)
-	    mag = floor(magnification(zoom_view) + 1.0) + .1;
-	else
-	    mag = ceil(magnification(zoom_view)) + .1;
-    }
-    else {
-	mag = floor(magnification(main_view) + 1.0) + .1;
-    }
-    if (!ask_magnification(&mag))
-	return 1;
-    /* 
-     * Determine the the zoom window (ie, cellhd)
-     */
-
-    G_copy(&cellhd, &main_view->cell.head, sizeof(cellhd));
-    cellhd.ns_res = main_view->cell.ns_res / mag;
-    cellhd.ew_res = main_view->cell.ew_res / mag;
-    cellhd.cols = (cellhd.east - cellhd.west) / cellhd.ew_res;
-    cellhd.rows = (cellhd.north - cellhd.south) / cellhd.ns_res;
-
-
-    /* convert x,y to col,row */
-
-    col = view_to_col(pick_view, x);
-    east = col_to_easting(&pick_view->cell.head, col, 0.5);
-    col = easting_to_col(&cellhd, east);
-
-    row = view_to_row(pick_view, y);
-    north = row_to_northing(&pick_view->cell.head, row, 0.5);
-    row = northing_to_row(&cellhd, north);
-
-    ncols = zoom_view->ncols;
-    nrows = zoom_view->nrows;
-
-
-    n = cellhd.cols - col;
-    if (n > col)
-	n = col;
-    if (n + n + 1 >= ncols) {
-	n = ncols / 2;
-	if (n + n + 1 >= ncols)
-	    n--;
-    }
-    left = col - n;
-    right = col + n;
-
-    n = cellhd.rows - row;
-    if (n > row)
-	n = row;
-    if (n + n + 1 >= nrows) {
-	n = nrows / 2;
-	if (n + n + 1 >= nrows)
-	    n--;
-    }
-    top = row - n;
-    bottom = row + n;
-
-
-    north = row_to_northing(&cellhd, top, 0.0);
-    west = col_to_easting(&cellhd, left, 0.0);
-    south = row_to_northing(&cellhd, bottom, 1.0);
-    east = col_to_easting(&cellhd, right, 1.0);
-
-
-    cellhd.north = north;
-    cellhd.south = south;
-    cellhd.east = east;
-    cellhd.west = west;
-
-    cellhd.rows = (cellhd.north - cellhd.south) / cellhd.ns_res;
-    cellhd.cols = (cellhd.east - cellhd.west) / cellhd.ew_res;
-
-    /*
-     * Outline the zoom window on the main map
-     * Turn previous one to grey.
-     */
-    if (zoom_view->cell.configured) {
-	R_standard_color(GREY);
-	Outline_cellhd(main_view, &zoom_view->cell.head);
-    }
-    R_standard_color(RED);
-    Outline_cellhd(main_view, &cellhd);
-
-
-    /*
-     * zoom
-     */
-    if (target_flag)
-	select_target_env();
-    G_copy(&zoom_view->cell.head, &cellhd, sizeof(cellhd));
-    Configure_view(zoom_view, pick_view->cell.name, pick_view->cell.mapset,
-		   pick_view->cell.ns_res, pick_view->cell.ew_res);
-    drawcell(zoom_view);
-    select_current_env();
-    display_points(1);
-
-    return 1;			/* pop back */
-}
-
-
-static int cancel(void)
-{
-    return -1;
-}

+ 1 - 1
imagery/i.rectify/main.c

@@ -14,7 +14,7 @@
  *               Markus Metz
  *               Markus Metz
  * PURPOSE:      calculate a transformation matrix and then convert x,y cell 
  * PURPOSE:      calculate a transformation matrix and then convert x,y cell 
  *               coordinates to standard map coordinates for each pixel in the 
  *               coordinates to standard map coordinates for each pixel in the 
- *               image (control points can come from i.points or i.vpoints)
+ *               image (control points can come from g.gui.gcp)
  * COPYRIGHT:    (C) 2002-2011 by the GRASS Development Team
  * COPYRIGHT:    (C) 2002-2011 by the GRASS Development Team
  *
  *
  *               This program is free software under the GNU General Public
  *               This program is free software under the GNU General Public

+ 10 - 6
imagery/i.target/i.target.html

@@ -9,7 +9,7 @@ to write the rectified map just prior to completion of the program;
 <em>i.target</em> enables the user to specify this location.
 <em>i.target</em> enables the user to specify this location.
 
 
 <em>i.target</em> must be run before 
 <em>i.target</em> must be run before 
-<em><a href="i.points.html">i.points</a></em> and 
+<em><a href="g.gui.gcp.html">g.gui.gcp</a></em> and 
 <em><a href="i.rectify.html">i.rectify</a></em>.
 <em><a href="i.rectify.html">i.rectify</a></em>.
 
 
 <h2>NOTES</h2>
 <h2>NOTES</h2>
@@ -29,13 +29,17 @@ group will be displayed.
 The GRASS 4 <em>
 The GRASS 4 <em>
 <a href="http://grass.osgeo.org/gdp/imagery/grass4_image_processing.pdf">Image Processing manual</a></em>
 <a href="http://grass.osgeo.org/gdp/imagery/grass4_image_processing.pdf">Image Processing manual</a></em>
 
 
-<p><em>
+<p>
+<em>
+<a href="g.gui.gcp.html">g.gui.gcp</a>,
 <a href="i.group.html">i.group</a>,
 <a href="i.group.html">i.group</a>,
-<a href="i.points.html">i.points</a>,
-<a href="i.vpoints.html">i.vpoints</a>,
 <a href="i.rectify.html">i.rectify</a>
 <a href="i.rectify.html">i.rectify</a>
-</em><br>
-<em><a href="wxGUI.gcp.html">Manage Ground Control Points</a></em>
+</em>
+
+<br>
+<em>
+<a href="wxGUI.gcp.html">Manage Ground Control Points</a>
+</em>
 
 
 
 
 <h2>AUTHOR</h2>
 <h2>AUTHOR</h2>

+ 0 - 12
imagery/i.vpoints/Makefile

@@ -1,12 +0,0 @@
-MODULE_TOPDIR = ../..
-
-PGM = i.vpoints
-
-LIBES     = $(IMAGERYLIB) $(SYMBLIB) $(DISPLAYLIB) $(VECTORLIB) $(GISLIB) $(CURSES) $(GMATHLIB)
-DEPENDENCIES= $(IMAGERYDEP) $(SYMBDEP) $(DISPLAYDEP) $(VECTORDEP) $(GISDEP) $(GMATHDEP)
-EXTRA_INC = $(VECT_INC)
-EXTRA_CFLAGS = $(VECT_CFLAGS)
-
-include $(MODULE_TOPDIR)/include/Make/Module.make
-
-default: cmd

+ 0 - 766
imagery/i.vpoints/analyze.c

@@ -1,766 +0,0 @@
-#include <string.h>
-#include <unistd.h>
-#include <math.h>
-#include <grass/gis.h>
-#include "globals.h"
-#include <grass/display.h>
-#include "crs.h"
-
-#define NLINES 18
-struct box
-{
-    int top, bottom, left, right;
-};
-
-static int which;
-static struct box more, less, report;
-static int height, size, edge, nlines;
-static int curp, first_point;
-static double rms;
-static double *xres, *yres, *gnd;
-static int pager;
-static int xmax, ymax, gmax;
-static char buf[300];
-
-static char delete_msg[11] = "delete_off";
-static char pick_msg[40] = " Double click to include/exclude pt. ";
-static int delete_mode;
-static char order_msg[10] = "1st ORDER";
-static int trans_order = 1;
-
-#define FMT0(buf,n) \
-	sprintf (buf, "%3d ", n)
-#define FMT1(buf,xres,yres,gnd) \
-	sprintf (buf, "%5.1f %5.1f %6.1f ", xres,yres,gnd)
-#define LHEAD1 "        error          "
-#define LHEAD2 "  #   col   row  target"
-
-#define FMT2(buf,e1,n1,e2,n2) \
-	sprintf (buf, "%9.1f %9.1f %9.1f %9.1f ", e1,n1,e2,n2)
-#define RHEAD1 "         image              target"
-#define RHEAD2 "    east     north      east     north"
-
-#define BACKGROUND GREY
-
-static int delete_mark(void);
-static int do_warp(void);
-static int rast_redraw(void);
-static int warp(void);
-static int no_warp(void);
-static int downarrow(struct box *, int);
-static int uparrow(struct box *, int);
-static int pick(int, int);
-static int get_order(void);
-static int show_point(int, int);
-static int printcentered(FILE *, char *, int);
-static int inbox(struct box *, int, int);
-static int cancel_which(void);
-static int done(void);
-static int do_report(FILE *);
-static int to_printer(void);
-static int askfile(void);
-static int to_file(void);
-static int dotext(char *, int, int, int, int, int, int);
-static int compute_transformation(void);
-
-static int do_1st(void)
-{
-    strcpy(order_msg, "1st ORDER");
-    trans_order = 1;
-    if (compute_transformation())
-	return 1;		/* back to analyze menu */
-
-    rast_redraw();
-    return 1;
-}
-
-static int do_2nd(void)
-{
-    strcpy(order_msg, "2nd ORDER");
-    trans_order = 2;
-    if (compute_transformation())
-	return 0;
-
-    rast_redraw();
-    return 1;
-}
-
-static int do_3rd(void)
-{
-    strcpy(order_msg, "3rd ORDER");
-    trans_order = 3;
-    if (compute_transformation())
-	return 0;
-
-    rast_redraw();
-    return 1;
-}
-
-static int delete_mark(void)
-{
-    if (delete_mode) {
-	strcpy(pick_msg, " Double click to include/exclude point");
-	strcpy(delete_msg, "delete_off");
-	delete_mode = 0;
-    }
-    else {
-	strcpy(pick_msg, " Double click on point to be DELETED   ");
-	strcpy(delete_msg, "DELETE_ON ");
-	delete_mode = 1;
-    }
-    pager = 1;			/* redisplay entire form */
-
-    return 1;
-}
-
-int delete_control_point(int n)
-{
-    int i;
-    char msg[80];
-
-    if ((n < 0) | (n > group.points.count - 1)) {
-	sprintf(msg, "%d is an invalid control point index value.", n);
-	G_warning(msg);
-	return 1;
-    }
-    for (i = n; i < group.points.count - 1; i++) {
-	G_copy(&group.points.e1[i], &group.points.e1[i + 1],
-	       sizeof(group.points.e1[0]));
-	G_copy(&group.points.n1[i], &group.points.n1[i + 1],
-	       sizeof(group.points.n1[0]));
-	G_copy(&group.points.e2[i], &group.points.e2[i + 1],
-	       sizeof(group.points.e2[0]));
-	G_copy(&group.points.n2[i], &group.points.n2[i + 1],
-	       sizeof(group.points.n2[0]));
-	G_copy(&group.points.status[i], &group.points.status[i + 1],
-	       sizeof(group.points.status[0]));
-    }
-    group.points.count -= 1;
-    if (I_put_control_points(group.name, &group.points) < 0) {
-	G_fatal_error("bad return on I_put_control_points");
-	return 1;
-    }
-    return 0;
-}
-
-/*---------------------------------------------------------------
-*/
-static int do_warp(void)
-{
-    static int use = 1;
-    int x, y;
-
-    static Objects objects[] = {
-	MENU("RASTER REDRAW", rast_redraw, &use),
-	INFO("Overlay vectors on raster image? ", &use),
-	MENU("NO", no_warp, &use),
-	MENU("YES", warp, &use),
-	{0}
-    };
-    x = (SCREEN_LEFT + SCREEN_RIGHT) / 2;
-    y = SCREEN_BOTTOM;
-    Set_mouse_xy(x, y);
-    Input_pointer(objects);
-    return 1;
-}
-
-static int no_warp(void)
-{
-    return -1;
-}
-
-static int warp(void)
-{
-    warpvect(group.E21, group.N21, trans_order);
-    return -1;
-}
-
-static int rast_redraw(void)
-{
-    Erase_view(VIEW_MAP1);
-    drawcell(VIEW_MAP1, 0);	/* 0 means don't initialize VIEW_MAP2 */
-    display_points(1);
-    return 0;
-}
-
-
-static int uparrow(struct box *box, int color)
-{
-    R_standard_color(color);
-    Uparrow(box->top + edge, box->bottom - edge, box->left + edge,
-	    box->right - edge);
-
-    return 0;
-}
-
-static int downarrow(struct box *box, int color)
-{
-    R_standard_color(color);
-    Downarrow(box->top + edge, box->bottom - edge, box->left + edge,
-	      box->right - edge);
-
-    return 0;
-}
-
-static int pick(int x, int y)
-{
-    int n;
-    int cur;
-
-    cur = which;
-    cancel_which();
-    if (inbox(&more, x, y)) {
-	if (curp >= group.points.count)
-	    return 0;
-	first_point = curp;
-	pager = 1;
-	return 1;
-    }
-    if (inbox(&less, x, y)) {
-	if (first_point == 0)
-	    return 0;
-	first_point -= nlines;
-	if (first_point < 0)
-	    first_point = 0;
-	pager = 1;
-	return 1;
-    }
-    if (!inbox(&report, x, y)) {
-	return 0;
-    }
-
-    n = (y - report.top) / height;
-    if (n == cur) {		/* second click! */
-	if (!delete_mode) {
-	    group.points.status[first_point + n] =
-		!group.points.status[first_point + n];
-	    compute_transformation();
-	    show_point(first_point + n, 1);
-	    return 1;
-	}
-	else {
-	    delete_control_point(first_point + n);
-	    first_point = 0;
-	    compute_transformation();
-	    pager = 1;
-	    return 1;
-	}
-    }
-
-    /* first click */
-    which = n;
-    show_point(first_point + n, 0);
-    if (!delete_mode)
-	R_standard_color(RED);
-    else
-	R_standard_color(ORANGE);
-
-    Outline_box((report.top + n * height) + 1, report.top + (n + 1) * height,
-		report.left, report.right - 1);
-
-    R_flush();
-
-    return 0;			/* ignore first click */
-
-}
-
-static int done(void)
-{
-    cancel_which();
-    return -1;
-}
-
-static int cancel_which(void)
-{
-    if (which >= 0) {
-	R_standard_color(BACKGROUND);
-	Outline_box((report.top + which * height) + 1,
-		    report.top + (which + 1) * height, report.left,
-		    report.right - 1);
-	show_point(first_point + which, 1);
-    }
-    which = -1;
-
-    return 0;
-}
-
-static int inbox(struct box *box, int x, int y)
-{
-    return (x > box->left && x < box->right && y > box->top &&
-	    y < box->bottom);
-}
-
-static int dotext(char *text, int top, int bottom, int left, int right,
-		  int centered, int color)
-{
-    R_standard_color(BACKGROUND);
-    R_box_abs(left, top, right, bottom);
-    R_standard_color(color);
-    R_move_abs(left + 1 + edge, bottom - 1 - edge);
-    if (centered)
-	R_move_rel((right - left - strlen(text) * size) / 2, 0);
-    R_set_window(top, bottom, left, right);	/* for text clipping */
-    R_text(text);
-    R_set_window(SCREEN_TOP, SCREEN_BOTTOM, SCREEN_LEFT, SCREEN_RIGHT);
-
-    return 0;
-}
-
-static int compute_transformation(void)
-{				/* returns 0 on success, 1 on fail */
-    int n, count;
-    double d, d1, d2, sum;
-    double e1, e2, n1, n2;
-    double xval, yval, gval;
-    static int order_pnts[3] = { 3, 6, 10 };
-    char msg[40];
-
-    xmax = ymax = gmax = 0;
-    xval = yval = gval = 0.0;
-
-    CRS_Compute_equation(trans_order);
-    if (group.equation_stat <= 0) {
-	if (group.equation_stat == 0) {
-	    sprintf(msg, "Not Enough Points -- %d are required.",
-		    order_pnts[trans_order - 1]);
-	    Menu_msg(msg);
-	    G_sleep(2);
-	}
-	return 1;
-    }
-
-
-    /* compute the row,col error plus ground error 
-     * keep track of largest and second largest error
-     */
-    sum = 0.0;
-    rms = 0.0;
-    count = 0;
-    for (n = 0; n < group.points.count; n++) {
-	if (group.points.status[n] <= 0)
-	    continue;
-	count++;
-	CRS_georef(group.points.e2[n], group.points.n2[n], &e1, &n1,
-		   group.E21, group.N21, trans_order);
-	CRS_georef(group.points.e1[n], group.points.n1[n], &e2, &n2,
-		   group.E12, group.N12, trans_order);
-
-	if ((d = xres[n] = e1 - group.points.e1[n]) < 0)
-	    d = -d;
-	if (d > xval) {
-	    xmax = n;
-	    xval = d;
-	}
-
-	if ((d = yres[n] = n1 - group.points.n1[n]) < 0)
-	    d = -d;
-	if (d > yval) {
-	    ymax = n;
-	    yval = d;
-	}
-
-	/* compute ground error (ie along diagonal) */
-	d1 = e2 - group.points.e2[n];
-	d2 = n2 - group.points.n2[n];
-	d = d1 * d1 + d2 * d2;
-	sum += d;		/* add it to rms sum, before taking sqrt */
-	d = sqrt(d);
-	gnd[n] = d;
-	if (d > gval) {		/* is this one the max? */
-	    gmax = n;
-	    gval = d;
-	}
-    }
-
-    /* compute overall rms error */
-    if (count)
-	rms = sqrt(sum / count);
-
-    return 0;
-}
-
-static int to_file(void)
-{
-    FILE *fd;
-    char msg[1024];
-
-    cancel_which();
-    if (Input_other(askfile, "Keyboard") < 0) {
-	return 0;
-    }
-
-    fd = fopen(buf, "w");
-    if (fd == NULL) {
-	sprintf(msg, "** Unable to create file %s\n", buf);
-	Beep();
-	Curses_write_window(PROMPT_WINDOW, 2, 1, msg);
-    }
-    else {
-	do_report(fd);
-	fclose(fd);
-	sprintf(msg, "Report saved in file %s\n", buf);
-	Curses_write_window(PROMPT_WINDOW, 2, 1, msg);
-    }
-    return 0;
-}
-
-static int askfile(void)
-{
-    char file[GNAME_MAX];
-
-    while (1) {
-	Curses_prompt_gets("Enter file to hold report: ", file);
-	G_strip(file);
-	if (*file == 0)
-	    return -1;
-	if (G_index(file, '/'))
-	    strcpy(buf, file);
-	else
-	    sprintf(buf, "%s/%s", G_home(), file);
-	if (access(buf, 0) != 0)
-	    return 1;
-	sprintf(buf, "** %s already exists. choose another file", file);
-	Beep();
-	Curses_write_window(PROMPT_WINDOW, 2, 1, buf);
-    }
-
-    return 0;
-}
-
-static int to_printer(void)
-{
-    FILE *fd;
-
-    cancel_which();
-    Menu_msg("Sending report to printer ...");
-    Curses_write_window(PROMPT_WINDOW, 1, 1, "Sending report to printer ...");
-    fd = popen("lp", "w");
-    do_report(fd);
-    pclose(fd);
-    return 0;
-}
-
-static int do_report(FILE * fd)
-{
-    char buf[100];
-    int n;
-    int width;
-
-    fprintf(fd, "LOCATION: %-20s GROUP: %-20s MAPSET: %s\n\n",
-	    G_location(), group.name, G_mapset());
-    fprintf(fd, "%15sAnalysis of control point registration\n\n", "");
-    fprintf(fd, "%s   %s\n", LHEAD1, RHEAD1);
-    fprintf(fd, "%s   %s\n", LHEAD2, RHEAD2);
-
-    FMT1(buf, 0.0, 0.0, 0.0);
-    width = strlen(buf);
-
-    for (n = 0; n < group.points.count; n++) {
-	FMT0(buf, n + 1);
-	fprintf(fd, "%s", buf);
-	if (group.equation_stat > 0 && group.points.status[n] > 0) {
-	    FMT1(buf, xres[n], yres[n], gnd[n]);
-	    fprintf(fd, "%s", buf);
-	}
-	else if (group.points.status[n] > 0)
-	    printcentered(fd, "?", width);
-	else
-	    printcentered(fd, "not used", width);
-	FMT2(buf,
-	     group.points.e1[n],
-	     group.points.n1[n], group.points.e2[n], group.points.n2[n]);
-	fprintf(fd, "   %s\n", buf);
-    }
-    fprintf(fd, "\n");
-    if (group.equation_stat < 0)
-	fprintf(fd, "Poorly place control points\n");
-    else if (group.equation_stat == 0)
-	fprintf(fd, "No active control points\n");
-    else
-	fprintf(fd,
-		"Overall rms error: %.2f                %s Transformation\n",
-		rms, order_msg);
-
-    return 0;
-}
-
-static int printcentered(FILE * fd, char *buf, int width)
-{
-    int len;
-    int n;
-    int i;
-
-    len = strlen(buf);
-    n = (width - len) / 2;
-
-    for (i = 0; i < n; i++)
-	fprintf(fd, " ");
-    fprintf(fd, "%s", buf);
-    i += len;
-    while (i++ < width)
-	fprintf(fd, " ");
-
-    return 0;
-}
-
-static int show_point(int n, int true_color)
-{
-    if (!true_color)
-	R_standard_color(ORANGE);
-    else if (group.points.status[n])
-	R_standard_color(GREEN);
-    else
-	R_standard_color(RED);
-
-    display_one_point(VIEW_MAP1, group.points.e1[n], group.points.n1[n]);
-
-    return 0;
-}
-
-static int get_order(void)
-{
-    static int use = 1;
-
-    static Objects objects[] = {
-	INFO("Select order of transformation->", &use),
-	MENU("1st Order", do_1st, &use),
-	MENU("2nd Order", do_2nd, &use),
-	MENU("3rd Order", do_3rd, &use),
-	{0}
-    };
-
-    if (Input_pointer(objects) < 0)
-	return -1;
-
-    return 1;
-
-}
-
-int analyze(void)
-{
-    static int use = 1;
-
-    static Objects objects[] = {
-	MENU("DONE", done, &use),
-	MENU("PRINT", to_printer, &use),
-	MENU("FILE", to_file, &use),
-	MENU("OVERLAY", do_warp, &use),
-	MENU(delete_msg, delete_mark, &use),
-	INFO("Transform->", &use),
-	MENU(order_msg, get_order, &use),
-	INFO(pick_msg, &use),
-	OTHER(pick, &use),
-	{0}
-    };
-
-    int color;
-    int tsize;
-    int cury;
-    int len;
-    int line;
-    int top, bottom, left, right, width, middle, nums;
-
-    /* to give user a response of some sort */
-    Menu_msg("Preparing analysis ...");
-
-    /*
-     * build a popup window at center of the screen.
-     * 35% the height and wide enough to hold the report
-     *
-     */
-
-    /* height of 1 line, based on NLINES taking up 35% vertical space */
-    height = (.35 * (SCREEN_BOTTOM - SCREEN_TOP)) / NLINES + 1;
-
-    /* size of text, 80% of line height */
-    tsize = .8 * height;
-    size = tsize - 2;		/* fudge for computing pixels width of text */
-
-    /* indent for the text */
-    edge = .1 * height + 1;
-
-    /* determine the length, in chars, of printed line */
-    FMT0(buf, 0);
-    nums = strlen(buf) * size;
-    FMT1(buf, 0.0, 0.0, 0.0);
-    len = strlen(buf);
-    middle = len * size;
-    FMT2(buf, 0.0, 0.0, 0.0, 0.0);
-    len += strlen(buf);
-
-    /* width is for max chars plus sidecar for more/less */
-    width = len * size + nums + 2 * height;
-    if ((SCREEN_RIGHT - SCREEN_LEFT) < width)
-	width = SCREEN_RIGHT - SCREEN_LEFT;
-
-
-    /* define the window */
-    bottom = VIEW_MENU->top - 1;
-    top = bottom - height * NLINES;
-
-
-    left = SCREEN_LEFT;
-    right = left + width;
-    middle += left + nums;
-    nums += left;
-
-    /* save what is under this area, so it can be restored */
-    R_panel_save(tempfile1, top, bottom + 1, left, right + 1);
-
-
-    /* fill it with white */
-    R_standard_color(BACKGROUND);
-    R_box_abs(left, top, right, bottom);
-
-    right -= 2 * height;	/* reduce it to exclude sidecar */
-
-    /* print messages in message area */
-    R_text_size(tsize, tsize);
-
-
-    /* setup the more/less boxes in the sidecar */
-    R_standard_color(BLACK);
-    less.top = top;
-    less.bottom = top + 2 * height;
-    less.left = right;
-    less.right = right + 2 * height;
-    Outline_box(less.top, less.bottom, less.left, less.right);
-
-    more.top = bottom - 2 * height;
-    more.bottom = bottom;
-    more.left = right;
-    more.right = right + 2 * height;
-    Outline_box(more.top, more.bottom, more.left, more.right);
-
-    /*
-     * top two lines are for column labels
-     * last two line is for overall rms error.
-     */
-    nlines = NLINES - 3;
-    first_point = 0;
-
-    /* allocate predicted values */
-    xres = (double *)G_calloc(group.points.count, sizeof(double));
-    yres = (double *)G_calloc(group.points.count, sizeof(double));
-    gnd = (double *)G_calloc(group.points.count, sizeof(double));
-
-    /* compute transformation for the first time */
-    compute_transformation();
-
-    /* put head on the report */
-    cury = top;
-    dotext(LHEAD1, cury, cury + height, left, middle, 0, BLACK);
-    dotext(RHEAD1, cury, cury + height, middle, right - 1, 0, BLACK);
-    cury += height;
-    dotext(LHEAD2, cury, cury + height, left, middle, 0, BLACK);
-    dotext(RHEAD2, cury, cury + height, middle, right - 1, 0, BLACK);
-    cury += height;
-    R_move_abs(left, cury - 1);
-    R_cont_abs(right, cury - 1);
-
-    /* isolate the sidecar */
-    R_move_abs(right, top);
-    R_cont_abs(right, bottom);
-
-    /* define report box */
-    report.top = cury;
-    report.left = left;
-    report.right = right;
-
-    /* lets do it */
-
-    pager = 1;
-    while (1) {
-	R_text_size(tsize, tsize);
-	line = 0;
-	curp = first_point;
-	cury = top + 2 * height;
-	while (1) {
-	    if (line >= nlines || curp >= group.points.count)
-		break;
-	    line++;
-
-	    if (!delete_mode)
-		color = BLACK;
-	    else
-		color = BLUE;
-
-	    if (group.equation_stat > 0 && group.points.status[curp] > 0) {
-		/* color = BLACK; */
-		FMT1(buf, xres[curp], yres[curp], gnd[curp]);
-		if (curp == xmax || curp == ymax || curp == gmax)
-		    color = RED;
-		dotext(buf, cury, cury + height, nums, middle, 0, color);
-	    }
-	    else if (group.points.status[curp] > 0)
-		dotext("?", cury, cury + height, nums, middle, 1, color);
-	    else
-		dotext("not used", cury, cury + height, nums, middle, 1,
-		       color);
-
-	    if (pager) {
-		FMT0(buf, curp + 1);
-		dotext(buf, cury, cury + height, left, nums, 0, color);
-		FMT2(buf,
-		     group.points.e1[curp],
-		     group.points.n1[curp],
-		     group.points.e2[curp], group.points.n2[curp]);
-		dotext(buf, cury, cury + height, middle, right - 1, 0, color);
-	    }
-	    cury += height;
-	    curp++;
-	}
-	report.bottom = cury;
-	downarrow(&more, curp < group.points.count ? color : BACKGROUND);
-	uparrow(&less, first_point > 0 ? color : BACKGROUND);
-	R_standard_color(BACKGROUND);
-	R_box_abs(left, cury, right - 1, bottom);
-	if (group.equation_stat < 0) {
-
-	    if (group.equation_stat == -1) {
-		color = RED;
-		strcpy(buf, "Poorly placed control points");
-	    }
-	    else {
-		if (group.equation_stat == -2)
-		    G_fatal_error("NOT ENOUGH MEMORY");
-		else
-		    G_fatal_error("PARAMETER ERROR");
-	    }
-
-	}
-	else if (group.equation_stat == 0) {
-	    color = RED;
-	    strcpy(buf, "No active control points");
-	}
-	else {
-	    color = BLACK;
-	    sprintf(buf, "Overall rms error: %.2f", rms);
-	}
-	dotext(buf, bottom - height, bottom, left, right - 1, 0, color);
-	R_standard_color(BLACK);
-	R_move_abs(left, bottom - height);
-	R_cont_abs(right - 1, bottom - height);
-
-	pager = 0;
-	which = -1;
-	if (Input_pointer(objects) < 0)
-	    break;
-	display_points(1);
-    }
-
-    /* all done. restore what was under the window */
-    right += 2 * height;	/* move it back over the sidecar */
-    R_standard_color(BACKGROUND);
-    R_box_abs(left, top, right, bottom);
-    R_panel_restore(tempfile1);
-    R_panel_delete(tempfile1);
-    R_flush();
-
-    G_free(xres);
-    G_free(yres);
-    G_free(gnd);
-    I_put_control_points(group.name, &group.points);
-    display_points(1);
-    return 0;			/* return but don't QUIT */
-}

+ 0 - 386
imagery/i.vpoints/ask.c

@@ -1,386 +0,0 @@
-#include <string.h>
-#include <grass/display.h>
-#include "globals.h"
-
-#define NLINES 18
-struct box
-{
-    int top, bottom, left, right;
-};
-
-static int text_size;
-static int which;
-static struct box cancel, more, less;
-static int height, size, edge, count;
-static int page, npages;
-static struct
-{
-    char name[100], mapset[100];
-    struct box box;
-} list[NLINES * 2];
-
-static int dobox(struct box *, char *, int, int, int, int, int);
-static int uparrow(struct box *, int);
-static int downarrow(struct box *, int);
-static int pick(int, int, int);
-static int inbox(struct box *, int, int);
-static int cancel_which(void);
-static int dotext(char *, int, int, int, int, int);
-
-int ask_gis_files(char *type, char *file, char *xname, char *xmapset,
-		  int position)
-{
-    static int use = 1;
-    static Objects objects[] = {
-	OTHER(pick, &use),
-	{0}
-    };
-
-    char msg[100];
-    FILE *fd;
-    int width;
-    int len1, len2, len;
-    long offset;
-    long *page_offset;
-    int col, nlist;
-    int line;
-    int stat;
-    char buf[100];
-    int top, bottom, left, right, center;
-    int topx, bottomx, leftx, rightx, widthx;
-    char name[100], mapset[100], cur_mapset[100];
-    int new_mapset;
-
-    Menu_msg("");
-
-    fd = fopen(file, "r");
-    if (fd == NULL)
-	G_fatal_error("ask_gis_files: can't read tempfile");
-    if (fread(&len1, sizeof(len1), 1, fd) != 1
-	|| fread(&len2, sizeof(len2), 1, fd) != 1 || len1 <= 0 || len2 <= 0) {
-	fclose(fd);
-	return 0;
-    }
-
-    sprintf(msg, "Double click on %s file to be plotted", type);
-
-    /*
-     * build a popup window at center of the screen.
-     * 35% the height and wide enough to hold 2 columms of file names
-     *
-     * the window is for choosing file names and will be laid out in 2 columns
-     *
-     *             ------------------------------------------
-     *             |     CANCEL           | (MORE) | (LESS) | 
-     *             ------------------------------------------
-     *             |             mapset                     |
-     *             ------------------------------------------
-     *             |      name1        |   name2            |
-     *             ------------------------------------------
-     *             |      name3        |   name4            |
-     *             ------------------------------------------
-     *             |      name5        |   name6            |
-     *             |                   .                    |
-     *             |                   .                    |
-     *             |                   .                    |
-     *             ------------------------------------------
-     */
-
-    /* height of 1 line, based on NLINES taking up 35% vertical space */
-    height = (.35 * (SCREEN_BOTTOM - SCREEN_TOP)) / NLINES + 1;
-
-    /* size of text, 80% of line height */
-    text_size = .8 * height;
-    size = text_size - 1;	/* fudge for computing pixels width of text */
-
-    /* indent for the text */
-    edge = .1 * height + 1;
-
-    /* this is a fudge to determine the length of the largest text */
-    len1 = 2 * len1;		/* name in 2 columns */
-    len2 += strlen("mapset ");
-    len = (len1 > len2 ? len1 : len2);
-
-    /* width is for max chars plus sidecar for more/less */
-    width = len * size + height;
-    widthx = strlen(msg) * size;
-    if (widthx < width)
-	widthx = width;
-
-    /* define the window */
-    top = (SCREEN_TOP + SCREEN_BOTTOM - height * NLINES) / 2;
-    bottom = top + height * NLINES;
-
-    center = (SCREEN_LEFT + SCREEN_RIGHT) / 2;
-    if (position > 0) {
-	right = (center + SCREEN_RIGHT + width) / 2;
-	if (right >= SCREEN_RIGHT)
-	    right = SCREEN_RIGHT - 1;
-	left = right - width;
-    }
-    else if (position < 0) {
-	left = (center + SCREEN_LEFT - width) / 2;
-	if (left <= SCREEN_LEFT)
-	    left = SCREEN_LEFT + 1;
-	right = left + width;
-    }
-    else {
-	left = center + width / 2;
-	right = left + width;
-    }
-
-    topx = top - 3 * height;
-    bottomx = topx + 2 * height;
-    leftx = (left + right - widthx) / 2;
-    if (leftx < SCREEN_LEFT)
-	leftx = SCREEN_LEFT;
-    rightx = leftx + widthx;
-
-    /* save what is under these areas, so they can be restored */
-    R_panel_save(tempfile1, top, bottom + 1, left, right + 1);
-    R_panel_save(tempfile2, topx, bottomx + 1, leftx, rightx + 1);
-
-    /* fill it top with GREY, pick area with white */
-    R_standard_color(WHITE);
-    R_box_abs(left, top, right, bottom);
-    R_standard_color(GREY);
-    R_box_abs(leftx, topx, rightx, bottomx);
-
-    R_standard_color(BLACK);
-    Outline_box(top, bottom, left, right);
-    right -= height;		/* reduce it to exclude sidecar */
-    Outline_box(top, bottom, left, right);
-
-    /* print messages above the files */
-    dotext(msg, topx, topx + height, leftx, rightx, 1);
-    dotext("Double click here to cancel", topx + height, bottomx, leftx,
-	   rightx, 1);
-    cancel.top = topx;
-    cancel.bottom = bottomx;
-    cancel.left = leftx;
-    cancel.right = rightx;
-
-    /* start the mouse in the cancel box */
-    Set_mouse_xy((leftx + rightx) / 2, (topx + bottomx) / 2);
-
-    dobox(&less, "", WHITE, top, right, right + height, 0);
-    dobox(&more, "", WHITE, bottom - height, right, right + height, 0);
-
-    /* as we read the file of names, keep track of pages so we can
-     * page backward
-     */
-    page = 0;
-    page_offset = (long *)G_calloc(npages = 1, sizeof(long));
-    *page_offset = G_ftell(fd);
-
-    nlist = sizeof(list) / sizeof(list[0]);
-    for (stat = -1; stat < 0;) {
-	line = 0;
-	count = 0;
-	*cur_mapset = 0;
-	col = 0;
-	while (1) {
-	    offset = G_ftell(fd);
-	    if (fgets(buf, sizeof buf, fd) == NULL
-		|| sscanf(buf, "%s %s", name, mapset) != 2)
-		break;
-	    if (new_mapset = (strcmp(cur_mapset, mapset) != 0)) {
-		if (line)
-		    line++;
-		if (col)
-		    line++;
-		col = 0;
-	    }
-	    if (count >= nlist || line + new_mapset >= NLINES) {
-		if (page + 1 == npages) {
-		    npages++;
-		    page_offset =
-			(long *)G_realloc(page_offset, npages * sizeof(long));
-		    page_offset[npages - 1] = offset;
-		}
-		break;
-	    }
-	    if (new_mapset) {
-		struct box dummy;
-		char label[100];
-
-		strcpy(cur_mapset, mapset);
-		sprintf(label, "Mapset %s", mapset);
-		dobox(&dummy, label, WHITE, top + line * height, left, right,
-		      0);
-		line++;
-	    }
-	    if (col) {
-		dobox(&list[count].box, name, GREY, top + line * height,
-		      left + width / 2, right, 0);
-		line++;
-		col = 0;
-	    }
-	    else {
-		dobox(&list[count].box, name, GREY, top + line * height, left,
-		      left + width / 2, 0);
-		col = 1;
-	    }
-	    strcpy(list[count].name, name);
-	    strcpy(list[count].mapset, mapset);
-	    count++;
-	}
-	downarrow(&more, page + 1 < npages ? BLACK : WHITE);
-	uparrow(&less, page > 0 ? BLACK : WHITE);
-	which = -1;
-	switch (Input_pointer(objects)) {
-	case -1:		/* more or less */
-	    break;
-	case -2:		/* cancel */
-	    stat = 0;
-	    continue;
-	default:		/* file picked */
-	    strcpy(xname, list[which].name);
-	    strcpy(xmapset, list[which].mapset);
-	    stat = 1;
-	    continue;
-	}
-	G_fseek(fd, page_offset[page], 0);
-	R_standard_color(WHITE);
-	R_box_abs(left + 1, top + 1, right - 1, bottom - 1);
-    }
-
-    /* all done. restore what was under the window */
-    right += height;		/* move it back over the sidecar */
-    R_standard_color(WHITE);
-    R_box_abs(left, top, right, bottom);
-    R_panel_restore(tempfile1);
-    R_panel_restore(tempfile2);
-    R_panel_delete(tempfile1);
-    R_panel_delete(tempfile2);
-    R_flush();
-
-    G_free(page_offset);
-    return stat;
-}
-
-static int dobox(struct box *box,
-		 char *text, int color, int top, int left, int right,
-		 int centered)
-{
-    int bottom;
-
-    bottom = top + height;
-    /* fill inside of box with color */
-    R_standard_color(color);
-    R_box_abs(left + 1, top + 1, right - 1, bottom - 1);
-
-    /* draw box outline and text in black */
-    R_standard_color(BLACK);
-    Outline_box(top, bottom, left, right);
-    dotext(text, top, bottom, left, right, centered);
-    R_flush();
-
-    box->top = top;
-    box->bottom = bottom;
-    box->left = left;
-    box->right = right;
-
-    return 0;
-}
-
-static int uparrow(struct box *box, int color)
-{
-    R_standard_color(color);
-    Uparrow(box->top + edge, box->bottom - edge, box->left + edge,
-	    box->right - edge);
-
-    return 0;
-}
-
-static int downarrow(struct box *box, int color)
-{
-    R_standard_color(color);
-    Downarrow(box->top + edge, box->bottom - edge, box->left + edge,
-	      box->right - edge);
-
-    return 0;
-}
-
-static int pick(int x, int y, int button)
-{
-    int n;
-
-    if (inbox(&more, x, y)) {
-	cancel_which();
-	if (page + 1 >= npages)
-	    return 0;
-	page++;
-	return -1;
-    }
-    if (inbox(&less, x, y)) {
-	cancel_which();
-	if (page == 0)
-	    return 0;
-	page--;
-	return -1;
-    }
-    if (inbox(&cancel, x, y)) {
-	if (which == -2)
-	    return -2;
-	cancel_which();
-	which = -2;
-	R_standard_color(RED);
-	Outline_box(cancel.top, cancel.bottom, cancel.left, cancel.right);
-	R_flush();
-	return 0;
-    }
-    /* search name list. handle double click */
-    for (n = 0; n < count; n++)
-	if (inbox(&list[n].box, x, y)) {
-	    if (n == which)	/* second click! */
-		return 1;
-	    cancel_which();
-	    which = n;
-	    R_standard_color(RED);
-	    Outline_box(list[n].box.top, list[n].box.bottom,
-			list[n].box.left, list[n].box.right);
-	    R_flush();
-	    return 0;		/* ignore first click */
-	}
-
-    cancel_which();
-    return 0;
-}
-
-static int cancel_which(void)
-{
-    if (which == -2) {
-	R_standard_color(BLACK);
-	Outline_box(cancel.top, cancel.bottom, cancel.left, cancel.right);
-    }
-    else if (which >= 0) {
-	R_standard_color(BLACK);
-	Outline_box(list[which].box.top, list[which].box.bottom,
-		    list[which].box.left, list[which].box.right);
-    }
-    which = -1;
-    R_flush();
-
-    return 0;
-}
-
-static int inbox(struct box *box, int x, int y)
-{
-    return (x > box->left && x < box->right && y > box->top &&
-	    y < box->bottom);
-}
-
-static int dotext(char *text,
-		  int top, int bottom, int left, int right, int centered)
-{
-    R_text_size(text_size, text_size);
-    R_move_abs(left + 1 + edge, bottom - 1 - edge);
-    if (centered)
-	R_move_rel((right - left - strlen(text) * size) / 2, 0);
-    R_set_window(top, bottom, left, right);	/* for text clipping */
-    R_text(text);
-    R_set_window(SCREEN_TOP, SCREEN_BOTTOM, SCREEN_LEFT, SCREEN_RIGHT);
-
-    return 0;
-}

+ 0 - 164
imagery/i.vpoints/ask_mag.c

@@ -1,164 +0,0 @@
-#include "globals.h"
-#include <grass/display.h>
-
-struct box
-{
-    int top, bottom, left, right;
-};
-
-static struct box plus, minus, value;
-static struct box cancel, accept;
-static int mag;
-
-static int dotext(char *, int, int, int, int, int);
-static int inbox(struct box *, int, int);
-static int incr(int, int);
-
-int ask_magnification(int *magnification)
-{
-    static int use = 1;
-    int x, y;
-    int height;
-    int stat;
-    int width;
-    int top, bottom, left, right;
-
-    static Objects objects[] = {
-	OTHER(incr, &use),
-	{0}
-    };
-
-    Menu_msg("");
-
-    mag = *magnification;
-    if (mag < 1)
-	mag = 1;
-
-    height = VIEW_MENU->nrows;
-    R_text_size(height - 4, height - 4);
-
-
-    Get_mouse_xy(&x, &y);
-    top = y - height / 2;
-    if (top < SCREEN_TOP)
-	top = SCREEN_TOP;
-    bottom = top + 4 * height;
-    if (bottom >= VIEW_MENU->top) {
-	top -= bottom - (VIEW_MENU->top - 1);
-	bottom = VIEW_MENU->top - 1;
-    }
-    width = Text_width("MAGNIFICATION") + 4;
-    left = x - width / 2;
-    if (left < SCREEN_LEFT)
-	left = SCREEN_LEFT;
-    right = left + width;
-    if (right > SCREEN_RIGHT) {
-	left -= right - SCREEN_RIGHT;
-	right = SCREEN_RIGHT;
-    }
-
-    R_panel_save(tempfile1, top, bottom, left, right);
-    R_standard_color(WHITE);
-    R_box_abs(left, top, right, bottom);
-    R_standard_color(BLACK);
-    Outline_box(top, bottom, left, right);
-
-    plus.top = top + height;
-    plus.bottom = plus.top + height;
-    plus.left = left;
-    plus.right = plus.left + Text_width("++") + 4;
-    Outline_box(plus.top, plus.bottom, plus.left, plus.right);
-
-    minus.top = top + height;
-    minus.bottom = minus.top + height;
-    minus.right = right;
-    minus.left = minus.right - Text_width("--") - 4;
-    Outline_box(minus.top, minus.bottom, minus.left, minus.right);
-
-    value.top = top + height;
-    value.bottom = value.top + height;
-    value.left = plus.right;
-    value.right = minus.left;
-    Outline_box(value.top, value.bottom, value.left, value.right);
-
-    accept.top = value.bottom;
-    accept.bottom = accept.top + height;
-    accept.left = left;
-    accept.right = right;
-    Outline_box(accept.top, accept.bottom, accept.left, accept.right);
-
-    cancel.top = accept.bottom;
-    cancel.bottom = cancel.top + height;
-    cancel.left = left;
-    cancel.right = right;
-    Outline_box(cancel.top, cancel.bottom, cancel.left, cancel.right);
-
-    dotext("MAGNIFICATION", top, top + height, left, right, WHITE);
-    dotext("+", plus.top, plus.bottom, plus.left, plus.right, GREY);
-    dotext("-", minus.top, minus.bottom, minus.left, minus.right, GREY);
-    dotext("ACCEPT", accept.top, accept.bottom, accept.left, accept.right,
-	   GREY);
-    dotext("CANCEL", cancel.top, cancel.bottom, cancel.left, cancel.right,
-	   GREY);
-    draw_mag();
-
-    stat = Input_pointer(objects);
-
-    /* to respond to user */
-    R_standard_color(WHITE);
-    R_box_abs(left, top, right, bottom);
-    R_flush();
-
-    R_panel_restore(tempfile1);
-    R_panel_delete(tempfile1);
-
-    *magnification = mag;
-    return stat > 0;
-}
-
-int draw_mag(void)
-{
-    char buf[10];
-
-    sprintf(buf, "%d", mag);
-    dotext(buf, value.top, value.bottom, value.left, value.right, WHITE);
-
-    return 0;
-}
-
-static int incr(int x, int y)
-{
-    if (inbox(&accept, x, y))
-	return 1;
-    if (inbox(&cancel, x, y))
-	return -1;
-    if (inbox(&plus, x, y)) {
-	mag++;
-	draw_mag();
-    }
-    else if (inbox(&minus, x, y) && mag > 1) {
-	mag--;
-	draw_mag();
-    }
-    return 0;
-}
-
-static int dotext(char *text,
-		  int top, int bottom, int left, int right, int background)
-{
-    R_standard_color(background);
-    R_box_abs(left + 1, top + 1, right - 1, bottom - 1);
-    R_standard_color(BLACK);
-    /* center the text */
-    left = (left + right - Text_width(text)) / 2;
-    Text(text, top, bottom, left, right, 2);
-    R_flush();
-
-    return 0;
-}
-
-static int inbox(struct box *box, int x, int y)
-{
-    return (x > box->left && x < box->right && y > box->top &&
-	    y < box->bottom);
-}

+ 0 - 57
imagery/i.vpoints/call.c

@@ -1,57 +0,0 @@
-#include <stdlib.h>
-#include <unistd.h>
-#include <signal.h>
-#include <sys/types.h>
-#ifdef __MINGW32__
-#include <process.h>
-#else
-#include <sys/wait.h>
-#endif
-#include <grass/gis.h>
-#include <grass/display.h>
-#include "globals.h"
-/*
- * call a subroutine, but as a child process
- * allowing interrupts for the child
- */
-
-int call(int (*function) (void), char *msg)
-{
-    int pid;
-    int w, status;
-    char i_msg[80];
-
-    /*
-     * build interrupt msg
-     */
-    sprintf(i_msg, "Hit %s %s\n", G_unctrl(interrupt_char), msg);
-    /*
-     * make sure all graphics have gotten to the monitor
-     */
-    R_stabilize();
-
-    /* fork to create child */
-    pid = fork();
-    if (pid < 0) {
-	End_curses();
-	perror("Can't fork");
-	exit(1);
-    }
-
-    /* parent just waits for child */
-    Curses_allow_interrupts(1);
-    if (pid) {
-	Curses_write_window(PROMPT_WINDOW, 1, 1, i_msg);
-	while ((w = wait(&status)) != pid && w != -1) ;
-	Curses_allow_interrupts(0);
-	Curses_write_window(PROMPT_WINDOW, 1, 1, "\n");
-    }
-
-    /* child turns on interrupts and calls the function */
-    else {
-	signal(SIGINT, SIG_DFL);
-	(*function) ();
-	exit(0);
-    }
-    return 0;
-}

+ 0 - 89
imagery/i.vpoints/cell.c

@@ -1,89 +0,0 @@
-#include <unistd.h>
-#include "globals.h"
-
-static int use = 1;
-static int plot(int, int);
-static int cancel(void);
-static int choose_cellfile(char *, char *);
-
-
-int plotcell(int x, int y)
-{
-    static Objects objects[] = {
-	MENU("CANCEL", cancel, &use),
-	INFO("Indicate which side should be plotted", &use),
-	OTHER(plot, &use),
-	{0}
-    };
-    /*
-     * if the target raster map list is ready, ask the user which side
-     * should be plotted, otherwise can only plot group files
-     */
-    if (access(cell_list, 0) == 0)
-	Input_pointer(objects);
-    else
-	plot(VIEW_MAP1->left + 1, 0);
-
-    return 0;
-}
-
-static int cancel(void)
-{
-    return 1;
-}
-
-
-static int plot(int x, int y)
-{
-    char name[100], mapset[100];
-    struct Cell_head cellhd;
-
-    if (x > VIEW_MAP1->left && x < VIEW_MAP1->right) {
-	if (!choose_groupfile(name, mapset))
-	    return 1;
-	Rast_get_cellhd(name, mapset, &cellhd);
-
-	Erase_view(VIEW_MAP1_ZOOM);
-	VIEW_MAP1_ZOOM->cell.configured = 0;
-
-	G_adjust_window_to_box(&cellhd, &VIEW_MAP1->cell.head,
-			       VIEW_MAP1->nrows, VIEW_MAP1->ncols);
-	Configure_view(VIEW_MAP1, name, mapset, cellhd.ns_res, cellhd.ew_res);
-	drawcell(VIEW_MAP1, 0);
-    }
-    else if (x > VIEW_MAP2->left && x < VIEW_MAP2->right) {
-	if (!choose_cellfile(name, mapset))
-	    return 1;
-	select_target_env();
-
-	Rast_get_cellhd(name, mapset, &cellhd);
-
-	Erase_view(VIEW_MAP2_ZOOM);
-	VIEW_MAP2_ZOOM->cell.configured = 0;
-
-	G_adjust_window_to_box(&cellhd, &VIEW_MAP2->cell.head,
-			       VIEW_MAP2->nrows, VIEW_MAP2->ncols);
-	Configure_view(VIEW_MAP2, name, mapset, cellhd.ns_res, cellhd.ew_res);
-	select_target_env();
-	drawcell(VIEW_MAP2, 0);
-	select_current_env();
-	if (from_screen < 0) {
-	    from_flag = 1;
-	    from_screen = 0;
-	    if (from_keyboard < 0) {
-		from_keyboard = 0;
-		from_screen = 1;
-	    }
-	}
-    }
-    else
-	return 0;		/* ignore mouse click */
-
-    display_points(1);
-    return 1;
-}
-
-static int choose_cellfile(char *name, char *mapset)
-{
-    return ask_gis_files("raster", cell_list, name, mapset, 1);
-}

+ 0 - 31
imagery/i.vpoints/cellhd.c

@@ -1,31 +0,0 @@
-#include "globals.h"
-
-int Outline_cellhd(View * view, struct Cell_head *cellhd)
-{
-    int row, col;
-    int top, bottom, left, right;
-
-    row = northing_to_row(&view->cell.head, cellhd->north) + .5;
-    top = row_to_view(view, row);
-    if (top < view->top)
-	top = view->top;
-
-    col = easting_to_col(&view->cell.head, cellhd->west) + .5;
-    left = col_to_view(view, col);
-    if (left < view->left)
-	left = view->left;
-
-    row = northing_to_row(&view->cell.head, cellhd->south) + .5;
-    bottom = row_to_view(view, row);
-    if (bottom > view->bottom)
-	bottom = view->bottom;
-
-    col = easting_to_col(&view->cell.head, cellhd->east) + .5;
-    right = col_to_view(view, col);
-    if (right > view->right)
-	right = view->right;
-
-    Outline_box(top, bottom, left, right);
-
-    return 0;
-}

+ 0 - 236
imagery/i.vpoints/colors.c

@@ -1,236 +0,0 @@
-#include <grass/display.h>
-#include "globals.h"
-
-/*
-   static int set_blue(void);
-   static int set_gray(void);
-   static int set_green(void);
-   static int set_red(void);
-   static int set_white(void);
-   static int set_yellow(void);
-   static int set_cur_clr(int);
- */
-static int setmap_blue(void);
-static int setmap_gray(void);
-static int setmap_green(void);
-static int setmap_red(void);
-static int setmap_white(void);
-static int setmap_yellow(void);
-
-/* static int done(void); */
-
-int set_colors(struct Colors *colors)
-{
-    return 0;
-}
-
-#ifdef UNUSED
-int set_menu_colors(struct Colors *colors)
-{
-
-    /* SCREEN OUTLINE and CURSOR */
-    Rast_add_c_color_rule((CELL) 241, 180, 180, 180, (CELL) 241, 180, 180, 180,
-		     colors);
-    /* RED */
-    Rast_add_c_color_rule((CELL) 242, 200, 90, 90, (CELL) 242, 200, 90, 90,
-		     colors);
-    /* ORANGE */
-    Rast_add_c_color_rule((CELL) 243, 150, 100, 50, (CELL) 243, 150, 100, 50,
-		     colors);
-    /* YELLOW */
-    Rast_add_c_color_rule((CELL) 244, 200, 200, 10, (CELL) 244, 200, 200, 10,
-		     colors);
-    /* GREEN */
-    Rast_add_c_color_rule((CELL) 245, 90, 200, 90, (CELL) 245, 90, 200, 90,
-		     colors);
-    /* BLUE */
-    Rast_add_c_color_rule((CELL) 246, 90, 90, 200, (CELL) 246, 90, 90, 200,
-		     colors);
-    /* INDIGO */
-    Rast_add_c_color_rule((CELL) 247, 100, 100, 10, (CELL) 247, 100, 100, 10,
-		     colors);
-    /* VIOLET */
-    Rast_add_c_color_rule((CELL) 248, 150, 150, 10, (CELL) 248, 150, 150, 10,
-		     colors);
-    /* WHITE */
-    Rast_add_c_color_rule((CELL) 249, 250, 250, 250, (CELL) 249, 250, 250, 250,
-		     colors);
-    /* BLACK */
-    Rast_add_c_color_rule((CELL) 250, 0, 0, 0, (CELL) 250, 0, 0, 0, colors);
-    /* GRAY */
-    Rast_add_c_color_rule((CELL) 251, 180, 180, 180, (CELL) 251, 180, 180, 180,
-		     colors);
-    /* BROWN */
-    Rast_add_c_color_rule((CELL) 252, 100, 100, 30, (CELL) 252, 100, 100, 30,
-		     colors);
-    /* MAGENTA */
-    Rast_add_c_color_rule((CELL) 253, 150, 90, 150, (CELL) 253, 150, 90, 150,
-		     colors);
-    /* AQUA */
-    Rast_add_c_color_rule((CELL) 254, 50, 120, 120, (CELL) 254, 50, 120, 120,
-		     colors);
-    /*      */
-    Rast_add_c_color_rule((CELL) 255, 250, 0, 0, (CELL) 255, 250, 0, 0, colors);
-
-    set_colors(colors);
-
-    return 0;
-}
-#endif /* set_menu_colors */
-
-#ifdef UNUSED
-int cursor_color(void)
-{
-
-    static int use = 1;
-
-    static Objects objects[] = {
-	MENU("DONE", done, &use),
-	INFO("Pick a Color ->", &use),
-	MENU("BLUE", set_blue, &use),
-	MENU("GRAY", set_gray, &use),
-	MENU("GREEN", set_green, &use),
-	MENU("RED", set_red, &use),
-	MENU("WHITE", set_white, &use),
-	MENU("YELLOW", set_yellow, &use),
-	{0}
-    };
-
-    Input_pointer(objects);
-    return 0;			/* return but don't quit */
-}
-
-static int set_blue(void)
-{
-    set_cur_clr(BLUE);
-    return 0;
-}
-
-static int set_gray(void)
-{
-    set_cur_clr(GREY);
-    return 0;
-}
-
-static int set_green(void)
-{
-    set_cur_clr(GREEN);
-    return 0;
-}
-
-static int set_red(void)
-{
-    set_cur_clr(RED);
-    return 0;
-}
-
-static int set_white(void)
-{
-    set_cur_clr(WHITE);
-    return 0;
-}
-
-static int set_yellow(void)
-{
-    set_cur_clr(YELLOW);
-    return 0;
-}
-
-static int set_cur_clr(int curs_color)
-{
-    struct Colors *colors;
-
-    colors = &VIEW_MAP1->cell.colors;
-
-    switch (curs_color) {
-    case BLUE:
-	Rast_add_c_color_rule((CELL) 241, 90, 90, 200, (CELL) 241, 90, 90, 200,
-			 colors);
-	break;
-
-    case GRAY:
-	Rast_add_c_color_rule((CELL) 241, 180, 180, 180, (CELL) 241, 180, 180, 180,
-			 colors);
-	break;
-
-    case GREEN:
-	Rast_add_c_color_rule((CELL) 241, 90, 200, 90, (CELL) 241, 90, 200, 90,
-			 colors);
-	break;
-
-    case RED:
-	Rast_add_c_color_rule((CELL) 241, 200, 90, 90, (CELL) 241, 200, 90, 90,
-			 colors);
-	break;
-
-    case WHITE:
-	Rast_add_c_color_rule((CELL) 241, 250, 250, 250, (CELL) 241, 250, 250, 250,
-			 colors);
-	break;
-
-    case YELLOW:
-	Rast_add_c_color_rule((CELL) 241, 200, 200, 10, (CELL) 241, 200, 200, 10,
-			 colors);
-	break;
-    }
-
-    set_colors(colors);
-    return 0;
-}
-#endif /* unused cursor color */
-
-int get_vector_color(void)
-{
-    static int use = 1;
-
-    static Objects objects[] = {
-	INFO("Pick color for vectors ->", &use),
-	MENU("BLUE", setmap_blue, &use),
-	MENU("GRAY", setmap_gray, &use),
-	MENU("GREEN", setmap_green, &use),
-	MENU("RED", setmap_red, &use),
-	MENU("WHITE", setmap_white, &use),
-	MENU("YELLOW", setmap_yellow, &use),
-	{0}
-    };
-
-    Input_pointer(objects);
-    return 0;			/* return but don't quit */
-}
-
-static int setmap_blue(void)
-{
-    return line_color = BLUE;
-}
-
-static int setmap_gray(void)
-{
-    return line_color = GREY;
-}
-
-static int setmap_green(void)
-{
-    return line_color = GREEN;
-}
-
-static int setmap_red(void)
-{
-    return line_color = RED;
-}
-
-static int setmap_white(void)
-{
-    return line_color = WHITE;
-}
-
-static int setmap_yellow(void)
-{
-    return line_color = YELLOW;
-}
-
-#ifdef UNUSED
-static int done(void)
-{
-    return -1;
-}
-#endif /* unused cursor color */

+ 0 - 49
imagery/i.vpoints/conv.c

@@ -1,49 +0,0 @@
-#include "globals.h"
-/* conversion routines to convert from view x,y to cell col,row
- * as well as cell col,row to cell east,north
- */
-int view_to_col(View * view, int x)
-{
-    return x - view->cell.left;
-}
-
-int view_to_row(View * view, int y)
-{
-    return y - view->cell.top;
-}
-
-int col_to_view(View * view, int col)
-{
-    return view->cell.left + col;
-}
-
-int row_to_view(View * view, int row)
-{
-    return view->cell.top + row;
-}
-
-/* in these next 2 routines, location determines if we are
- * converting from center of the cell (location == .5)
- * top or left edge (location == 0.0)
- * bottom or right edge (location == 1.0)
- */
-
-double row_to_northing(struct Cell_head *cellhd, int row, double location)
-{
-    return cellhd->north - (row + location) * cellhd->ns_res;
-}
-
-double col_to_easting(struct Cell_head *cellhd, int col, double location)
-{
-    return cellhd->west + (col + location) * cellhd->ew_res;
-}
-
-double northing_to_row(struct Cell_head *cellhd, double north)
-{
-    return (cellhd->north - north) / cellhd->ns_res;
-}
-
-double easting_to_col(struct Cell_head *cellhd, double east)
-{
-    return (east - cellhd->west) / cellhd->ew_res;
-}

+ 0 - 711
imagery/i.vpoints/crs.c

@@ -1,711 +0,0 @@
-
-/***************************************************************************/
-
-/***************************************************************************/
-/*
-   CRS.C - Center for Remote Sensing rectification routines
-
-   Written By: Brian J. Buckley
-
-   At: The Center for Remote Sensing
-   Michigan State University
-   302 Berkey Hall
-   East Lansing, MI  48824
-   (517)353-7195
-
-   Written: 12/19/91
-
-   Last Update: 12/26/91 Brian J. Buckley
-   Last Update:  1/24/92 Brian J. Buckley
-   Added printout of trnfile. Triggered by BDEBUG.
-   Last Update:  1/27/92 Brian J. Buckley
-   Fixed bug so that only the active control points were used.
- */
-
-/***************************************************************************/
-
-/***************************************************************************/
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <math.h>
-#include <limits.h>
-#include <grass/gis.h>
-
-/*
-   #define MSDOS 1
- */
-
-/*
-   #define BDEBUG
- */
-#ifdef BDEBUG
-FILE *fp;
-#endif
-
-#ifdef MSDOS
-
-#include "stdlib.h"
-#include "dummy.h"
-
-typedef double DOUBLE;
-
-#else
-
-#include <grass/imagery.h>
-
-typedef double DOUBLE;
-
-#endif
-
-#include "crs.h"
-
-/* STRUCTURE FOR USE INTERNALLY WITH THESE FUNCTIONS.  THESE FUNCTIONS EXPECT
-   SQUARE MATRICES SO ONLY ONE VARIABLE IS GIVEN (N) FOR THE MATRIX SIZE */
-
-struct MATRIX
-{
-    int n;			/* SIZE OF THIS MATRIX (N x N) */
-    DOUBLE *v;
-};
-
-/* CALCULATE OFFSET INTO ARRAY BASED ON R/C */
-
-#define M(row,col) m->v[(((row)-1)*(m->n))+(col)-1]
-
-/***************************************************************************/
-/*
- */
-
-/***************************************************************************/
-
-#define MSUCCESS     1		/* SUCCESS */
-#define MNPTERR      0		/* NOT ENOUGH POINTS */
-#define MUNSOLVABLE -1		/* NOT SOLVABLE */
-#define MMEMERR     -2		/* NOT ENOUGH MEMORY */
-#define MPARMERR    -3		/* PARAMETER ERROR */
-#define MINTERR     -4		/* INTERNAL ERROR */
-
-/***************************************************************************/
-/*
-   FUNCTION PROTOTYPES FOR STATIC (INTERNAL) FUNCTIONS
- */
-
-/***************************************************************************/
-
-#ifdef MSDOS
-
-static int calccoef(struct Control_Points *, double *, double *, int);
-static int calcls(struct Control_Points *, struct MATRIX *,
-		  DOUBLE *, DOUBLE *, double *, double *);
-static int exactdet(struct Control_Points *, struct MATRIX *,
-		    DOUBLE *, DOUBLE *, double *, double *);
-static int solvemat(struct MATRIX *, DOUBLE *, DOUBLE *, double *, double *);
-static DOUBLE term(int, double, double);
-
-#ifdef BDEBUG
-static int checkgeoref(struct Control_Points *, double *, double *, int, int,
-		       FILE * fp);
-#endif
-
-#else
-
-static int calccoef();
-static int calcls();
-static int exactdet();
-static int solvemat();
-static DOUBLE term();
-
-#ifdef BDEBUG
-static int checkgeoref();
-#endif
-
-#endif
-
-/***************************************************************************/
-/*
-   USE THIS TRANSFORMATION FUNCTION IF YOU WANT TO DO ARRAYS.
- */
-
-/***************************************************************************/
-
-#ifdef BETTERGEOREF
-
-extern void CRS_georef(int, DOUBLE *, DOUBLE *, DOUBLE *, DOUBLE *, int);
-
-void CRS_georef2(int order,	/* ORDER OF TRANSFORMATION TO BE PERFORMED, MUST MATCH THE
-				   ORDER USED TO CALCULATE THE COEFFICIENTS */
-		 double E[],	/* EASTING COEFFICIENTS */
-		 double N[],	/* NORTHING COEFFICIENTS */
-		 double e[],	/* EASTINGS TO BE TRANSFORMED */
-		 double n[],	/* NORTHINGS TO BE TRANSFORMED */
-		 int numpts	/* NUMBER OF POINTS TO BE TRANSFORMED */
-    )
-{
-    DOUBLE e3, e2n, e2, en2, en, e1, n3, n2, n1;
-    int i;
-
-    switch (order) {
-    case 3:
-
-	for (i = 0; i < numpts; i++) {
-	    e1 = e[i];
-	    n1 = n[i];
-	    e2 = e1 * e1;
-	    en = e1 * n1;
-	    n2 = n1 * n1;
-	    e3 = e1 * e2;
-	    e2n = e2 * n1;
-	    en2 = e1 * n2;
-	    n3 = n1 * n2;
-
-	    e[i] = E[0] +
-		E[1] * e1 + E[2] * n1 +
-		E[3] * e2 + E[4] * en + E[5] * n2 +
-		E[6] * e3 + E[7] * e2n + E[8] * en2 + E[9] * n3;
-	    n[i] = N[0] +
-		N[1] * e1 + N[2] * n1 +
-		N[3] * e2 + N[4] * en + N[5] * n2 +
-		N[6] * e3 + N[7] * e2n + N[8] * en2 + N[9] * n3;
-	}
-	break;
-
-    case 2:
-
-	for (i = 0; i < numpts; i++) {
-	    e1 = e[i];
-	    n1 = n[i];
-	    e2 = e1 * e1;
-	    n2 = n1 * n1;
-	    en = e1 * n1;
-
-	    e[i] = E[0] + E[1] * e1 + E[2] * n1 +
-		E[3] * e2 + E[4] * en + E[5] * n2;
-	    n[i] = N[0] + N[1] * e1 + N[2] * n1 +
-		N[3] * e2 + N[4] * en + N[5] * n2;
-	}
-	break;
-
-    case 1:
-
-	for (i = 0; i < numpts; i++) {
-	    e1 = e[i];
-	    n1 = n[i];
-	    e[i] = E[0] + E[1] * e1 + E[2] * n1;
-	    n[i] = N[0] + N[1] * e1 + N[2] * n1;
-	}
-	break;
-    }
-}
-
-#endif
-
-/***************************************************************************/
-/*
-   TRANSFORM A SINGLE COORDINATE PAIR.
- */
-
-/***************************************************************************/
-
-int CRS_georef(double e1,	/* EASTINGS TO BE TRANSFORMED */
-	       double n1,	/* NORTHINGS TO BE TRANSFORMED */
-	       double *e,	/* EASTINGS TO BE TRANSFORMED */
-	       double *n,	/* NORTHINGS TO BE TRANSFORMED */
-	       double E[],	/* EASTING COEFFICIENTS */
-	       double N[],	/* NORTHING COEFFICIENTS */
-	       int order	/* ORDER OF TRANSFORMATION TO BE PERFORMED, MUST MATCH THE
-				   ORDER USED TO CALCULATE THE COEFFICIENTS */
-    )
-{
-    DOUBLE e3, e2n, en2, n3, e2, en, n2;
-
-    switch (order) {
-    case 1:
-
-	*e = E[0] + E[1] * e1 + E[2] * n1;
-	*n = N[0] + N[1] * e1 + N[2] * n1;
-	break;
-
-    case 2:
-
-	e2 = e1 * e1;
-	n2 = n1 * n1;
-	en = e1 * n1;
-
-	*e = E[0] + E[1] * e1 + E[2] * n1 + E[3] * e2 + E[4] * en + E[5] * n2;
-	*n = N[0] + N[1] * e1 + N[2] * n1 + N[3] * e2 + N[4] * en + N[5] * n2;
-	break;
-
-    case 3:
-
-	e2 = e1 * e1;
-	en = e1 * n1;
-	n2 = n1 * n1;
-	e3 = e1 * e2;
-	e2n = e2 * n1;
-	en2 = e1 * n2;
-	n3 = n1 * n2;
-
-	*e = E[0] +
-	    E[1] * e1 + E[2] * n1 +
-	    E[3] * e2 + E[4] * en + E[5] * n2 +
-	    E[6] * e3 + E[7] * e2n + E[8] * en2 + E[9] * n3;
-	*n = N[0] +
-	    N[1] * e1 + N[2] * n1 +
-	    N[3] * e2 + N[4] * en + N[5] * n2 +
-	    N[6] * e3 + N[7] * e2n + N[8] * en2 + N[9] * n3;
-	break;
-
-    default:
-
-	return (MPARMERR);
-	break;
-    }
-
-    return (MSUCCESS);
-}
-
-/***************************************************************************/
-/*
-   COMPUTE THE GEOREFFERENCING COEFFICIENTS BASED ON A SET OF CONTROL POINTS
- */
-
-/***************************************************************************/
-
-int
-CRS_compute_georef_equations(struct Control_Points *cp, double E12[],
-			     double N12[], double E21[], double N21[],
-			     int order)
-{
-    double *tempptr;
-    int status;
-
-    if (order < 1 || order > MAXORDER)
-	return (MPARMERR);
-
-#ifdef BDEBUG
-    fp = fopen("error.dat", "w");
-    if (fp == NULL)
-	return (-1);
-#endif
-
-    /* CALCULATE THE FORWARD TRANSFORMATION COEFFICIENTS */
-
-    status = calccoef(cp, E12, N12, order);
-    if (status != MSUCCESS)
-	return (status);
-
-#ifdef BDEBUG
-    checkgeoref(cp, E12, N12, order, 1, fp);
-#endif
-
-    /* SWITCH THE 1 AND 2 EASTING AND NORTHING ARRAYS */
-
-    tempptr = cp->e1;
-    cp->e1 = cp->e2;
-    cp->e2 = tempptr;
-    tempptr = cp->n1;
-    cp->n1 = cp->n2;
-    cp->n2 = tempptr;
-
-    /* CALCULATE THE BACKWARD TRANSFORMATION COEFFICIENTS */
-
-    status = calccoef(cp, E21, N21, order);
-
-#ifdef BDEBUG
-    checkgeoref(cp, E21, N21, order, 0, fp);
-    fclose(fp);
-#endif
-
-    /* SWITCH THE 1 AND 2 EASTING AND NORTHING ARRAYS BACK */
-
-    tempptr = cp->e1;
-    cp->e1 = cp->e2;
-    cp->e2 = tempptr;
-    tempptr = cp->n1;
-    cp->n1 = cp->n2;
-    cp->n2 = tempptr;
-
-    return (status);
-}
-
-/***************************************************************************/
-/*
-   COMPUTE THE GEOREFFERENCING COEFFICIENTS BASED ON A SET OF CONTROL POINTS
- */
-
-/***************************************************************************/
-
-static int
-calccoef(struct Control_Points *cp, double E[], double N[], int order)
-{
-    struct MATRIX m;
-    DOUBLE *a;
-    DOUBLE *b;
-    int numactive;		/* NUMBER OF ACTIVE CONTROL POINTS */
-    int status, i;
-
-    /* CALCULATE THE NUMBER OF VALID CONTROL POINTS */
-
-    for (i = numactive = 0; i < cp->count; i++) {
-	if (cp->status[i] > 0)
-	    numactive++;
-    }
-
-    /* CALCULATE THE MINIMUM NUMBER OF CONTROL POINTS NEEDED TO DETERMINE
-       A TRANSFORMATION OF THIS ORDER */
-
-    m.n = ((order + 1) * (order + 2)) / 2;
-
-    if (numactive < m.n)
-	return (MNPTERR);
-
-    /* INITIALIZE MATRIX */
-
-    m.v = (DOUBLE *) G_calloc(m.n * m.n, sizeof(DOUBLE));
-    if (m.v == NULL) {
-	return (MMEMERR);
-    }
-    a = (DOUBLE *) G_calloc(m.n, sizeof(DOUBLE));
-    if (a == NULL) {
-	G_free((char *)m.v);
-	return (MMEMERR);
-    }
-    b = (DOUBLE *) G_calloc(m.n, sizeof(DOUBLE));
-    if (b == NULL) {
-	G_free((char *)m.v);
-	G_free((char *)a);
-	return (MMEMERR);
-    }
-
-    if (numactive == m.n)
-	status = exactdet(cp, &m, a, b, E, N);
-    else
-	status = calcls(cp, &m, a, b, E, N);
-
-    G_free((char *)m.v);
-    G_free((char *)a);
-    G_free((char *)b);
-
-    return (status);
-}
-
-/***************************************************************************/
-/*
-   CALCULATE THE TRANSFORMATION COEFFICIENTS WITH EXACTLY THE MINIMUM
-   NUMBER OF CONTROL POINTS REQUIRED FOR THIS TRANSFORMATION.
- */
-
-/***************************************************************************/
-
-static int exactdet(struct Control_Points *cp, struct MATRIX *m, DOUBLE a[], DOUBLE b[], double E[],	/* EASTING COEFFICIENTS */
-		    double N[]	/* NORTHING COEFFICIENTS */
-    )
-{
-    int pntnow, currow, j;
-
-    currow = 1;
-    for (pntnow = 0; pntnow < cp->count; pntnow++) {
-	if (cp->status[pntnow] > 0) {
-	    /* POPULATE MATRIX M */
-
-#ifdef BDEBUG
-	    fprintf(fp, "%2d ", pntnow + 1);
-#endif
-
-	    for (j = 1; j <= m->n; j++) {
-		M(currow, j) = term(j, cp->e1[pntnow], cp->n1[pntnow]);
-#ifdef BDEBUG
-		fprintf(fp, "%+14.7le ", M(currow, j));
-		if (j == 5)
-		    fprintf(fp, "\n   ");
-#endif
-	    }
-#ifdef BDEBUG
-	    fprintf(fp, "\n");
-#endif
-
-	    /* POPULATE MATRIX A AND B */
-
-	    a[currow - 1] = cp->e2[pntnow];
-	    b[currow - 1] = cp->n2[pntnow];
-#ifdef BDEBUG
-	    fprintf(fp, "   %+14.7le ", a[currow - 1]);
-	    fprintf(fp, "%+14.7le\n", b[currow - 1]);
-#endif
-
-	    currow++;
-	}
-#ifdef BDEBUG
-	else {
-	    fprintf(fp, "%2d UNUSED\n", pntnow + 1);
-	}
-#endif
-    }
-
-    if (currow - 1 != m->n)
-	return (MINTERR);
-
-    return (solvemat(m, a, b, E, N));
-}
-
-/***************************************************************************/
-/*
-   CALCULATE THE TRANSFORMATION COEFFICIENTS WITH MORE THAN THE MINIMUM
-   NUMBER OF CONTROL POINTS REQUIRED FOR THIS TRANSFORMATION.  THIS
-   ROUTINE USES THE LEAST SQUARES METHOD TO COMPUTE THE COEFFICIENTS.
- */
-
-/***************************************************************************/
-
-static int calcls(struct Control_Points *cp, struct MATRIX *m, DOUBLE a[], DOUBLE b[], double E[],	/* EASTING COEFFICIENTS */
-		  double N[]	/* NORTHING COEFFICIENTS */
-    )
-{
-    int i, j, n, numactive = 0;
-
-    /* INITIALIZE THE UPPER HALF OF THE MATRIX AND THE TWO COLUMN VECTORS */
-
-    for (i = 1; i <= m->n; i++) {
-	for (j = i; j <= m->n; j++)
-	    M(i, j) = 0.0;
-	a[i - 1] = b[i - 1] = 0.0;
-    }
-
-    /* SUM THE UPPER HALF OF THE MATRIX AND THE COLUMN VECTORS ACCORDING TO
-       THE LEAST SQUARES METHOD OF SOLVING OVER DETERMINED SYSTEMS */
-
-    for (n = 0; n < cp->count; n++) {
-	if (cp->status[n] > 0) {
-	    numactive++;
-	    for (i = 1; i <= m->n; i++) {
-		for (j = i; j <= m->n; j++)
-		    M(i, j) +=
-			term(i, cp->e1[n], cp->n1[n]) * term(j, cp->e1[n],
-							     cp->n1[n]);
-
-		a[i - 1] += cp->e2[n] * term(i, cp->e1[n], cp->n1[n]);
-		b[i - 1] += cp->n2[n] * term(i, cp->e1[n], cp->n1[n]);
-	    }
-	}
-    }
-
-    if (numactive <= m->n)
-	return (MINTERR);
-
-    /* TRANSPOSE VALUES IN UPPER HALF OF M TO OTHER HALF */
-
-    for (i = 2; i <= m->n; i++) {
-	for (j = 1; j < i; j++)
-	    M(i, j) = M(j, i);
-    }
-
-    return (solvemat(m, a, b, E, N));
-}
-
-/***************************************************************************/
-/*
-   CALCULATE THE X/Y TERM BASED ON THE TERM NUMBER
-
-   ORDER\TERM   1    2    3    4    5    6    7    8    9   10
-   1        e0n0 e1n0 e0n1
-   2        e0n0 e1n0 e0n1 e2n0 e1n1 e0n2
-   3        e0n0 e1n0 e0n1 e2n0 e1n1 e0n2 e3n0 e2n1 e1n2 e0n3
- */
-
-/***************************************************************************/
-
-static DOUBLE term(int term, double e, double n)
-{
-    switch (term) {
-    case 1:
-	return ((DOUBLE) 1.0);
-    case 2:
-	return ((DOUBLE) e);
-    case 3:
-	return ((DOUBLE) n);
-    case 4:
-	return ((DOUBLE) (e * e));
-    case 5:
-	return ((DOUBLE) (e * n));
-    case 6:
-	return ((DOUBLE) (n * n));
-    case 7:
-	return ((DOUBLE) (e * e * e));
-    case 8:
-	return ((DOUBLE) (e * e * n));
-    case 9:
-	return ((DOUBLE) (e * n * n));
-    case 10:
-	return ((DOUBLE) (n * n * n));
-    }
-    return ((DOUBLE) 0.0);
-}
-
-/***************************************************************************/
-/*
-   SOLVE FOR THE 'E' AND 'N' COEFFICIENTS BY USING A SOMEWHAT MODIFIED
-   GAUSSIAN ELIMINATION METHOD.
-
-   | M11 M12 ... M1n | | E0   |   | a0   |
-   | M21 M22 ... M2n | | E1   | = | a1   |
-   |  .   .   .   .  | | .    |   | .    |
-   | Mn1 Mn2 ... Mnn | | En-1 |   | an-1 |
-
-   and
-
-   | M11 M12 ... M1n | | N0   |   | b0   |
-   | M21 M22 ... M2n | | N1   | = | b1   |
-   |  .   .   .   .  | | .    |   | .    |
-   | Mn1 Mn2 ... Mnn | | Nn-1 |   | bn-1 |
- */
-
-/***************************************************************************/
-
-static int
-solvemat(struct MATRIX *m, DOUBLE a[], DOUBLE b[], double E[], double N[])
-{
-    int i, j, i2, j2, imark;
-    DOUBLE factor, temp;
-    DOUBLE pivot;		/* ACTUAL VALUE OF THE LARGEST PIVOT CANDIDATE */
-
-    for (i = 1; i <= m->n; i++) {
-	j = i;
-
-	/* find row with largest magnitude value for pivot value */
-
-	pivot = M(i, j);
-	imark = i;
-	for (i2 = i + 1; i2 <= m->n; i2++) {
-	    temp = fabs(M(i2, j));
-	    if (temp > fabs(pivot)) {
-		pivot = M(i2, j);
-		imark = i2;
-	    }
-	}
-
-	/* if the pivot is very small then the points are nearly co-linear */
-	/* co-linear points result in an undefined matrix, and nearly */
-	/* co-linear points results in a solution with rounding error */
-
-	if (pivot == 0.0)
-	    return (MUNSOLVABLE);
-
-	/* if row with highest pivot is not the current row, switch them */
-
-	if (imark != i) {
-	    for (j2 = 1; j2 <= m->n; j2++) {
-		temp = M(imark, j2);
-		M(imark, j2) = M(i, j2);
-		M(i, j2) = temp;
-	    }
-
-	    temp = a[imark - 1];
-	    a[imark - 1] = a[i - 1];
-	    a[i - 1] = temp;
-
-	    temp = b[imark - 1];
-	    b[imark - 1] = b[i - 1];
-	    b[i - 1] = temp;
-	}
-
-	/* compute zeros above and below the pivot, and compute
-	   values for the rest of the row as well */
-
-	for (i2 = 1; i2 <= m->n; i2++) {
-	    if (i2 != i) {
-		factor = M(i2, j) / pivot;
-		for (j2 = j; j2 <= m->n; j2++)
-		    M(i2, j2) -= factor * M(i, j2);
-		a[i2 - 1] -= factor * a[i - 1];
-		b[i2 - 1] -= factor * b[i - 1];
-	    }
-	}
-    }
-
-    /* SINCE ALL OTHER VALUES IN THE MATRIX ARE ZERO NOW, CALCULATE THE
-       COEFFICIENTS BY DIVIDING THE COLUMN VECTORS BY THE DIAGONAL VALUES. */
-
-    for (i = 1; i <= m->n; i++) {
-	E[i - 1] = a[i - 1] / M(i, i);
-	N[i - 1] = b[i - 1] / M(i, i);
-    }
-
-    return (MSUCCESS);
-}
-
-/***************************************************************************/
-/*
- */
-
-/***************************************************************************/
-
-#ifdef BDEBUG
-
-static int
-checkgeoref(struct Control_Points *cp, double E[], double N[], int order,
-	    int forward, FILE * fp)
-{
-    DOUBLE xrms, yrms, dx, dy, dx2, dy2, totaldist, dist;
-    double tempx, tempy;
-    int i, n, numactive;
-
-    n = ((order + 1) * (order + 2)) / 2;
-
-    if (forward)
-	fprintf(fp, "FORWARD:\n");
-    else
-	fprintf(fp, "BACKWARD:\n");
-
-    fprintf(fp, "%d order\n", order);
-    for (i = 0; i < n; i++)
-	fprintf(fp, "%+.17E %+.17E\n", E[i], N[i]);
-
-    xrms = yrms = dx2 = dy2 = totaldist = 0.0;
-    numactive = 0;
-    for (i = 0; i < cp->count; i++) {
-	fprintf(fp, "\nCONTROL POINT: %d\n", i + 1);
-
-	fprintf(fp, "%20s: %+.20lE %+.20lE\n", "ORIGINAL POINT",
-		cp->e1[i], cp->n1[i]);
-	fprintf(fp, "%20s: %+.20lE %+.20lE\n", "DESIRED POINT",
-		cp->e2[i], cp->n2[i]);
-
-	if (cp->status[i] > 0) {
-	    numactive++;
-	    CRS_georef(cp->e1[i], cp->n1[i], &tempx, &tempy, E, N, order);
-
-	    fprintf(fp, "%20s: %+.20lE %+.20lE\n", "CALCULATED POINT", tempx,
-		    tempy);
-	    dx = tempx - cp->e2[i];
-	    dy = tempy - cp->n2[i];
-	    fprintf(fp, "%20s: %+.20lE %+.20lE\n", "RESIDUAL ERROR", dx, dy);
-	    dx2 = dx * dx;
-	    dy2 = dy * dy;
-	    dist = sqrt(dx2 + dy2);
-	    fprintf(fp, "%20s: %+.20lE\n", "DISTANCE (RMS) ERROR", dist);
-
-	    xrms += dx2;
-	    yrms += dy2;
-
-	    totaldist += dist;
-	}
-	else
-	    fprintf(fp, "NOT USED\n");
-    }
-    xrms = sqrt(xrms / (DOUBLE) numactive);
-    yrms = sqrt(yrms / (DOUBLE) numactive);
-
-    fprintf(fp, "\n%20s: %+.20lE %+.20lE\n", "RMS ERROR", xrms, yrms);
-
-    fprintf(fp, "\n%20s: %+.20lE\n", "TOTAL RMS ERROR",
-	    sqrt(xrms * xrms + yrms * yrms));
-
-    fprintf(fp, "\n%20s: %+.20lE\n", "AVG. DISTANCE ERROR",
-	    totaldist / numactive);
-
-    return (0);
-}
-
-#endif

+ 0 - 39
imagery/i.vpoints/crs.h

@@ -1,39 +0,0 @@
-
-/***************************************************************************/
-
-/***************************************************************************/
-/*
-   CRS.H - Center for Remote Sensing rectification routines
-
-   Written By: Brian J. Buckley
-
-   At: The Center for Remote Sensing
-   Michigan State University
-   302 Berkey Hall
-   East Lansing, MI  48824
-   (517)353-7195
-
-   Written: 12/19/91
-
-   Last Update: 12/26/91 Brian J. Buckley
- */
-
-/***************************************************************************/
-
-/***************************************************************************/
-
-#define MAXORDER 3
-
-#ifdef MSDOS
-
-extern int CRS_compute_georef_equations(struct Control_Points *, double *,
-					double *, double *, double *, int);
-extern int CRS_georef(double, double, double *, double *, double *, double *,
-		      int);
-
-#else
-
-extern int CRS_compute_georef_equations();
-extern int CRS_georef();
-
-#endif

+ 0 - 267
imagery/i.vpoints/curses.c

@@ -1,267 +0,0 @@
-#include <stdlib.h>
-#include <unistd.h>
-#include "globals.h"
-
-static int inited = 0;
-
-static WINDOW *save;
-WINDOW *newwin();
-
-static Window *make_window(int top, int bottom, int left, int right)
-{
-    Window *window;
-
-    if (top < 0 || bottom >= LINES || left < 0 || right >= COLS
-	|| bottom - top <= 1 || right - left <= 1) {
-	End_curses();
-	fprintf(stderr, "make_window(%d,%d,%d,%d): illegal screen values\n",
-		top, bottom, left, right);
-	G_sleep(3);
-	exit(1);
-    }
-    window = (Window *) G_malloc(sizeof(Window));
-    window->top = top;
-    window->bottom = bottom;
-    window->left = left;
-    window->right = right;
-    Curses_clear_window(window);
-    return window;
-}
-
-int Begin_curses(void)
-{
-    /* should only be called once at program outset */
-
-    initscr();			/* initialize curses standard screens   */
-    raw();			/* set tty modes via curses calls       */
-    noecho();
-    nonl();
-
-    inited = 1;
-
-    /* make a window to save stdscr */
-    save = newwin(LINES, COLS, 0, 0);
-
-    /* make_window (nrows, ncols, start_row, start_col) */
-    INFO_WINDOW = make_window(0, LINES - 4, COLS / 2, COLS - 1);
-    MENU_WINDOW = make_window(0, LINES - 4, 0, COLS / 2);
-    PROMPT_WINDOW = make_window(LINES - 4, LINES - 1, 0, COLS - 1);
-    refresh();
-
-    return 0;
-}
-
-int End_curses(void)
-{
-    /* should only be called upon program exit */
-
-    clear();			/* clear the screen */
-    refresh();
-    endwin();			/* let curses reset the tty now */
-    return 0;
-}
-
-int Suspend_curses(void)
-{
-    overwrite(stdscr, save);
-    clear();
-    refresh();
-    endwin();
-
-    return 0;
-}
-
-int Resume_curses(void)
-{
-    clear();
-    refresh();
-    overwrite(save, stdscr);
-    refresh();
-
-    return 0;
-}
-
-int Curses_allow_interrupts(int ok)
-{
-    refresh();
-    if (ok)
-	noraw();
-    else
-	raw();
-
-    return 0;
-}
-
-int Curses_clear_window(Window * window)
-{
-    int y, x;
-
-    if (!inited)
-	return 1;
-    for (y = window->top + 1; y < window->bottom; y++) {
-	move(y, x = window->left + 1);
-	while (x++ < window->right)
-	    addch(' ');
-    }
-    Curses_outline_window(window);
-    refresh();
-
-    return 0;
-}
-
-int Curses_outline_window(Window * window)
-{
-    int x, y;
-
-    move(window->top, x = window->left + 1);
-    while (x++ < window->right)
-	addch('-');
-    move(window->bottom, x = window->left + 1);
-    while (x++ < window->right)
-	addch('-');
-    for (y = window->top + 1; y < window->bottom; y++) {
-	move(y, window->left);
-	addch('|');
-	move(y, window->right);
-	addch('|');
-    }
-    move(window->top, window->left);
-    addch('+');
-    move(window->top, window->right);
-    addch('+');
-    move(window->bottom, window->left);
-    addch('+');
-    if (window->bottom < LINES - 1 || window->right < COLS - 1) {
-	move(window->bottom, window->right);
-	addch('+');
-    }
-
-    return 0;
-}
-
-int Curses_write_window(Window * window, int line, int col, char *message)
-{
-    int y, x, i;
-
-    if (!inited) {
-	fprintf(stderr, "%s\n", message);
-	return 1;
-    }
-    if (line <= 0 || line >= window->bottom - window->top)
-	return 1;
-    if (col <= 0 || col >= window->right - window->left)
-	return 1;
-    move(y = window->top + line, x = window->left + col);
-    while (*message != 0 && *message != '\n' && x < window->right) {
-	addch(*message);
-	message++;
-	x++;
-    }
-    if (*message == '\n')
-	for (i = x; i < window->right; i++)
-	    addch(' ');
-    move(y, x);
-    refresh();
-
-    return 0;
-}
-
-
-int Curses_replot_screen(void)
-{
-    int x, y;
-
-    getyx(stdscr, y, x);
-    wrefresh(curscr);
-    move(y, x);
-    refresh();
-
-    return 0;
-}
-
-int Curses_prompt_gets(char *prompt, char *answer)
-{
-    char c;
-    int n;
-    int y, x;
-
-    *answer = 0;
-    n = 0;
-
-    Curses_write_window(PROMPT_WINDOW, 1, 1, "\n");
-    Curses_write_window(PROMPT_WINDOW, 1, 1, prompt);
-
-    for (;;) {
-	refresh();
-	c = Curses_getch(0);
-
-	if (c == '\n' || c == '\r')
-	    break;
-
-	getyx(stdscr, y, x);
-
-	if (c > '\037' && c < '\177') {	/* octal codes: accept space to '~' */
-	    if (x < PROMPT_WINDOW->right) {
-		*answer++ = c;
-		*answer = 0;
-		addch(c);
-		n++;
-	    }
-	    continue;
-	}
-
-	if (c == '\b' || c == '\177') {	/* backspace or DEL (decimal 8,127) */
-	    if (n > 0) {
-		answer--;
-		*answer = 0;
-		move(y, x - 1);
-		addch(' ');
-		move(y, x - 1);
-		n--;
-	    }
-	    continue;
-	}
-	Beep();
-    }
-
-    return 0;
-}
-
-int Beep(void)
-{
-    putchar('\7');
-    fflush(stdout);
-
-    return 0;
-}
-
-int Curses_getch(int with_echo)
-{
-    char achar;
-    int c;
-    int kill;
-
-    if (!inited)
-	return 0;
-    kill = 0;
-    while (1) {
-	c = getch() & 0177;
-	if (c == interrupt_char) {
-	    if (kill++ >= 3) {
-		End_curses();
-		exit(0);
-	    }
-	    continue;
-	}
-	kill = 0;
-	if (c != 18)
-	    break;
-	Curses_replot_screen();
-    }
-    if (with_echo) {
-	achar = c;
-	addch(achar);
-	refresh();
-    }
-    return c;
-}

+ 0 - 11
imagery/i.vpoints/debug.c

@@ -1,11 +0,0 @@
-#include "globals.h"
-#include <grass/display.h>
-
-int debug(char *msg, ...)
-{
-    R_stabilize();
-    Curses_write_window(PROMPT_WINDOW, 1, 1, msg);
-    /*    Curses_getch(0); */
-
-    return 0;
-}

+ 0 - 71
imagery/i.vpoints/defs.h

@@ -1,71 +0,0 @@
-#include <curses.h>
-#include <grass/gis.h>
-#include <grass/imagery.h>
-
-/* this is a curses structure */
-typedef struct
-{
-    int top, left, bottom, right;
-} Window;
-
-/* this is a graphics structure */
-typedef struct
-{
-    int top, bottom, left, right;
-    int nrows, ncols;
-    struct
-    {
-	int configured;
-	struct Cell_head head;
-	struct Colors colors;
-	char name[GNAME_MAX];
-	char mapset[GMAPSET_MAX];
-	int top, bottom, left, right;
-	double ew_res, ns_res;	/* original map resolution */
-    } cell;
-} View;
-
-/*   Replaced with following structure for CRS.c
-   typedef struct
-   {
-   char name[100];
-   struct Ref ref;
-   struct Control_Points points;
-   double E12[3], N12[3], E21[3], N21[3];
-   int equation_stat;
-   } Group;
- */
-
-typedef struct
-{
-    char name[GNAME_MAX];
-    struct Ref ref;
-    struct Control_Points points;
-    double E12[10], N12[10], E21[10], N21[10];
-    int equation_stat;
-} Group;
-
-typedef struct
-{
-    int type;			/* object type */
-    int (*handler) ();		/* routine to handle the event */
-    char *label;		/* label to display if MENU or OPTION */
-    int binding;		/* OPTION bindings */
-    int *status;		/* MENU,OPTION status */
-    int top, bottom, left, right;
-} Objects;
-
-#define MENU_OBJECT 1
-#define OPTION_OBJECT 2
-#define INFO_OBJECT 3
-#define OTHER_OBJECT 4
-
-
-#define MENU(label,handler,status) \
-	{MENU_OBJECT,handler,label,0,status,0,0,0,0}
-#define OPTION(label,binding,status) \
-	{OPTION_OBJECT,NULL,label,binding,status,0,0,0,0}
-#define INFO(label,status) \
-	{INFO_OBJECT,NULL,label,0,status,0,0,0,0}
-#define OTHER(handler,status) \
-	{OTHER_OBJECT,handler,NULL,0,status,0,0,0,0}

+ 0 - 118
imagery/i.vpoints/digit.c

@@ -1,118 +0,0 @@
-#include <stdlib.h>
-#include <unistd.h>
-#include "globals.h"
-
-static int setup(void);
-static int oops(void);
-static int no(void);
-static int yes(void);
-
-int setup_digitizer(void)
-{
-    static int use = 1;
-    static Objects objects[] = {
-	INFO("Do you wish to use the digitizer?  ", &use),
-	MENU("YES", yes, &use),
-	MENU("NO", no, &use),
-	{0}
-    };
-    char command[1024];
-
-    use_digitizer = 0;
-    /*
-     * test to see if we have a digitizer (geo.quest)
-     * make sure this program has execute permission first.
-     * then run the program and check its exit status
-     *  0 means can use digitizer, other means can't
-     */
-    sprintf(command, "%s/etc/geo.quest", G_gisbase());
-    if (access(command, 1) != 0)
-	return 0;
-    if (system(command))
-	return 0;
-
-
-    /*
-     * ask the user if he/she wishes to use it
-     */
-    Start_mouse_in_menu();
-    Input_pointer(objects);
-    if (use_digitizer)
-	Input_other(setup, "Keyboard");
-
-    return 0;
-}
-
-static int setup(void)
-{
-    char command[1024];
-
-    /*
-     * setup the digitizer. system() call must exit with 0 to indicate
-     * everything went fine
-     */
-    sprintf(command, "%s/etc/geo.reg %s %d",
-	    G_gisbase(), digit_points, getpid());
-    Suspend_curses();
-    if (system(command)) {
-	use_digitizer = 0;
-	G_sleep(3);
-    }
-    Resume_curses();
-
-    return 0;
-}
-
-int digitizer_point(double *east, double *north)
-{
-    char command[1024];
-    FILE *fd;
-    int stat;
-
-    /* make sure digitzer is to be used */
-    if (!use_digitizer)
-	return 0;
-
-    sprintf(command, "%s/etc/geo.point %s %s",
-	    G_gisbase(), digit_points, digit_results);
-
-    Suspend_curses();
-    if (system(command)) {
-	G_sleep(3);
-	Resume_curses();
-	oops();
-	return 0;
-    }
-    Resume_curses();
-    fd = fopen(digit_results, "r");
-    if (fd == NULL) {
-	oops();
-	return 0;
-    }
-    stat = (fscanf(fd, "%lf %lf", east, north) == 2);
-    fclose(fd);
-
-    if (stat == 0)
-	oops();
-    return stat;
-}
-
-static int oops(void)
-{
-    Curses_clear_window(MENU_WINDOW);
-    Curses_write_window(MENU_WINDOW, 3, 2, "Can't get data from digitizer");
-
-    return 0;
-}
-
-static int no(void)
-{
-    use_digitizer = 0;
-    return 1;
-}
-
-static int yes(void)
-{
-    use_digitizer = 1;
-    return 1;
-}

+ 0 - 57
imagery/i.vpoints/dot.c

@@ -1,57 +0,0 @@
-#include "globals.h"
-#include <grass/display.h>
-
-int dot(int x, int y)
-{
-    double vx[5], vy[5];
-
-    vx[0] = x;
-    vy[0] = y - dotsize;
-    vx[1] = x - dotsize;
-    vy[1] = y;
-    vx[2] = x;
-    vy[2] = y + dotsize;
-    vx[3] = x + dotsize;
-    vy[3] = y;
-    vx[4] = x;
-    vy[4] = y - dotsize;
-
-    R_polygon_abs(vx, vy, 5);
-    /*
-       int i;
-
-       for (i = 0; i < dotsize; i++)
-       {
-       R_move_abs (x-i, y+i-dotsize);
-       R_cont_rel (i+i,0);
-       R_move_abs (x-i, y+dotsize-i);
-       R_cont_rel (i+i,0);
-       }
-       R_move_abs (x-dotsize, y);
-       R_cont_rel (dotsize+dotsize, 0);
-     */
-
-    return 0;
-}
-
-int save_under_dot(int x, int y)
-{
-    R_panel_save(tempfile1, y - dotsize, y + dotsize, x - dotsize,
-		 x + dotsize);
-
-    return 0;
-}
-
-int restore_under_dot(void)
-{
-    R_panel_restore(tempfile1);
-
-    return 0;
-}
-
-int release_under_dot(void)
-{
-    R_panel_delete(tempfile1);
-
-    return 0;
-}

+ 0 - 109
imagery/i.vpoints/drawcell.c

@@ -1,109 +0,0 @@
-#include "globals.h"
-#include <grass/display.h>
-#include <stdlib.h>
-
-/* initflag: 0 means don't initialize VIEW_MAP1 or VIEW_MAP2 */
-int drawcell(View * view, int initflag)
-{
-    int fd;
-    int left, top;
-    int ncols, nrows;
-    int row;
-    DCELL *dcell;
-    int read_colors;
-    struct Colors *colors;
-    char msg[100];
-
-    if (!view->cell.configured)
-	return 0;
-    if (view == VIEW_MAP1 || view == VIEW_MAP1_ZOOM) {
-	colors = &VIEW_MAP1->cell.colors;
-	read_colors = view == VIEW_MAP1;
-    }
-    else {
-	colors = &VIEW_MAP2->cell.colors;
-	read_colors = view == VIEW_MAP2;
-    }
-
-    if (read_colors) {
-	Rast_free_colors(colors);
-	if (Rast_read_colors(view->cell.name, view->cell.mapset, colors) < 0)
-	    return 0;
-	/* set_menu_colors(colors); */
-    }
-
-    display_title(view);
-
-    set_colors(colors);
-
-    R_standard_color(BLACK);
-
-    if (initflag) {
-	Erase_view(VIEW_TITLE1_ZOOM);
-	Erase_view(VIEW_TITLE2_ZOOM);
-	Erase_view(VIEW_MAP1_ZOOM);
-	Erase_view(VIEW_MAP2);
-	Erase_view(VIEW_MAP2_ZOOM);
-    }
-
-    Rast_set_window(&view->cell.head);
-    nrows = Rast_window_rows();
-    ncols = Rast_window_cols();
-
-    left = view->cell.left;
-    top = view->cell.top;
-
-    R_standard_color(YELLOW);
-    Outline_box(top, top + nrows - 1, left, left + ncols - 1);
-
-    if (getenv("NO_DRAW"))
-	return 1;
-
-    fd = Rast_open_old(view->cell.name, view->cell.mapset);
-    dcell = Rast_allocate_d_buf();
-
-    sprintf(msg, "Displaying %s ...", view->cell.name);
-    Menu_msg(msg);
-
-    D_cell_draw_setup(top, top + nrows, left, left + ncols);
-    for (row = 0; row < nrows; row++) {
-	Rast_get_d_row_nomask(fd, dcell, row);
-	D_draw_d_raster(row, dcell, colors);
-    }
-    D_cell_draw_end();
-
-    /* only set if cell is on the target side (always a group map on the source side) */
-    if (view == VIEW_MAP2 || view == VIEW_MAP2_ZOOM)
-	cellmap_present = 1;	/* for drawcell */
-
-    Rast_close(fd);
-    G_free(dcell);
-
-
-    if (colors != &VIEW_MAP1->cell.colors)
-	set_colors(&VIEW_MAP1->cell.colors);
-
-    if (initflag) {
-	/* initialize for overlay function in drawvect routine */
-	D_new_window("warp_map", VIEW_MAP1->top, VIEW_MAP1->bottom,
-		     VIEW_MAP1->left, VIEW_MAP1->right);
-	return row == nrows;
-    }
-    return 0;
-}
-
-int re_fresh_rast(void)
-{
-    /* current location side */
-    drawcell(VIEW_MAP1, 0);	/* 0 means don't initialize ZOOM panel */
-
-    /* target side */
-    Erase_view(VIEW_MAP2);
-    Erase_view(VIEW_MAP2_ZOOM);
-
-    select_target_env();
-    drawcell(VIEW_MAP2, 0);
-    select_current_env();
-
-    return 0;
-}

+ 0 - 319
imagery/i.vpoints/drawvect.c

@@ -1,319 +0,0 @@
-#include <string.h>
-#include <grass/display.h>
-#include "vectpoints.h"
-#include <grass/vector.h>
-#include "globals.h"
-
-#define VFILES 12
-
-#define DO_REFRESH -1
-#define DO_NEW      0
-#define DO_ZOOM     1
-#define DO_WARP     2
-
-
-static int view2on, view2zoomon, numfiles = 0;
-static char vect_file[VFILES][GNAME_MAX];
-static char vect_mapset[VFILES][GMAPSET_MAX];
-static char vect_color[VFILES][10];
-static int get_clr_name(char *, int);
-static int choose_vectfile(char *, char *);
-static int drawvect(int, View *, double *, double *, int);
-
-int plotvect(void)
-{
-    return (drawvect
-	    (DO_NEW, (View *) NULL, (double *)NULL, (double *)NULL, 0));
-}
-
-int zoomvect(View * zoom_view)
-{
-    return (drawvect(DO_ZOOM, zoom_view, (double *)NULL, (double *)NULL, 0));
-}
-
-int re_fresh_vect(void)
-{
-    return (drawvect
-	    (DO_REFRESH, (View *) NULL, (double *)NULL, (double *)NULL, 0));
-}
-
-int warpvect(double E[], double N[], int trans_order)
-{
-    return (drawvect(DO_WARP, VIEW_MAP1, E, N, trans_order));
-}
-
-
-static int drawvect(int zoomit,	/* -1 = refresh, 0 = new image, 1 = zoom, 2 = warp */
-		    View * zoom_view, double E[], double N[], int trans_order)
-{				/* order of transformation if warping vectors */
-    int stat = 0;
-    int i;
-    char name[GNAME_MAX], mapset[GMAPSET_MAX];
-    struct Cell_head cellhd;
-    struct line_pnts *Points;
-    char msg[100], win_name[100];
-    int t, b, l, r;
-    int blank = 0;
-    View *active_view;
-    int left, top, nrows, ncols;
-    static int vectclr[VFILES];
-
-
-    /* if refresh screen or overlay & no displayed vector maps return */
-    if ((zoomit == DO_REFRESH || zoomit == DO_WARP) && !numfiles) {
-	if (zoomit == DO_REFRESH)
-	    display_points(1);
-	return 0;
-    }
-
-    /* numfiles stays at 0 until the end of the first vector map init */
-
-    if (numfiles >= VFILES) {
-	G_warning
-	    ("Can't display another map; reached maximum number of files");
-	return 0;
-    }
-
-    select_target_env();
-
-    if (zoomit == DO_REFRESH || zoomit == DO_NEW) {	/* New Map File or Refresh Screen */
-
-	if (zoomit == DO_NEW) {	/* zoomit==0, Draw New Map File */
-	    if (!choose_vectfile(name, mapset))
-		return 0;
-
-	    strcpy(vect_file[numfiles], name);
-	    strcpy(vect_mapset[numfiles], mapset);
-
-	    get_vector_color();	/* ask line_color to draw map */
-
-	    if (!numfiles) {	/* first map: SET VECTOR WINDOW BY WIND */
-		G_get_window(&cellhd);
-		G_copy(&VIEW_MAP2->cell.head, &cellhd, sizeof(cellhd));
-	    }
-	    else		/* not the first map */
-		G_copy(&cellhd, &VIEW_MAP2->cell.head,
-		       sizeof(VIEW_MAP2->cell.head));
-
-	    numfiles++;
-
-	}
-	else {			/* zoomit=-1 Refresh Screen */
-	    G_copy(&cellhd, &VIEW_MAP2->cell.head,
-		   sizeof(VIEW_MAP2->cell.head));
-
-	    if (!cellmap_present)
-		Erase_view(VIEW_MAP2_ZOOM);
-
-	    VIEW_MAP2_ZOOM->cell.configured = 0;
-	    blank = BLACK;
-	}
-
-	strcpy(win_name, "vect_map");
-	if (!view2on) {
-	    t = VIEW_MAP2->top;
-	    b = VIEW_MAP2->bottom;
-	    l = VIEW_MAP2->left;
-	    r = VIEW_MAP2->right;
-	    D_new_window(win_name, t, b, l, r);
-	    if (!cellmap_present)
-		blank = BLACK;
-	    else
-		blank = 0;	/* don't erase viewport */
-	    view2on = 1;
-	}
-
-	active_view = VIEW_MAP2;
-    }
-    else {			/* zoomit>0   Zoom or Warp */
-
-	G_copy(&cellhd, &zoom_view->cell.head, sizeof(zoom_view->cell.head));
-
-	if (!(zoom_view == VIEW_MAP1)) {	/* target side */
-	    VIEW_MAP2_ZOOM->cell.configured = 0;
-	    strcpy(win_name, "zoom_map");
-	    if (!view2zoomon) {
-		t = VIEW_MAP2_ZOOM->top;
-		b = VIEW_MAP2_ZOOM->bottom;
-		l = VIEW_MAP2_ZOOM->left;
-		r = VIEW_MAP2_ZOOM->right;
-		D_new_window(win_name, t, b, l, r);
-		view2zoomon = 1;
-
-	    }
-	    active_view = VIEW_MAP2_ZOOM;
-	    blank = BLACK;
-	}
-	else {
-	    strcpy(win_name, "warp_map");	/* defined in drawcell routine */
-	    active_view = VIEW_MAP1;
-	    blank = 0;		/* don't erase viewport */
-	}
-    }
-
-    nrows = active_view->nrows;
-    ncols = active_view->ncols;
-    left = active_view->left;
-    top = active_view->top;
-
-    D_set_cur_wind(win_name);
-    R_standard_color(YELLOW);
-    Outline_box(top, top + nrows - 1, left, left + ncols - 1);
-    Points = Vect_new_line_struct();
-
-    if (zoomit != DO_WARP) {
-	Curses_clear_window(INFO_WINDOW);
-	Curses_write_window(INFO_WINDOW, 1, 13, "COORDINATES");
-	Curses_write_window(INFO_WINDOW, 3, 2, "MAIN WINDOW");
-
-	sprintf(msg, "N = %10.2f   E = %10.2f", VIEW_MAP2->cell.head.north,
-		VIEW_MAP2->cell.head.east);
-	Curses_write_window(INFO_WINDOW, 5, 4, msg);
-	sprintf(msg, "S = %10.2f   W = %10.2f", VIEW_MAP2->cell.head.south,
-		VIEW_MAP2->cell.head.west);
-	Curses_write_window(INFO_WINDOW, 6, 4, msg);
-
-	Curses_write_window(INFO_WINDOW, 9, 2, "ZOOM WINDOW");
-	sprintf(msg, "N = %10.2f   E = %10.2f",
-		VIEW_MAP2_ZOOM->cell.head.north,
-		VIEW_MAP2_ZOOM->cell.head.east);
-	Curses_write_window(INFO_WINDOW, 11, 4, msg);
-	sprintf(msg, "S = %10.2f   W = %10.2f",
-		VIEW_MAP2_ZOOM->cell.head.south,
-		VIEW_MAP2_ZOOM->cell.head.west);
-	Curses_write_window(INFO_WINDOW, 12, 4, msg);
-    }
-
-    if (zoomit) {		/* ie ! DO_NEW */
-
-	dsp_setup(blank, &cellhd);
-
-	for (i = 0; i < numfiles; i++) {
-	    sprintf(msg, "Displaying %s", vect_file[i]);
-	    Menu_msg(msg);
-	    R_standard_color(vectclr[i]);
-	    if (zoomit != DO_WARP)
-		stat = plot(vect_file[i], vect_mapset[i], Points);
-	    else
-		stat = plot_warp(vect_file[i], vect_mapset[i],
-				 Points, E, N, trans_order);
-	}
-    }
-    else {			/* ie DO_NEW */
-
-	if (numfiles == 1) {	/* let first file set window */
-	    G_copy(&VIEW_MAP2->cell.head, &cellhd, sizeof(cellhd));
-
-	    cellhd.rows = VIEW_MAP2->nrows;
-	    cellhd.cols = VIEW_MAP2->ncols;
-	    cellhd.ns_res = (cellhd.north - cellhd.south) / cellhd.rows;
-	    cellhd.ew_res = (cellhd.east - cellhd.west) / cellhd.cols;
-	    if (cellhd.ns_res > cellhd.ew_res)
-		cellhd.ew_res = cellhd.ns_res;
-	    else
-		cellhd.ns_res = cellhd.ew_res;
-
-	    VIEW_MAP2->cell.ns_res = cellhd.ns_res;
-	    VIEW_MAP2->cell.ew_res = cellhd.ew_res;
-
-	    G_copy(&VIEW_MAP2->cell.head, &cellhd, sizeof(cellhd));
-
-	    G_adjust_window_to_box(&cellhd, &VIEW_MAP2->cell.head,
-				   VIEW_MAP2->nrows, VIEW_MAP2->ncols);
-
-	    if (!cellmap_present) {
-		Configure_view(VIEW_MAP2, vect_file[numfiles - 1],
-			       vect_mapset[numfiles - 1], cellhd.ns_res,
-			       cellhd.ew_res);
-	    }
-
-	    Curses_write_window(INFO_WINDOW, 15, 2,
-				"WHERE CURSOR-> Mid Button");
-	}
-
-	dsp_setup(blank, &cellhd);
-
-	R_standard_color(YELLOW);
-	Outline_box(top, top + nrows - 1, left, left + ncols - 1);
-
-	sprintf(msg, "Displaying %s", vect_file[numfiles - 1]);
-	Menu_msg(msg);
-
-	R_standard_color(line_color);
-	vectclr[numfiles - 1] = line_color;
-
-	get_clr_name(vect_color[numfiles - 1], line_color);
-
-	stat =
-	    plot(vect_file[numfiles - 1], vect_mapset[numfiles - 1], Points);
-
-    }
-
-    display_points(1);
-
-    R_standard_color(WHITE);
-    Outline_box(top, top + nrows - 1, left, left + ncols - 1);
-
-    Menu_msg("");
-
-    Vect_destroy_line_struct(Points);
-
-    /*    VIEW_MAP2->cell.configured = 1; XXX */
-
-    select_current_env();
-    if (from_screen < 0) {
-	from_flag = 1;
-	from_screen = 0;
-	if (from_keyboard < 0) {
-	    from_keyboard = 0;
-	    from_screen = 1;
-	}
-    }
-
-    if (numfiles) {
-	Curses_clear_window(MENU_WINDOW);
-	Curses_write_window(MENU_WINDOW, 1, 5, "COLOR  MAP FILE");
-	for (i = 0; i < numfiles; i++) {
-	    sprintf(msg, "%7s  %s", vect_color[i], vect_file[i]);
-	    Curses_write_window(MENU_WINDOW, i + 3, 3, msg);
-	}
-    }
-
-    return 0;
-}
-
-static int choose_vectfile(char *name, char *mapset)
-{
-    return ask_gis_files("vector", vect_list, name, mapset, 1);
-}
-
-static int get_clr_name(char *name, int clr)
-{
-    switch (clr) {
-    case BLUE:
-	strcpy(name, "blue");
-	break;
-
-    case GRAY:
-	strcpy(name, "gray");
-	break;
-
-    case GREEN:
-	strcpy(name, "green");
-	break;
-
-    case RED:
-	strcpy(name, "red");
-	break;
-
-    case WHITE:
-	strcpy(name, "white");
-	break;
-
-    case YELLOW:
-	strcpy(name, "yellow");
-	break;
-    }
-
-    return 0;
-}

+ 0 - 76
imagery/i.vpoints/driver.c

@@ -1,76 +0,0 @@
-#include "globals.h"
-
-static int use = 1;
-static int really_quit(void);
-static int dont_stop(void);
-static int stop(void);
-static int go_refresh(void);
-static int do_re_fresh(void);
-
-int driver(void)
-{
-    static Objects objects[] = {
-	MENU("QUIT", really_quit, &use),
-	MENU("ZOOM", zoom, &use),
-	MENU("RASTER", plotcell, &use),
-	MENU("VECTOR", plotvect, &use),
-	MENU("REFRESH", do_re_fresh, &use),
-	/*      MENU("cursorcol", cursor_color, &use), */
-	MENU("ANALYZE", analyze, &use),
-	INFO(" Input: ", &from_flag),
-	/*      OPTION("DIGITIZER",2,&from_digitizer),  */
-	OPTION("KEYBOARD", 2, &from_keyboard),
-	OPTION("SCREEN", 2, &from_screen),
-	OTHER(mark, &use),
-	{0}
-    };
-
-    Input_pointer(objects);
-    Menu_msg("");
-
-    return 0;
-}
-
-static int really_quit(void)
-{
-    static Objects objects[] = {
-	INFO("Quit Program? ", &use),
-	MENU("NO", dont_stop, &use),
-	MENU("YES", stop, &use),
-	{0}
-    };
-    if (Input_pointer(objects) < 0)
-	return -1;
-    return 0;			/* don't quit */
-}
-
-static int dont_stop(void)
-{
-    return 1;
-}
-
-static int stop(void)
-{
-    return -1;
-}
-
-static int go_refresh(void)
-{
-    if (cellmap_present)
-	re_fresh_rast();
-    re_fresh_vect();
-    return 1;
-}
-
-static int do_re_fresh(void)
-{
-    static Objects objects[] = {
-	INFO("Refresh display? ", &use),
-	MENU("NO", dont_stop, &use),
-	MENU("YES", go_refresh, &use),
-	{0}
-    };
-
-    Input_pointer(objects);
-    return 0;			/* don't quit */
-}

+ 0 - 21
imagery/i.vpoints/equ.c

@@ -1,21 +0,0 @@
-#include "globals.h"
-
-/*
-   Compute_equation()
-   {
-   group.equation_stat = CRS_compute_georef_equations(&group.points,
-   group.E12, group.N12, group.E21, group.N21);
-
-   return 0;
-   }
- */
-
-int CRS_Compute_equation(int order)
-{
-    group.equation_stat = CRS_compute_georef_equations(&group.points,
-						       group.E12, group.N12,
-						       group.E21, group.N21,
-						       order);
-
-    return 0;
-}

+ 0 - 21
imagery/i.vpoints/find.c

@@ -1,21 +0,0 @@
-#include <stdlib.h>
-#include "globals.h"
-
-/*
- * run etc/i.find command find all cell, vect files
- * in the target location.
- */
-int find_target_files(void)
-{
-    char command[1024];
-
-    select_target_env();
-    sprintf(command, "%s/etc/i.find %s %s cell %s vector %s",
-	    G_gisbase(), G_location(), G_mapset(), cell_list, vect_list);
-    select_current_env();
-
-    if (0 != system(command))
-	G_fatal_error("Problem running i.find");
-
-    return 0;
-}

+ 0 - 219
imagery/i.vpoints/globals.h

@@ -1,219 +0,0 @@
-#include <grass/colors.h>
-#include "defs.h"
-
-extern int cellmap_present;
-
-extern int SCREEN_TOP;
-extern int SCREEN_BOTTOM;
-extern int SCREEN_LEFT;
-extern int SCREEN_RIGHT;
-
-extern Window *INFO_WINDOW;
-extern Window *MENU_WINDOW;
-extern Window *PROMPT_WINDOW;
-
-extern View *VIEW_MAP1;
-extern View *VIEW_TITLE1;
-extern View *VIEW_MAP1_ZOOM;
-extern View *VIEW_TITLE1_ZOOM;
-
-extern View *VIEW_MAP2;
-extern View *VIEW_TITLE2;
-extern View *VIEW_MAP2_ZOOM;
-extern View *VIEW_TITLE2_ZOOM;
-
-extern View *VIEW_MENU;
-
-extern Group group;
-
-extern char interrupt_char;
-extern char *tempfile1;
-extern char *tempfile2;
-extern char *digit_points;	/* digitizer control points */
-extern char *digit_results;	/* digitizer results */
-extern int use_digitizer;	/* is there a digitizer out there? */
-
-/* group file list, target cell,vector files */
-extern char *group_list;
-extern char *cell_list;
-extern char *vect_list;
-
-extern int from_keyboard;	/* input method */
-extern int from_digitizer;
-extern int from_screen;
-extern int from_flag;
-
-extern int dotsize;
-
-extern int line_color;
-
-/* analyze.c */
-int delete_control_point(int);
-int analyze(void);
-
-/* ask.c */
-int ask_gis_files(char *, char *, char *, char *, int);
-
-/* ask_lineclr.c */
-int ask_line_color(char *, int, char *, int);
-
-/* ask_mag.c */
-int ask_magnification(int *);
-int draw_mag(void);
-
-/* call.c */
-int call(int (*)(void), char *);
-
-/* cell.c */
-int plotcell(int, int);
-
-/* cellhd.c */
-int Outline_cellhd(View *, struct Cell_head *);
-
-/* colors.c */
-int set_colors(struct Colors *);
-
-/*
-   int set_menu_colors(struct Colors *);
-   int cursor_color(void);
- */
-int get_vector_color(void);
-
-/* conv.c */
-int view_to_col(View *, int);
-int view_to_row(View *, int);
-int col_to_view(View *, int);
-int row_to_view(View *, int);
-double row_to_northing(struct Cell_head *, int, double);
-double col_to_easting(struct Cell_head *, int, double);
-double northing_to_row(struct Cell_head *, double);
-double easting_to_col(struct Cell_head *, double);
-
-/* crs.c */
-int CRS_georef(double, double, double *, double *, double[], double[], int);
-int CRS_compute_georef_equations(struct Control_Points *, double[], double[],
-				 double[], double[], int);
-/* curses.c */
-int Begin_curses(void);
-int End_curses(void);
-int Suspend_curses(void);
-int Resume_curses(void);
-int Curses_allow_interrupts(int);
-int Curses_clear_window(Window *);
-int Curses_outline_window(Window *);
-int Curses_write_window(Window *, int, int, char *);
-int Curses_replot_screen(void);
-int Curses_prompt_gets(char *, char *);
-int Beep(void);
-int Curses_getch(int);
-
-/* debug.c */
-int debug(char *, ...);
-
-/* digit.c */
-int setup_digitizer(void);
-int digitizer_point(double *, double *);
-
-/* dot.c */
-int dot(int, int);
-int save_under_dot(int, int);
-int restore_under_dot(void);
-int release_under_dot(void);
-
-/* drawcell.c */
-int drawcell(View *, int);
-int re_fresh_rast(void);
-
-/* drawvect.c */
-int plotvect(void);
-int zoomvect(View *);
-int re_fresh_vect(void);
-int warpvect(double[], double[], int);
-
-/* driver.c */
-int driver(void);
-
-/* equ.c */
-int CRS_Compute_equation(int);
-
-/* find.c */
-int find_target_files(void);
-
-/* graphics.c */
-int Init_graphics(void);
-int Outline_box(int, int, int, int);
-int Text_width(char *);
-int Text(char *, int, int, int, int, int);
-int Uparrow(int, int, int, int);
-int Downarrow(int, int, int, int);
-
-/* group.c */
-int prepare_group_list(void);
-int choose_groupfile(char *, char *);
-
-/* input.c */
-int Input_pointer(Objects *);
-int Input_box(Objects *, int, int);
-int Input_other(int (*)(void), char *);
-int Menu_msg(char *);
-int Start_mouse_in_menu(void);
-
-/* main.c */
-int main(int, char *[]);
-
-#ifdef __GNUC_MINOR__
-int quit(int) __attribute__ ((__noreturn__));
-#else
-int quit(int);
-#endif
-int error(const char *, int);
-
-/* mark.c */
-int mark(int, int, int);
-int mark_point(View *, int, int);
-
-/* mouse.c */
-int Mouse_pointer(int *, int *, int *);
-int Mouse_box_anchored(int, int, int *, int *, int *);
-int Get_mouse_xy(int *, int *);
-int Set_mouse_xy(int, int);
-
-/* open.c */
-FILE *open_vect(char *, char *);
-int close_vect(FILE *);
-
-/* points.c */
-int display_points(int);
-int display_points_in_view(View *, int, double *, double *, int *, int);
-int display_one_point(View *, double, double);
-
-/* setup.c */
-int dsp_setup(int, struct Cell_head *);
-
-/* target.c */
-int get_target(void);
-int select_current_env(void);
-int select_target_env(void);
-
-/* title.c */
-int display_title(View *);
-
-/* view.c */
-int Configure_view(View *, char *, char *, double, double);
-int In_view(View *, int, int);
-int Erase_view(View *);
-double magnification(View *);
-
-/* where.c */
-int where(int, int);
-
-/* zoom.c */
-int zoom(void);
-
-/* zoom_box.c */
-int zoom_box(void);
-
-/* zoom_pnt.c */
-int zoom_point(void);
-
-#undef INIT

+ 0 - 123
imagery/i.vpoints/graphics.c

@@ -1,123 +0,0 @@
-#include "globals.h"
-#include <grass/display.h>
-
-static View *makeview(double bottom, double top, double left, double right)
-{
-    View *view;
-
-    view = (View *) G_malloc(sizeof(View));
-
-    top = 100 - top;
-    bottom = 100 - bottom;
-
-    view->top = SCREEN_TOP + (SCREEN_BOTTOM - SCREEN_TOP) * top / 100.0;
-    view->bottom = SCREEN_TOP + (SCREEN_BOTTOM - SCREEN_TOP) * bottom / 100.0;
-    view->left = SCREEN_LEFT + (SCREEN_RIGHT - SCREEN_LEFT) * left / 100.0;
-    view->right = SCREEN_LEFT + (SCREEN_RIGHT - SCREEN_LEFT) * right / 100.0;
-
-    if (view->top < SCREEN_TOP)
-	view->top = SCREEN_TOP;
-    if (view->bottom > SCREEN_BOTTOM)
-	view->bottom = SCREEN_BOTTOM;
-    if (view->left < SCREEN_LEFT)
-	view->left = SCREEN_LEFT;
-    if (view->right > SCREEN_RIGHT)
-	view->right = SCREEN_RIGHT;
-
-    Outline_box(view->top, view->bottom, view->left, view->right);
-
-    view->top++;
-    view->bottom--;
-    view->left++;
-    view->right--;
-
-    view->nrows = view->bottom - view->top + 1;
-    view->ncols = view->right - view->left + 1;
-    view->cell.configured = 0;
-
-    return view;
-}
-
-int Init_graphics(void)
-{
-    D_full_screen();
-
-
-    SCREEN_TOP = R_screen_top();
-    SCREEN_BOTTOM = R_screen_bot();
-    SCREEN_LEFT = R_screen_left();
-    SCREEN_RIGHT = R_screen_rite();
-
-    R_standard_color(WHITE);
-
-    VIEW_TITLE1 = makeview(97.5, 100.0, 0.0, 50.0);
-    VIEW_TITLE2 = makeview(97.5, 100.0, 50.0, 100.0);
-    VIEW_MAP1 = makeview(51.0, 97.5, 0.0, 50.0);
-    VIEW_MAP2 = makeview(51.0, 97.5, 50.0, 100.0);
-    VIEW_TITLE1_ZOOM = makeview(47.5, 51.0, 0.0, 50.0);
-    VIEW_TITLE2_ZOOM = makeview(47.5, 51.0, 50.0, 100.0);
-    VIEW_MAP1_ZOOM = makeview(2.5, 47.5, 0.0, 50.0);
-    VIEW_MAP2_ZOOM = makeview(2.5, 47.5, 50.0, 100.0);
-    VIEW_MENU = makeview(0.0, 2.5, 0.0, 100.0);
-
-    Rast_init_colors(&VIEW_MAP1->cell.colors);
-    Rast_init_colors(&VIEW_MAP2->cell.colors);
-
-    return 0;
-}
-
-int Outline_box(int top, int bottom, int left, int right)
-{
-    R_move_abs(left, top);
-    R_cont_abs(left, bottom);
-    R_cont_abs(right, bottom);
-    R_cont_abs(right, top);
-    R_cont_abs(left, top);
-
-    return 0;
-}
-
-
-int Text_width(char *text)
-{
-    double top, bottom, left, right;
-
-    R_get_text_box(text, &top, &bottom, &left, &right);
-
-    if (right > left)
-	return right - left + 1;
-    else
-	return left - right + 1;
-}
-
-int Text(char *text, int top, int bottom, int left, int right, int edge)
-{
-    R_set_window(top, bottom, left, right);
-    R_move_abs(left + edge, bottom - edge);
-    R_text(text);
-    R_set_window(SCREEN_TOP, SCREEN_BOTTOM, SCREEN_LEFT, SCREEN_RIGHT);
-
-    return 0;
-}
-
-int Uparrow(int top, int bottom, int left, int right)
-{
-    R_move_abs((left + right) / 2, bottom);
-    R_cont_abs((left + right) / 2, top);
-    R_cont_rel((left - right) / 2, (bottom - top) / 2);
-    R_move_abs((left + right) / 2, top);
-    R_cont_rel((right - left) / 2, (bottom - top) / 2);
-
-    return 0;
-}
-
-int Downarrow(int top, int bottom, int left, int right)
-{
-    R_move_abs((left + right) / 2, top);
-    R_cont_abs((left + right) / 2, bottom);
-    R_cont_rel((left - right) / 2, (top - bottom) / 2);
-    R_move_abs((left + right) / 2, bottom);
-    R_cont_rel((right - left) / 2, (top - bottom) / 2);
-
-    return 0;
-}

+ 0 - 69
imagery/i.vpoints/group.c

@@ -1,69 +0,0 @@
-#include <string.h>
-#include <stdlib.h>
-#include "globals.h"
-
-static int cmp(const void *, const void *);
-
-int prepare_group_list(void)
-{
-    FILE *fd;
-    int *idx;
-    int n;
-    int len, len1, len2;
-
-    /* open file to store group file names */
-    fd = fopen(group_list, "w");
-    if (fd == NULL)
-	G_fatal_error("Can't open any tempfiles");
-
-    /*
-     * build sorted index into group files
-     * so that all raster maps for a mapset to appear together
-     */
-    idx = (int *)G_calloc(group.ref.nfiles, sizeof(int));
-    for (n = 0; n < group.ref.nfiles; n++)
-	idx[n] = n;
-    qsort(idx, group.ref.nfiles, sizeof(int), cmp);
-
-    /* determine length of longest mapset name, and longest raster map name */
-    len1 = len2 = 0;
-    for (n = 0; n < group.ref.nfiles; n++) {
-	len = strlen(group.ref.file[n].name);
-	if (len > len1)
-	    len1 = len;
-	len = strlen(group.ref.file[n].mapset);
-	if (len > len2)
-	    len2 = len;
-    }
-
-    /* write lengths, names to file */
-    fwrite(&len1, sizeof(len1), 1, fd);
-    fwrite(&len2, sizeof(len2), 1, fd);
-    for (n = 0; n < group.ref.nfiles; n++)
-	fprintf(fd, "%s %s\n", group.ref.file[idx[n]].name,
-		group.ref.file[idx[n]].mapset);
-    fclose(fd);
-
-    G_free(idx);
-
-    return 0;
-}
-
-static int cmp(const void *aa, const void *bb)
-{
-    const int *a = aa, *b = bb;
-    int n;
-
-    if (n = strcmp(group.ref.file[*a].mapset, group.ref.file[*b].mapset))
-	return n;
-    return strcmp(group.ref.file[*a].name, group.ref.file[*b].name);
-}
-
-/* ask the user to pick a file */
-int choose_groupfile(char *name, char *mapset)
-{
-    int stat;
-
-    stat = ask_gis_files("raster", group_list, name, mapset, -1);
-    return (stat);
-}

+ 0 - 314
imagery/i.vpoints/i.vpoints.html

@@ -1,314 +0,0 @@
-<h2>DESCRIPTION</h2>
-
-This program enables the user to identify coordinate pairs of points from a
-vector map or keyboard entry and corresponding points in an image to be
-rectified. The map coordinate values of each point are used to calculate a
-transformation matrix.  The operator may then use the 
-<em><a href="i.rectify.html">i.rectify</a></em> program to rectify the image using
-the transformation matrix coefficients calculated from the control point
-file created in <em>i.vpoints</em>.  The
-<em> <a href="i.rectify.html">i.rectify</a></em> program performs a first, second or
-third order transformation of the image.
-
-<p>The first step is to display the unrectified image and
-corresponding vector map data.  The operator would then
-mark corresponding control point locations on the image and
-map. To identify the precise location of a point to be
-marked, <em>i.vpoints</em> has a zoom option.  In addition to
-marking control points on an image to be rectified and
-inputting their world coordinate values using the
-keyboard,  <em>i.vpoints</em> has the option to simultaneously
-display vector map data available in the targeted database,
-and identify on the vector map the location of the
-corresponding marked points.  When this option is chosen,
-the coordinate values are input automatically.  Any GRASS
-map layer or vector map in the targeted database LOCATION
-can be displayed using <em>i.vpoints</em>.  The <em>i.vpoints</em> program
-also has the capability of overlaying (i.e., warping) the
-vector data onto the raster image to visually check the
-accuracy of the registration based on the current set of
-active control points.  During the process of marking
-points and entering map coordinates, the user can compute
-the RMS (root mean square) error for each point entered.
-The <em>i.vpoints</em>  program does this by calculating a
-transformation equation (the same one that is calculated in
-the GRASS program
-
-<a href="i.rectify.html">i.rectify</a>
-2).  Coefficients are
-computed for the equation.  The coefficients are then used in the
-equation along with the x,y coordinates of the marked points.  The
-results are plugged into an equation for RMS error.  The
-interpretation of RMS error is described in the ANALYZE subsection.
-
-
-<p>The procedures for marking control points (registration
-points), displaying vector map layers,  overlaying vector maps onto
-the raster image, and calculating RMS error are described in the
-following sections .
-
-
-<p>To enter the program (the <em>i.vpoints</em> program requires the use of a
-graphics monitor) type <em>i.vpoints</em>:
-
-
-<dl>
-     <dd><b>i.vpoints</b>
-</dl>
-
-The first prompt in the program asks for the imagery group to
-be registered . . .
-
-
-<pre>
-     Enter imagery group to be registered
-     Enter 'list' for a list of existing imagery groups
-     Enter 'list -f' for a verbose listing
-     Hit RETURN to cancel request
-     &gt;
-</pre>
-
-For example,   
-
-<dl>
-<dd>&gt;<b>list</b>     
-</dl>
-
-might produce the following response:
-
-<pre>
-     &lt;list&gt;
-     Available groups
-     - - - - - - - - - - - - - - - - - - - - - - - - - -
-     test
-     - - - - - - - - - - - - - - - - - - - - - - - - - -
-     hit RETURN to continue --&gt;
-</pre>
-whereas,  
-<dl>
-<dd>&gt;<b>list -f</b>       
-</dl>
-
-might produce the following response
-
-<pre>
-     Available groups
-     - - - - - - - - - - - - - - - - - - - - - - - - - -
-     test
-         photo in PERMANENT
-         res2 in tifftest
-     - - - - - - - - - - - - - - - - - - - - - - - - - -
-     hit RETURN to continue --&gt;
-</pre>
-
-The imagery group entered above should contain the files
-that you wish to rectify.  After entering the group to be
-registered, the terminal screen displays the message:
-<pre>
-     &gt;test
-     &lt;test&gt;
-     Use mouse now . . .
-</pre>
-And the color graphics monitor displays the following
-screen:
-
-<p>     Any single file in the imagery group may be used to mark
-points, and points can be marked on more than one file in the
-imagery group to accumulate the suggested minimum number of points
-(3 for a 1st order transformation, 6 for a 2nd order, and 10 for a
-3rd order).  Any file in the imagery group can be subsequently
-rectified (using <em><a href="i.rectify.html">i.rectify</a></em>)
-based on the transformation matrix computed from these points.
-
-<p>     The chosen file is displayed in the upper left quadrant of the
-monitor at a default magnification based on the extent of the
-current active window.
-
-<p>
-<b>RASTER IMAGE</b>
-
-<p>     The raster image option on the menu at the bottom of the
-window allows the user to display any single file in the imagery
-group in the upper right quadrant of the window screen.  The option
-provides the same file selection pick list as is presented when you
-first enter the <em>i.vpoints</em> program.  When you select this option,
-the program will erase the data contained in all of the four
-quadrant windows and will reinitialize all program values.
-
-
-<p>
-<b>VECTOR MAPS</b>
-<p>     The vector maps option on the menu at the bottom of the screen
-allows the user to display vector map data in the upper right
-quadrant of the screen.  After selecting the vector map layer to
-display, a menu selection bar appears along the bottom on the
-screen. This pick list is used to select the line color (blue,
-gray, green, red, white, or yellow) for the selected vector data
-layer.
-<p><b>Refresh</b>
-<p>     The refresh option on the main menu allows the user to
-"refresh" or re-draw the displayed vector data. This function will
-erase all outlines showing the limits of previously zoomed areas. 
-A "yes/no" roompt will appear:
-<pre>
-     Refresh Map ?       NO   YES
-</pre>
-<p><b>Zoom</b>
-<p>     To enlarge a raster or vector image, place the mouse cross
-hairs on the word zoom on the main menu and press the left button. 
-The following menu will be displayed at the bottom. of the screen:
-<pre>
-     CANCEL   BOX   POINT      Select type of zoom
-</pre>
-You have the option to identify the map extent of the zoom window
-using either the mouse to define a box, or the mouse to mark a
-center point from which to enlarge the image.  The box option first
-prompts you to identify a starting corner for the zoom region and
-then allows you to define the area to be zoomed using a rubber band
-box.  The prompts appear as follows...
-<pre>
-     CANCEL    Mark the first corner of region
-
-     CANCEL     Define the region
-</pre>
-After marking the first corner of the region to be enlarged, hold
-down the left button and move the mouse to change the size and
-shape of the rubber band box.  After defining the area to be
-enlarged, press the right button  to accept it.
-
-
-<p>
-The point method for enlarging an image will display a mouse menu
-to guide you in selecting the appropriate enlargement.  To enlarge
-or reduce the magnification factor, place the cursor on the "+" or
-"-" box and press the left button on the mouse.
-<p><p>You may zoom either the raster or the vector display.
-<p>Upon accepting the new region limits, the raster or vector data are
-redisplayed in either the lower left (raster) or lower right
-(vector) windows.
-<p>The extent of the zoomed area is outlined on the unzoomed image in
-the main window area.
-<p>     While the main menu is displayed,  you can mark
-corrosponding control points on the raster and vector
-images or enter map coordinates from the keyboard.  If you
-are using coordinates taken from a reference map, circle
-these points and then use whatever means you have available
-to identify as precisely as possible the coordinate values
-for these points.  Digitizing software is recommended,
-especially <a href="wxGUI.vdigit.html">wxGUI vector digitizer</a>. Once you have
-determined the standard coordinates (for example, UTM's) of
-each circled point, you are ready to mark the points on the
-displayed image.
-<p>     To mark the points on the image, that correspond to the points
-on the standard coordinate map, place the mouse cross hairs on the
-point on the image to be marked (you will probably have to ZOOM to
-find the exact spot) and press the left hand button on the mouse. 
-A diamond shaped symbol will be marked on the image.  The text
-monitor will display the following screen:
-<pre>
-          Point 1 marked on the image at
-          East:  1023.77
-          North:  -164.41
-
-          Enter coordinates as east north:
-</pre>
-<b>Analyze</b>
-<p>
-     After a number of points have been marked (a minimum of 4 for
-a 1st order transformation, 7 for a 2nd order, and 11 for a 3rd
-order), the RMS error of the points marked on the image can be
-checked.  This is done by placing the cross hairs on the word
-ANALYZE on the main menu at the bottom of the monitor.  The
-following error report is superimposed on the monitor:
-<pre>
-
-   error                      image                target
-  #    col  row target   east      north       east      north 
-     
-  1   -0.9  0.0  1.0   1048.5     -144.8   679132.5  4351080.6
-  2    1.0  0.4  1.3   2153.1     -567.2   684314.7  4399001.4
-  .
-  .
-  .
-          Overall rms error  76.85
-</pre>
-
-     The RMS error for the image being rectified is recorded under
-the column "error" and subTITLEd "row' and "col".  In the above
-report, the marked point number 1 is 0.0 rows and -0.9 columns from
-the predicted location calculated by the transformation equation.
-     The RMS error for the target database map is recorded under
-the heading "error"  and the subheading "target".  This is the RMS
-error for the east and the north coordinate values of the target
-map, but it is represented in the table using one general value.
-     The overall RMS error for the image is displayed at the bottom
-of the screen in meters.  Points that generate a high RMS error are
-displayed in red on the monitor.
-     The x,y coordinate values of the point marked on the image
-being rectified are recorded under the heading "image" and the
-subheadings "east" and "north".
-     The standard coordinate values of the point in the target
-database are recorded under the heading "target" and the
-subheadings "east" and "north".
-     If the user would like to exclude or include a point, this can
-be accomplished by placing the mouse cross hairs on the point
-number to be included (if the point is absent) or excluded (if the
-point is displayed) and then pressing the left button on the mouse
-twice.  When a point is excluded, it is not included in the
-calculation of the RMS error, or included in the final
-transformation matrix.  However, it can be retrieved within
-<em>i.vpoints</em> at any time by double clicking with the mouse as
-described above.
-<p>The following menu appears at the bottom of the monitor:
-<pre>
-   DONE   PRINT   FILE   OVERLAY   DELETE ON       Transformation -
--&gt;   1st ORDER   Double click on point to be DELETED
-</pre>
-Selecting DELETE ON will toggle the option to DELETE OFF, the
-toggle option is used to allow the user to physically remove a
-control point from the POINTS file instead of just flagging it as
-an non-active reference point.
-<p><b>Overlay</b>
-<p>Overlay allows the user to overlay the vector map(s) onto the
-raster image.  Overlay can be used to warp (register) and display
-the selected vector map data on top of the raster image contained
-in the upper left window of the color screen.  An inverse
-coordinate transformation is performed using the currently active
-order of transformation (i.e., first, second, or third).
-<pre>
-     Overlay vectors on raster image   NO   YES
-</pre>
-By selecting the 1st ORDER option, the user may select the order of
-transformation desired:
-<pre>
-     Select order of transformation --&gt; 1st Order 2nd Order 3rd Order
-</pre>
-The program will immediately recalculate the RMSE and the number of
-points required.
-<p><b>Quit</b>
-<p>     To exit the <em>i.vpoints</em> program, place the mouse cross hairs on
-the word QUIT at the bottom of the monitor and all of the marked
-points (including coordinates) will be saved.
-
-<h2>SEE ALSO</h2>
-
-The GRASS 4 <em>
-<a href="http://grass.itc.it/gdp/imagery/grass4_image_processing.pdf">Image
-Processing manual</a></em>
-
-<p><em>
-<a href="g.mapsets.html">g.mapsets</a><br>
-<a href="i.group.html">i.group</a><br>
-<a href="i.points.html">i.points</a><br>
-<a href="i.rectify.html">i.rectify</a><br>
-<a href="i.target.html">i.target</a>
-</em><br>
-<em><a href="gm_georect.html">gis.m: GEORECTIFY TOOL</a></em>
-
-
-<h2>AUTHOR</h2>
-
-William R. Enslin, Michigan State University Center for Remote Sensing<br>
-Radim Blazek (update to GRASS 5.7)<br>
-Hamish Bowman (finish GRASS 6 porting)
-<p><i>Last changed: $Date$</i>

+ 0 - 263
imagery/i.vpoints/input.c

@@ -1,263 +0,0 @@
-#include "globals.h"
-#include <grass/display.h>
-
-static int active = 0;
-static int replot;
-static int mouse(Objects *, int, int, int);
-static int use_mouse_msg(void);
-static int draw_objects(Objects *);
-static Objects *find(Objects *, int, int);
-static int select_option(Objects *, Objects *);
-static int draw_option_boxes(Objects *);
-static int visible(Objects *);
-
-#define TEXT_COLOR BLACK
-#define FILL_COLOR GREY
-#define OUTLINE_COLOR WHITE
-
-/* Input: drive mouse. returns status of handler that returns != 0 */
-int Input_pointer(Objects * objects)
-{
-    return mouse(objects, 0, 0, 0);
-}
-
-int Input_box(Objects * objects, int ax, int ay)
-{
-    return mouse(objects, ax, ay, 1);
-}
-
-int Input_other(int (*function) (void), char *type)
-{
-    int stat;
-    char msg[1024];
-
-    sprintf(msg, "%s input required", type);
-    Menu_msg(msg);
-
-    stat = (*function) ();
-    if (active) {
-	use_mouse_msg();
-    }
-
-    Menu_msg("");
-    return stat;
-}
-
-static int mouse(Objects * objects, int ax, int ay, int box)
-{
-    int first;
-    int stat;
-    int x, y, button;
-    Objects *obj;
-
-
-    first = !active;
-    active = 1;
-    if (first)
-	use_mouse_msg();
-
-    if (box) {
-	x = ax + 20;
-	y = ay + 20;
-    }
-    stat = 0;
-    replot = 1;
-    while (stat == 0) {
-	if (replot) {
-	    replot = 0;
-	    draw_objects(objects);
-	}
-	if (box)
-	    Mouse_box_anchored(ax, ay, &x, &y, &button);
-	else
-	    Mouse_pointer(&x, &y, &button);
-
-	if (!(obj = find(objects, x, y)))
-	    continue;
-
-	switch (obj->type) {
-	case MENU_OBJECT:
-	case OTHER_OBJECT:
-	    stat = (*obj->handler) (x, y, button);
-	    break;
-	case OPTION_OBJECT:
-	    select_option(objects, obj);
-	    draw_option_boxes(objects);
-	    break;
-	}
-    }
-
-    /* if we are first call, mark not active
-     * indicate that objects above use must be replotted.
-     */
-    if (first)
-	active = 0;
-    Menu_msg("");
-
-    return stat;
-}
-
-
-static int use_mouse_msg(void)
-{
-    Curses_write_window(PROMPT_WINDOW, 1, 1, "Use mouse now ...\n");
-
-    return 0;
-}
-
-static int draw_objects(Objects * objects)
-{
-    Objects *obj;
-    int top, bottom, left, right;
-    int size, edge;
-
-
-    /* erase the menu window */
-    Erase_view(VIEW_MENU);
-    R_flush();
-
-    /* determine sizes and text indentation */
-    size = VIEW_MENU->nrows - 4;
-    edge = 2;
-
-    R_text_size(size, size);
-
-    left = VIEW_MENU->left;
-    top = VIEW_MENU->top;
-    bottom = VIEW_MENU->bottom;
-
-
-    /* put the (boxed) text on the menu view */
-    for (obj = objects; obj->type; obj++) {
-	if (!visible(obj))
-	    continue;
-	switch (obj->type) {
-	case OPTION_OBJECT:
-	case MENU_OBJECT:
-	    right = left + 2 * edge + Text_width(obj->label);
-	    obj->left = left;
-	    obj->right = right;
-	    obj->top = top;
-	    obj->bottom = bottom;
-
-	    R_standard_color(FILL_COLOR);
-	    R_box_abs(left, top, right, bottom);
-
-	    R_standard_color(TEXT_COLOR);
-	    Text(obj->label, top, bottom, left, right, edge);
-
-	    R_standard_color(OUTLINE_COLOR);
-	    Outline_box(top, bottom, left, right);
-
-	    left = right;
-	    break;
-
-	case INFO_OBJECT:
-	    if (*obj->label == 0)
-		break;
-	    if (*obj->status < 0)
-		break;
-	    right = left + 2 * edge + Text_width(obj->label);
-	    R_standard_color(WHITE);
-	    Text(obj->label, top, bottom, left, right, edge);
-
-	    left = right;
-	    break;
-	}
-    }
-    draw_option_boxes(objects);
-    R_flush();
-
-    return 0;
-}
-
-static Objects *find(Objects * objects, int x, int y)
-{
-    Objects *other;
-
-    other = NULL;
-    for (; objects->type; objects++) {
-	if (!visible(objects))
-	    continue;
-	switch (objects->type) {
-	case MENU_OBJECT:
-	case OPTION_OBJECT:
-	    if (x >= objects->left && x <= objects->right
-		&& y >= objects->top && y <= objects->bottom)
-		return objects;
-	    break;
-	case OTHER_OBJECT:
-	    other = objects;
-	    break;
-	}
-    }
-    return other;
-}
-
-static int select_option(Objects * objects, Objects * obj)
-{
-    while (objects->type) {
-	if (objects->type == OPTION_OBJECT && *objects->status >= 0 &&
-	    objects->binding == obj->binding)
-	    *objects->status = 0;
-	objects++;
-    }
-    *obj->status = 1;
-
-    return 0;
-}
-
-static int draw_option_boxes(Objects * objects)
-{
-    Objects *x;
-
-    R_standard_color(OUTLINE_COLOR);
-    for (x = objects; x->type; x++) {
-	if (x->type == OPTION_OBJECT && *x->status == 0)
-	    Outline_box(x->top + 1, x->bottom, x->left, x->right - 1);
-    }
-    R_standard_color(GREEN);
-    for (x = objects; x->type; x++) {
-	if (x->type == OPTION_OBJECT && *x->status > 0)
-	    Outline_box(x->top + 1, x->bottom, x->left, x->right - 1);
-    }
-    R_flush();
-
-    return 0;
-}
-
-static int visible(Objects * object)
-{
-    if (object->type == OPTION_OBJECT)
-	return (*object->status >= 0);
-    return (*object->status > 0);
-}
-
-int Menu_msg(char *msg)
-{
-    int size, edge;
-
-    size = VIEW_MENU->nrows - 4;
-    edge = 2;
-
-    Erase_view(VIEW_MENU);
-
-    if (*msg) {
-	R_text_size(size, size);
-	R_standard_color(WHITE);
-	Text(msg, VIEW_MENU->top, VIEW_MENU->bottom,
-	     VIEW_MENU->left, VIEW_MENU->right, edge);
-    }
-    R_flush();
-    replot = 1;
-
-    return 0;
-}
-
-int Start_mouse_in_menu(void)
-{
-    Set_mouse_xy((VIEW_MENU->left + 2 * VIEW_MENU->right) / 3,
-		 (VIEW_MENU->top + VIEW_MENU->bottom) / 2);
-
-    return 0;
-}

+ 0 - 269
imagery/i.vpoints/main.c

@@ -1,269 +0,0 @@
-
-/****************************************************************************
- *
- * MODULE:       i.vpoints
- * AUTHOR(S):    Bill Enslin & Brian Buckley
- *                     Center for Remote Sensing
- *                     Michigan State University
- *                     302 Berkey Hall
- *                     East Lansing, MI 48824-1111 
- *                     (517) - 353-7195 (original contributors)
- *               Radim Blazek <radim.blazek gmail.com>
- *               Markus Neteler <neteler itc.it>
- *               Bernhard Reiter <bernhard intevation.de>, 
- *               Glynn Clements <glynn gclements.plus.com>, 
- *               Hamish Bowman <hamish_b yahoo.com>
- * PURPOSE:      REVISION of i.points to work with vector map layers
- *               and 2nd/3rd order transformations
- * COPYRIGHT:    (C) 1999-2007 by the GRASS Development Team
- *
- *               This program is free software under the GNU General Public
- *               License (>=v2). Read the file COPYING that comes with GRASS
- *               for details.
- *
- *****************************************************************************/
-
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <signal.h>
-#include <grass/gis.h>
-#include <grass/display.h>
-#include <grass/glocale.h>
-#include "globals.h"
-
-int cellmap_present;
-
-int SCREEN_TOP;
-int SCREEN_BOTTOM;
-int SCREEN_LEFT;
-int SCREEN_RIGHT;
-
-Window *INFO_WINDOW;
-Window *MENU_WINDOW;
-Window *PROMPT_WINDOW;
-
-View *VIEW_MAP1;
-View *VIEW_TITLE1;
-View *VIEW_MAP1_ZOOM;
-View *VIEW_TITLE1_ZOOM;
-
-View *VIEW_MAP2;
-View *VIEW_TITLE2;
-View *VIEW_MAP2_ZOOM;
-View *VIEW_TITLE2_ZOOM;
-
-View *VIEW_MENU;
-
-Group group;
-
-char interrupt_char;
-char *tempfile1;
-char *tempfile2;
-char *digit_points;	/* digitizer control points */
-char *digit_results;	/* digitizer results */
-int use_digitizer;	/* is there a digitizer out there? */
-
-/* group file list, target cell,vector files */
-char *group_list;
-char *cell_list;
-char *vect_list;
-
-int from_keyboard = -1;	/* input method */
-int from_digitizer = -1;
-int from_screen = -1;
-int from_flag;
-
-int dotsize = 4;
-
-int line_color;
-
-int main(int argc, char *argv[])
-{
-    char name[GNAME_MAX], mapset[GMAPSET_MAX], xmapset[GMAPSET_MAX];
-    struct Cell_head cellhd;
-    struct Option *grp;
-    struct GModule *module;
-
-    /* must run in a term window */
-    G_putenv("GRASS_UI_TERM", "1");
-
-    G_gisinit(argv[0]);
-
-    module = G_define_module();
-    G_add_keyword(_("imagery"));
-    G_add_keyword(_("geometry"));
-    module->description =
-	_("Set registration points for an imagery group from a vector map "
-	  "or keyboard entry.");
-
-    grp = G_define_option();
-    grp->key = "group";
-    grp->type = TYPE_STRING;
-    grp->required = YES;
-    grp->gisprompt = "old,group,group";
-    grp->description = _("Name of imagery group to be registered");
-
-    if (G_parser(argc, argv))
-	exit(EXIT_FAILURE);
-
-
-    Rast_suppress_masking();	/* to do this for target location */
-
-    interrupt_char = G_intr_char();
-    tempfile1 = G_tempfile();
-    tempfile2 = G_tempfile();
-    cell_list = G_tempfile();
-    vect_list = G_tempfile();
-    group_list = G_tempfile();
-    digit_points = G_tempfile();
-    digit_results = G_tempfile();
-
-    R_open_driver();
-
-    /* parse group name */
-    /* only enforce local-mapset-only due to I_get_group_ref() not liking "@mapset" */
-    if (G_name_is_fully_qualified(grp->answer, group.name, xmapset)) {
-	if (0 != strcmp(G_mapset(), xmapset))
-	    G_fatal_error(_("[%s] Only local groups may be used"),
-			  grp->answer);
-    }
-    else {
-	strncpy(group.name, grp->answer, GNAME_MAX - 1);
-	group.name[GNAME_MAX - 1] = '\0';	/* strncpy() doesn't null terminate on overflow */
-    }
-
-    if (!I_get_group_ref(group.name, &group.ref))
-	G_fatal_error(_("Group [%s] contains no maps, run i.group"),
-		      group.name);
-
-    if (group.ref.nfiles <= 0)
-	G_fatal_error(_("Group [%s] contains no maps, run i.group"),
-		      group.name);
-
-    /* write group files to group list file */
-    prepare_group_list();
-
-    /* get target info and environment */
-    get_target();
-    find_target_files();
-
-    /* read group control points, if any */
-    G_suppress_warnings(1);
-    if (!I_get_control_points(group.name, &group.points))
-	group.points.count = 0;
-    G_suppress_warnings(0);
-
-    /* determine transformation equation */
-    CRS_Compute_equation(1);
-
-    signal(SIGINT, SIG_IGN);
-    /*  signal (SIGQUIT, SIG_IGN); */
-
-    Init_graphics();
-    display_title(VIEW_MAP1);
-    select_target_env();
-    display_title(VIEW_MAP2);
-    select_current_env();
-
-    Begin_curses();
-    G_set_error_routine(error);
-
-    /*
-       #ifdef SIGTSTP
-       signal (SIGTSTP, SIG_IGN);
-       #endif
-     */
-
-
-    /* ask user for group file to be displayed */
-    do {
-	if (!choose_groupfile(name, mapset))
-	    quit(0);
-	/* display this file in "map1" */
-    }
-    while (!G_find_raster2(name, mapset));
-    Rast_get_cellhd(name, mapset, &cellhd);
-
-    G_adjust_window_to_box(&cellhd, &VIEW_MAP1->cell.head, VIEW_MAP1->nrows,
-			   VIEW_MAP1->ncols);
-    Configure_view(VIEW_MAP1, name, mapset, cellhd.ns_res, cellhd.ew_res);
-
-    drawcell(VIEW_MAP1, 1);
-    display_points(1);
-
-    Curses_clear_window(PROMPT_WINDOW);
-
-    /* determine initial input method. */
-
-    use_digitizer = 0;
-
-    /*    DELETED 6-25-92 if want to permanently delete, delete digit.c
-       and other references to digitizer stuff
-
-       setup_digitizer();
-       if (use_digitizer)
-       {
-       from_digitizer = 1;
-       from_keyboard  = 0;
-       from_flag = 1;
-       }
-     */
-
-    /*go do the work */
-    cellmap_present = 0;
-    driver();
-
-    quit(0);
-}
-
-int quit(int n)
-{
-    char command[1024];
-
-    End_curses();
-    R_close_driver();
-    if (use_digitizer) {
-	sprintf(command, "%s/etc/geo.unlock %s", G_gisbase(), digit_points);
-	system(command);
-    }
-    unlink(tempfile1);
-    unlink(tempfile2);
-    unlink(cell_list);
-    unlink(group_list);
-    unlink(vect_list);
-    unlink(digit_points);
-    unlink(digit_results);
-
-    system("d.frame -s full_screen -e");
-
-    exit(n);
-}
-
-int error(const char *msg, int fatal)
-{
-    char buf[200];
-    int x, y, button;
-
-    Curses_clear_window(PROMPT_WINDOW);
-    Curses_write_window(PROMPT_WINDOW, 1, 1, "LOCATION:\n");
-    Curses_write_window(PROMPT_WINDOW, 1, 12, G_location());
-    Curses_write_window(PROMPT_WINDOW, 2, 1, "MAPSET:\n");
-    Curses_write_window(PROMPT_WINDOW, 2, 12, G_location());
-
-    Beep();
-    if (fatal)
-	sprintf(buf, _("ERROR: %s"), msg);
-    else
-	sprintf(buf, _("WARNING: %s (click mouse to continue)"), msg);
-
-    Menu_msg(buf);
-
-    if (fatal)
-	quit(1);
-
-    Mouse_pointer(&x, &y, &button);
-    Curses_clear_window(PROMPT_WINDOW);
-
-    return 0;
-}

+ 0 - 197
imagery/i.vpoints/mark.c

@@ -1,197 +0,0 @@
-#include "globals.h"
-#include <grass/display.h>
-
-static int get_point2(double *, double *);
-static int keyboard(void);
-static int _keyboard(void);
-static int digitizer(void);
-static int screen(int, int, int);
-static int cancel(void);
-
-int mark(int x, int y, int button)
-{
-    if (button != 1)
-	return where(x, y);
-
-    if (VIEW_MAP1->cell.configured && In_view(VIEW_MAP1, x, y))
-	mark_point(VIEW_MAP1, x, y);
-    else if (VIEW_MAP1_ZOOM->cell.configured && In_view(VIEW_MAP1_ZOOM, x, y))
-	mark_point(VIEW_MAP1_ZOOM, x, y);
-    return 0;			/* return but don't quit */
-}
-
-int mark_point(View * view, int x, int y)
-{
-    double e1, n1;
-    double e2, n2;
-    int row, col;
-
-    char buf[100];
-
-    /* convert x,y to east,north at center of cell */
-    col = view_to_col(view, x);
-    e1 = col_to_easting(&view->cell.head, col, 0.5);
-    row = view_to_row(view, y);
-    n1 = row_to_northing(&view->cell.head, row, 0.5);
-
-    Curses_clear_window(MENU_WINDOW);
-    sprintf(buf, "Point %d marked on image at", group.points.count + 1);
-    Curses_write_window(MENU_WINDOW, 1, 1, buf);
-    sprintf(buf, "East:  %10.2f", e1);
-    Curses_write_window(MENU_WINDOW, 3, 3, buf);
-    sprintf(buf, "North: %10.2f", n1);
-    Curses_write_window(MENU_WINDOW, 4, 3, buf);
-    Curses_clear_window(INFO_WINDOW);
-
-    R_standard_color(ORANGE);
-
-    save_under_dot(x, y);
-
-    dot(x, y);
-
-    if (!get_point2(&e2, &n2)) {
-	Curses_clear_window(MENU_WINDOW);
-	restore_under_dot();
-    }
-    else {
-	Curses_write_window(MENU_WINDOW, 7, 1, "Point located at");
-	sprintf(buf, "East:  %10.2f", e2);
-	Curses_write_window(MENU_WINDOW, 9, 3, buf);
-	sprintf(buf, "North: %10.2f", n2);
-	Curses_write_window(MENU_WINDOW, 10, 3, buf);
-	I_new_control_point(&group.points, e1, n1, e2, n2, 1);
-	I_put_control_points(group.name, &group.points);
-	CRS_Compute_equation(1);
-	display_points(1);
-    }
-    release_under_dot();
-
-    return 0;
-}
-
-static double N, E;
-
-static int get_point2(double *east, double *north)
-{
-    int stat;
-    static int use = 1;
-    static Objects objects[] = {
-	MENU("CANCEL", cancel, &use),
-	INFO("Mark point on target image", &use),
-	OTHER(screen, &use),
-	{0}
-    };
-
-    if (from_digitizer > 0) {
-	stat = Input_other(digitizer, "Digitizer");
-    }
-    else if (from_screen > 0) {
-	/*      set_colors (&VIEW_MAP2->cell.colors); */
-	stat = Input_pointer(objects) > 0;
-	/*      set_colors (&VIEW_MAP1->cell.colors); */
-    }
-    else
-	stat = Input_other(keyboard, "Keyboard");
-
-    if (stat) {
-	*east = E;
-	*north = N;
-    }
-
-    return stat;
-}
-
-static int keyboard(void)
-{
-    int ok;
-
-    Curses_clear_window(INFO_WINDOW);
-    ok = _keyboard();
-    Curses_clear_window(INFO_WINDOW);
-    return ok;
-}
-
-static int _keyboard(void)
-{
-    char buf[100], buf1[100], buf2[100];
-
-    while (1) {
-	Curses_prompt_gets("Enter coordinates as east north: ", buf);
-	G_strip(buf);
-	if (*buf == 0) {
-	    return 0;
-	}
-	if (sscanf(buf, "%s %s", buf1, buf2) != 2) {
-	    Beep();
-	    continue;
-	}
-	/* scan for lat/lon string first as "123E 45S" passes the %lf test but is wrong */
-	if (!(G_lon_scan(buf1, &E) && G_lat_scan(buf2, &N))) {
-	    if (sscanf(buf, "%lf %lf", &E, &N) != 2) {
-		Beep();
-		continue;
-	    }
-	}
-
-	Curses_clear_window(INFO_WINDOW);
-	sprintf(buf, "East:   %f\n", E);
-	Curses_write_window(INFO_WINDOW, 2, 2, buf);
-	sprintf(buf, "North:  %f\n", N);
-	Curses_write_window(INFO_WINDOW, 3, 2, buf);
-	Curses_write_window(INFO_WINDOW, 5, 1, "Look ok? (y/n) ");
-
-	while (1) {
-	    int c;
-
-	    c = Curses_getch(0);
-	    if (c == 'y' || c == 'Y')
-		return 1;
-	    if (c == 'n' || c == 'N')
-		break;
-	    Beep();
-	}
-    }
-
-    return 0;
-}
-
-static int digitizer(void)
-{
-    return digitizer_point(&E, &N);
-}
-
-
-static int screen(int x, int y, int button)
-{
-    int row, col;
-    char buf[50];
-
-    View *view;
-
-    if (In_view(VIEW_MAP2, x, y) && VIEW_MAP2->cell.configured)
-	view = VIEW_MAP2;
-    else if (In_view(VIEW_MAP2_ZOOM, x, y) && VIEW_MAP2_ZOOM->cell.configured)
-	view = VIEW_MAP2_ZOOM;
-    else
-	return 0;		/* ignore mouse event */
-
-    col = view_to_col(view, x);
-    E = col_to_easting(&view->cell.head, col, 0.5);
-    row = view_to_row(view, y);
-    N = row_to_northing(&view->cell.head, row, 0.5);
-
-    if (button == 1)
-	return 1;
-
-    sprintf(buf, "East:   %10.2f\n", E);
-    Curses_write_window(INFO_WINDOW, 2, 2, buf);
-    sprintf(buf, "North:  %10.2f\n", N);
-    Curses_write_window(INFO_WINDOW, 3, 2, buf);
-
-    return 0;
-}
-
-static int cancel(void)
-{
-    return -1;
-}

+ 0 - 56
imagery/i.vpoints/mouse.c

@@ -1,56 +0,0 @@
-#include "globals.h"
-#include <grass/display.h>
-
-static int first = 1;
-static int curx, cury;
-
-int Mouse_pointer(int *x, int *y, int *button)
-{
-    if (first) {
-	curx = (SCREEN_LEFT + SCREEN_RIGHT) / 2;
-	cury = (SCREEN_TOP + SCREEN_BOTTOM) / 2;
-	first = 0;
-    }
-    R_get_location_with_pointer(&curx, &cury, button);
-    *x = curx;
-    *y = cury;
-
-#ifdef BUTTON3
-    if (*button == 3)
-	quit(0);
-#endif
-
-    return 0;
-}
-
-int Mouse_box_anchored(int x1, int y1, int *x2, int *y2, int *button)
-{
-    R_get_location_with_box(x1, y1, x2, y2, button);
-    curx = *x2;
-    cury = *y2;
-    first = 0;
-
-#ifdef BUTTON3
-    if (*button == 3)
-	quit(0);
-#endif
-
-    return 0;
-}
-
-int Get_mouse_xy(int *x, int *y)
-{
-    *x = curx;
-    *y = cury;
-
-    return 0;
-}
-
-int Set_mouse_xy(int x, int y)
-{
-    first = 0;
-    curx = x;
-    cury = y;
-
-    return 0;
-}

+ 0 - 161
imagery/i.vpoints/plot.c

@@ -1,161 +0,0 @@
-#include <unistd.h>
-#include <grass/gis.h>
-#include <grass/vector.h>
-#include <grass/display.h>
-#include <grass/symbol.h>
-#include <grass/glocale.h>
-#include "vectpoints.h"
-#include "globals.h"
-
-
-#define SYM_SIZE 5
-#define SYM_NAME "basic/cross1"
-
-
-int plot(char *name, char *mapset, struct line_pnts *Points)
-{
-    int line, nlines, ltype;
-    struct Cell_head window;
-    struct Map_info P_map;
-    SYMBOL *Symb;
-    RGBA_Color *linecolor_rgb, *fillcolor_rgb;
-    struct color_rgb rgb;
-    int ix, iy;
-
-    Vect_set_open_level(2);
-    Vect_set_fatal_error(GV_FATAL_RETURN);
-
-    if (2 > Vect_open_old(&P_map, name, mapset)) {
-	return -1;
-    }
-
-    G_get_set_window(&window);
-
-    nlines = Vect_get_num_lines(&P_map);
-
-    /* set line and fill color for vector point symbols */
-    linecolor_rgb = G_malloc(sizeof(RGB_Color));
-    fillcolor_rgb = G_malloc(sizeof(RGB_Color));
-
-    rgb = G_standard_color_rgb(line_color);
-    linecolor_rgb->r = rgb.r;
-    linecolor_rgb->g = rgb.g;
-    linecolor_rgb->b = rgb.b;
-    linecolor_rgb->a = RGBA_COLOR_OPAQUE;
-    fillcolor_rgb->a = RGBA_COLOR_NONE;
-
-
-    for (line = 1; line <= nlines; line++) {
-	ltype = Vect_read_line(&P_map, Points, NULL, line);
-
-	if (ltype & GV_POINT) {	/* GV_ singular: don't plot centroids, Points only */
-
-	    Symb = S_read(SYM_NAME);
-
-	    if (Symb == NULL) {
-		G_warning(_("Cannot read symbol, cannot display points"));
-		return (-1);
-	    }
-	    else
-		S_stroke(Symb, SYM_SIZE, 0, 0);
-
-	    ix = (int)(D_u_to_d_col(Points->x[0]) + 0.5);
-	    iy = (int)(D_u_to_d_row(Points->y[0]) + 0.5);
-
-	    D_symbol(Symb, ix, iy, linecolor_rgb, fillcolor_rgb);
-	}
-
-
-	if (ltype & GV_LINES) {	/* GV_ plural: both lines and boundaries */
-	    D_polyline(Points->x, Points->y, Points->n_points);
-	}
-    }
-
-    Vect_close(&P_map);
-    G_free(linecolor_rgb);
-    G_free(fillcolor_rgb);
-
-    return 0;
-}
-
-/* plot inverse coordinate transformation */
-int plot_warp(char *name, char *mapset, struct line_pnts *Points,
-	      double E[], double N[], int trans_order)
-{
-    double *x, *y;
-    int i, np;
-    int line, nlines, ltype;
-    struct Cell_head window;
-    struct Map_info P_map;
-    SYMBOL *Symb;
-    RGBA_Color *linecolor_rgb, *fillcolor_rgb;
-    struct color_rgb rgb;
-    int ix, iy;
-
-    Vect_set_open_level(2);
-    Vect_set_fatal_error(GV_FATAL_RETURN);
-
-    if (2 > Vect_open_old(&P_map, name, mapset)) {
-	return -1;
-    }
-
-    G_get_set_window(&window);
-
-    nlines = Vect_get_num_lines(&P_map);
-
-    /* set line and fill color for vector point symbols */
-    linecolor_rgb = G_malloc(sizeof(RGB_Color));
-    fillcolor_rgb = G_malloc(sizeof(RGB_Color));
-
-    rgb = G_standard_color_rgb(line_color);
-    linecolor_rgb->r = rgb.r;
-    linecolor_rgb->g = rgb.g;
-    linecolor_rgb->b = rgb.b;
-    linecolor_rgb->a = RGBA_COLOR_OPAQUE;
-    fillcolor_rgb->a = RGBA_COLOR_NONE;
-
-
-    for (line = 1; line <= nlines; line++) {
-	ltype = Vect_read_line(&P_map, Points, NULL, line);
-
-	if (ltype & GV_POINT) {	/* GV_ singular: don't plot centroids, Points only */
-
-	    Symb = S_read(SYM_NAME);
-
-	    if (Symb == NULL) {
-		G_warning(_("Cannot read symbol, cannot display points"));
-		return (-1);
-	    }
-	    else
-		S_stroke(Symb, SYM_SIZE, 0, 0);
-
-	    x = Points->x;
-	    y = Points->y;
-
-	    CRS_georef(x[0], y[0], &x[0], &y[0], E, N, trans_order);
-
-	    ix = (int)(D_u_to_d_col(x[0]) + 0.5);
-	    iy = (int)(D_u_to_d_row(y[0]) + 0.5);
-
-	    D_symbol(Symb, ix, iy, linecolor_rgb, fillcolor_rgb);
-	}
-
-	if (ltype & GV_LINES) {	/* GV_ plural: both lines and boundaries */
-
-	    np = Points->n_points;
-	    x = Points->x;
-	    y = Points->y;
-
-	    for (i = 1; i < np; i++)
-		CRS_georef(x[i], y[i], &x[i], &y[i], E, N, trans_order);
-
-	    D_polyline(x, y, np);
-	}
-    }
-
-    Vect_close(&P_map);
-    G_free(linecolor_rgb);
-    G_free(fillcolor_rgb);
-
-    return 0;
-}

+ 0 - 60
imagery/i.vpoints/points.c

@@ -1,60 +0,0 @@
-#include "globals.h"
-#include <grass/display.h>
-
-/* overlay ground control points on the display */
-
-int display_points(int in_color)
-{
-
-    display_points_in_view(VIEW_MAP1, in_color,
-			   group.points.e1, group.points.n1,
-			   group.points.status, group.points.count);
-
-    display_points_in_view(VIEW_MAP1_ZOOM, in_color,
-			   group.points.e1, group.points.n1,
-			   group.points.status, group.points.count);
-
-    display_points_in_view(VIEW_MAP2, in_color,
-			   group.points.e2, group.points.n2,
-			   group.points.status, group.points.count);
-
-    display_points_in_view(VIEW_MAP2_ZOOM, in_color,
-			   group.points.e2, group.points.n2,
-			   group.points.status, group.points.count);
-
-    return 0;
-}
-
-int display_points_in_view(View * view, int in_color,
-			   double *east, double *north, int *status,
-			   int count)
-{
-    if (!view->cell.configured)
-	return 1;
-    while (count-- > 0) {
-	if (in_color && (*status > 0))
-	    R_standard_color(GREEN);
-	else if (in_color && (*status == 0))
-	    R_standard_color(RED);
-	else
-	    R_standard_color(GREY);
-	status++;
-	display_one_point(view, *east++, *north++);
-    }
-
-    return 0;
-}
-
-int display_one_point(View * view, double east, double north)
-{
-    int row, col, x, y;
-
-    row = northing_to_row(&view->cell.head, north) + .5;
-    col = easting_to_col(&view->cell.head, east) + .5;
-    y = row_to_view(view, row);
-    x = col_to_view(view, col);
-    if (In_view(view, x, y))
-	dot(x, y);
-
-    return 0;
-}

+ 0 - 70
imagery/i.vpoints/setup.c

@@ -1,70 +0,0 @@
-#include <string.h>
-#include <grass/gis.h>
-#include <grass/display.h>
-#include "globals.h"
-
-/* D_setup (clear)
- *
- * This is a high level D call.
- * It does a full setup for the current graphics frame.
- *
- *   1. Makes sure there is a current graphics frame
- *      (will create a full-screen one, if not
- *   2. Sets the region coordinates so that the graphics frame
- *      and the active program region agree
- *      (may change active program region to do this).
- *   3. Performs graphic frame/region coordinate conversion intialization
- *
- * Returns: 0 if ok. Exits with error message if failure.
- *
- * Note: Connection to driver must already be made.
- *
- * clear values:
- *   1: clear frame (visually and coordinates)
- *   0: do not clear frame
- */
-
-int dsp_setup(int blank, struct Cell_head *cellhead)
-{
-    char name[128];
-    double t, b, l, r;
-
-    if (D_get_cur_wind(name)) {
-	t = R_screen_top();
-	b = R_screen_bot();
-	l = R_screen_left();
-	r = R_screen_rite();
-	strcpy(name, "full_screen");
-	D_new_window(name, t, b, l, r);
-    }
-
-    if (D_set_cur_wind(name))
-	G_fatal_error("Current graphics frame not available");
-
-    D_get_screen_window(&t, &b, &l, &r);
-
-    /* clear the window, if requested to do so */
-    if (blank) {
-	D_clear_window();
-	if (!cellmap_present) {
-	    R_standard_color(blank);
-	    R_box_abs(l, t, r, b);
-	}
-    }
-
-    D_check_map_window(cellhead);
-
-    if (Rast_set_window(cellhead) < 0)
-	G_fatal_error("Invalid graphics window coordinates");
-
-    /* Determine conversion factors */
-    D_do_conversions(cellhead, t, b, l, r);
-
-    D_set_clip(t, b, l, r);
-
-    /* set text clipping, for good measure */
-    R_set_window(t, b, l, r);
-    R_move_abs(0, 0);
-    D_move_abs(0, 0);
-    return 0;
-}

+ 0 - 69
imagery/i.vpoints/target.c

@@ -1,69 +0,0 @@
-#include <unistd.h>
-#include <string.h>
-#include <grass/gis.h>
-#include "globals.h"
-
-/* read the target for the group and cast it into the alternate GRASS env */
-
-static int which_env;
-
-int get_target(void)
-{
-    char location[GNAME_MAX];
-    char mapset[GMAPSET_MAX];
-    char buf[1024];
-    int stat;
-
-    if (!I_get_target(group.name, location, mapset)) {
-	sprintf(buf, "Target information for group [%s] missing\n",
-		group.name);
-	goto error;
-    }
-
-    sprintf(buf, "%s/%s", G_gisdbase(), location);
-    if (access(buf, 0) != 0) {
-	sprintf(buf, "Target location [%s] not found\n", location);
-	goto error;
-    }
-    G_create_alt_env();
-    G__setenv("LOCATION_NAME", location);
-    stat = G__mapset_permissions(mapset);
-    if (stat > 0) {
-	G__setenv("MAPSET", mapset);
-	G_create_alt_search_path();
-	G_switch_env();
-	G_switch_search_path();
-	which_env = 0;
-	return 1;
-    }
-    sprintf(buf, "Mapset [%s] in target location [%s] - ", mapset, location);
-    strcat(buf, stat == 0 ? "permission denied\n" : "not found\n");
-  error:
-    strcat(buf, "Please run i.target for group ");
-    strcat(buf, group.name);
-    G_fatal_error(buf);
-
-    return -1;
-}
-
-int select_current_env(void)
-{
-    if (which_env != 0) {
-	G_switch_env();
-	G__switch_search_path();
-	which_env = 0;
-    }
-
-    return 0;
-}
-
-int select_target_env(void)
-{
-    if (which_env != 1) {
-	G_switch_env();
-	G__switch_search_path();
-	which_env = 1;
-    }
-
-    return 0;
-}

+ 0 - 48
imagery/i.vpoints/title.c

@@ -1,48 +0,0 @@
-#include <stdlib.h>
-#include "globals.h"
-#include <grass/display.h>
-
-int display_title(View * view)
-{
-    View *title;
-    char left[100], center[100];
-    int size;
-
-    *left = 0;
-    *center = 0;
-
-    if (view->cell.configured) {
-	sprintf(center, "%s (mag %.1f)",
-		view->cell.name, magnification(view));
-    }
-
-    if (view == VIEW_MAP1) {
-	sprintf(left, "%s", G_location());
-	title = VIEW_TITLE1;
-    }
-    else if (view == VIEW_MAP1_ZOOM) {
-	title = VIEW_TITLE1_ZOOM;
-    }
-
-    if (view == VIEW_MAP2) {
-	sprintf(left, "%s", G_location());
-	title = VIEW_TITLE2;
-    }
-    else if (view == VIEW_MAP2_ZOOM) {
-	title = VIEW_TITLE2_ZOOM;
-    }
-
-    Erase_view(title);
-    R_standard_color(WHITE);
-    size = title->nrows - 4;
-    R_text_size(size, size);
-    Text(left, title->top, title->bottom, title->left, title->right, 2);
-    if (*center) {
-	R_standard_color(YELLOW);
-	Text(center, title->top, title->bottom,
-	     (title->left + title->right - Text_width(center)) / 2,
-	     title->right, 2);
-    }
-
-    return 0;
-}

+ 0 - 4
imagery/i.vpoints/vectpoints.h

@@ -1,4 +0,0 @@
-#include <grass/vector.h>
-/* plot.c */
-int plot(char *, char *, struct line_pnts *);
-int plot_warp(char *, char *, struct line_pnts *, double[], double[], int);

+ 0 - 49
imagery/i.vpoints/view.c

@@ -1,49 +0,0 @@
-#include "globals.h"
-#include <string.h>
-#include <grass/display.h>
-
-int Configure_view(View * view, char *name, char *mapset, double ns_res, double ew_res	/* original map resolution */
-    )
-{
-    Erase_view(view);
-    view->cell.configured = 0;
-
-    /* copy the cell name into the view */
-    strcpy(view->cell.name, name);
-    strcpy(view->cell.mapset, mapset);
-
-    /* determine the map edges */
-    view->cell.left = view->left + (view->ncols - view->cell.head.cols) / 2;
-    view->cell.right = view->cell.left + view->cell.head.cols - 1;
-    view->cell.top = view->top + (view->nrows - view->cell.head.rows) / 2;
-    view->cell.bottom = view->cell.top + view->cell.head.rows - 1;
-
-    /* remember original resolutions */
-    view->cell.ns_res = ns_res;
-    view->cell.ew_res = ew_res;
-
-    view->cell.configured = 1;
-
-    return 0;
-}
-
-int In_view(View * view, int x, int y)
-{
-    return (x >= view->left && x <= view->right && y >= view->top &&
-	    y <= view->bottom);
-}
-
-int Erase_view(View * view)
-{
-    R_standard_color(BLACK);
-    R_box_abs(view->left, view->top, view->right, view->bottom);
-
-    return 0;
-}
-
-double magnification(View * view)
-{
-    if (!view->cell.configured)
-	return ((double)0.0);
-    return (view->cell.ew_res / view->cell.head.ew_res);
-}

+ 0 - 73
imagery/i.vpoints/where.c

@@ -1,73 +0,0 @@
-#include "globals.h"
-
-static int where_am_i(View *, int, int, Window *, double *, double *,
-		      Window *, int);
-static int where_12(View *, int, int);
-static int where_21(View *, int, int);
-
-int where(int x, int y)
-{
-    if (VIEW_MAP1->cell.configured && In_view(VIEW_MAP1, x, y))
-	where_12(VIEW_MAP1, x, y);
-    else if (VIEW_MAP1_ZOOM->cell.configured && In_view(VIEW_MAP1_ZOOM, x, y))
-	where_12(VIEW_MAP1_ZOOM, x, y);
-    else if (VIEW_MAP2->cell.configured && In_view(VIEW_MAP2, x, y))
-	where_21(VIEW_MAP2, x, y);
-    else if (VIEW_MAP2_ZOOM->cell.configured && In_view(VIEW_MAP2_ZOOM, x, y))
-	where_21(VIEW_MAP2_ZOOM, x, y);
-    return 0;			/* return but don't quit */
-}
-
-static int where_12(View * view, int x, int y)
-{
-    where_am_i(view, x, y, MENU_WINDOW, group.E12, group.N12, INFO_WINDOW, 1);
-    return 0;
-}
-
-static int where_21(View * view, int x, int y)
-{
-    where_am_i(view, x, y, INFO_WINDOW, group.E21, group.N21, MENU_WINDOW, 2);
-    return 0;
-}
-
-static int where_am_i(View * view, int x, int y, Window * w1,
-		      double *E, double *N, Window * w2, int windnum)
-{
-    double e1, n1, e2, n2;
-    int row, col;
-
-    char buf[100];
-
-    /* convert x,y to east,north at center of cell */
-    col = view_to_col(view, x);
-    e1 = col_to_easting(&view->cell.head, col, 0.5);
-    row = view_to_row(view, y);
-    n1 = row_to_northing(&view->cell.head, row, 0.5);
-
-    /* Curses_clear_window (w1); */
-    if (windnum == 2)
-	Curses_write_window(INFO_WINDOW, 15, 2, "WHERE CURSOR             ");
-    else
-	Curses_write_window(INFO_WINDOW, 15, 2, "WHERE CELL               ");
-    sprintf(buf, "E = %10.2f", e1);
-    Curses_write_window(INFO_WINDOW, 17, 3, buf);
-    sprintf(buf, "N = %10.2f", n1);
-    Curses_write_window(INFO_WINDOW, 18, 3, buf);
-
-    /* if transformation equation is useable, determine point via equation */
-    if (group.equation_stat <= 0 || windnum == 2) {
-	Curses_write_window(INFO_WINDOW, 15, 18, "           ");
-	Curses_write_window(INFO_WINDOW, 17, 18, "                 ");
-	Curses_write_window(INFO_WINDOW, 18, 18, "                 ");
-	return 1;
-    }
-
-    I_georef(e1, n1, &e2, &n2, E, N);
-    /* Curses_clear_window (w2); */
-    Curses_write_window(INFO_WINDOW, 15, 18, "COORDINATES");
-    sprintf(buf, "E = %10.2f", e2);
-    Curses_write_window(INFO_WINDOW, 17, 18, buf);
-    sprintf(buf, "N = %10.2f", n2);
-    Curses_write_window(INFO_WINDOW, 18, 18, buf);
-    return 0;
-}

+ 0 - 24
imagery/i.vpoints/zoom.c

@@ -1,24 +0,0 @@
-#include "globals.h"
-
-static int cancel(void);
-
-int zoom(void)
-{
-    static int use = 1;
-
-    static Objects objects[] = {
-	MENU("CANCEL", cancel, &use),
-	MENU("BOX", zoom_box, &use),
-	MENU("POINT", zoom_point, &use),
-	INFO("Select type of zoom", &use),
-	{0}
-    };
-
-    Input_pointer(objects);
-    return 0;			/* return, but don't QUIT */
-}
-
-static int cancel(void)
-{
-    return -1;
-}

+ 0 - 197
imagery/i.vpoints/zoom_box.c

@@ -1,197 +0,0 @@
-#include "globals.h"
-#include <grass/display.h>
-
-static int x1, y1, x2, y2;
-static View *pick_view, *zoom_view, *main_view;
-static int target_flag;
-
-static int zoom2(int, int);
-static int zoom1(int, int);
-
-static int cancel(void)
-{
-    return -1;
-}
-
-int zoom_box(void)
-{
-    static int use = 1;
-
-
-    static Objects objects[] = {
-	MENU("CANCEL", cancel, &use),
-	INFO(" Mark first corner of region ", &use),
-	OTHER(zoom1, &use),
-	{0}
-    };
-
-    Input_pointer(objects);
-    return 1;
-}
-
-static int zoom1(int x, int y)
-{				/* called by Input_pointer */
-    static int use = 1;
-    static Objects objects[] = {
-	MENU("CANCEL", cancel, &use),
-	INFO(" Define the region ", &use),
-	OTHER(zoom2, &use),
-	{0}
-    };
-
-    /* 
-     * user has marked first corner 
-     * this determines which view is being zoomed
-     */
-    x1 = x;
-    y1 = y;
-
-    if (In_view(pick_view = VIEW_MAP1, x1, y1)) {
-	main_view = VIEW_MAP1;
-	zoom_view = VIEW_MAP1_ZOOM;
-	target_flag = 0;
-    }
-    else if (In_view(pick_view = VIEW_MAP2, x1, y1)) {
-	if (!pick_view->cell.configured)
-	    return 0;		/* ignore the mouse event */
-	main_view = VIEW_MAP2;
-	zoom_view = VIEW_MAP2_ZOOM;
-	target_flag = 1;
-    }
-    else if (In_view(pick_view = VIEW_MAP1_ZOOM, x1, y1)) {
-	if (!pick_view->cell.configured)
-	    return 0;		/* ignore the mouse event */
-	main_view = VIEW_MAP1;
-	zoom_view = VIEW_MAP1_ZOOM;
-	target_flag = 0;
-    }
-    else if (In_view(pick_view = VIEW_MAP2_ZOOM, x1, y1)) {
-	if (!pick_view->cell.configured)
-	    return 0;		/* ignore the mouse event */
-	main_view = VIEW_MAP2;
-	zoom_view = VIEW_MAP2_ZOOM;
-	target_flag = 1;
-    }
-    else
-	return 0;		/* ignore the mouse event */
-    if (!pick_view->cell.configured)
-	return 0;		/* just to be sure */
-
-    return Input_box(objects, x, y);
-}
-
-static int zoom2(int x, int y)
-{
-    int top, bottom, left, right;
-    int row, col;
-    struct Cell_head cellhd;
-
-    x2 = x;
-    y2 = y;
-    /* 
-     * user has completed the zoom window.
-     * must be in same view as first corner
-     */
-    if (x1 == x2 || y1 == y2)
-	return 0;		/* ignore event */
-    if (!In_view(pick_view, x2, y2))
-	return 0;
-    /*
-     * ok, erase menu messages
-     */
-    Menu_msg("");
-
-    /*
-     * assign window coordinates to top,bottom,left,right
-     */
-    if (x1 < x2) {
-	left = x1;
-	right = x2;
-    }
-    else {
-	left = x2;
-	right = x1;
-    }
-    if (y1 < y2) {
-	top = y1;
-	bottom = y2;
-    }
-    else {
-	top = y2;
-	bottom = y1;
-    }
-
-    /* 
-     * Determine the zoom window (ie, cellhd)
-     * must copy the current view cellhd first, to preserve header info
-     * (such as projection, zone, and other items.)
-     * compute zoom window northings,eastings, rows, cols, and resolution
-     */
-
-    G_copy(&cellhd, &pick_view->cell.head, sizeof(cellhd));
-
-    /* convert top to northing at top edge of cell
-     * left to easting at left edge
-     */
-    col = view_to_col(pick_view, left);
-    row = view_to_row(pick_view, top);
-    cellhd.north = row_to_northing(&pick_view->cell.head, row, 0.0);
-    cellhd.west = col_to_easting(&pick_view->cell.head, col, 0.0);
-
-    /* convert bottom to northing at bottom edge of cell
-     * right to easting at right edge
-     */
-
-    col = view_to_col(pick_view, right);
-    row = view_to_row(pick_view, bottom);
-    cellhd.south = row_to_northing(&pick_view->cell.head, row, 1.0);
-    cellhd.east = col_to_easting(&pick_view->cell.head, col, 1.0);
-
-    cellhd.rows = bottom - top + 1;
-    cellhd.cols = right - left + 1;
-    cellhd.ns_res = (cellhd.north - cellhd.south) / cellhd.rows;
-    cellhd.ew_res = (cellhd.east - cellhd.west) / cellhd.cols;
-
-    /*
-     * Outline the zoom window on the main map
-     * Turn previous one to grey.
-     */
-
-    if (zoom_view->cell.configured) {
-	R_standard_color(GREY);
-	Outline_cellhd(main_view, &zoom_view->cell.head);
-    }
-    R_standard_color(YELLOW);
-    Outline_cellhd(main_view, &cellhd);
-
-    /*
-     * zoom
-     */
-    if (target_flag) {
-	select_target_env();
-	G_copy(&zoom_view->cell.head, &cellhd, sizeof(cellhd));
-	zoom_view->cell.ns_res = cellhd.ns_res;
-	zoom_view->cell.ew_res = cellhd.ew_res;
-    }
-
-
-    G_adjust_window_to_box(&cellhd, &zoom_view->cell.head, zoom_view->nrows,
-			   zoom_view->ncols);
-
-    Configure_view(zoom_view, pick_view->cell.name, pick_view->cell.mapset,
-		   pick_view->cell.ns_res, pick_view->cell.ew_res);
-
-    if (target_flag) {
-	if (cellmap_present)
-	    drawcell(zoom_view, 0);
-	zoomvect(zoom_view);
-	VIEW_MAP2_ZOOM->cell.configured = 1;
-    }
-    else
-	drawcell(zoom_view, 0);
-
-    select_current_env();
-    display_points(1);
-
-    return 1;			/* pop back */
-}

+ 0 - 263
imagery/i.vpoints/zoom_pnt.c

@@ -1,263 +0,0 @@
-#include <math.h>
-#include "globals.h"
-#include <grass/display.h>
-
-static View *pick_view, *zoom_view, *main_view;
-static int target_flag;
-static int zoom1(int, int);
-static int cancel(void);
-
-int zoom_point(void)
-{
-    static int use = 1;
-
-    static Objects objects[] = {
-	MENU("CANCEL", cancel, &use),
-	INFO(" Mark center of area to be zoomed ", &use),
-	OTHER(zoom1, &use),
-	{0}
-    };
-
-    Input_pointer(objects);
-    return 1;
-}
-
-static int zoom1(int x, int y)
-{				/* called by Input_pointer */
-    int top, bottom, left, right;
-    int n, row, col;
-    int nrows, ncols;
-    struct Cell_head cellhd;
-    int mag;
-    double magnification();
-    double north, south, east, west;
-    double ns_range, ew_range, pnt_north, pnt_east, x_range, y_range;
-
-    if (In_view(pick_view = VIEW_MAP1, x, y)) {
-	main_view = VIEW_MAP1;
-	zoom_view = VIEW_MAP1_ZOOM;
-	target_flag = 0;
-    }
-    else if (In_view(pick_view = VIEW_MAP2, x, y)) {
-	if (!pick_view->cell.configured)
-	    return 0;		/* ignore the mouse event */
-	main_view = VIEW_MAP2;
-	zoom_view = VIEW_MAP2_ZOOM;
-	target_flag = 1;
-    }
-    else if (In_view(pick_view = VIEW_MAP1_ZOOM, x, y)) {
-	if (!pick_view->cell.configured)
-	    return 0;		/* ignore the mouse event */
-	main_view = VIEW_MAP1;
-	zoom_view = VIEW_MAP1_ZOOM;
-	target_flag = 0;
-    }
-    else if (In_view(pick_view = VIEW_MAP2_ZOOM, x, y)) {
-	if (!pick_view->cell.configured)
-	    return 0;		/* ignore the mouse event */
-	main_view = VIEW_MAP2;
-	zoom_view = VIEW_MAP2_ZOOM;
-	target_flag = 1;
-    }
-    else
-	return 0;		/* ignore the mouse event */
-    if (!pick_view->cell.configured)
-	return 0;		/* just to be sure */
-    /*
-     * make sure point is within edges of image as well
-     */
-    if (x <= pick_view->cell.left)
-	return 0;
-    if (x >= pick_view->cell.right)
-	return 0;
-    if (y <= pick_view->cell.top)
-	return 0;
-    if (y >= pick_view->cell.bottom)
-	return 0;
-
-    /*
-     *
-     ok, erase menu messages
-     */
-    Menu_msg("");
-
-    /* determine magnification of zoom */
-    if (zoom_view->cell.configured) {
-	if (zoom_view == pick_view)
-	    mag = floor(magnification(zoom_view) + 1.0) + .1;
-	else
-	    mag = ceil(magnification(zoom_view)) + .1;
-    }
-    else {
-	mag = floor(magnification(main_view) + 1.0) + .1;
-    }
-    if (!ask_magnification(&mag))
-	return 1;
-    /* 
-     * Determine the zoom window (ie, cellhd)
-     */
-
-    G_copy(&cellhd, &main_view->cell.head, sizeof(cellhd));
-
-    if (target_flag == 0) {
-	cellhd.ns_res = main_view->cell.ns_res / mag;
-	cellhd.ew_res = main_view->cell.ew_res / mag;
-    }
-
-    cellhd.cols = (cellhd.east - cellhd.west) / cellhd.ew_res;
-    cellhd.rows = (cellhd.north - cellhd.south) / cellhd.ns_res;
-
-    /* convert x,y to col,row */
-
-    col = view_to_col(pick_view, x);
-    east = col_to_easting(&pick_view->cell.head, col, 0.5);
-    col = easting_to_col(&cellhd, east);
-
-    row = view_to_row(pick_view, y);
-    north = row_to_northing(&pick_view->cell.head, row, 0.5);
-    row = northing_to_row(&cellhd, north);
-
-    if (target_flag == 0) {
-	ncols = zoom_view->ncols;
-	nrows = zoom_view->nrows;
-
-	n = cellhd.cols - col;
-	if (n > col)
-	    n = col;
-	if (n + n + 1 >= ncols) {
-	    n = ncols / 2;
-	    if (n + n + 1 >= ncols)
-		n--;
-	}
-	left = col - n;
-	right = col + n;
-
-	n = cellhd.rows - row;
-	if (n > row)
-	    n = row;
-	if (n + n + 1 >= nrows) {
-	    n = nrows / 2;
-	    if (n + n + 1 >= nrows)
-		n--;
-	}
-
-	top = row - n;
-	bottom = row + n;
-
-	n = cellhd.rows - row;
-	north = row_to_northing(&cellhd, top, 0.0);
-	west = col_to_easting(&cellhd, left, 0.0);
-	south = row_to_northing(&cellhd, bottom, 1.0);
-	east = col_to_easting(&cellhd, right, 1.0);
-
-	cellhd.north = north;
-	cellhd.south = south;
-	cellhd.east = east;
-	cellhd.west = west;
-
-	cellhd.rows = (cellhd.north - cellhd.south) / cellhd.ns_res;
-	cellhd.cols = (cellhd.east - cellhd.west) / cellhd.ew_res;
-
-	/*
-	 * Outline the zoom window on the main map
-	 * Turn previous one to grey.
-	 */
-	if (zoom_view->cell.configured) {
-	    R_standard_color(GREY);
-	    Outline_cellhd(main_view, &zoom_view->cell.head);
-	}
-
-	R_standard_color(YELLOW);
-	Outline_cellhd(main_view, &cellhd);
-
-    }
-    else {
-	top = pick_view->cell.top;
-	bottom = pick_view->cell.bottom;
-	left = pick_view->cell.left;
-	right = pick_view->cell.right;
-
-	north = cellhd.north;
-	south = cellhd.south;
-	east = cellhd.east;
-	west = cellhd.west;
-
-	ns_range = north - south;
-	ew_range = east - west;
-	y_range = (double)(bottom - top);
-	x_range = (double)(right - left);
-
-	pnt_north = north - (ns_range / y_range) * (double)row;
-	pnt_east = east - (ew_range / x_range) * (double)(x_range - col);
-
-	north = pnt_north + ns_range / mag / 2.0;
-	south = pnt_north - ns_range / mag / 2.0;
-	east = pnt_east + ew_range / mag / 2.0;
-	west = pnt_east - ew_range / mag / 2.0;
-
-	cellhd.north = north;
-	cellhd.south = south;
-	cellhd.east = east;
-	cellhd.west = west;
-
-	cellhd.rows = zoom_view->bottom - zoom_view->top + 1;
-	cellhd.cols = zoom_view->right - zoom_view->left + 1;
-	cellhd.ns_res = (north - south) / cellhd.rows;
-	cellhd.ew_res = (east - west) / cellhd.cols;
-
-	if (cellhd.ns_res > cellhd.ew_res)
-	    cellhd.ew_res = cellhd.ns_res;
-	else
-	    cellhd.ns_res = cellhd.ew_res;
-
-	/*
-	 * Outline the zoom window on the main map
-	 * Turn previous one to grey.
-	 */
-	if (zoom_view->cell.configured) {
-	    R_standard_color(GREY);
-	    Outline_cellhd(main_view, &zoom_view->cell.head);
-	}
-
-    }
-
-    /*
-     * zoom
-     */
-    if (target_flag)
-	select_target_env();
-
-    G_copy(&zoom_view->cell.head, &cellhd, sizeof(cellhd));
-
-    if (target_flag) {
-	R_standard_color(YELLOW);
-	Outline_cellhd(VIEW_MAP2, &zoom_view->cell.head);
-
-	zoom_view->cell.ns_res = cellhd.ns_res;
-	zoom_view->cell.ew_res = cellhd.ew_res;
-
-	G_adjust_window_to_box(&cellhd, &zoom_view->cell.head,
-			       zoom_view->nrows, zoom_view->ncols);
-    }
-
-    Configure_view(zoom_view, pick_view->cell.name, pick_view->cell.mapset,
-		   pick_view->cell.ns_res, pick_view->cell.ew_res);
-
-    if (target_flag) {
-	zoomvect(zoom_view);
-	VIEW_MAP2_ZOOM->cell.configured = 1;
-    }
-    else
-	drawcell(zoom_view, 0);
-
-    select_current_env();
-    display_points(1);
-
-    return 1;			/* pop back */
-}
-
-
-static int cancel(void)
-{
-    return -1;
-}

+ 2 - 2
imagery/imageryintro.html

@@ -95,11 +95,11 @@ GRASS is able to geocode raster and image data of various types:
 <ul>
 <ul>
 <li>unreferenced scanned maps by defining four corner points
 <li>unreferenced scanned maps by defining four corner points
  (<a href="i.group.html">i.group</a>, <a href="i.target.html">i.target</a>,
  (<a href="i.group.html">i.group</a>, <a href="i.target.html">i.target</a>,
- <a href="i.points.html">i.points</a>, <a href="i.rectify.html">i.rectify</a>)</li>
+ <a href="g.gui.gcp.html">g.gui.gcp</a>, <a href="i.rectify.html">i.rectify</a>)</li>
 <li>unreferenced satellite data from optical and Radar sensors by
 <li>unreferenced satellite data from optical and Radar sensors by
  defining a certain number of ground control points 
  defining a certain number of ground control points 
  (<a href="i.group.html">i.group</a>, <a href="i.target.html">i.target</a>,
  (<a href="i.group.html">i.group</a>, <a href="i.target.html">i.target</a>,
- <a href="i.points.html">i.points</a>, <a href="i.rectify.html">i.rectify</a>)</li>
+ <a href="g.gui.gcp.html">g.gui.gcp</a>, <a href="i.rectify.html">i.rectify</a>)</li>
 <li>interactive graphical <a href="wxGUI.gcp.html">Ground Control Point (GCP) manager</a></li>
 <li>interactive graphical <a href="wxGUI.gcp.html">Ground Control Point (GCP) manager</a></li>
 <!--
 <!--
 <li>orthophoto generation based on DEM: <a href="i.ortho.photo.html">i.ortho.photo</a></li>
 <li>orthophoto generation based on DEM: <a href="i.ortho.photo.html">i.ortho.photo</a></li>

+ 1 - 1
lib/imagery/group.c

@@ -386,7 +386,7 @@ int I_add_file_to_group_ref(const char *name, const char *mapset,
  for (n = 0; n < src.nfiles; n++)
  for (n = 0; n < src.nfiles; n++)
  I_transfer_group_ref_file (&src, n, &dst);
  I_transfer_group_ref_file (&src, n, &dst);
  \endcode
  \endcode
- * This routine is used by <i>i.points</i> to create the REF file for a
+ * This routine is used by <i>g.gui.gcp</i> to create the REF file for a
  * subgroup.
  * subgroup.
  *
  *
  *  \param src
  *  \param src

+ 3 - 3
lib/imagery/imagerylib.dox

@@ -210,7 +210,7 @@ for (n = 0; n < src.nfiles; n++)
 \endverbatim
 \endverbatim
 
 
 <P>
 <P>
-This routine is used by <I>i.points</I> to create the REF file for a
+This routine is used by <I>g.gui.gcp</I> to create the REF file for a
 subgroup.
 subgroup.
 
 
 <P>
 <P>
@@ -229,7 +229,7 @@ int I_get_target() read target information
 Reads the target <B>location</B> and <B>mapset</B> from the TARGET
 Reads the target <B>location</B> and <B>mapset</B> from the TARGET
 file for the specified group. Returns 1 if successful; 0 otherwise
 file for the specified group. Returns 1 if successful; 0 otherwise
 (and prints a diagnostic error). This routine is used by
 (and prints a diagnostic error). This routine is used by
-<I>i.points</I> and <I>i.rectify</I> and probably should not be used
+<I>g.gui.gcp</I> and <I>i.rectify</I> and probably should not be used
 by other programs.
 by other programs.
 
 
 <P>
 <P>
@@ -256,7 +256,7 @@ information.
 <P>
 <P>
 The following routines read and write the POINTS file, which contains
 The following routines read and write the POINTS file, which contains
 the image registration control points. This file is created and
 the image registration control points. This file is created and
-updated by the module <I>i.points</I>,and read by <I>i.rectify.</I>
+updated by the module <I>g.gui.gcp</I>,and read by <I>i.rectify.</I>
 
 
 <P>
 <P>
 These routines use the <I>Control_Points</I> structure, which is
 These routines use the <I>Control_Points</I> structure, which is

+ 1 - 1
lib/imagery/target.c

@@ -9,7 +9,7 @@
  * Reads the target <b>location</b> and <b>mapset</b>
  * Reads the target <b>location</b> and <b>mapset</b>
  * from the TARGET file for the specified group. Returns 1 if successful; 0
  * from the TARGET file for the specified group. Returns 1 if successful; 0
  * otherwise (and prints a diagnostic error). This routine is used by
  * otherwise (and prints a diagnostic error). This routine is used by
- * <i>i.points</i> and <i>i.rectify</i> and probably should not be used by
+ * <i>g.gui.gcp</i> and <i>i.rectify</i> and probably should not be used by
  * other programs.
  * other programs.
  * <b>Note.</b> This routine does <b>not</b> validate the target information.
  * <b>Note.</b> This routine does <b>not</b> validate the target information.
  *
  *

+ 5 - 1
misc/m.transform/m.transform.html

@@ -51,7 +51,11 @@ the higher coefficients equal to zero.
 
 
 <h2>SEE ALSO</h2>
 <h2>SEE ALSO</h2>
 
 
-<em><a href="i.rectify.html">i.rectify</a></em>
+<em>
+<a href="i.rectify.html">i.rectify</a>,
+<a href="v.rectify.html">v.rectify</a>,
+<a href="v.transform.html">v.transform</a>
+</em>
 
 
 
 
 <h2>AUTHORS</h2>
 <h2>AUTHORS</h2>

+ 9 - 9
scripts/g.extension/g.extension.html

@@ -1,8 +1,8 @@
 <h2>DESCRIPTION</h2>
 <h2>DESCRIPTION</h2>
 
 
 <em>g.extension</em> downloads and installs, removes or updates
 <em>g.extension</em> downloads and installs, removes or updates
-extensions from <a href="http://svn.osgeo.org/grass/grass-addons/grass7/">GRASS Addons SVN repository</a> into the local GRASS
-installation.
+extensions from
+<a href="http://svn.osgeo.org/grass/grass-addons/grass7/">GRASS Addons SVN repository</a> into the local GRASS GIS installation.
 
 
 <p>Re-running <em>g.extension</em> on an installed GRASS Addons
 <p>Re-running <em>g.extension</em> on an installed GRASS Addons
 extension re-installs the requested extension which may include
 extension re-installs the requested extension which may include
@@ -12,16 +12,16 @@ by <em><a href="g.extension.all.html">g.extension.all</a></em>.
 
 
 <h2>EXAMPLES</h2>
 <h2>EXAMPLES</h2>
 
 
-Download and install <em>i.points.auto</em> into current GRASS installation
+Download and install <em>r.stream.distance</em> into current GRASS installation
 
 
 <div class="code"><pre>
 <div class="code"><pre>
-g.extension extension=i.points.auto
+g.extension extension=r.stream.distance
 </pre></div>
 </pre></div>
 
 
 Remove locally installed extension
 Remove locally installed extension
 
 
 <div class="code"><pre>
 <div class="code"><pre>
-g.extension extension=i.points.auto operation=remove
+g.extension extension=r.stream.distance operation=remove
 </pre></div>
 </pre></div>
 
 
 List all available extensions from GRASS Addons SVN repository
 List all available extensions from GRASS Addons SVN repository
@@ -39,16 +39,16 @@ g.extension -a
 <h2>SEE ALSO</h2>
 <h2>SEE ALSO</h2>
 
 
 <em>
 <em>
-  <a href="g.extension.all.html">g.extension.all</a>
+<a href="g.extension.all.html">g.extension.all</a>
 </em>
 </em>
 
 
 <p>
 <p>
 See also <a href="http://grasswiki.osgeo.org/wiki/GRASS_AddOns">GRASS Addons</a> wiki page.
 See also <a href="http://grasswiki.osgeo.org/wiki/GRASS_AddOns">GRASS Addons</a> wiki page.
 
 
-<h2>AUTHOR</h2>
+<h2>AUTHORS</h2>
 
 
-Markus Neteler<br>
-Martin Landa, Czech Technical University in Prague, Czech Republic
+Markus Neteler (original shell script)<br>
+Martin Landa, Czech Technical University in Prague, Czech Republic (Python rewrite)
 
 
 <p>
 <p>
 <i>Last changed: $Date$</i>
 <i>Last changed: $Date$</i>

+ 0 - 2
tools/dep_tree2sql.sh

@@ -44,9 +44,7 @@
 # 	 imagery/i.ortho.photo/photo.elev/OBJ.i686-pc-linux-gnu/main.o
 # 	 imagery/i.ortho.photo/photo.elev/OBJ.i686-pc-linux-gnu/main.o
 # 	 imagery/i.ortho.photo/photo.rectify/OBJ.i686-pc-linux-gnu/target.o
 # 	 imagery/i.ortho.photo/photo.rectify/OBJ.i686-pc-linux-gnu/target.o
 # 	 imagery/i.ortho.photo/photo.target/OBJ.i686-pc-linux-gnu/main.o
 # 	 imagery/i.ortho.photo/photo.target/OBJ.i686-pc-linux-gnu/main.o
-# 	 imagery/i.points/OBJ.i686-pc-linux-gnu/target.o
 # 	 imagery/i.rectify/OBJ.i686-pc-linux-gnu/target.o
 # 	 imagery/i.rectify/OBJ.i686-pc-linux-gnu/target.o
-# 	 imagery/i.vpoints/OBJ.i686-pc-linux-gnu/target.o
 #
 #
 # to discover which files import a given symbol, or more complex queries
 # to discover which files import a given symbol, or more complex queries
 # such as:
 # such as:

+ 1 - 1
vector/v.rectify/main.c

@@ -7,7 +7,7 @@
  * PURPOSE:      calculate a transformation matrix and then convert x,y(,z) 
  * PURPOSE:      calculate a transformation matrix and then convert x,y(,z) 
  *               coordinates to standard map coordinates for all objects in 
  *               coordinates to standard map coordinates for all objects in 
  *               the vector
  *               the vector
- *               control points can come from i.points or i.vpoints or 
+ *               control points can come from g.gui.gcp or 
  *               a user-given text file
  *               a user-given text file
  * COPYRIGHT:    (C) 2002-2011 by the GRASS Development Team
  * COPYRIGHT:    (C) 2002-2011 by the GRASS Development Team
  *
  *

+ 17 - 16
vector/v.rectify/v.rectify.html

@@ -22,9 +22,7 @@ errors and deviations of the Ground Control Points prior to transformation.
 
 
 <p>
 <p>
 2D Ground Control Points can be identified in 
 2D Ground Control Points can be identified in 
-<em><a href="i.points.html">i.points</a></em>
-or
-<em><a href="i.vpoints.html">i.vpoints</a></em>
+<em><a href="g.gui.gcp.html">g.gui.gcp</a></em>.
 <p>
 <p>
 3D Ground Control Points must be provided in a text file with the 
 3D Ground Control Points must be provided in a text file with the 
 <b>points</b> option. The 3D format is equivalent to the format for 2D 
 <b>points</b> option. The 3D format is equivalent to the format for 2D 
@@ -104,22 +102,25 @@ The GRASS 4 <em>
 <a href="http://grass.osgeo.org/gdp/imagery/grass4_image_processing.pdf">Image
 <a href="http://grass.osgeo.org/gdp/imagery/grass4_image_processing.pdf">Image
 Processing manual</a></em>
 Processing manual</a></em>
 
 
-<p><em>
-  <a href="v.transform.html">v.transform</a>,
-  <a href="m.transform.html">m.transform</a>,
-  <a href="i.rectify.html">i.rectify</a>,
-  <a href="r.proj.html">r.proj</a>,
-  <a href="v.proj.html">v.proj</a>,
-  <a href="i.group.html">i.group</a>,
-  <a href="i.points.html">i.points</a>,
-  <a href="i.vpoints.html">i.vpoints</a>,
-  <a href="i.target.html">i.target</a>
-  <br>
-  <a href="wxGUI.gcp.html">Manage Ground Control Points</a>
+<p>
+<em>
+<a href="g.gui.gcp.html">g.gui.gcp</a>,
+<a href="i.group.html">i.group</a>,
+<a href="i.rectify.html">i.rectify</a>,
+<a href="i.target.html">i.target</a>,
+<a href="m.transform.html">m.transform</a>,
+<a href="r.proj.html">r.proj</a>,
+<a href="v.proj.html">v.proj</a>,
+<a href="v.transform.html">v.transform</a>,
+</em>
+
+<br>
+<em>
+<a href="wxGUI.gcp.html">Manage Ground Control Points</a>
 </em>
 </em>
 
 
 
 
-<h2>AUTHORS</h2>
+<h2>AUTHOR</h2>
 
 
 Markus Metz
 Markus Metz
 
 

+ 2 - 2
vector/v.transform/v.transform.html

@@ -79,8 +79,8 @@ The resulting map is a 3D vector map.
 
 
 <em>
 <em>
 <a href="m.transform.html">m.transform</a>,
 <a href="m.transform.html">m.transform</a>,
-<a href="v.rectify.html">v.rectify</a>, 
-<a href="v.in.ogr.html">v.in.ogr</a>
+<a href="i.rectify.html">i.rectify</a>,
+<a href="v.rectify.html">v.rectify</a>
 </em>
 </em>
 
 
 <h2>AUTHOR</h2>
 <h2>AUTHOR</h2>