浏览代码

cleanup of unused display modules (d.colors, d.measure, d.what.rast, d.what.vect, d.zoom, trunk https://trac.osgeo.org/grass/changeset/62508)

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@62516 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler 10 年之前
父节点
当前提交
a98ddabe15
共有 55 个文件被更改,包括 14 次插入4072 次删除
  1. 0 6
      display/Makefile
  2. 1 1
      display/d.colorlist/d.colorlist.html
  3. 0 10
      display/d.colors/Makefile
  4. 0 5
      display/d.colors/Readme
  5. 0 31
      display/d.colors/colors.h
  6. 0 269
      display/d.colors/curses.c
  7. 0 192
      display/d.colors/d.colors.html
  8. 0 6
      display/d.colors/externs.h
  9. 0 30
      display/d.colors/get_info.c
  10. 0 11
      display/d.colors/graphics.h
  11. 0 323
      display/d.colors/interact.c
  12. 0 91
      display/d.colors/main.c
  13. 0 26
      display/d.colors/set_sigs.c
  14. 0 8
      display/d.colors/sigint.c
  15. 0 49
      display/d.colors/tbl_toggle.c
  16. 0 10
      display/d.measure/Makefile
  17. 0 62
      display/d.measure/d.measure.html
  18. 0 25
      display/d.measure/draw_line.c
  19. 0 8
      display/d.measure/local_proto.h
  20. 0 98
      display/d.measure/main.c
  21. 0 184
      display/d.measure/msurements.c
  22. 0 16
      display/d.what.rast/Makefile
  23. 0 151
      display/d.what.rast/d.what.rast.html
  24. 0 14
      display/d.what.rast/local_proto.h
  25. 0 139
      display/d.what.rast/main.c
  26. 0 26
      display/d.what.rast/opencell.c
  27. 0 181
      display/d.what.rast/show.c
  28. 0 84
      display/d.what.rast/what.c
  29. 0 8
      display/d.what.rast/what.h
  30. 0 18
      display/d.what.vect/Makefile
  31. 0 57
      display/d.what.vect/d.what.vect.html
  32. 0 158
      display/d.what.vect/main.c
  33. 0 13
      display/d.what.vect/openvect.c
  34. 0 491
      display/d.what.vect/what.c
  35. 0 17
      display/d.what.vect/what.h
  36. 0 17
      display/d.zoom/Makefile
  37. 0 141
      display/d.zoom/box.c
  38. 0 43
      display/d.zoom/center.c
  39. 0 43
      display/d.zoom/d.zoom.html
  40. 0 11
      display/d.zoom/graphics.h
  41. 0 46
      display/d.zoom/local_proto.h
  42. 0 273
      display/d.zoom/main.c
  43. 0 90
      display/d.zoom/pan.c
  44. 0 129
      display/d.zoom/print.c
  45. 0 71
      display/d.zoom/quit.c
  46. 0 42
      display/d.zoom/redraw.c
  47. 0 102
      display/d.zoom/returns.c
  48. 0 185
      display/d.zoom/set.c
  49. 0 45
      display/d.zoom/zoom.c
  50. 4 5
      general/g.region/g.region.html
  51. 3 2
      raster/r.category/r.category.html
  52. 0 2
      raster/r.his/r.his.html
  53. 4 4
      scripts/i.spectral/i.spectral.html
  54. 0 1
      tools/dep_tree2sql.sh
  55. 2 2
      vector/v.lrs/v.lrs.where/v.lrs.where.html

+ 0 - 6
display/Makefile

@@ -34,12 +34,6 @@ SUBDIRS = \
 	d.vect.chart \
 	d.vect.chart \
 	d.thematic.area \
 	d.thematic.area \
 	d.where
 	d.where
-#	d.colors \
-#	d.extract \
-#	d.measure \
-#	d.what.rast \
-#	d.what.vect \
-#	d.zoom \
 
 
 include $(MODULE_TOPDIR)/include/Make/Dir.make
 include $(MODULE_TOPDIR)/include/Make/Dir.make
 
 

+ 1 - 1
display/d.colorlist/d.colorlist.html

@@ -6,7 +6,7 @@ separator (default is comma).
 
 
 <h2>SEE ALSO</h2>
 <h2>SEE ALSO</h2>
 
 
-<em><a href="d.colors.html">d.colors</a></em><br>
+<em><a href="r.colors.html">r.colors</a></em><br>
 
 
 <h2>AUTHOR</h2>
 <h2>AUTHOR</h2>
 
 

+ 0 - 10
display/d.colors/Makefile

@@ -1,10 +0,0 @@
-MODULE_TOPDIR = ../..
-
-PGM = d.colors
-
-LIBES     = $(DISPLAYLIB) $(RASTERLIB) $(GISLIB) $(CURSES)
-DEPENDENCIES= $(DISPLAYDEP) $(RASTERDEP) $(GISDEP) $(CURSESDEP)
-
-include $(MODULE_TOPDIR)/include/Make/Module.make
-
-default: cmd

+ 0 - 5
display/d.colors/Readme

@@ -1,5 +0,0 @@
-On two occasions this program has crashed (segmentation fault) when
-in colormode=fixed upon entering d.colors file_name.  I can get this
-to happen everytime, but  I suspect a bug.
-Jan
-1/6/91

+ 0 - 31
display/d.colors/colors.h

@@ -1,31 +0,0 @@
-/* curses.c */
-int Initialize_curses(void);
-int Close_curses(void);
-int Write_cats(struct Categories *, int);
-int Write_menu(void);
-int Write_status(int, int, int, int, int, int);
-int Write_message(int, char *);
-int Clear_message(void);
-int Clear_menu(void);
-int Write_menu_line(int, char *);
-int Replot_screen(void);
-int Get_curses_text(char[]);
-
-/* get_info.c */
-int get_map_info(char *, char *);
-
-/* interact.c */
-int interact(struct Categories *, struct Colors *, char *, char *);
-int shift_color(int, int);
-
-/* main.c */
-int main(int, char **);
-
-/* set_sigs.c */
-int set_signals(void);
-
-/* sigint.c */
-void sigint(int);
-
-/* tbl_toggle.c */
-int table_toggle(char *, char *, struct Colors *);

+ 0 - 269
display/d.colors/curses.c

@@ -1,269 +0,0 @@
-#include <curses.h>
-#include <grass/gis.h>
-#include <grass/colors.h>
-#include <grass/raster.h>
-
-
-/*               " <------------ Room for text --------------> " */
-#define LINE01	 "  R/r  increase/decrease RED"
-#define LINE02	 "  G/g  increase/decrease GREEN"
-#define LINE03	 "  B/b  increase/decrease BLUE"
-#define LINE04	 "  I/i  increase/decrease increment"
-#define LINE05	 "  h    highlight current category"
-#define LINE06	 ""
-#define LINE07	 "  D/d  down; move to next category"
-#define LINE08	 "  U/u  up  ; move to previous category"
-#define LINE09	 "  +/-  shift entire color table"
-#define LINE10	 "  c    save color table"
-#define LINE11	 "  t    toggle different color table"
-#define LINE12	 "  Q    quit"
-#define LINE13	 "  *  Replot screen"
-
-WINDOW *newwin();
-WINDOW *CAT_WIN;
-WINDOW *COLR_WIN;
-WINDOW *MENU_WIN;
-WINDOW *MESG_WIN;
-
-
-int Initialize_curses(void)
-{
-    initscr();
-    raw();
-    crmode();
-    noecho();
-    nonl();
-
-    /*         newwin(NROWS, NCOLS, BEGROW, BEGCOL) ; */
-    CAT_WIN = newwin(9, 80, 0, 0);
-    COLR_WIN = newwin(9, 30, 8, 0);
-    MENU_WIN = newwin(15, 51, 8, 29);
-    MESG_WIN = newwin(5, 30, 16, 0);
-
-    werase(CAT_WIN);
-    werase(COLR_WIN);
-    werase(MENU_WIN);
-    werase(MESG_WIN);
-
-    return 0;
-}
-
-int Close_curses(void)
-{
-    clear();
-    refresh();
-    mvcur(0, COLS - 1, LINES - 1, 0);
-    endwin();
-
-    return 0;
-}
-
-int Write_cats(struct Categories *pcats, int current_cat)
-{
-    char buffer[128];
-    CELL tmp = current_cat;
-    int start_cat, end_cat, at_cat, at_line;
-
-    if (Rast_is_c_null_value(&tmp))
-	current_cat = 0;
-    else
-	current_cat++;
-    Rast_set_c_null_value(&tmp, 1);
-    start_cat = current_cat - 2;
-    start_cat = start_cat > 0 ? start_cat : 0;
-    end_cat = start_cat + 4;
-    end_cat = end_cat < pcats->num + 1 ? end_cat : pcats->num + 1;
-
-    werase(CAT_WIN);
-    wmove(CAT_WIN, 1, 20);
-    sprintf(buffer, "CATEGORIES:   %3d to %3d of %3d",
-	    start_cat, end_cat, pcats->num);
-    waddstr(CAT_WIN, buffer);
-
-    at_line = 3;
-
-    for (at_cat = start_cat; at_cat <= pcats->num + 1; at_cat++) {
-	if (at_cat == current_cat) {
-	    if (!at_cat)
-		sprintf(buffer, "-> %3s %s", "N",
-			Rast_get_c_cat(&tmp, pcats));
-	    else
-		sprintf(buffer, "-> %3d %s", at_cat - 1,
-			Rast_get_c_cat(at_cat - 1, pcats));
-	}
-	else {
-	    if (!at_cat)
-		sprintf(buffer, "   %3s %s", "N",
-			Rast_get_c_cat(&tmp, pcats));
-	    else
-		sprintf(buffer, "   %3d %s", at_cat - 1,
-			Rast_get_c_cat(at_cat - 1, pcats));
-	}
-	wmove(CAT_WIN, at_line++, 1);
-	waddstr(CAT_WIN, buffer);
-    }
-
-    box(CAT_WIN, '|', '-');
-    wrefresh(CAT_WIN);
-    return (0);
-}
-
-int Write_menu(void)
-{
-    werase(MENU_WIN);
-    wmove(MENU_WIN, 1, 1);
-    waddstr(MENU_WIN, LINE01);
-    wmove(MENU_WIN, 2, 1);
-    waddstr(MENU_WIN, LINE02);
-    wmove(MENU_WIN, 3, 1);
-    waddstr(MENU_WIN, LINE03);
-    wmove(MENU_WIN, 4, 1);
-    waddstr(MENU_WIN, LINE04);
-    wmove(MENU_WIN, 5, 1);
-    waddstr(MENU_WIN, LINE05);
-    wmove(MENU_WIN, 6, 1);
-    waddstr(MENU_WIN, LINE06);
-    wmove(MENU_WIN, 7, 1);
-    waddstr(MENU_WIN, LINE07);
-    wmove(MENU_WIN, 8, 1);
-    waddstr(MENU_WIN, LINE08);
-    wmove(MENU_WIN, 9, 1);
-    waddstr(MENU_WIN, LINE09);
-    wmove(MENU_WIN, 10, 1);
-    waddstr(MENU_WIN, LINE10);
-    wmove(MENU_WIN, 11, 1);
-    waddstr(MENU_WIN, LINE11);
-    wmove(MENU_WIN, 12, 1);
-    waddstr(MENU_WIN, LINE12);
-    wmove(MENU_WIN, 13, 1);
-    waddstr(MENU_WIN, LINE13);
-
-    box(MENU_WIN, '|', '-');
-    wrefresh(MENU_WIN);
-
-    return 0;
-}
-
-int
-Write_status(int red, int grn, int blu, int shift_incr, int at_cat,
-	     int hi_mode)
-{
-    char buffer[40];
-    CELL tmp = at_cat;
-
-    werase(COLR_WIN);
-
-    if (hi_mode)
-	sprintf(buffer, "HIGHLIGHT COLOR");
-    else {
-	if (!Rast_is_c_null_value(&tmp))
-	    sprintf(buffer, "CATEGORY NUMBER: %d", at_cat);
-	else
-	    sprintf(buffer, "CATEGORY NUMBER: N");
-    }
-    wmove(COLR_WIN, 1, 3);
-    waddstr(COLR_WIN, buffer);
-
-    sprintf(buffer, "       RED: %3d   %3d%%", red, (int)((float)red / 2.56));
-    wmove(COLR_WIN, 3, 3);
-    waddstr(COLR_WIN, buffer);
-
-    sprintf(buffer, "     GREEN: %3d   %3d%%", grn, (int)((float)grn / 2.56));
-    wmove(COLR_WIN, 4, 3);
-    waddstr(COLR_WIN, buffer);
-
-    sprintf(buffer, "      BLUE: %3d   %3d%%", blu, (int)((float)blu / 2.56));
-    wmove(COLR_WIN, 5, 3);
-    waddstr(COLR_WIN, buffer);
-
-    sprintf(buffer, "SHIFT INCR: %3d   %3d%%", shift_incr,
-	    (int)((float)shift_incr / 2.56));
-    wmove(COLR_WIN, 7, 3);
-    waddstr(COLR_WIN, buffer);
-
-    box(COLR_WIN, '|', '-');
-    wmove(COLR_WIN, 0, 0);
-    wrefresh(COLR_WIN);
-
-    return 0;
-}
-
-int Write_message(int line, char *message)
-{
-    wmove(MESG_WIN, line, 1);
-    waddstr(MESG_WIN, "                            ");
-    wmove(MESG_WIN, line, 1);
-    waddstr(MESG_WIN, message);
-    wmove(MESG_WIN, 0, 0);
-    wrefresh(MESG_WIN);
-
-    return 0;
-}
-
-int Clear_message(void)
-{
-    werase(MESG_WIN);
-    wrefresh(MESG_WIN);
-
-    return 0;
-}
-
-int Clear_menu(void)
-{
-    werase(MENU_WIN);
-    box(MENU_WIN, '|', '-');
-
-    return 0;
-}
-
-int Write_menu_line(int line, char *message)
-{
-    wmove(MENU_WIN, line, 1);
-    wclrtoeol(MENU_WIN);
-    wmove(MENU_WIN, line, 1);
-    waddstr(MENU_WIN, message);
-    wrefresh(MENU_WIN);
-
-    return 0;
-}
-
-int Replot_screen(void)
-{
-    wrefresh(curscr);
-
-    return 0;
-}
-
-int Get_curses_text(char answer[])
-{
-    char newchar;
-    char *pointer;
-    int curx, cury;
-
-    pointer = answer;
-
-    for (;;) {
-	newchar = wgetch(MENU_WIN) & 0177;
-
-	if ((newchar > '\037') && (newchar < '\177')) {	/* octal codes: accept space to '~' */
-	    *(pointer++) = newchar;
-	    *pointer = 000;
-	    waddch(MENU_WIN, newchar);
-	    wrefresh(MENU_WIN);
-	}
-	else if (newchar == '\b' || newchar == '\177') {	/* backspace or DEL */
-	    if (pointer > answer) {
-		*(pointer--) = 000;
-		getyx(MENU_WIN, cury, curx);
-		wmove(MENU_WIN, cury, curx - 1);
-		waddch(MENU_WIN, ' ');
-		wmove(MENU_WIN, cury, curx - 1);
-		wrefresh(MENU_WIN);
-	    }
-	}
-	else
-	    break;
-    }
-
-    return 0;
-}

+ 0 - 192
display/d.colors/d.colors.html

@@ -1,192 +0,0 @@
-<h2>DESCRIPTION</h2>
-
-A color table file associates specific colors with the categories of a
-raster map layer. The user can change these map category color assignments
-(i.e., change the map's color table) interactively, by first displaying the
-raster map to the graphics monitor and then running the program
-<em>d.colors</em>.
-
-<p>Any color changes made using <em>d.colors</em> will not immediately be
-shown on the graphics display; however, any color changes saved will
-still alter the map's color table and will appear next time the raster
-map layer is redisplayed (see <em><a href="d.colortable.html">d.colortable</a></em>).
-
-<p>The user must first display the relevant raster map layer to the
-active frame on the graphics monitor (e.g., using
-<em><a href="d.rast.html">d.rast</a></em>) before running
-<em>d.colors</em>. The user can then either enter the name of the
-raster map layer whose color table is to be changed on the command
-line (e.g., by typing: <tt>d.colors map=soils</tt>), or type
-<tt>d.colors</tt> without program arguments. If the user simply types
-<tt>d.colors</tt> without program arguments on the command line,
-<em>d.colors</em> will ask the user to enter the name of an existing
-raster map layer using the standard GRASS interface.
-
-<p>In either case, the user is then presented with the <em>d.colors</em>
-command menu, shown below.
-<!-- This menu is the same as the category and color
-changing portion of the <em><a href="d.display.html">d.display</a></em>
-menu. -->
-The <em>d.colors</em> commands are listed beneath the Category
-Pointer Movement, Color Modification, Replotting Screen, and Quitting
-sections below.  Commands are invoked by typing in the single-key response
-shown to the left below. (Longer descriptions of these commands appear to
-the right.) Results from invoking these commands will be reflected in the
-Category and Category Number sections of the <em>d.colors</em> screen. On
-the <em>d.colors</em> screen menu, commands appear in the right half of the
-screen, and the current status of categories appears in the left half of the
-screen.
-
-<pre>
-CATEGORIES
-   0    No Data
-   1    (Category 1 description)
-   2    (Category 2 description)
-   .    ....
-   .    ....
-CATEGORY NUMBER:
-   RED         0   0%
-   GREEN       0   0%
-   BLUE        0   0%
-Shift Incr:   10   3%
-CATEGORY POINTER MOVEMENT
-   D/d  down (cats)        Move pointer to next category
-   U/u  up   (cats)        Move pointer to previous category
-COLOR MODIFICATIONS
-   R/r  RED                Increase/decrease RED intensity
-   G/g  GREEN              Increase/decrease GREEN intensity
-   B/b  BLUE               Increase/decrease BLUE intensity
-   I/i  increment          Increase/decrease increment 
-                           (of intensity shift)
-   h    highlight          Highlight current color
-   +/-  shift colors       Shift entire color table (up/down)
-   c    save color         Save color table
-   t    toggle table       Toggle to different color table
-REPLOTTING SCREEN
-   *    Replot screen      Replots the screen
-QUITTING
-   Q    quit               Quits program
-</pre>
-
-Changing categories - The keys 
-<b>"d, D, u,"</b>
-and 
-<b>"U"</b>
-are used to move to a different category. The lower case letters move up, 
-<b>u,</b>
-and down, 
-<b>d,</b>
-the category list one category at a time. The upper case letters move 10 
-categories at a time for fast movement. The cursor does wrap between the 
-first and last categories. The current category is noted on the text screen 
-with an arrow, and is indicated on the graphics screen by a box around the 
-current color. 
-
-<p>
-Changing colors - The color associated with the current category can be 
-changed with the 
-<b>"R, r, G, g, B,"</b>
-and 
-<b>b</b>
-keys. The upper case letters increase the intensities of 
-red 
-<b>R,</b>
-green 
-<b>G,</b>
-and blue 
-<b>B</b>
-for the current category; the lower case letters decrease the intensities of 
-these same colors for the current category. Video devices make all the 
-colors of the spectrum by mixing red, green, and blue. For those 
-accustomed to red, yellow, and blue being the primary colors, this can 
-be confusing. For starters, yellow is made by mixing red and green. The 
-intensities are listed on the text screen in as percentages. 
-
-<p>
-Keys <b>I</b> and <b>i</b> increase and decrease the
-percentage change that each keystroke of one of the color
-keys (<em>R, r, G, g, B, b</em>) causes in its respective
-color. The increase increment is initially set to 10%.
-Thus, pressing the <em>R</em> key would will increase the
-red component of the current category by 10%.
-
-<p>
-Highlight - The 
-<b>h</b>
-key toggles between the current category color and the current 
-highlight color. This color is initially black but can be modified as 
-above while in highlight mode. Blinking can be accomplished by repeatedly 
-striking the 
-<b>h</b>
-key. When changing to different categories using the movement keys as 
-described above, while in highlight mode the category colors will be 
-always left showing their actual colors. Only one category is highlighted 
-at any one time. 
-
-<p>
-Saving the current color table - 
-Pressing the <b>c</b> key will save the current color table as you have 
-modified it. This table will then be used next time you 
-display or paint this raster map layer. 
-
-<p>
-Color table toggle - Different types of color tables are suitable for 
-different raster map layers. 
-The key 
-<b>t</b>
-flips between the following color tables: red, green, blue color ramp; gray 
-scale; smooth changing color wave; random colors; and the saved color table. 
-
-<p>
-Color table shift - The entire table is shifted up and down using the 
-<b>+</b>
-and 
-<b>-</b>
-keys. 
-
-<p>
-Quitting the <em>d.colors</em> program - Pressing the
-<b>Q</b> key will cause you to quit the <em>d.colors</em>
-program.  If colors have been modified but not saved,
-<em>d.colors</em> will ask:
-<pre>
-         Colors changed
-         Save the changes? (y/n)
-</pre>
-The user should type in <b>y</b> to save changes, 
-or <b>n</b> to not save changes, before quitting the program. 
-If the user types <b>n</b>, the program will ask: 
-<pre>
-         Quit anyway? (y/n) 
-</pre>
-<h2>NOTES</h2>
-
-<p>
-The map whose color table is to be altered with
-<em>d.colors</em> must already be on display in the active
-display frame on the graphics monitor before
-<em>d.colors</em> is run. This can be done using the
-command <em><a href="d.rast.html">d.rast</a> map=name</em> (where <em>name</em> is a raster map
-layer whose color table the user wishes to alter).
-
-<p>Some color monitors may not support the full range of colors required 
-to display all of the map's categories listed in the map's color table. 
-However, regardless of whether the user can see the color changes he is 
-effecting to a map's color table, any changes to a map's color table 
-made with <em>d.colors</em> that are saved will appear in the map's color table. 
-
-<h2>SEE ALSO</h2>
-
-<em>
-<a href="d.colortable.html">d.colortable</a>,
-<a href="d.rast.html">d.rast</a>,
-<a href="r.colors.html">r.colors</a>
-</em>
-
-<h2>AUTHOR</h2>
-
-James Westervelt, U.S. Army Construction Engineering 
-Research Laboratory
-
-<p><i>Last changed: $Date$</i>
-

+ 0 - 6
display/d.colors/externs.h

@@ -1,6 +0,0 @@
-struct signalflag
-{
-    int interrupt;
-};
-
-extern struct signalflag signalflag;

+ 0 - 30
display/d.colors/get_info.c

@@ -1,30 +0,0 @@
-#include <stdlib.h>
-#include <stdio.h>
-#include <grass/gis.h>
-#include <grass/display.h>
-#include <grass/colors.h>
-#include <grass/glocale.h>
-#include "colors.h"
-
-int get_map_info(char *name, char *mapset)
-{
-    struct Colors colors;
-    struct Categories categories;
-
-    if (!name)
-	exit(0);
-    if (*name == '\0')
-	exit(0);
-
-    /* Reading color lookup table */
-    if (Rast_read_cats(name, mapset, &categories) == -1)
-	G_fatal_error(_("Error reading category file for <%s>"), name);
-
-    /* Reading color lookup table */
-    if (Rast_read_colors(name, mapset, &colors) == -1)
-	G_fatal_error(_("Unable to read color table for raster map <%s>"), name);
-
-    interact(&categories, &colors, name, mapset);
-
-    return 0;
-}

+ 0 - 11
display/d.colors/graphics.h

@@ -1,11 +0,0 @@
-#define BLOCKS_PER_COL	32
-#define TEXT1_X		.61
-#define TEXT1_Y		.03
-#define TEXT2_X		.61
-#define TEXT2_Y		.06
-#define TITL1_X		.01
-#define TITL1_Y		.03
-#define TITL2_X		.01
-#define TITL2_Y		.06
-#define WINDOW_PROP_SCREEN_X	.8500
-#define WINDOW_PROP_SCREEN_Y	.9373

+ 0 - 323
display/d.colors/interact.c

@@ -1,323 +0,0 @@
-#include <unistd.h>
-#include <grass/gis.h>
-#include <grass/display.h>
-#include "graphics.h"
-#include "colors.h"
-
-static int save_colors(char *, char *, struct Colors *);
-static int yes(char *, char *);
-
-#define XSCALE  2.0
-#define YSCALE  2.0
-
-#define WRITE_STATUS \
-    Write_status(cur_red, cur_grn, cur_blu, shift_incr, at_cat, hi_mode)
-
-#define WRITE_CATS      Write_cats(categories, at_cat)
-
-int
-interact(struct Categories *categories, struct Colors *colors, char *name,
-	 char *mapset)
-{
-    char buffer[128];
-    CELL at_cat, tmp;
-    int hi_mode;
-    int hi_save_mode;
-    int shift_incr;
-    int cur_char;
-    int red_hi;
-    int grn_hi;
-    int blu_hi;
-    int cur_red;
-    int cur_grn;
-    int cur_blu;
-    int colors_changed;
-    int quit;
-
-    set_signals();
-    red_hi = 0;
-    grn_hi = 0;
-    blu_hi = 0;
-    hi_mode = 0;
-    hi_save_mode = 0;
-
-    colors_changed = 0;
-    Rast_set_c_null_value(&at_cat, 1);
-    Rast_get_c_color(&at_cat, &cur_red, &cur_grn, &cur_blu, colors);
-    shift_incr = 10;
-
-    Initialize_curses();
-
-    WRITE_CATS;
-
-    Write_menu();
-
-    WRITE_STATUS;
-
-    /*  mark_category(at_cat, 1) ; */
-
-    while (1) {
-	cur_char = getchar() & 0177;
-	sprintf(buffer, "  %c", cur_char);
-	Write_message(2, buffer);
-	switch (cur_char) {
-	case '*':
-	    Replot_screen();
-	    break;
-	case 'Q':
-	    quit = 1;
-	    if (colors_changed) {
-		if (yes("Colors changed", "Save the changes? (y/n)"))
-		    quit = save_colors(name, mapset, colors);
-		else
-		    quit = yes("Quit anyway? (y/n)", "");
-	    }
-	    if (quit) {
-		Clear_message();
-		Write_message(2, "Bye   ");
-		G_sleep(2);
-
-		Close_curses();
-		return (0);
-	    }
-	    break;
-
-	case 'D':
-	case 'U':
-	case 'd':
-	case 'u':
-	    if (hi_mode && !hi_save_mode) {
-		Rast_get_c_color(&at_cat, &cur_red, &cur_grn, &cur_blu, colors);
-	    }
-	    /*              tmark_category(at_cat, 0) ; */
-	    if (Rast_is_c_null_value(&at_cat))
-		tmp = 0;
-	    else
-		tmp = at_cat + 1;
-	    switch (cur_char) {
-	    case 'd':
-		tmp++;
-		break;
-	    case 'u':
-		tmp += categories->num + 1;
-		break;
-	    case 'D':
-		tmp += 10;
-		break;
-	    case 'U':
-		if (categories->num > 10)
-		    tmp += categories->num - 9;
-		else
-		    tmp += categories->num - (categories->num - 1);
-		break;
-	    }
-	    tmp = tmp % (categories->num + 2);	/* changed 11/99 M.N. */
-	    if (!tmp)
-		Rast_set_c_null_value(&at_cat, 1);
-	    else
-		at_cat = tmp - 1;
-
-	    if (hi_mode) {
-		cur_red = red_hi;
-		cur_grn = grn_hi;
-		cur_blu = blu_hi;
-		if (hi_save_mode) {
-		    Rast_set_c_color(at_cat, cur_red, cur_grn, cur_blu, colors);
-		    colors_changed = 1;
-		}
-	    }
-	    else {
-		Rast_get_c_color(&at_cat, &cur_red, &cur_grn, &cur_blu, colors);
-	    }
-
-	    WRITE_CATS;
-	    WRITE_STATUS;
-	    /*              mark_category(at_cat, 1) ; */
-	    break;
-	case 'r':
-	case 'R':
-	case 'g':
-	case 'G':
-	case 'b':
-	case 'B':
-	    if (hi_mode) {
-		switch (cur_char) {
-		case 'r':
-		    red_hi = shift_color(red_hi, -shift_incr);
-		    break;
-		case 'R':
-		    red_hi = shift_color(red_hi, shift_incr);
-		    break;
-		case 'g':
-		    grn_hi = shift_color(grn_hi, -shift_incr);
-		    break;
-		case 'G':
-		    grn_hi = shift_color(grn_hi, shift_incr);
-		    break;
-		case 'b':
-		    blu_hi = shift_color(blu_hi, -shift_incr);
-		    break;
-		case 'B':
-		    blu_hi = shift_color(blu_hi, shift_incr);
-		    break;
-		}
-		cur_red = red_hi;
-		cur_grn = grn_hi;
-		cur_blu = blu_hi;
-		if (hi_save_mode) {
-		    Rast_set_c_color(at_cat, cur_red, cur_grn, cur_blu, colors);
-		    colors_changed = 1;
-		}
-	    }
-	    else {
-		Rast_get_c_color(&at_cat, &cur_red, &cur_grn, &cur_blu, colors);
-		switch (cur_char) {
-		case 'r':
-		    cur_red = shift_color(cur_red, -shift_incr);
-		    break;
-		case 'R':
-		    cur_red = shift_color(cur_red, shift_incr);
-		    break;
-		case 'g':
-		    cur_grn = shift_color(cur_grn, -shift_incr);
-		    break;
-		case 'G':
-		    cur_grn = shift_color(cur_grn, shift_incr);
-		    break;
-		case 'b':
-		    cur_blu = shift_color(cur_blu, -shift_incr);
-		    break;
-		case 'B':
-		    cur_blu = shift_color(cur_blu, shift_incr);
-		    break;
-		}
-		Rast_set_c_color(at_cat, cur_red, cur_grn, cur_blu, colors);
-		colors_changed = 1;
-	    }
-	    WRITE_STATUS;
-	    break;
-	case 'i':
-	    shift_incr = shift_color(shift_incr, -1);
-	    WRITE_STATUS;
-	    break;
-	case 'I':
-	    shift_incr = shift_color(shift_incr, 1);
-	    WRITE_STATUS;
-	    break;
-	case '+':
-	    Rast_shift_c_colors(1, colors);
-	    if (hi_mode) {
-		cur_red = red_hi;
-		cur_grn = grn_hi;
-		cur_blu = blu_hi;
-		if (hi_save_mode)
-		    Rast_set_c_color(at_cat, cur_red, cur_grn, cur_blu, colors);
-	    }
-	    colors_changed = 1;
-	    WRITE_STATUS;
-	    break;
-	case '-':
-	    Rast_shift_c_colors(-1, colors);
-	    if (hi_mode) {
-		cur_red = red_hi;
-		cur_grn = grn_hi;
-		cur_blu = blu_hi;
-		if (hi_save_mode)
-		    Rast_set_c_color(at_cat, cur_red, cur_grn, cur_blu, colors);
-	    }
-	    colors_changed = 1;
-	    WRITE_STATUS;
-	    break;
-	case 'c':		/* Writeout color lookup table */
-	    colors_changed = 0;
-	    save_colors(name, mapset, colors);
-	    break;
-
-	case 't':
-	    Clear_message();
-	    Write_message(1, "toggling new color table...");
-	    table_toggle(name, mapset, colors);
-	    /*Clear_message() ; */
-	    if (hi_mode) {
-		cur_red = red_hi;
-		cur_grn = grn_hi;
-		cur_blu = blu_hi;
-		if (hi_save_mode)
-		    Rast_set_c_color(at_cat, cur_red, cur_grn, cur_blu, colors);
-	    }
-	    colors_changed = 1;
-	    break;
-	case 'h':
-	case 'H':
-	    if (hi_mode) {
-		Rast_get_c_color(&at_cat, &cur_red, &cur_grn, &cur_blu, colors);
-		hi_mode = 0;
-		hi_save_mode = 0;
-	    }
-	    else {
-		cur_red = red_hi;
-		cur_grn = grn_hi;
-		cur_blu = blu_hi;
-		hi_mode = 1;
-		if (cur_char == 'H') {
-		    Rast_set_c_color(at_cat, cur_red, cur_grn, cur_blu, colors);
-		    hi_save_mode = 1;
-		    colors_changed = 1;
-		}
-	    }
-	    WRITE_STATUS;
-
-	    break;
-	default:
-
-	    sprintf(buffer, "  %c - Unknown Command", cur_char);
-	    Write_message(2, buffer);
-	    break;
-	}
-    }
-}
-
-int shift_color(int colr, int shift)
-{
-    colr = colr + shift;
-    if (colr < 0)
-	colr = 0;
-    if (colr > 255)
-	colr = 255;
-    return (colr);
-}
-
-static int yes(char *msg1, char *msg2)
-{
-    int c;
-
-    Clear_message();
-    Write_message(1, msg1);
-    Write_message(2, msg2);
-
-    while (1) {
-	c = getchar() & 0177;
-	switch (c) {
-	case 'y':
-	case 'Y':
-	    Clear_message();
-	    return 1;
-
-	case 'n':
-	case 'N':
-	    Clear_message();
-	    return 0;
-	}
-	putchar('\7');
-    }
-}
-
-static int save_colors(char *name, char *mapset, struct Colors *colors)
-{
-    Clear_message();
-    Write_message(2, "Writing color table      ");
-
-    Rast_write_colors(name, mapset, colors);
-    Clear_message();
-    return 1;
-}

+ 0 - 91
display/d.colors/main.c

@@ -1,91 +0,0 @@
-/****************************************************************************
- *
- * MODULE:       d.colors
- * AUTHOR(S):    Jim Westervelt (CERL) (original contributor)
- *               Markus Neteler <neteler itc.it>,
- *               Bernhard Reiter <bernhard intevation.de>, 
- *               Eric G. Miller <egm2 jps.net>, 
- *               Glynn Clements <glynn gclements.plus.com>, 
- *               Hamish Bowman <hamish_b yahoo.com>
- * PURPOSE:      Enables the user to change color table of raster map layers
- * 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 <grass/gis.h>
-#include <grass/glocale.h>
-#include <grass/display.h>
-#include <grass/raster.h>
-#include "colors.h"
-
-int main(int argc, char **argv)
-{
-    char name[128] = "";
-    struct Option *map;
-    struct GModule *module;
-    char *mapset;
-    char buff[500];
-
-    /* must run in a term window */
-    G_putenv("GRASS_UI_TERM", "1");
-
-    /* Initialize the GIS calls */
-    G_gisinit(argv[0]);
-
-    module = G_define_module();
-    G_add_keyword(_("display"));
-    G_add_keyword(_("color table"));
-    G_add_keyword(_("raster"));
-    module->description =
-	"Allows the user to interactively change the color table "
-	"of a raster map layer displayed on the graphics monitor.";
-
-    map = G_define_option();
-    map->key = "map";
-    map->type = TYPE_STRING;
-    if (*name)
-	map->answer = name;
-    if (*name)
-	map->required = NO;
-    else
-	map->required = YES;
-    map->gisprompt = "old,cell,raster";
-    map->description = "Name of raster map";
-
-    if (G_parser(argc, argv))
-	exit(1);
-
-    /* Make sure map is available */
-    if (map->answer == NULL)
-	exit(0);
-    mapset = G_find_raster2(map->answer, "");
-    if (mapset == NULL) {
-	char msg[256];
-
-	sprintf(msg, "Raster file [%s] not available", map->answer);
-	G_fatal_error(msg);
-    }
-
-    if (Rast_map_is_fp(map->answer, mapset)) {
-	sprintf(buff,
-		"Raster file [%s] is floating point! \nd.colors only works with integer maps",
-		map->answer);
-	G_fatal_error(buff);
-    }
-
-    /* connect to the driver */
-    if (D_open_driver() != 0)
-	G_fatal_error("No graphics device selected");
-
-    /* Read in the map region associated with graphics window */
-    D_setup(0);
-
-    get_map_info(map->answer, mapset);
-
-    D_close_driver();
-    exit(0);
-}

+ 0 - 26
display/d.colors/set_sigs.c

@@ -1,26 +0,0 @@
-
-#include "externs.h"
-#include <signal.h>
-#include <grass/config.h>
-
-struct signalflag signalflag;
-
-extern RETSIGTYPE sigint(int);
-
-int set_signals(void)
-{
-
-    /* ignore ctrlz */
-
-#ifdef SIGTSTP
-    signal(SIGTSTP, SIG_IGN);
-#endif
-
-    /* set other signal catches */
-
-    signalflag.interrupt = 0;
-
-    signal(SIGINT, sigint);
-
-    return 0;
-}

+ 0 - 8
display/d.colors/sigint.c

@@ -1,8 +0,0 @@
-#include <signal.h>
-#include "externs.h"
-
-void sigint(int n)
-{
-    signal(n, sigint);
-    signalflag.interrupt = n;
-}

+ 0 - 49
display/d.colors/tbl_toggle.c

@@ -1,49 +0,0 @@
-#include <grass/gis.h>
-#include <grass/raster.h>
-#include "colors.h"
-
-static int toggle_number;
-
-int table_toggle(char *name, char *mapset, struct Colors *colors)
-{
-    CELL min, max;
-    char *msg = '\0';
-    char info[100];
-
-    Rast_get_c_color_range(&min, &max, colors);
-    Rast_free_colors(colors);
-    sprintf(info, "Color range: %d to %d\n", min, max);
-
-    toggle_number++;
-    toggle_number &= 6;
-    switch (toggle_number) {
-    case 0:
-	msg = "Original colors";
-	Rast_read_colors(name, mapset, colors);
-	break;
-    case 1:
-	msg = "Ramp colors";
-	Rast_make_ramp_colors(colors, min, max);
-	break;
-    case 2:
-	msg = "Grey scale colors";
-	Rast_make_grey_scale_colors(colors, min, max);
-	break;
-    case 3:
-	msg = "Random colors";
-	Rast_make_random_colors(colors, min, max);
-	break;
-    case 4:
-	msg = "Wave colors";
-	Rast_make_wave_colors(colors, min, max);
-	break;
-    case 5:
-	msg = "Aspect colors";
-	Rast_make_aspect_colors(colors, min, max);
-	break;
-    }
-    Write_message(2, msg);
-    Write_message(3, info);
-
-    return 0;
-}

+ 0 - 10
display/d.measure/Makefile

@@ -1,10 +0,0 @@
-MODULE_TOPDIR = ../..
-
-PGM = d.measure
-
-LIBES     = $(DISPLAYLIB) $(GISLIB)
-DEPENDENCIES= $(DISPLAYDEP) $(GISDEP)
-
-include $(MODULE_TOPDIR)/include/Make/Module.make
-
-default: cmd

+ 0 - 62
display/d.measure/d.measure.html

@@ -1,62 +0,0 @@
-<h2>DESCRIPTION</h2>
-
-<em>d.measure</em> provides the user with an interactive
-way to measure the lengths and areas of lines and polygons
-drawn by the user in the active frame on the graphics
-monitor.  Lines and polygons are drawn using a pointing
-device (mouse).  Each line segment is drawn in colors
-<b>c1</b> and <b>c2</b>.  A mouse button menu indicates
-that the user can find out the geographic coordinates of
-the cursor location, draw line segments between
-user-specified vertices, and quit <em>d.measure</em>. Lines
-and polygons are defined by the series of vertices marked
-by the user. If more than two successive vertices are
-drawn, <em>d.measure</em> prints the area encompassed
-(<em>d.measure</em> will assume the area is closed even if
-the user has not joined the first and last vertices).
-<!-- (not [currently] true!)  Line lengths are stated in the same units
-as those of the current LOCATION. In a XY-LOCATION, where no units are
-available, <em>d.measure</em> prints a warning and gives results without
-units. -->
-Areas can be stated in hectares, square miles, square meters and
-square kilometers.
-
-Lines and polygons drawn using <em>d.measure</em> will
-overlay (not overwrite) whatever display currently appears
-in the active frame on the graphics monitor.  The user can,
-for example, run 
-<em><a href="d.rast.html">d.rast</a></em> or 
-<em><a href="d.vect.html">d.vect</a></em> prior to running
-<em>d.measure</em>, and use raster and/or vector maps as a backdrop.
-
-<h2>NOTES</h2>
-
-<em>d.measure</em> uses all segments drawn by the user when computing area. 
-If the user draws an area within another area, the combined 
-area of both regions will be output. 
-
-<h2>TODO</h2>
-
-Output lengths in the same units as those of the current LOCATION as
-found in the <tt>PROJ_UNITS</tt> file (see <em>g.proj</em>).
-Volunteers are welcome for this task.
-
-<h2>SEE ALSO</h2>
-
-<em><a href="d.frame.html">d.frame</a></em><br>
-<em><a href="d.graph.html">d.graph</a></em><br>
-<em><a href="d.rast.html">d.rast</a></em><br>
-<em><a href="d.vect.html">d.vect</a></em><br>
-<em><a href="d.where.html">d.where</a></em><br>
-<em><a href="g.proj.html">g.proj</a></em>
-
-
-<h2>AUTHORS</h2>
-
-James Westervelt, 
-<br>
-Michael Shapiro, <br>
-U.S. Army Construction Engineering 
-Research Laboratory
-
-<p><i>Last changed: $Date$</i>

+ 0 - 25
display/d.measure/draw_line.c

@@ -1,25 +0,0 @@
-#include <stdlib.h>
-#include <grass/display.h>
-#include "local_proto.h"
-
-int
-draw_line(int screen_x, int screen_y, int cur_screen_x, int cur_screen_y,
-	  int color1, int color2)
-{
-    D_use_color(color1);
-    R_move_abs(cur_screen_x, cur_screen_y);
-    R_cont_abs(screen_x, screen_y);
-    D_use_color(color2);
-    if (abs(screen_y - cur_screen_y) <= abs(screen_x - cur_screen_x)) {
-	R_move_abs(cur_screen_x, cur_screen_y - 1);
-	R_cont_abs(screen_x, screen_y - 1);
-    }
-    else {
-	R_move_abs(cur_screen_x + 1, cur_screen_y);
-	R_cont_abs(screen_x + 1, screen_y);
-    }
-
-    R_flush();
-
-    return 0;
-}

+ 0 - 8
display/d.measure/local_proto.h

@@ -1,8 +0,0 @@
-/* draw_line.c */
-int draw_line(int, int, int, int, int, int);
-
-/* msurements.c */
-int measurements(int, int, int, int, int);
-int print_en(double, double, int);
-int print_length(double, int, int);
-int add_point(double **, double **, int *, int *, double, double);

+ 0 - 98
display/d.measure/main.c

@@ -1,98 +0,0 @@
-
-/****************************************************************************
- *
- * MODULE:       d.measure
- * AUTHOR(S):    James Westervelt and Michael Shapiro 
- *                (CERL - original contributors)
- *               Markus Neteler <neteler itc.it>, 
- *               Reinhard Brunzema <r.brunzema@web.de>, 
- *               Bernhard Reiter <bernhard intevation.de>, 
- *               Huidae Cho <grass4u gmail.com>, 
- *               Eric G. Miller <egm2 jps.net>, 
- *               Glynn Clements <glynn gclements.plus.com>, 
- *               Hamish Bowman <hamish_b yahoo.com>, 
- *               Jan-Oliver Wagner <jan intevation.de>
- * PURPOSE:      interactive line and polygon measurement in display
- * COPYRIGHT:    (C) 1999-2006 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 <grass/gis.h>
-#include <grass/display.h>
-#include <grass/glocale.h>
-#include "local_proto.h"
-
-int main(int argc, char **argv)
-{
-    struct GModule *module;
-    struct
-    {
-	struct Option *c1;
-	struct Option *c2;
-	struct Flag *s;
-	struct Flag *m;
-	struct Flag *k;
-    } parm;
-    int color1, color2, s_flag, m_flag, k_flag;
-
-    /* Initialize the GIS calls */
-    G_gisinit(argv[0]);
-
-    module = G_define_module();
-    G_add_keyword(_("display"));
-    G_add_keyword(_("geometry"));
-    module->description =
-	_("Measures the lengths and areas of features drawn "
-	  "by the user in the active display frame on the "
-	  "graphics monitor.");
-
-    parm.c1 = G_define_option();
-    parm.c1->key = "c1";
-    parm.c1->description = _("Line color 1");
-    parm.c1->type = TYPE_STRING;
-    parm.c1->required = NO;
-    parm.c1->gisprompt = "old_color,color,color";
-    parm.c1->answer = DEFAULT_BG_COLOR;
-
-    parm.c2 = G_define_option();
-    parm.c2->key = "c2";
-    parm.c2->description = _("Line color 2");
-    parm.c2->type = TYPE_STRING;
-    parm.c2->required = NO;
-    parm.c2->gisprompt = "old_color,color,color";
-    parm.c2->answer = DEFAULT_FG_COLOR;
-
-    parm.s = G_define_flag();
-    parm.s->key = 's';
-    parm.s->description = _("Suppress clear screen");
-
-    parm.m = G_define_flag();
-    parm.m->key = 'm';
-    parm.m->description = _("Output in meters only");
-
-    parm.k = G_define_flag();
-    parm.k->key = 'k';
-    parm.k->description = _("Output in kilometers as well");
-
-    if (G_parser(argc, argv))
-	exit(EXIT_FAILURE);
-
-    if (R_open_driver() != 0)
-	G_fatal_error(_("No graphics device selected"));
-
-    color1 = D_translate_color(parm.c1->answer);
-    color2 = D_translate_color(parm.c2->answer);
-    s_flag = parm.s->answer;
-    m_flag = parm.m->answer;
-    k_flag = parm.k->answer;
-
-    measurements(color1, color2, s_flag, m_flag, k_flag);
-
-    R_close_driver();
-
-    exit(EXIT_SUCCESS);
-}

+ 0 - 184
display/d.measure/msurements.c

@@ -1,184 +0,0 @@
-#include <grass/gis.h>
-#include <grass/display.h>
-#include "local_proto.h"
-
-
-FILE *output;
-
-int measurements(int color1, int color2, int s_flag, int m_flag, int k_flag)
-{
-    double *x, *y;
-    int npoints, nalloc;
-    double area;
-    double cur_ux, cur_uy;
-    double length;
-    double ux, uy;
-    int button;
-    int cur_screen_x, cur_screen_y;
-    int screen_x, screen_y;
-    struct Cell_head window;
-    double t, b, l, r;
-
-    nalloc = 128;
-    x = (double *)G_calloc(nalloc, sizeof(double));
-    y = (double *)G_calloc(nalloc, sizeof(double));
-
-
-    /* Use stderr for TCLTK-Output */
-    if (s_flag)
-	output = stderr;
-    else
-	output = stdout;
-
-    /* Set up area/distance calculations  */
-    G_begin_polygon_area_calculations();
-    G_begin_distance_calculations();
-
-    G_get_window(&window);
-    D_get_dst(&t, &b, &l, &r);
-    D_do_conversions(&window, t, b, l, r);
-
-    for (;;) {
-	npoints = 0;
-	if (!s_flag)
-	    G_clear_screen();
-	fprintf(output, "\nButtons:\n");
-	fprintf(output, "Left:   where am i\n");
-	fprintf(output, "Middle: set FIRST vertex\n");
-	fprintf(output, "Right:  quit this\n");
-
-	screen_y = (t + b) / 2;
-	screen_x = (l + r) / 2;
-
-	do {
-	    R_get_location_with_pointer(&screen_x, &screen_y, &button);
-	    cur_uy = D_d_to_u_row((double)screen_y);
-	    cur_ux = D_d_to_u_col((double)screen_x);
-	    if (button == 1)
-		print_en(cur_ux, cur_uy, s_flag);
-	    if (button == 3)
-		return (0);
-	} while (button != 2);
-
-	add_point(&x, &y, &npoints, &nalloc, cur_ux, cur_uy);
-	if (!s_flag)
-	    G_clear_screen();
-	fprintf(output, "\nLeft:   where am i\n");
-	fprintf(output, "Middle: set NEXT vertex\n");
-	fprintf(output, "Right:  FINISH\n");
-
-	R_move_abs(screen_x, screen_y);
-	cur_screen_x = screen_x;
-	cur_screen_y = screen_y;
-
-	length = 0.0;
-
-	do {
-	    D_use_color(color1);
-	    R_get_location_with_line(cur_screen_x, cur_screen_y, &screen_x,
-				     &screen_y, &button);
-	    uy = D_d_to_u_row((double)screen_y);
-	    ux = D_d_to_u_col((double)screen_x);
-	    if (button == 1) {
-		print_en(ux, uy, s_flag);
-	    }
-	    else if (button == 2) {
-		draw_line(screen_x, screen_y, cur_screen_x, cur_screen_y,
-			  color1, color2);
-		add_point(&x, &y, &npoints, &nalloc, ux, uy);
-		length += G_distance(cur_ux, cur_uy, ux, uy);
-		print_length(length, s_flag, k_flag);
-		cur_screen_x = screen_x;
-		cur_screen_y = screen_y;
-		cur_ux = ux;
-		cur_uy = uy;
-	    }
-	} while (button != 3);
-
-	R_flush();
-
-	if (!s_flag)
-	    G_clear_screen();
-	fprintf(output, "\nButtons:\n");
-	fprintf(output, "Left:   DO ANOTHER\n");
-	fprintf(output, "Middle:\n");
-	fprintf(output, "Right:  quit this\n");
-	/*
-	 * 10000 is sq meters per hectare
-	 * 2589988 is sq meters per sq mile
-	 */
-	fprintf(output, "\n");
-	print_length(length, s_flag, k_flag);
-	if (npoints > 3) {
-	    area = G_area_of_polygon(x, y, npoints);
-	    if (!m_flag) {
-		fprintf(output, "AREA:  %10.2f hectares\n", area / 10000);
-		fprintf(output, "AREA:  %10.4f square miles\n",
-			area / 2589988.11);
-	    }
-	    fprintf(output, "AREA:  %10.2f square meters\n", area);
-	    if (k_flag)
-		fprintf(output, "AREA:   %10.4f square kilometers\n",
-			area / 1000000);
-	}
-
-	R_get_location_with_pointer(&screen_x, &screen_y, &button);
-	if (button == 3)
-	    return (0);
-    }
-
-    return 0;
-}
-
-int print_en(double e, double n, int s_flag)
-{
-    char buf[100];
-
-    /* Use stderr for TCLTK-Output */
-    if (s_flag)
-	output = stderr;
-    else
-	output = stdout;
-
-    G_format_easting(e, buf, G_projection());
-    fprintf(output, "EAST:  %s\n", buf);
-    G_format_northing(n, buf, G_projection());
-    fprintf(output, "NORTH: %s\n", buf);
-
-    return 0;
-}
-
-int print_length(double length, int s_flag, int k_flag)
-{
-    /* Use stderr for TCLTK-Output */
-    if (s_flag)
-	output = stderr;
-    else
-	output = stdout;
-
-    fprintf(output, "LEN:   %10.2f meters\n", length);
-    if (k_flag)
-	fprintf(output, "LEN:   %10.4f kilometers\n", length / 1000);
-
-    return 0;
-}
-
-int add_point(double **x, double **y,
-	      int *npoints, int *nalloc, double ux, double uy)
-{
-    double *px, *py;
-
-    px = *x;
-    py = *y;
-
-    if (*npoints >= *nalloc) {
-	*nalloc *= 2;
-	*x = px = (double *)G_realloc(px, *nalloc * sizeof(double));
-	*y = py = (double *)G_realloc(py, *nalloc * sizeof(double));
-    }
-    px[*npoints] = ux;
-    py[*npoints] = uy;
-    *npoints += 1;
-
-    return 0;
-}

+ 0 - 16
display/d.what.rast/Makefile

@@ -1,16 +0,0 @@
-
-MODULE_TOPDIR = ../..
-
-PGM = d.what.rast
-
-LIBES        = $(DISPLAYLIB) $(RASTERLIB) $(GISLIB)
-
-DEPENDENCIES = $(DISPLAYDEP) $(RASTERDEP) $(GISDEP)
-
-include $(MODULE_TOPDIR)/include/Make/Module.make
-
-default: cmd
-
-
-
-

+ 0 - 151
display/d.what.rast/d.what.rast.html

@@ -1,151 +0,0 @@
-<h2>DESCRIPTION</h2>
-
-<em>d.what.rast</em> outputs the category values and labels
-associated with cell(s) at user-specified location(s) on
-user-named raster map layer(s).
-
-<p>
-The program will query the contents of raster map layer(s)
-named by the user on the command line. These map layers
-must exist in the user's current mapset search path.  If
-the user does not name any raster map layers on the command
-line, <em>d.what.rast</em> will query the category contents
-of whatever raster map layer is already displayed in the
-active frame on the graphics monitor.
-
-<p>
-The program activates the mouse, and expects the user to
-indicate the cell location(s) to be queried by depressing a
-mouse button over desired location(s) within the current
-geographic region in the active display frame on the
-graphic monitor.
-
-
-<h2>NOTES</h2>
-
-Mouse button return values are as follows: 0 indicates no
-button was pressed, 1 indicates that the left mouse button
-was pressed, 2 indicates the middle button was pressed, and
-3 indicates that the right mouse button was pressed.
-
-<p>
-<em>d.what.rast</em> will always print its output to the
-terminal screen.  <em>d.what.rast</em> output can be
-redirected into a file; however, if it is, the output will
-go both to the screen and to the file.  For example:
-
-<p>
-<dl>
-<dt><b>d.what.rast map=</b><em>soils,aspect</em><b> &gt; what.out</b> 
-<p><dd>will both send <em>d.what.rast</em> output to the screen
-and capture its output in the file named
-<em>what.out</em>.</dd>
-</dl>
-
-<p>
-The maximum number of raster map layers that can be queried at one time is 15.
-
-<p>
-<em><a href="d.what.vect.html">d.what.vect</a></em>
-allows the user to interactively query the category
-contents of multiple vector map layers at user-specified
-locations.
-
-
-<h2>EXAMPLES</h2>
-
-It is helpful, but not necessary, to first display a map to
-be used for reference in the active display frame before
-running <em>d.what.rast</em>.  For example, the user might
-type the following series of commands and receive the
-output below.
-
-<p>
-<dl>
-<dt><b>d.rast map=</b><em>soils</em>
-<p><dd>To first display the <em>soils</em> map in the active frame.</dd>
-</dl>
-
-<p><dl>
-<dt><b>d.what.rast map=</b><em>soils,aspect</em><br>
-<p><dd>User then moves the mouse to desired location on the
-displayed <em>soils</em> map layer, and presses the left
-mouse button to query the category contents of the
-<em>soils</em> and <em>aspect</em> maps at this geographic
-location.  The program then outputs the below information
-to the user's terminal.</dd>
-</dl>
-
-<pre>
-617112(E) 3732014(N) 
-soils in PERMANENT (44)Nunn clay loam, NdC 
-aspect in PERMANENT (20)15 degrees north of west 
-</pre>
-
-<p>The first line of output gives the easting (E) and northing (N) coordinates 
-of the geographic location at which the user clicked the mouse. 
-Subsequent lines give the selected map(s) name and mapset, map category value 
-(within parentheses), and map category label corresponding to this 
-user-selected map location. 
-
-<p>
-The query may be repeated as often as desired using the
-left mouse button.  The right button on the mouse is used
-to quit the <em>d.what.rast</em> session.
-
-<p>
-Users can set the <b>-t</b> flag to obtain a terse output
-from <em>d.what.rast</em>.  This is useful when the user
-wishes output to be parsed by another program (like
-<em>awk</em>). If the <b>-t</b> flag is set, users can also
-select the field separator used (with the
-<b>fs=</b><em>name</em> option), or elect to use the
-default <b>:</b> field separator.  In this case, the
-command
-
-<p>
-<dl>
-<dt><b>d.what.rast -t map=</b><em>soils,aspect</em>
-<p><dd> produces output in the form shown below. The first line of
-output gives the easting, northing, and the mouse button
-return value (see NOTES below).  Each
-subsequent line gives the map name and its mapset, the
-category value, and category label of the point specified
-on the user-named raster map layers.  The default output
-field separator, a colon, is used since none was specified
-on the command line.</dd>
-</dl>
-
-<pre>
-617112:3732014:1 
-soils@PERMANENT:44:Nunn clay loam, NdC 
-aspect@PERMANENT:20:15 degrees north of west 
-</pre>
-
-<p>
-Users can also use this program inside of shell scripts
-that require as input a map category value and a mouse
-button depressed.  Users can choose an option to run
-<em>d.what.rast</em> only once, and return only the map
-category value found and the number of the mouse button
-depressed.
-
-
-<h2>SEE ALSO</h2>
-
-<em>
-<a href="d.rast.html">d.rast</a><br>
-<a href="d.what.vect.html">d.what.vect</a><br>
-<a href="g.region.html">g.region</a>
-</em>
-<br>
-
-
-<h2>AUTHOR</h2>
-
-Michael Shapiro, 
-U.S. Army Construction Engineering 
-Research Laboratory
-
-<p>
-<i>Last changed: $Date$</i>

+ 0 - 14
display/d.what.rast/local_proto.h

@@ -1,14 +0,0 @@
-/* opencell.c */
-int opencell(char *, char *, char *);
-
-/* show.c */
-int show_cat(int, int, char *, char *, int, char *, int, char *,
-	     RASTER_MAP_TYPE);
-int show_dval(int, int, char *, char *, DCELL, char *, int, char *,
-	     RASTER_MAP_TYPE);
-int show_utm(char *, char *, double, double, struct Cell_head *, int, int,
-	     int, char *);
-int show_buttons(int);
-
-/* what.c */
-int what(int, int, int, char *, int, int);

+ 0 - 139
display/d.what.rast/main.c

@@ -1,139 +0,0 @@
-
-/****************************************************************************
- *
- * MODULE:       d.what.rast
- * AUTHOR(S):    Michael Shapiro (CERL) (original contributor)
- *               Markus Neteler <neteler itc.it>, 
- *               Andreas Lange <andreas.lange rhein-main.de>, 
- *               Bernhard Reiter <bernhard intevation.de>, 
- *               Huidae Cho <grass4u gmail.com>, 
- *               Eric G. Miller <egm2 jps.net>, 
- *               Glynn Clements <glynn gclements.plus.com>, 
- *               Hamish Bowman <hamish_b yahoo.com>
- * PURPOSE:      interactive query of cat/label of raster map in display
- * COPYRIGHT:    (C) 1999-2006 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 <string.h>
-#include "what.h"
-#include <grass/display.h>
-#include <grass/raster.h>
-#include <grass/glocale.h>
-#include "local_proto.h"
-
-struct Categories *cats;
-int *fd;
-char **rast;
-int nrasts;
-char **name;
-char **mapset;
-
-int main(int argc, char **argv)
-{
-    int i, j;
-    int width, mwidth;
-    struct Flag *once, *terse, *colrow;
-    struct Option *opt1, *fs;
-    struct GModule *module;
-
-    /* Initialize the GIS calls */
-    G_gisinit(argv[0]);
-
-    module = G_define_module();
-    G_add_keyword(_("display"));
-    G_add_keyword(_("raster"));
-    G_add_keyword(_("position"));
-    G_add_keyword(_("querying"));
-    module->description =
-	_("Allows the user to interactively query the category contents "
-	  "of multiple raster map layers at user specified locations "
-	  "within the current geographic region.");
-
-
-    rast = NULL;
-
-    opt1 = G_define_option();
-    opt1->key = "map";
-    opt1->type = TYPE_STRING;
-    opt1->required = YES;
-    opt1->multiple = YES;
-    opt1->gisprompt = "old,cell,raster";
-    opt1->description = _("Name of existing raster map(s)");
-    opt1->key_desc = "name";
-
-    fs = G_define_option();
-    fs->key = "fs";
-    fs->type = TYPE_STRING;
-    fs->required = NO;
-    fs->answer = ":";
-    fs->description = _("Field separator (terse mode only)");
-    fs->key_desc = "character";
-
-    once = G_define_flag();
-    once->key = '1';
-    once->description = _("Identify just one location");
-
-    terse = G_define_flag();
-    terse->key = 't';
-    terse->description = _("Terse output. For parsing by programs");
-
-    colrow = G_define_flag();
-    colrow->key = 'c';
-    colrow->description =
-	_("Print out col/row for the entire map in grid resolution of the region");
-
-    if (G_parser(argc, argv))
-	exit(EXIT_FAILURE);
-
-
-    if (opt1->answers && opt1->answers[0])
-	rast = opt1->answers;
-
-    if (D_open_driver() != 0)
-	G_fatal_error(_("No graphics device selected"));
-
-    D_setup(0);
-
-    if (rast) {
-	for (i = 0; rast[i]; i++) ;
-	nrasts = i;
-
-	fd = (int *)G_malloc(nrasts * sizeof(int));
-	name = (char **)G_malloc(nrasts * sizeof(char *));
-	mapset = (char **)G_malloc(nrasts * sizeof(char *));
-	cats =
-	    (struct Categories *)G_malloc(nrasts * sizeof(struct Categories));
-
-	width = mwidth = 0;
-	for (i = 0; i < nrasts; i++) {
-	    name[i] = (char *)G_malloc(GNAME_MAX);
-	    mapset[i] = (char *)G_malloc(GMAPSET_MAX);
-
-	    if ((fd[i] = opencell(rast[i], name[i], mapset[i])) < 0)
-		G_fatal_error(_("Raster map <%s> not found"), rast[i]);
-
-	    j = strlen(name[i]);
-	    if (j > width)
-		width = j;
-
-	    j = strlen(mapset[i]);
-	    if (j > mwidth)
-		mwidth = j;
-
-	    if (Rast_read_cats(name[i], mapset[i], &cats[i]) < 0)
-		cats[i].ncats = -1;
-	}
-    }
-
-    what(once->answer, terse->answer, colrow->answer, fs->answer, width,
-	 mwidth);
-
-    D_close_driver();
-    exit(EXIT_SUCCESS);
-}

+ 0 - 26
display/d.what.rast/opencell.c

@@ -1,26 +0,0 @@
-#include <string.h>
-#include <grass/gis.h>
-#include <grass/raster.h>
-#include <grass/glocale.h>
-
-int opencell(char *fullname, char *name, char *mapset)
-{
-    char *m;
-    int fd;
-
-    strcpy(name, fullname);
-    m = G_find_raster2(name, "");
-    if (m == NULL) {
-	G_warning(_("Raster map <%s> not found"), name);
-	return -1;
-    }
-
-    if (strlen(m) == 0)
-	strcpy(mapset, G_mapset());
-    else
-	strcpy(mapset, m);
-
-    fd = Rast_open_old(name, mapset);
-
-    return fd;
-}

+ 0 - 181
display/d.what.rast/show.c

@@ -1,181 +0,0 @@
-#include <unistd.h>
-#include <string.h>
-#include <grass/gis.h>
-#include <grass/raster.h>
-
-static int nlines = 100;
-
-int show_cat(int width, int mwidth,
-	     char *name, char *mapset, int cat, char *label,
-	     int terse, char *fs, RASTER_MAP_TYPE map_type)
-{
-    char *fname;
-    char buf[100];
-    CELL cell_val;
-
-    cell_val = cat;
-    if (map_type != CELL_TYPE)
-	sprintf(buf, ", quant  ");
-    else
-	sprintf(buf, " ");
-    if (terse) {
-	fname = G_fully_qualified_name(name, mapset);
-	if (Rast_is_c_null_value(&cell_val)) {
-	    if (!isatty(fileno(stdout)))
-		fprintf(stdout, "%s%s%sNull%s%s\n", fname, buf, fs, fs,
-			label);
-	    fprintf(stderr, "%s%s%sNull%s%s\n", fname, buf, fs, fs, label);
-	}
-	else {
-	    if (!isatty(fileno(stdout)))
-		fprintf(stdout, "%s%s%s%d%s%s\n", fname, buf, fs, cat, fs,
-			label);
-	    fprintf(stderr, "%s%s%s%d%s%s\n", fname, buf, fs, cat, fs, label);
-	}
-    }
-    else {
-	if (Rast_is_c_null_value(&cell_val)) {
-	    if (!isatty(fileno(stdout)))
-		fprintf(stdout, "%*s in %-*s%s (Null)%s\n", width, name,
-			mwidth, mapset, buf, label);
-	    fprintf(stderr, "%*s in %-*s%s (Null)%s\n", width, name, mwidth,
-		    mapset, buf, label);
-	}
-	else {
-	    if (!isatty(fileno(stdout)))
-		fprintf(stdout, "%*s in %-*s%s (%d)%s\n", width, name, mwidth,
-			mapset, buf, cat, label);
-	    fprintf(stderr, "%*s in %-*s%s (%d)%s\n", width, name, mwidth,
-		    mapset, buf, cat, label);
-	}
-    }
-    nlines += 1;
-
-    return 0;
-}
-
-int show_dval(int width, int mwidth,
-	      char *name, char *mapset, DCELL dval, char *label,
-	      int terse, char *fs, RASTER_MAP_TYPE map_type)
-{
-    DCELL dcell_val;
-    char *fname;
-
-    dcell_val = dval;
-    if (terse) {
-	fname = G_fully_qualified_name(name, mapset);
-	if (Rast_is_d_null_value(&dcell_val)) {
-	    if (!isatty(fileno(stdout)))
-		fprintf(stdout, "%s, actual %sNull%s%s\n", fname, fs, fs,
-			label);
-	    fprintf(stderr, "%s, actual %sNull%s%s\n", fname, fs, fs, label);
-	}
-	else {
-	    if (!isatty(fileno(stdout)))
-		fprintf(stdout, "%s, actual %s%.*g%s%s\n", fname, fs,
-			map_type == FCELL_TYPE ? 7 : 15, dval, fs, label);
-	    fprintf(stderr, "%s, actual %s%.*g%s%s\n", fname, fs,
-		    map_type == FCELL_TYPE ? 7 : 15, dval, fs, label);
-	}
-    }
-    else {
-	if (Rast_is_d_null_value(&dcell_val)) {
-	    if (!isatty(fileno(stdout)))
-		fprintf(stdout, "%*s in %-*s, actual  (Null)%s\n", width,
-			name, mwidth, mapset, label);
-	    fprintf(stderr, "%*s in %-*s, actual  (Null)%s\n", width, name,
-		    mwidth, mapset, label);
-	}
-	else {
-	    if (!isatty(fileno(stdout)))
-		fprintf(stdout, "%*s in %-*s, actual  (%.*g)%s\n", width, name,
-			mwidth, mapset, map_type == FCELL_TYPE ? 7 : 15,
-			dval, label);
-	    fprintf(stderr, "%*s in %-*s, actual  (%.*g)%s\n", width, name,
-		    mwidth, mapset, map_type == FCELL_TYPE ? 7 : 15, dval,
-		    label);
-	}
-    }
-    nlines += 1;
-
-    return 0;
-}
-
-int show_utm(char *name, char *mapset, double north, double east,
-	     struct Cell_head *window, int terse, int colrow, int button,
-	     char *fs)
-{
-    char e[50], n[50];
-    int e_col, n_row;
-    static char once = 1;
-    static struct Cell_head cellhd;
-
-    if (window->proj == PROJECTION_LL && !isatty(fileno(stdout))) {
-	/* format in decimal rather than d.m.s */
-	G_format_northing(north, n, -1);
-	G_format_easting(east, e, -1);
-    }
-    else {
-	G_format_northing(north, n, window->proj);
-	G_format_easting(east, e, window->proj);
-    }
-
-    if (once) {
-	/* speed up? */
-	once = 0;
-	Rast_get_cellhd(name, mapset, &cellhd);
-    }
-
-    n_row = (int)((cellhd.north - north) / window->ns_res);
-    e_col = (int)((east - cellhd.west) / window->ew_res);
-
-    if (terse) {
-	if (!isatty(fileno(stdout))) {
-	    fprintf(stdout, "\n%s%s%s%s", e, fs, n, fs);
-	    if (colrow)
-		fprintf(stdout, "%d%s%d%s", e_col, fs, n_row, fs);
-	    fprintf(stdout, "%d\n", button);
-	}
-	fprintf(stderr, "\n%s%s%s%s", e, fs, n, fs);
-	if (colrow)
-	    fprintf(stderr, "%d%s%d%s", e_col, fs, n_row, fs);
-	fprintf(stderr, "%d\n", button);
-    }
-    else {
-	if (window->proj != PROJECTION_LL) {
-	    strcat(n, "(N)");
-	    strcat(e, "(E)");
-	}
-
-	if (!isatty(fileno(stdout))) {
-	    fprintf(stdout, "\n%s %s", e, n);
-	    if (colrow)
-		fprintf(stdout, ", %d(col) %d(row)", e_col, n_row);
-	    fprintf(stdout, "\n");
-	}
-	fprintf(stderr, "\n%s %s", e, n);
-	if (colrow)
-	    fprintf(stderr, ", %d(col) %d(row)", e_col, n_row);
-	fprintf(stderr, "\n");
-    }
-    nlines += 2;
-
-    return 0;
-}
-
-int show_buttons(int once)
-{
-    if (once) {
-	fprintf(stderr, "\nClick mouse button on desired location\n\n");
-	nlines = 3;
-    }
-    else if (nlines >= 18) {	/* display prompt every screen full */
-	fprintf(stderr, "\n");
-	fprintf(stderr, "Buttons\n");
-	fprintf(stderr, " Left:  what's here\n");
-	fprintf(stderr, " Right: quit\n");
-	nlines = 4;
-    }
-
-    return 0;
-}

+ 0 - 84
display/d.what.rast/what.c

@@ -1,84 +0,0 @@
-#include <string.h>
-#include <grass/display.h>
-#include <grass/glocale.h>
-#include "what.h"
-#include "local_proto.h"
-
-int what(int once, int terse, int colrow, char *fs, int width, int mwidth)
-{
-    int i;
-    int row, col;
-    int nrows, ncols;
-    CELL *buf, null_cell;
-    DCELL *dbuf, null_dcell;
-    struct Cell_head window;
-    int screen_x, screen_y;
-    double east, north;
-    int button;
-    RASTER_MAP_TYPE *map_type;
-
-    map_type = (RASTER_MAP_TYPE *) G_malloc(nrasts * sizeof(RASTER_MAP_TYPE));
-
-    G_get_set_window(&window);
-    nrows = window.rows;
-    ncols = window.cols;
-    buf = Rast_allocate_c_buf();
-    dbuf = Rast_allocate_d_buf();
-
-    screen_x = ((int)D_get_d_west() + (int)D_get_d_east()) / 2;
-    screen_y = ((int)D_get_d_north() + (int)D_get_d_south()) / 2;
-
-    for (i = 0; i < nrasts; i++)
-	map_type[i] = Rast_get_map_type(fd[i]);
-
-    do {
-	if (!terse)
-	    show_buttons(once);
-	R_get_location_with_pointer(&screen_x, &screen_y, &button);
-	if (!once) {
-	    if (button == 2)
-		continue;
-	    if (button == 3)
-		break;
-	}
-
-	east = D_d_to_u_col(screen_x + 0.5);
-	north = D_d_to_u_row(screen_y + 0.5);
-	col = D_d_to_a_col(screen_x + 0.5);
-	row = D_d_to_a_row(screen_y + 0.5);
-
-	show_utm(name[0], mapset[0], north, east, &window, terse, colrow,
-		 button, fs);
-	Rast_set_c_null_value(&null_cell, 1);
-	Rast_set_d_null_value(&null_dcell, 1);
-	for (i = 0; i < nrasts; i++) {
-	    if (row < 0 || row >= nrows || col < 0 || col >= ncols) {
-		G_message(_("You are clicking outside the map"));
-		continue;
-	    }
-	    Rast_get_c_row(fd[i], buf, row);
-	    if (map_type[i] == CELL_TYPE) {
-		show_cat(width, mwidth, name[i], mapset[i], buf[col],
-			 Rast_get_c_cat(&buf[col], &cats[i]), terse, fs,
-			 map_type[i]);
-		continue;
-	    }
-	    else {		/* fp map */
-		show_cat(width, mwidth, name[i], mapset[i], buf[col],
-			 "", terse, fs, map_type[i]);
-	    }
-
-	    if (map_type[i] == CELL_TYPE)
-		continue;
-
-	    Rast_get_d_row(fd[i], dbuf, row);
-
-	    show_dval(width, mwidth, name[i], mapset[i], dbuf[col],
-		      Rast_get_d_cat(&dbuf[col], &cats[i]), terse,
-		      fs, map_type[i]);
-	}
-    }
-    while (!once);
-
-    return 0;
-}

+ 0 - 8
display/d.what.rast/what.h

@@ -1,8 +0,0 @@
-#include <grass/gis.h>
-
-extern struct Categories *cats;
-extern int *fd;
-extern char **rast;
-extern int nrasts;
-extern char **name;
-extern char **mapset;

+ 0 - 18
display/d.what.vect/Makefile

@@ -1,18 +0,0 @@
-MODULE_TOPDIR = ../..
-
-PGM = d.what.vect
-
-LIBES        = $(DISPLAYLIB) $(VECTORLIB) $(DBMILIB) $(GISLIB)
-
-DEPENDENCIES = $(DISPLAYDEP) $(VECTORDEP) $(DBMIDEP) $(GISDEP)
-
-EXTRA_CFLAGS = $(VECT_CFLAGS)
-EXTRA_INC = $(VECT_INC)
-
-include $(MODULE_TOPDIR)/include/Make/Module.make
-
-default: cmd
-
-
-
-

+ 0 - 57
display/d.what.vect/d.what.vect.html

@@ -1,57 +0,0 @@
-<h2>DESCRIPTION</h2>
-
-<em>d.what.vect</em>
-outputs the category value(s) associated with user-specified location(s) 
-in user-specified vector map layer(s). 
-
-<p>The program activates the mouse, and expects the user to indicate the 
-location(s) to be queried by depressing a mouse button over desired location(s) 
-within the current geographic region in the active display frame on the 
-graphic monitor. Query results from map(s) are by default displayed in a new 
-monitor, where label values can be added or changed. Using parameter <b>-x</b> 
-information will be displayed as plain text to terminal window.
-<p>This module always reports standard acres, even when the location uses
-US Survey feet as the map unit.
-
-<h2>EXAMPLE</h2>
-
-A sample <em>d.what.vect</em> session is given below. Although it is not 
-necessary that the user first displays a vector map to be queried in the 
-active display frame, it is helpful to have a map displayed there for 
-reference. 
-
-<p>
-<b>d.vect map=</b><em>roads</em><p>Displays the <em>roads</em> vector map layer on the graphics monitor. 
-<p>
-<b>d.what.vect map=</b><em>roads,geology</em><p>After typing this, the user moves the mouse to a desired location 
-on the displayed <em>roads</em> map layer, and presses the left mouse 
-button to query the category value of the <em>roads</em> and the
-<em>geology</em> vector map at this location. 
-
-The program then outputs the category value of a line type corresponding 
-to this user-selected map location, for the vector map queried by the user. 
-
-<p>
-The query may be repeated as often as desired using the left mouse button. The 
-middle mouse button toggles the flash color.
-The right button on the mouse is used to quit the <em>d.what.vect</em> session. 
-
-
-<h2>SEE ALSO</h2>
-
-<em><a href="d.rast.html">d.rast</a><br>
-<a href="d.vect.html">d.vect</a><br>
-<a href="d.what.rast.html">d.what.rast</a><br>
-<a href="g.region.html">g.region</a><br>
-<a href="v.what.html">v.what</a>
-</em>
-
-
-<h2>AUTHOR</h2>
-
-Jim Hinthorne,
-Central Washington University<br>
-Upgrades by Dennis Finch, National Park Service
- and Radim Blazek, ITC-Irst, Trento, Italy
-
-<p><i>Last changed: $Date$</i>

+ 0 - 158
display/d.what.vect/main.c

@@ -1,158 +0,0 @@
-
-/****************************************************************************
- *
- * MODULE:       d.what.vect
- * AUTHOR(S):    Jim Hinthorne, Central Washington U.(original contributor)
- *               Dennis Finch, National Park Service,
- *               Radim Blazek <radim.blazek gmail.com>, 
- *               Stephan Holl <sholl gmx net>, 
- *               Alex Shevlakov <sixote yahoo.com>, 
- *               Glynn Clements <glynn gclements.plus.com>, 
- *               Hamish Bowman <hamish_b yahoo.com>, 
- *               Markus Neteler <neteler itc.it>
- * PURPOSE:      query category values / attributes in vector maps
- * COPYRIGHT:    (C) 2002-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.
- *
- *****************************************************************************/
-/*
- *
- * attempt to auto-select vector maps displayed in monitor (like d.zoom)
- *
- */
-
-#include <stdlib.h>
-#include <string.h>
-#include <grass/glocale.h>
-#include <grass/gis.h>
-#include <grass/display.h>
-#include <grass/vector.h>
-#include "what.h"
-#include <grass/dbmi.h>
-#include <grass/glocale.h>
-
-char **vect;
-int nvects;
-struct Map_info *Map;
-
-/* Vector map grabbing taken from d.zoom */
-
-int main(int argc, char **argv)
-{
-    struct Flag *once, *terse, *txt, *topo_flag, *edit_flag;
-    struct Option *opt1;
-    struct GModule *module;
-    char *mapset;
-    char *str;
-    int i, j, level, width = 0, mwidth = 0;
-
-    /* Initialize the GIS calls */
-    G_gisinit(argv[0]);
-
-    module = G_define_module();
-    G_add_keyword(_("display"));
-    G_add_keyword(_("vector"));
-    G_add_keyword(_("position"));
-    G_add_keyword(_("querying"));
-    module->description =
-	_("Allows the user to interactively query a vector map layer "
-	  "at user-selected locations within the current geographic region.");
-
-    vect = NULL;
-
-    once = G_define_flag();
-    once->key = '1';
-    once->description = _("Identify just one location");
-
-    opt1 = G_define_option();
-    opt1->key = "map";
-    opt1->type = TYPE_STRING;
-    opt1->multiple = YES;
-    opt1->key_desc = "name";
-    opt1->required = YES;
-    opt1->gisprompt = "old,vector,vector";
-    opt1->description = _("Name of existing vector map");
-
-    terse = G_define_flag();
-    terse->key = 't';
-    terse->description = _("Terse output. For parsing by programs");
-
-    txt = G_define_flag();
-    txt->key = 'x';
-    txt->description =
-	_("Print information as plain text to terminal window");
-
-    topo_flag = G_define_flag();
-    topo_flag->key = 'd';
-    topo_flag->description = _("Print topological information (debugging)");
-
-    edit_flag = G_define_flag();
-    edit_flag->key = 'e';
-    edit_flag->description = _("Open form in edit mode");
-
-    if (G_parser(argc, argv))
-	exit(EXIT_FAILURE);
-
-    if (opt1->answers && opt1->answers[0])
-	vect = opt1->answers;
-
-    /* Look at maps given on command line */
-
-    if (vect) {
-	for (i = 0; vect[i]; i++) ;
-	nvects = i;
-
-	for (i = 0; i < nvects; i++) {
-	    mapset = openvect(vect[i]);
-	    if (mapset == NULL)
-		G_fatal_error(_("Unable to open vector map <%s>"), vect[i]);
-	}
-
-	Map = (struct Map_info *)G_malloc(nvects * sizeof(struct Map_info));
-
-	width = mwidth = 0;
-	for (i = 0; i < nvects; i++) {
-	    str = strchr(vect[i], '@');
-	    if (str)
-		j = str - vect[i];
-	    else
-		j = strlen(vect[i]);
-	    if (j > width)
-		width = j;
-
-	    mapset = openvect(vect[i]);
-	    j = strlen(mapset);
-	    if (j > mwidth)
-		mwidth = j;
-
-	    level = Vect_open_old(&Map[i], vect[i], mapset);
-	    if (level < 0)
-		G_fatal_error(_("Vector map <%s> not found"), vect[i]);
-
-	    if (level < 2)
-		G_fatal_error(_("%s: You must build topology on vector map"),
-			      vect[i]);
-
-	    G_message(_("Building spatial index..."));
-	    Vect_build_spatial_index(&Map[i], stderr);
-	}
-    }
-
-    if (R_open_driver() != 0)
-	G_fatal_error(_("No graphics device selected"));
-    D_setup(0);
-
-    what(once->answer, txt->answer, terse->answer,
-	 width, mwidth, topo_flag->answer, edit_flag->answer);
-
-    for (i = 0; i < nvects; i++)
-	Vect_close(&Map[i]);
-
-    R_close_driver();
-
-    G_message(_("Done."));
-    exit(EXIT_SUCCESS);
-}

+ 0 - 13
display/d.what.vect/openvect.c

@@ -1,13 +0,0 @@
-#include <grass/gis.h>
-#include <grass/glocale.h>
-
-char *openvect(char *name)
-{
-    char *mapset;
-
-    mapset = G_find_vector2(name, "");
-
-    if (mapset == NULL)
-	fprintf(stderr, _("warning: %s - vector map not found\n"), name);
-    return mapset;
-}

+ 0 - 491
display/d.what.vect/what.c

@@ -1,491 +0,0 @@
-#include <string.h>
-#include <unistd.h>
-#include <math.h>
-#include <grass/gis.h>
-#include <grass/display.h>
-#include <grass/colors.h>
-#include <grass/vector.h>
-#include <grass/form.h>
-#include <grass/dbmi.h>
-#include "what.h"
-#include <grass/glocale.h>
-
-static int nlines = 50;
-
-#define WDTH 5
-
-int what(int once, int txt, int terse, int width, int mwidth,
-	 int topo, int edit)
-{
-    int type, edit_mode;
-    int row, col;
-    int nrows, ncols;
-    struct Cell_head window;
-    int screen_x, screen_y;
-    double east, north;
-    int button;
-    char east_buf[40], north_buf[40];
-    double sq_meters, sqm_to_sqft, acres, hectares, sq_miles;
-    double x1, y1, x2, y2, z = 0, l = 0;
-    int notty;
-    double maxdist;
-    int getz = 0;
-    struct field_info *Fi;
-
-    plus_t line, area = 0, centroid;
-    int i;
-    struct line_pnts *Points;
-    struct line_cats *Cats;
-    char buf[1000], *str, title[500];
-    dbString html;
-    char *form;
-
-    if (terse)
-	txt = 1;		/* force text for terse */
-
-    G_get_set_window(&window);
-
-    G_begin_polygon_area_calculations();
-    nrows = window.rows;
-    ncols = window.cols;
-
-    screen_x = ((int)D_get_d_west() + (int)D_get_d_east()) / 2;
-    screen_y = ((int)D_get_d_north() + (int)D_get_d_south()) / 2;
-
-    Points = Vect_new_line_struct();
-    Cats = Vect_new_cats_struct();
-    db_init_string(&html);
-
-    if (!isatty(fileno(stdout)))
-	notty = 1;		/* no terminal */
-    else
-	notty = 0;
-
-    /* always use plain feet not US survey ft */
-    /*  if you really want USfeet, try G_database_units_to_meters_factor()
-	here, but then watch that sq_miles is not affected too */
-    sqm_to_sqft = 1 / ( 0.0254 * 0.0254 * 12 * 12 );
-
-
-    do {
-	if (!terse)
-	    show_buttons(once);
-	R_get_location_with_pointer(&screen_x, &screen_y, &button);
-	if (!once) {
-	    if (button == 3) {
-		break;
-	    }
-	    if (button == 2) {
-		continue;
-	    }
-	}
-
-	east = D_d_to_u_col((double)screen_x);
-	north = D_d_to_u_row((double)screen_y);
-
-	row = (window.north - north) / window.ns_res;
-	col = (east - window.west) / window.ew_res;
-	if (row < 0 || row >= nrows)
-	    continue;
-	if (col < 0 || col >= ncols)
-	    continue;
-
-	x1 = D_d_to_u_col((double)(screen_x - WDTH));
-	y1 = D_d_to_u_row((double)(screen_y - WDTH));
-	x2 = D_d_to_u_col((double)(screen_x + WDTH));
-	y2 = D_d_to_u_row((double)(screen_y + WDTH));
-
-	x1 = fabs(x2 - x1);
-	y1 = fabs(y2 - y1);
-
-	if (x1 > y1)
-	    maxdist = x1;
-	else
-	    maxdist = y1;
-	G_debug(1, "Maximum distance in map units = %f\n", maxdist);
-
-	F_clear();
-	for (i = 0; i < nvects; i++) {
-	    Vect_reset_cats(Cats);
-	    /* Try to find point first and only if no one was found try lines,
-	     *  otherwise point on line could not be selected ans similarly for areas */
-	    line =
-		Vect_find_line(&Map[i], east, north, 0.0,
-			       GV_POINT | GV_CENTROID, maxdist, 0, 0);
-	    if (line == 0)
-		line = Vect_find_line(&Map[i], east, north, 0.0,
-				      GV_LINE | GV_BOUNDARY | GV_FACE,
-				      maxdist, 0, 0);
-
-	    area = 0;
-	    if (line == 0) {
-		area = Vect_find_area(&Map[i], east, north);
-		getz = Vect_tin_get_z(&Map[i], east, north, &z, NULL, NULL);
-	    }
-
-	    G_debug(2, "line = %d, area = %d", line, area);
-
-	    if (!i && txt) {
-		G_format_easting(east, east_buf, G_projection());
-		G_format_northing(north, north_buf, G_projection());
-		fprintf(stdout, "\n%s(E) %s(N)\n", east_buf, north_buf);
-		if (notty)
-		    fprintf(stderr, "\n%s(E) %s(N)\n", east_buf, north_buf);
-		nlines++;
-	    }
-
-	    strcpy(buf, vect[i]);
-	    if ((str = strchr(buf, '@')))
-		*str = 0;
-
-	    if (txt) {
-		fprintf(stdout, "\n%*s in %-*s  ", width, Map[i].name, mwidth,
-			Map[i].mapset);
-		if (notty)
-		    fprintf(stderr, "\n%*s in %-*s  ", width, Map[i].name,
-			    mwidth, Map[i].mapset);
-		nlines++;
-	    }
-
-	    if (line + area == 0) {
-		if (txt) {
-		    fprintf(stdout, _("Nothing Found.\n"));
-		    if (notty)
-			fprintf(stderr, _("Nothing Found.\n"));
-		    nlines++;
-		}
-		continue;
-	    }
-	    else {
-		/* Start form */
-		db_set_string(&html, "");
-		if (!txt) {
-		    sprintf(title, "%s", Map[i].name);
-		    db_append_string(&html,
-				     "<HTML><HEAD><TITLE>Form</TITLE><BODY>");
-		    sprintf(buf, "map: '%s'<BR>mapset: '%s'<BR>", Map[i].name,
-			    Map[i].mapset);
-		    db_append_string(&html, buf);
-		}
-	    }
-
-	    if (line > 0) {
-		type = Vect_read_line(&Map[i], Points, Cats, line);
-		switch (type) {
-		case GV_POINT:
-		    sprintf(buf, "Point");
-		    break;
-		case GV_LINE:
-		    sprintf(buf, "Line");
-		    break;
-		case GV_BOUNDARY:
-		    sprintf(buf, "Boundary");
-		    break;
-		case GV_FACE:
-		    sprintf(buf, "Face");
-		    break;
-		case GV_CENTROID:
-		    sprintf(buf, "Centroid");
-		    break;
-		default:
-		    sprintf(buf, "Unknown");
-		}
-		if (type & GV_LINES) {
-		    if (G_projection() == 3)
-			l = Vect_line_geodesic_length(Points);
-		    else
-			l = Vect_line_length(Points);
-		}
-
-
-		if (topo) {
-		    int n, node[2], nnodes, nnlines, nli, nodeline, left,
-			right;
-		    float angle;
-
-		    fprintf(stdout,
-			    "-----------------------------------------------\n");
-		    if (type & GV_BOUNDARY)
-			Vect_get_line_areas(&(Map[i]), line, &left, &right);
-		    else
-			left = right = 0;
-		    fprintf(stdout,
-			    _("Line: %d  Type: %s  Left: %d  Right: %d  "),
-			    line, buf, left, right);
-		    if (type & GV_LINES) {
-			nnodes = 2;
-			fprintf(stdout, _("Length: %f\n"), l);
-		    }
-		    else {	/* points */
-			nnodes = 0;
-			fprintf(stdout, "\n");
-		    }
-
-		    if (nnodes > 0)
-			Vect_get_line_nodes(&(Map[i]), line, &node[0], &node[1]);
-
-		    for (n = 0; n < nnodes; n++) {
-			double nx, ny, nz;
-
-			nnlines = Vect_get_node_n_lines(&(Map[i]), node[n]);
-
-			Vect_get_node_coor(&(Map[i]), node[n], &nx, &ny, &nz);
-			fprintf(stdout,
-				_("  Node[%d]: %d  Number of lines: %d  Coordinates: %.6f, %.6f, %.6f\n"),
-				n, node[n], nnlines, nx, ny, nz);
-
-			for (nli = 0; nli < nnlines; nli++) {
-			    nodeline =
-				Vect_get_node_line(&(Map[i]), node[n], nli);
-			    angle =
-				Vect_get_node_line_angle(&(Map[i]), node[n],
-							 nli);
-			    fprintf(stdout, _("    Line: %5d  Angle: %.8f\n"),
-				    nodeline, angle);
-			}
-		    }
-
-		}
-		else if (txt) {
-		    fprintf(stdout, "%s\n", buf);
-		    if (type & GV_LINES)
-			fprintf(stdout, _("length %f\n"), l);
-		}
-		else {
-		    db_append_string(&html, "feature type: ");
-		    db_append_string(&html, buf);
-		    db_append_string(&html, "<BR>");
-
-		    if (type & GV_LINES) {
-			sprintf(buf, "length: %f<BR>", l);
-			db_append_string(&html, buf);
-		    }
-		}
-
-		/* Height */
-		if (Vect_is_3d(&(Map[i]))) {
-		    int j;
-		    double min, max;
-
-		    if (type & GV_POINTS) {
-			if (txt)
-			    fprintf(stdout, _("Point height: %f\n"),
-				    Points->z[0]);
-			else {
-			    sprintf(buf, "Point height: %f<BR>",
-				    Points->z[0]);
-			    db_append_string(&html, buf);
-			}
-		    }
-		    else if (type & GV_LINES) {
-			min = max = Points->z[0];
-			for (j = 1; j < Points->n_points; j++) {
-			    if (Points->z[j] < min)
-				min = Points->z[j];
-			    if (Points->z[j] > max)
-				max = Points->z[j];
-			}
-			if (min == max) {
-			    if (txt)
-				fprintf(stdout, _("Line height: %f\n"), min);
-			    else {
-				sprintf(buf, "Line height: %f<BR>", min);
-				db_append_string(&html, buf);
-			    }
-			}
-			else {
-			    if (txt)
-				fprintf(stdout,
-					_("Line height min: %f max: %f\n"),
-					min, max);
-			    else {
-				sprintf(buf,
-					"Line height min: %f max: %f<BR>",
-					min, max);
-				db_append_string(&html, buf);
-			    }
-			}
-		    }
-		}
-	    }
-
-	    if (area > 0) {
-		if (Map[i].head.with_z && getz) {
-		    if (txt)
-			fprintf(stdout, _("Area height: %f\n"), z);
-		    else {
-			sprintf(buf, "feature type: Area<BR>height: %f<BR>",
-				z);
-			db_append_string(&html, buf);
-		    }
-		}
-		else {
-		    if (txt) {
-			fprintf(stdout, _("Area\n"));
-		    }
-		    else {
-			sprintf(buf, "feature type: Area<BR>");
-			db_append_string(&html, buf);
-		    }
-		}
-
-		sq_meters = Vect_get_area_area(&Map[i], area);
-		hectares  = sq_meters / 10000.;
-		/* 1 acre = 1 chain(66') * 1 furlong(10 chains),
-		    or if you prefer ( 5280 ft/mi ^2 / 640 acre/sq mi ) */
-		acres = (sq_meters * sqm_to_sqft) / (66 * 660);
-		sq_miles = acres / 640.;
-
-
-		if (topo) {
-		    int nisles, isleidx, isle, isle_area;
-
-		    nisles = Vect_get_area_num_isles(&Map[i], area);
-		    fprintf(stdout,
-			    "-----------------------------------------------\n");
-		    fprintf(stdout, _("Area: %d  Number of isles: %d\n"),
-			    area, nisles);
-
-		    for (isleidx = 0; isleidx < nisles; isleidx++) {
-			isle = Vect_get_area_isle(&Map[i], area, isleidx);
-			fprintf(stdout, _("  Isle[%d]: %d\n"), isleidx, isle);
-		    }
-
-		    isle = Vect_find_island(&Map[i], east, north);
-
-		    if (isle) {
-			isle_area = Vect_get_isle_area(&Map[i], isle);
-			fprintf(stdout, _("Island: %d  In area: %d\n"), isle,
-				isle_area);
-		    }
-
-		}
-		else if (txt) {
-		    fprintf(stdout,
-			    _("Size - Sq Meters: %.3f\t\tHectares: %.3f\n"),
-			    sq_meters, hectares);
-
-		    fprintf(stdout,
-			    _("           Acres: %.3f\t\tSq Miles: %.4f\n"),
-			    acres, sq_miles);
-		    if (notty) {
-			fprintf(stderr,
-				_("Size - Sq Meters: %.3f\t\tHectares: %.3f\n"),
-				sq_meters, hectares);
-
-			fprintf(stderr,
-				_("           Acres: %.3f\t\tSq Miles: %.4f\n"),
-				acres, sq_miles);
-		    }
-		    nlines += 3;
-		}
-		else {
-		    sprintf(buf, "area size: %f<BR>", sq_meters);
-		    db_append_string(&html, buf);
-		}
-
-		centroid = Vect_get_area_centroid(&Map[i], area);
-		if (centroid > 0) {
-		    Vect_read_line(&Map[i], Points, Cats, centroid);
-		}
-	    }
-
-	    if (Cats->n_cats > 0) {
-		int j;
-
-		for (j = 0; j < Cats->n_cats; j++) {
-		    G_debug(2, "field = %d category = %d", Cats->field[j],
-			    Cats->cat[j]);
-		    if (txt) {
-			fprintf(stdout, _("Layer: %d\ncategory: %d\n"),
-				Cats->field[j], Cats->cat[j]);
-		    }
-		    else {
-			db_append_string(&html, "<HR><BR>");
-			sprintf(buf, "Layer: %d<BR>category: %d<BR>",
-				Cats->field[j], Cats->cat[j]);
-			db_append_string(&html, buf);
-		    }
-		    Fi = Vect_get_field(&(Map[i]), Cats->field[j]);
-		    if (Fi == NULL) {
-			if (txt) {
-			    fprintf(stdout,
-				    _("Database connection not defined"));
-			}
-			else {
-			    db_append_string(&html,
-					     "Database connection not defined<BR>");
-			}
-		    }
-		    else {
-			int format;
-
-			if (txt) {
-			    fprintf(stdout,
-				    _("driver: %s\ndatabase: %s\ntable: %s\nkey column: %s\n"),
-				    Fi->driver, Fi->database, Fi->table,
-				    Fi->key);
-			}
-			else {
-			    sprintf(buf,
-				    "driver: %s<BR>database: %s<BR>table: %s<BR>key column: %s<BR>",
-				    Fi->driver, Fi->database, Fi->table,
-				    Fi->key);
-			    db_append_string(&html, buf);
-			}
-
-			if (edit && strcmp(Map[i].mapset, G_mapset()) == 0)
-			    edit_mode = F_EDIT;
-			else
-			    edit_mode = F_VIEW;
-
-			if (txt)
-			    format = F_TXT;
-			else
-			    format = F_HTML;
-			F_generate(Fi->driver, Fi->database, Fi->table,
-				   Fi->key, Cats->cat[j], NULL, NULL,
-				   edit_mode, format, &form);
-
-			if (txt) {
-			    fprintf(stdout, "%s", form);
-			}
-			else {
-			    db_append_string(&html, form);
-			}
-			G_free(form);
-			G_free(Fi);
-		    }
-		}
-	    }
-	    fflush(stdout);
-	    if (!txt && !topo) {
-		db_append_string(&html, "</BODY></HTML>");
-		G_debug(3, db_get_string(&html));
-		F_open(title, db_get_string(&html));
-	    }
-	}
-
-    } while (!once);
-    Vect_destroy_line_struct(Points);
-
-    return 0;
-}
-
-/* TODO */
-int show_buttons(int once)
-{
-    if (once) {
-	fprintf(stderr, _("\nClick mouse button on desired location\n\n"));
-	nlines = 3;
-    }
-    else if (nlines >= 18) {	/* display prompt every screen full */
-	fprintf(stderr, "\n");
-	fprintf(stderr, _("Buttons\n"));
-	fprintf(stderr, _(" Left:  what's here\n"));
-	fprintf(stderr, _(" Right: quit\n"));
-	nlines = 4;
-    }
-
-    return 0;
-}

+ 0 - 17
display/d.what.vect/what.h

@@ -1,17 +0,0 @@
-/* openvect.c */
-char *openvect(char *);
-
-/* what.c */
-int what(int, int, int, int, int, int, int);
-int show_buttons(int);
-
-/*flash.c */
-void flash_area(struct Map_info *, plus_t, struct line_pnts *, int);
-void flash_line(struct Map_info *, plus_t, struct line_pnts *, int);
-
-/* attr.c */
-int disp_attr(char *, char *, char *, char *, int);
-
-extern char **vect;
-extern int nvects;
-extern struct Map_info *Map;

+ 0 - 17
display/d.zoom/Makefile

@@ -1,17 +0,0 @@
-
-MODULE_TOPDIR = ../..
-
-PGM = d.zoom
-
-LIBES     = $(DISPLAYLIB) $(VECTORLIB) $(GISLIB) $(DATETIMELIB) 
-DEPENDENCIES= $(VECTORDEP) $(GISDEP) $(DISPLAYDEP) $(DATETIMEDEP)
-EXTRA_INC = $(VECT_INC)
-EXTRA_CFLAGS = $(VECT_CFLAGS)
-
-include $(MODULE_TOPDIR)/include/Make/Module.make
-
-default: cmd
-
-
-
-

+ 0 - 141
display/d.zoom/box.c

@@ -1,141 +0,0 @@
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-#include <grass/gis.h>
-#include <grass/display.h>
-#include "local_proto.h"
-
-int make_window_box(struct Cell_head *window, double magnify, int full,
-		    int hand)
-{
-    int screen_x, screen_y;
-    double px, py, ux1, uy1, ux2, uy2;
-    double ns, ew;
-    int button;
-    int cur_screen_x, cur_screen_y;
-    int mode;			/* 1, 2 */
-    int resetwin;
-    struct Cell_head defwin;
-    int printmenu = 1;
-
-    G_get_default_window(&defwin);
-
-    mode = 1;
-    while (1) {
-	resetwin = 0;
-	if (!hand) {
-	    if (printmenu) {
-		fprintf(stderr, "\n\nButtons:\n");
-		fprintf(stderr, "Left:   1. corner\n");
-		fprintf(stderr, "Middle: Unzoom\n");
-		if (full)
-		    fprintf(stderr, "Right:  Main menu\n\n");
-		else
-		    fprintf(stderr, "Right:  Quit\n\n");
-
-		printmenu = 0;
-	    }
-	}
-	else {
-	    if (mode == 1)
-		fprintf(stderr, "\r1. corner");
-	    else
-		fprintf(stderr, "\r2. corner");
-	}
-	if (mode == 1) {
-	    if (!hand) {
-		R_get_location_with_pointer(&screen_x, &screen_y, &button);
-	    }
-	    else {
-		R_get_location_with_box(0, 0, &screen_x, &screen_y, &button);
-	    }
-	    cur_screen_x = screen_x;
-	    cur_screen_y = screen_y;
-	}
-	else {
-	    R_get_location_with_box(cur_screen_x, cur_screen_y, &screen_x,
-				    &screen_y, &button);
-	}
-
-	/* For print only */
-	px = D_d_to_u_col((double)screen_x);
-	py = D_d_to_u_row((double)screen_y);
-	if (!hand)
-	    print_coor(window, py, px);
-
-	if (button == 1) {
-	    if (!hand) {
-		if (mode == 1) {
-		    fprintf(stderr, "\n\nButtons:\n");
-		    fprintf(stderr, "Left:   1. corner (reset)\n");
-		    fprintf(stderr, "Middle: 2. corner\n");
-		    if (full)
-			fprintf(stderr, "Right:   Main menu\n\n");
-		    else
-			fprintf(stderr, "Right:   Quit\n\n");
-		    mode = 2;
-		}
-		if (mode == 2) {
-		    cur_screen_x = screen_x;
-		    cur_screen_y = screen_y;
-		}
-	    }
-	    else {		/* hand */
-		if (mode == 1) {
-		    mode = 2;
-		}
-		else {
-		    ux1 = D_d_to_u_col((double)cur_screen_x);
-		    uy1 = D_d_to_u_row((double)cur_screen_y);
-		    ux2 = D_d_to_u_col((double)screen_x);
-		    uy2 = D_d_to_u_row((double)screen_y);
-		    resetwin = 1;
-		    mode = 1;
-		}
-	    }
-	}
-	else if (button == 2) {
-	    if (mode == 1) {	/* unzoom */
-		ux2 = D_d_to_u_col((double)screen_x);
-		uy2 = D_d_to_u_row((double)screen_y);
-		ew = window->east - window->west;
-		ns = window->north - window->south;
-
-		if (ns <= window->ns_res)
-		    ns = 2 * window->ns_res;
-		else
-		    ew /= magnify;
-
-		if (ew <= window->ew_res)
-		    ew = 2 * window->ew_res;
-		else
-		    ns /= magnify;
-
-		ux1 = window->east + ew / 2;
-		ux2 = window->west - ew / 2;
-		uy1 = window->north + ns / 2;
-		uy2 = window->south - ns / 2;
-	    }
-	    else {
-		ux1 = D_d_to_u_col((double)cur_screen_x);
-		uy1 = D_d_to_u_row((double)cur_screen_y);
-		ux2 = D_d_to_u_col((double)screen_x);
-		uy2 = D_d_to_u_row((double)screen_y);
-		printmenu = 1;
-		mode = 1;
-	    }
-	    fprintf(stderr, "\n");
-	    resetwin = 1;
-	}
-	else {
-	    fprintf(stderr, "\n");
-	    return 1;
-	}
-	if (resetwin) {
-	    set_win(window, ux1, uy1, ux2, uy2, hand);
-	}
-    }
-
-    fprintf(stderr, "\n");
-    return 1;			/* not reached */
-}

+ 0 - 43
display/d.zoom/center.c

@@ -1,43 +0,0 @@
-#include <string.h>
-#include <grass/gis.h>
-#include <grass/display.h>
-#include "local_proto.h"
-
-int make_window_center(struct Cell_head *window, double magnify, double east,
-		       double north)
-{
-    char buffer[64];
-    double east_west, north_south;
-    int len_n, len_e;
-
-    len_n = len_e = 0;
-
-    if (east < 0.0 && north < 0.0) {
-	east = (window->east + window->west) / 2.;
-	north = (window->north + window->south) / 2.;
-    }
-
-    east_west = (window->east - window->west) / magnify;
-    window->east = east + east_west / 2;
-    window->west = east - east_west / 2;
-    if (window->proj == PROJECTION_LL) {
-	if (east_west > 360) {
-	    window->east = east + 180;
-	    window->west = east - 180;
-	}
-	window->east = G_adjust_easting(window->east, window);
-    }
-
-    north_south = (window->north - window->south) / magnify;
-    window->north = north + north_south / 2;
-    window->south = north - north_south / 2;
-    G_limit_south(&window->south, window->proj);
-    G_limit_north(&window->north, window->proj);
-
-    G_format_easting(window->east, buffer, window->proj);
-    G_format_easting(window->west, buffer, window->proj);
-    G_format_northing(window->north, buffer, window->proj);
-    G_format_northing(window->south, buffer, window->proj);
-
-    return 0;
-}

+ 0 - 43
display/d.zoom/d.zoom.html

@@ -1,43 +0,0 @@
-<h2>DESCRIPTION</h2>
-
-<em>d.zoom</em> allows the user to interactively adjust the settings 
-of the current geographic region using a pointing device such as 
-a mouse. 
-Like <em><a href="g.region.html">g.region</a></em>, 
-<em>d.zoom</em> re-defines the settings of the geographic
-region.  However, <em>d.zoom</em> allows the user to change
-the current region settings interactively, by either
-outlining the new region perimeter with a mouse, unzoom
-or pan the region. The graphics display is updated by the module.
-
-<p>
-After the user types the command <b>d.zoom</b> a mouse-button menu will appear
-directing the user.
-
-<p>
-Additionally the region settings can be modified by
-running <em><a href="g.region.html">g.region</a></em>. 
-
-<h2>NOTES</h2>
-
-Although it is not necessary that the user display a map in
-the active display frame before running <em>d.zoom</em>, it
-is helpful to do this for reference. Using parameter <b>-f</b> integrate a 
-pan function, <b>-h </b> facilitates the use for handhelds. 
-
-<h2>SEE ALSO</h2>
-
-<em><a href="d.erase.html">d.erase</a></em><br>
-<em><a href="d.rast.html">d.rast</a></em><br>
-<em><a href="d.vect.html">d.vect</a></em><br>
-<em><a href="g.region.html">g.region</a></em>
-
-<h2>AUTHOR</h2>
-
-Michael Shapiro, 
-U.S. Army Construction Engineering 
-Research Laboratory
-<br>
-Improvements by Huidae Cho and Markus Neteler
-
-<p><i>Last changed: $Date$</i>

+ 0 - 11
display/d.zoom/graphics.h

@@ -1,11 +0,0 @@
-#define BLOCKS_PER_COL	32
-#define TEXT1_X		.61
-#define TEXT1_Y		.03
-#define TEXT2_X		.61
-#define TEXT2_Y		.06
-#define TITL1_X		.01
-#define TITL1_Y		.03
-#define TITL2_X		.01
-#define TITL2_Y		.06
-#define WINDOW_PROP_SCREEN_X	.8500
-#define WINDOW_PROP_SCREEN_Y	.9373

+ 0 - 46
display/d.zoom/local_proto.h

@@ -1,46 +0,0 @@
-#include <grass/gis.h>
-#include <grass/config.h>
-
-/* box.c */
-int make_window_box(struct Cell_head *, double, int, int);
-
-/* center.c */
-int make_window_center(struct Cell_head *, double, double, double);
-
-/* returns.c */
-int get_wind_bot(void);
-int get_wind_top(void);
-int get_wind_rite(void);
-int get_wind_left(void);
-int get_map_bot(void);
-int get_map_top(void);
-int get_map_left(void);
-int get_map_rite(void);
-int get_wind_y_pos(float);
-int get_wind_x_pos(float);
-
-/* zoom.c */
-int zoomwindow(struct Cell_head *, int, double);
-
-/* pan.c */
-int do_pan(struct Cell_head *);
-int pan_window(struct Cell_head *, int, int);
-
-/* redraw.c */
-int redraw(void);
-
-/* print.c */
-int print_coor(struct Cell_head *, double, double);
-int print_win(struct Cell_head *, double, double, double, double);
-int print_limit(struct Cell_head *, struct Cell_head *);
-
-/* set.c */
-int set_win(struct Cell_head *, double, double, double, double, int);
-
-/* quit.c */
-int quit(struct Cell_head *, struct Cell_head *);
-
-extern char *cmd;
-extern char **rast, **vect, **list;
-extern int nrasts, nvects, nlists;
-extern double U_east, U_west, U_south, U_north;

+ 0 - 273
display/d.zoom/main.c

@@ -1,273 +0,0 @@
-
-/****************************************************************************
- *
- * MODULE:       d.zoom
- * AUTHOR(S):    Michael Shapiro (USACERL) (original contributor)
- *               Radim Blazek <radim.blazek gmail.com>,
- *               Stephan Holl <sholl gmx net>, 
- *               Huidae Cho <grass4u gmail.com>, 
- *               Florian Goessmann <florian wallweg39.de>, 
- *               Glynn Clements <glynn gclements.plus.com>, 
- *               Hamish Bowman <hamish_b yahoo.com>, 
- *               Markus Neteler <neteler itc.it>, 
- *               Paul Kelly <paul-grass stjohnspoint.co.uk>
- * PURPOSE:      interactively change the current region using the mouse
- * COPYRIGHT:    (C) 2002-2006 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 <string.h>
-#include <grass/gis.h>
-#include <grass/display.h>
-#include <grass/vector.h>
-
-#include "local_proto.h"
-#include <grass/glocale.h>
-
-char *cmd;
-char **rast, **vect, **list;
-int nrasts, nvects, nlists;
-double U_east, U_west, U_south, U_north;
-
-int main(int argc, char **argv)
-{
-    int stat;
-
-#ifdef QUIET
-    struct Flag *quiet;
-#endif
-    struct Flag *full, *hand, *pan, *last;
-    struct Option *rmap, *vmap, *zoom;
-    struct GModule *module;
-    double magnify;
-    int i, first = 1;
-    char *map;
-    double ux1, uy1, ux2, uy2;
-    struct Cell_head window, defwin, currwin, tmpwin;
-
-    /* Initialize globals */
-    rast = vect = NULL;
-    nrasts = nvects = 0;
-
-    /* Initialize the GIS calls */
-    G_gisinit(argv[0]);
-
-    module = G_define_module();
-    G_add_keyword(_("display"));
-    G_add_keyword(_("zoom"));
-    module->description =
-	_("Allows the user to change the current geographic "
-	  "region settings interactively, with a mouse.");
-
-    rast = NULL;
-    vect = NULL;
-
-    rmap = G_define_option();
-    rmap->key = "rast";
-    rmap->type = TYPE_STRING;
-    rmap->multiple = YES;
-    rmap->required = NO;
-    rmap->gisprompt = "old,cell,raster";
-    rmap->description = _("Name of raster map");
-
-    vmap = G_define_option();
-    vmap->key = "vector";
-    vmap->type = TYPE_STRING;
-    vmap->multiple = YES;
-    vmap->required = NO;
-    vmap->gisprompt = "old,dig,vector";
-    vmap->description = _("Name of vector map");
-
-    zoom = G_define_option();
-    zoom->key = "zoom";
-    zoom->type = TYPE_DOUBLE;
-    zoom->required = NO;
-    zoom->answer = "0.75";
-    zoom->options = "0.001-1000.0";
-    zoom->description = _("Magnification: >1.0 zooms in, <1.0 zooms out");
-
-#ifdef QUIET
-    quiet = G_define_flag();
-    quiet->key = 'q';
-    quiet->description = "Quiet";
-#endif
-
-    full = G_define_flag();
-    full->key = 'f';
-    full->description = _("Full menu (zoom + pan) & Quit menu");
-
-    pan = G_define_flag();
-    pan->key = 'p';
-    pan->description = _("Pan mode");
-
-    hand = G_define_flag();
-    hand->key = 'h';
-    hand->description = _("Handheld mode");
-
-    last = G_define_flag();
-    last->key = 'r';
-    last->description = _("Return to previous zoom");
-
-    if (G_parser(argc, argv))
-	exit(EXIT_FAILURE);
-
-    if ((full->answer + pan->answer + hand->answer) > 1)
-	G_fatal_error(_("Please choose only one mode of operation"));
-
-    sscanf(zoom->answer, "%lf", &magnify);
-
-#ifdef QUIET
-    /* if map was found in monitor: */
-    if (rast || vect)
-	quiet->answer = 1;
-#endif
-
-    cmd = NULL;
-    rast = rmap->answers;
-    vect = vmap->answers;
-
-    if (rast) {
-	struct Cell_head window;
-
-	for (i = 0; rast[i]; i++) ;
-	nrasts = i;
-
-	for (i = 0; i < nrasts; i++) {
-	    Rast_get_cellhd(rast[i], "", &window);
-	    {
-		if (first) {
-		    first = 0;
-		    U_east = window.east;
-		    U_west = window.west;
-		    U_south = window.south;
-		    U_north = window.north;
-		}
-		else {
-		    if (window.east > U_east)
-			U_east = window.east;
-		    if (window.west < U_west)
-			U_west = window.west;
-		    if (window.south < U_south)
-			U_south = window.south;
-		    if (window.north > U_north)
-			U_north = window.north;
-		}
-	    }
-	}
-    }
-
-    if (vect) {
-	struct Map_info Map;
-	struct bound_box box;
-
-	for (i = 0; vect[i]; i++) ;
-	nvects = i;
-
-	for (i = 0; i < nvects; i++) {
-	    if (Vect_open_old(&Map, vect[i], "") >= 2) {
-		Vect_get_map_box(&Map, &box);
-		if (first) {
-		    first = 0;
-		    U_east = box.E;
-		    U_west = box.W;
-		    U_south = box.S;
-		    U_north = box.N;
-		}
-		else {
-		    if (box.E > U_east)
-			U_east = box.E;
-		    if (box.W < U_west)
-			U_west = box.W;
-		    if (box.S < U_south)
-			U_south = box.S;
-		    if (box.N > U_north)
-			U_north = box.N;
-		}
-	    }
-	}
-    }
-
-#ifdef BOUNDARY
-    if (!first) {
-	/*
-	   if(U_east == U_west)
-	   {
-	   U_east += 100;
-	   U_west -= 100;
-	   }
-	   if(U_south == U_north)
-	   {
-	   U_south -= 100;
-	   U_north += 100;
-	   }
-	 */
-
-	U_east += 0.05 * (U_east - U_west);
-	U_west -= 0.05 * (U_east - U_west);
-	U_south -= 0.05 * (U_north - U_south);
-	U_north += 0.05 * (U_north - U_south);
-    }
-#endif
-
-    if (R_open_driver() != 0)
-	G_fatal_error(_("No graphics device selected"));
-
-    D_setup(0);
-
-    if (!hand->answer) {
-	fprintf(stderr, _("%d raster%s, %d vector%s\n"),
-		nrasts, (nrasts > 1 ? "s" : ""),
-		nvects, (nvects > 1 ? "s" : ""));
-    }
-
-    if (last->answer) {		/* restoring temporary region */
-	map = G_find_file("windows", "previous_zoom", "");
-
-	if (!map)
-	    G_fatal_error(_("No previous zoom available"));
-
-	G__get_window(&tmpwin, "windows", "previous_zoom", map);
-
-	G_message(_("Returning to previous zoom"));
-
-	ux1 = tmpwin.east;
-	ux2 = tmpwin.west;
-	uy1 = tmpwin.north;
-	uy2 = tmpwin.south;
-
-	set_win(&tmpwin, ux1, uy1, ux2, uy2, hand->answer);
-
-	exit(0);
-    }
-
-    /* Do the zoom */
-    G_get_window(&window);
-    /* Save current region before it is changed */
-    G__put_window(&window, "windows", "previous_zoom");
-    G_get_window(&currwin);
-    G_get_default_window(&defwin);
-    if (full->answer == 1)
-	stat = zoomwindow(&window, 1, magnify);
-    else if (pan->answer == 1)
-	do_pan(&window);
-    else {
-	if (hand->answer == 0)
-	    make_window_box(&window, magnify, 0, 0);
-	else
-	    make_window_box(&window, magnify, 0, 1);
-    }
-
-    if (full->answer) {
-	quit(&defwin, &currwin);	/* calling the quit menu function */
-    }
-
-    R_close_driver();
-
-    G_message(_("Zooming complete."));
-    exit(stat);
-}

+ 0 - 90
display/d.zoom/pan.c

@@ -1,90 +0,0 @@
-/* possible TODO: add support for magnify (zoom=) */
-
-#include <grass/gis.h>
-#include <grass/display.h>
-#include "local_proto.h"
-#include <grass/glocale.h>
-
-
-int do_pan(struct Cell_head *window)
-{
-    int screen_x, screen_y, button;
-    int end = 0, printmenu = 1;
-
-    while (!end) {
-	if (printmenu) {
-	    fprintf(stderr, _("\n\nButtons:\n"));
-	    fprintf(stderr, _("Left:   Pan\n"));
-	    fprintf(stderr, _("Right:  Quit\n"));
-	    printmenu = 0;
-	}
-
-	R_get_location_with_pointer(&screen_x, &screen_y, &button);
-
-
-	if (button == 1) {
-	    /* pan */
-	    pan_window(window, screen_x, screen_y);
-	    printmenu = 1;
-	}
-	else if (button == 2) {
-	    /* noop */
-	    printmenu = 1;
-	}
-	else if (button == 3) {
-	    end = 1;
-	}
-    }
-
-    return (0);
-}
-
-
-
-int pan_window(struct Cell_head *window, int screen_x, int screen_y)
-{
-    double px, py, uxc, uyc, ux1, uy1, ux2, uy2;
-    double north, south, east, west, ns, ew;
-    int t;
-
-    px = D_d_to_u_col((double)screen_x);
-    py = D_d_to_u_row((double)screen_y);
-    fprintf(stderr, "\n");
-    print_coor(window, py, px);
-    fprintf(stderr, "\n");
-
-    uxc = D_d_to_u_col((double)screen_x);
-    uyc = D_d_to_u_row((double)screen_y);
-    t = uxc / window->ew_res;
-    uxc = t * window->ew_res;
-    t = uyc / window->ns_res;
-    uyc = t * window->ns_res;
-
-    ew = window->east - window->west;
-    ns = window->north - window->south;
-
-    ux1 = uxc - ew / 2;
-    ux2 = uxc + ew / 2;
-    uy1 = uyc - ns / 2;
-    uy2 = uyc + ns / 2;
-
-    north = uy1 > uy2 ? uy1 : uy2;
-    south = uy1 < uy2 ? uy1 : uy2;
-    west = ux1 < ux2 ? ux1 : ux2;
-    east = ux1 > ux2 ? ux1 : ux2;
-
-    if (window->proj == PROJECTION_LL) {
-	if (north > 90) {
-	    north = 90;
-	    south = 90 - ns;
-	}
-	else if (south < -90) {
-	    south = -90;
-	    north = -90 + ns;
-	}
-    }
-
-    set_win(window, east, north, west, south, 0);
-
-    return (0);
-}

+ 0 - 129
display/d.zoom/print.c

@@ -1,129 +0,0 @@
-#include <string.h>
-#include <grass/gis.h>
-#include <grass/display.h>
-#include "local_proto.h"
-
-static int max(int a, int b)
-{
-    return a > b ? a : b;
-}
-
-int print_coor(struct Cell_head *window, double north, double east)
-{
-    char buffer[200];
-    int len_n, len_s, len_e, len_w, t;
-
-    len_n = len_s = len_e = len_w = 0;
-
-    G_limit_north(&north, window->proj);
-    G_limit_east(&east, window->proj);
-
-    t = (window->north - north) / window->ns_res;
-    north = window->north - (t) * window->ns_res;
-
-    t = (window->east - east) / window->ew_res;
-    east = window->east - (t) * window->ew_res;
-
-    strcpy(buffer, "?");
-    G_format_northing(north, buffer, window->proj);
-    len_n = max(len_n, strlen(buffer));
-    fprintf(stderr, "%-*s(N)  ", len_n, buffer);
-
-    strcpy(buffer, "?");
-    G_format_easting(east, buffer, window->proj);
-    len_e = max(len_e, strlen(buffer));
-    fprintf(stderr, "%-*s(E)  ", len_e, buffer);
-
-    fprintf(stderr, "\r");
-    fflush(stderr);
-
-    return 1;
-}
-
-int print_win(struct Cell_head *window, double north, double south,
-	      double east, double west)
-{
-    char buffer[200];
-    int len_n, len_s, len_e, len_w, t;
-
-    len_n = len_s = len_e = len_w = 0;
-
-    G_limit_north(&north, window->proj);
-    G_limit_south(&south, window->proj);
-    G_limit_east(&east, window->proj);
-    G_limit_west(&west, window->proj);
-
-    t = (window->north - north) / window->ns_res;
-    north = window->north - (t) * window->ns_res;
-
-    t = (south - window->south) / window->ns_res;
-    south = window->south + (t) * window->ns_res;
-
-    t = (window->east - east) / window->ew_res;
-    east = window->east - (t) * window->ew_res;
-
-    t = (west - window->west) / window->ew_res;
-    west = window->west + (t) * window->ew_res;
-
-    strcpy(buffer, "?");
-    G_format_northing(north, buffer, window->proj);
-    len_n = max(len_n, strlen(buffer));
-    fprintf(stderr, "north: %-*s  ", len_n, buffer);
-
-    strcpy(buffer, "?");
-    G_format_northing(south, buffer, window->proj);
-    len_s = max(len_s, strlen(buffer));
-    fprintf(stderr, "south: %-*s  ", len_s, buffer);
-
-    strcpy(buffer, "?");
-    G_format_easting(east, buffer, window->proj);
-    len_e = max(len_e, strlen(buffer));
-    fprintf(stderr, "east: %-*s  ", len_e, buffer);
-
-    strcpy(buffer, "?");
-    G_format_easting(west, buffer, window->proj);
-    len_w = max(len_w, strlen(buffer));
-    fprintf(stderr, "west: %-*s  ", len_w, buffer);
-
-    fprintf(stderr, "\r");
-    fflush(stderr);
-
-    return 1;
-}
-
-int print_limit(struct Cell_head *window, struct Cell_head *defwin)
-{
-    char buffer[1000];
-    int limit = 0;
-
-    if (window->north > defwin->north) {
-	sprintf(buffer, "North");
-	limit = 1;
-    }
-    if (window->south < defwin->south) {
-	if (limit)
-	    sprintf(buffer, "%s, south", buffer);
-	else
-	    sprintf(buffer, "South");
-	limit = 1;
-    }
-    if (window->east > defwin->east) {
-	if (limit)
-	    sprintf(buffer, "%s, east", buffer);
-	else
-	    sprintf(buffer, "East");
-	limit = 1;
-    }
-    if (window->west < defwin->west) {
-	if (limit)
-	    sprintf(buffer, "%s, west", buffer);
-	else
-	    sprintf(buffer, "West");
-	limit = 1;
-    }
-    if (limit) {
-	fprintf(stderr, "%s limit of default region reached.\n", buffer);
-    }
-
-    return (limit);
-}

+ 0 - 71
display/d.zoom/quit.c

@@ -1,71 +0,0 @@
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-#include <grass/gis.h>
-#include <grass/display.h>
-#include "local_proto.h"
-#include <grass/glocale.h>
-
-int quit(struct Cell_head *defwin, struct Cell_head *currwin)
-{
-
-    int screen_x, screen_y, button;
-    int hand = 0;
-    double ux1, uy1, ux2, uy2, ew, ns;
-
-    fprintf(stderr, "\n\nButtons:\n");
-    fprintf(stderr, "Left:   reset to default region\n");
-    fprintf(stderr, "Middle: reset to region before d.zoom started\n");
-    fprintf(stderr, "Right:  Quit\n");
-
-    R_get_location_with_pointer(&screen_x, &screen_y, &button);
-
-    if (button == 1) {
-	ew = defwin->east - defwin->west;
-	ns = defwin->north - defwin->south;
-
-	if (ns <= defwin->ns_res) {
-	    ns = 2 * defwin->ns_res;
-	}
-
-	if (ew <= defwin->ew_res) {
-	    ew = 2 * defwin->ew_res;
-	}
-
-	ux1 = defwin->east;
-	ux2 = defwin->west;
-	uy1 = defwin->north;
-	uy2 = defwin->south;
-
-	set_win(defwin, ux1, uy1, ux2, uy2, hand);
-	return 0;
-    }
-
-    if (button == 2) {
-	ew = currwin->east - currwin->west;
-	ns = currwin->north - currwin->south;
-
-	if (ns <= currwin->ns_res) {
-	    ns = 2 * currwin->ns_res;
-	}
-
-	if (ew <= currwin->ew_res) {
-	    ew = 2 * currwin->ew_res;
-	}
-
-	ux1 = currwin->east;
-	ux2 = currwin->west;
-	uy1 = currwin->north;
-	uy2 = currwin->south;
-
-	set_win(currwin, ux1, uy1, ux2, uy2, hand);
-	return 0;
-    }
-
-    if (button == 3) {
-	return 0;
-    }
-
-    return 0;
-
-}

+ 0 - 42
display/d.zoom/redraw.c

@@ -1,42 +0,0 @@
-#include <stdlib.h>
-#include <grass/display.h>
-#include <grass/glocale.h>
-#include "local_proto.h"
-
-int redraw(void)
-{
-    int i;
-    char command[128];
-
-    R_close_driver();
-
-    sprintf(command, "d.erase");
-    system(command);
-
-    if (cmd) {
-	system(cmd);
-    }
-    else {
-	/* Redraw raster map */
-	if (rast) {
-	    for (i = 0; i < nrasts; i++) {
-		sprintf(command, "d.rast -o map=%s", rast[i]);
-		system(command);
-	    }
-	}
-
-	/* Redraw vector map */
-	if (vect) {
-	    for (i = 0; i < nvects; i++) {
-		sprintf(command, "d.vect map=%s", vect[i]);
-		system(command);
-	    }
-	}
-    }
-
-    if (R_open_driver() != 0)
-	G_fatal_error(_("No graphics device selected"));
-    D_setup(0);
-
-    return 0;
-}

+ 0 - 102
display/d.zoom/returns.c

@@ -1,102 +0,0 @@
-#include <grass/display.h>
-#include "graphics.h"
-#include <stdio.h>
-#define GETEM	if (notgotem) getem()
-static int notgotem = 1;
-static int wind_top;
-static int wind_bot;
-static int wind_rite;
-static int wind_left;
-static int getem(void);
-
-int get_wind_bot(void)
-{
-    GETEM;
-    return (wind_bot);
-}
-
-int get_wind_top(void)
-{
-    GETEM;
-    return (wind_top);
-}
-
-int get_wind_rite(void)
-{
-    GETEM;
-    return (wind_rite);
-}
-
-int get_wind_left(void)
-{
-    GETEM;
-    return (wind_left);
-}
-
-int get_map_bot(void)
-{
-    GETEM;
-    return (wind_bot);
-}
-
-int get_map_top(void)
-{
-    register float tmp1, tmp2, tmp3;
-
-    GETEM;
-    if (notgotem) {
-	getem();
-	notgotem = 0;
-    }
-    tmp1 = (float)wind_bot;
-    tmp2 = (float)wind_top;
-    tmp3 = tmp1 + WINDOW_PROP_SCREEN_Y * (tmp2 - tmp1);
-    return ((int)tmp3);
-}
-
-int get_map_left(void)
-{
-    register float tmp1, tmp2, tmp3;
-
-    GETEM;
-    tmp1 = (float)wind_left;
-    tmp2 = (float)wind_rite;
-    tmp3 = tmp2 - WINDOW_PROP_SCREEN_X * (tmp2 - tmp1);
-    return ((int)tmp3);
-}
-
-int get_map_rite(void)
-{
-    GETEM;
-    return (wind_rite);
-}
-
-int get_wind_y_pos(float position)
-{
-    register float tmp1, tmp2, tmp3;
-
-    GETEM;
-    tmp1 = (float)wind_top;
-    tmp2 = (float)wind_bot;
-    tmp3 = tmp1 + position * (tmp2 - tmp1);
-    return ((int)tmp3);
-}
-
-int get_wind_x_pos(float position)
-{
-    register float tmp1, tmp2, tmp3;
-
-    GETEM;
-    tmp1 = (float)wind_left;
-    tmp2 = (float)wind_rite;
-    tmp3 = tmp1 + position * (tmp2 - tmp1);
-    return ((int)tmp3);
-}
-
-static int getem(void)
-{
-    D_get_screen_window(&wind_top, &wind_bot, &wind_left, &wind_rite);
-    notgotem = 0;
-
-    return 0;
-}

+ 0 - 185
display/d.zoom/set.c

@@ -1,185 +0,0 @@
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-#include <grass/gis.h>
-#include <grass/display.h>
-#include "local_proto.h"
-
-static double round_to(double in, int sd)
-{
-    double mult = 1, out;
-
-    while (rint(in * mult) < pow(10, sd - 1))
-	mult *= 10.0;
-
-    out = rint(in * mult);
-    out = out / mult;
-    return out;
-}
-
-int set_win(struct Cell_head *window, double ux1, double uy1, double ux2,
-	    double uy2, int hand)
-{
-    struct Cell_head defwin;
-    double north, south, east, west;
-    double tnorth, tsouth, teast, twest, td;
-    double ncol, nrow, ew, ns, nsr, ewr;
-    int resetres, resetwin, limit;
-    int screen_x, screen_y, button;
-
-    resetwin = 1;
-
-    G_get_default_window(&defwin);
-
-    north = uy1 > uy2 ? uy1 : uy2;
-    south = uy1 < uy2 ? uy1 : uy2;
-    west = ux1 < ux2 ? ux1 : ux2;
-    east = ux1 > ux2 ? ux1 : ux2;
-
-    G_limit_south(&south, window->proj);
-    G_limit_north(&north, window->proj);
-    G_limit_east(&east, window->proj);
-    G_limit_west(&west, window->proj);
-    if (window->proj == PROJECTION_LL) {
-	if ((east - west) > 360) {
-	    fprintf(stderr, "(longitude range > 360) -> resetting\n");
-	    td = (east + west) / 2;
-	    east = td + 180;
-	    west = td - 180;
-	}
-    }
-
-    resetres = 1;
-    while (resetres) {
-	nsr = round_to(window->ns_res, 3);
-	ewr = round_to(window->ew_res, 3);
-
-	td = ceil(north / nsr);
-	tnorth = td * nsr;
-	td = floor(south / nsr);
-	tsouth = td * nsr;
-	td = rint(east / ewr);
-	teast = td * ewr;
-	td = rint(west / ewr);
-	twest = td * ewr;
-
-	ns = tnorth - tsouth;
-	ew = teast - twest;
-	if ((ns < 2 * window->ns_res || ew < 2 * window->ew_res) && !hand) {
-	    nsr = round_to(nsr / 10.0, 3);
-	    ewr = round_to(ewr / 10.0, 3);
-	    if (nsr < 0.00000001 || ewr < 0.00000001) {
-		fprintf(stderr,
-			"Minimum resolution supported by d.zoom reached.\n");
-		resetwin = 0;
-		break;
-	    }
-
-	    fprintf(stderr, "\nResolution is too low for selected region.\n");
-	    fprintf(stderr, "Buttons:\n");
-	    fprintf(stderr,
-		    "Left:   Increase resolution to n-s = %g e-w = %g\n", nsr,
-		    ewr);
-	    fprintf(stderr, "Middle: Cancel (keep previous region)\n");
-	    fprintf(stderr, "Right:  Cancel (keep previous region)\n");
-
-	    R_get_location_with_pointer(&screen_x, &screen_y, &button);
-
-	    if (button == 1) {
-		window->ns_res = nsr;
-		window->ns_res3 = nsr;
-		window->ew_res = ewr;
-		window->ew_res3 = ewr;
-	    }
-	    else {
-		resetres = 0;
-		resetwin = 0;
-	    }
-	}
-	else {
-	    resetres = 0;
-	}
-    }
-
-    nrow = (tnorth - tsouth) / window->ns_res;
-    ncol = (teast - twest) / window->ew_res;
-    if ((nrow > 10000000 || ncol > 10000000) && !hand) {
-	nsr = round_to(window->ns_res * 10, 3);
-	ewr = round_to(window->ew_res * 10, 3);
-	fprintf(stderr, "\nResolution is too high for selected region.\n");
-	fprintf(stderr, "Buttons:\n");
-	fprintf(stderr,
-		"Left:   Decrease resolution to n-s = %.20f e-w = %.20f\n",
-		nsr, ewr);
-	fprintf(stderr, "Middle: Keep current resolution\n");
-	fprintf(stderr, "Right:  Keep current resolution\n");
-
-	R_get_location_with_pointer(&screen_x, &screen_y, &button);
-
-	if (button == 1) {
-	    window->ns_res = nsr;
-	    window->ns_res3 = nsr;
-	    window->ew_res = ewr;
-	    window->ew_res3 = ewr;
-	    td = rint(tnorth / nsr);
-	    tnorth = td * nsr;
-	    td = rint(tsouth / nsr);
-	    tsouth = td * nsr;
-	    td = rint(teast / ewr);
-	    teast = td * ewr;
-	    td = rint(twest / ewr);
-	    twest = td * ewr;
-	}
-    }
-
-    if (window->proj == PROJECTION_LL) {
-	if (tnorth > 90)
-	    tnorth = 90;
-	if (tsouth < -90)
-	    tsouth = -90;
-	if (teast > 360)
-	    teast -= 360;	/* allow 0->360 as easting (e.g. Mars) */
-	if (twest > 360)
-	    twest -= 360;
-	if (teast < -180)
-	    teast += 360;
-	if (twest < -180)
-	    twest += 360;
-    }
-
-    if (tnorth == tsouth)
-	tnorth += window->ns_res;
-    if (window->proj != PROJECTION_LL) {
-	if (teast == twest)
-	    teast += window->ew_res;
-    }
-    else {
-	if ((fabs(teast - twest) <= window->ew_res) ||
-	    (fabs(teast - 360 - twest) <= window->ew_res)) {
-	    teast -= window->ew_res;
-	}
-    }
-
-    if (resetwin) {
-	/* favour resolution over bounds; round inwards to protect lat/lon */
-	window->north = floor(tnorth / window->ns_res) * window->ns_res;
-	window->south = ceil(tsouth / window->ns_res) * window->ns_res;
-	window->east = floor(teast / window->ew_res) * window->ew_res;
-	window->west = ceil(twest / window->ew_res) * window->ew_res;
-
-	if (!hand) {
-	    fprintf(stderr, "\n");
-	    print_win(window, north, south, east, west);
-	    fprintf(stderr, "\n");
-	}
-
-	limit = print_limit(window, &defwin);
-
-	G_adjust_Cell_head3(window, 0, 0, 0);
-	G_put_window(window);
-	Rast_set_window(window);
-	redraw();
-    }
-
-    return 1;
-}

+ 0 - 45
display/d.zoom/zoom.c

@@ -1,45 +0,0 @@
-#include <grass/gis.h>
-#include <grass/display.h>
-#include "local_proto.h"
-#include <grass/glocale.h>
-
-int zoomwindow(struct Cell_head *window, int quiet, double magnify)
-{
-    int screen_x, screen_y, button;
-    int end = 0;
-    int printmenu = 1;
-
-    while (!end) {
-	if (printmenu) {
-	    fprintf(stderr, _("\n\nButtons:\n"));
-	    fprintf(stderr, _("Left:   Zoom menu\n"));
-	    fprintf(stderr, _("Middle: Pan\n"));
-	    fprintf(stderr, _("Right:  Quit menu\n"));
-	    printmenu = 0;
-	}
-
-	R_get_location_with_pointer(&screen_x, &screen_y, &button);
-
-	if (button == 1) {
-	    /* enter zoom menu */
-	    make_window_box(window, magnify, 1, 0);
-	    printmenu = 1;
-	}
-	else if (button == 2) {
-	    /* pan */
-	    pan_window(window, screen_x, screen_y);
-	}
-	else if (button == 3) {
-	    end = 1;
-	}
-    }
-
-#ifdef QUIET
-    if (!quiet) {
-	fprintf(stderr, _("This region now saved as current region.\n\n"));
-	fprintf(stderr,
-		_("Note: run 'd.erase' for the new region to affect the graphics.\n"));
-    }
-#endif
-    return (0);
-}

+ 4 - 5
general/g.region/g.region.html

@@ -453,12 +453,11 @@ projection since it is reprojected on the fly.
 <h2>SEE ALSO</h2>
 <h2>SEE ALSO</h2>
 
 
 <em>
 <em>
-<a href="d.zoom.html">d.zoom</a><br>
-<a href="g.access.html">g.access</a><br>
-<a href="g.mapsets.html">g.mapsets</a><br>
-<a href="g.proj.html">g.proj</a><br>
+<a href="g.access.html">g.access</a>,
+<a href="g.mapsets.html">g.mapsets</a>,
+<a href="g.proj.html">g.proj</a>,
 <a href="g.setproj.html">g.setproj</a><br>
 <a href="g.setproj.html">g.setproj</a><br>
-environment variables: <a href="variables.html#internal">GRASS_REGION and WIND_OVERRIDE</a>
+Environment variables: <a href="variables.html#internal">GRASS_REGION and WIND_OVERRIDE</a>
 </em>
 </em>
 
 
 
 

+ 3 - 2
raster/r.category/r.category.html

@@ -155,9 +155,10 @@ EOF
 UNIX Manual entries for <i>awk</i> and <i>sort</i>
 UNIX Manual entries for <i>awk</i> and <i>sort</i>
 
 
 <p>
 <p>
-<em><a href="r.coin.html">r.coin</a>,
-<a href="r.describe.html">r.describe</a>,
+<em>
 <a href="d.what.rast.html">d.what.rast</a>,
 <a href="d.what.rast.html">d.what.rast</a>,
+<a href="r.coin.html">r.coin</a>,
+<a href="r.describe.html">r.describe</a>,
 <a href="r.support.html">r.support</a>
 <a href="r.support.html">r.support</a>
 </em>
 </em>
 
 

+ 0 - 2
raster/r.his/r.his.html

@@ -47,7 +47,6 @@ cell in the <i>INTENSITY</i> map layer.  This map layer
 should have an appropriate gray-scale color table
 should have an appropriate gray-scale color table
 associated with it. You can ensure this by using the color
 associated with it. You can ensure this by using the color
 manipulation capabilities of
 manipulation capabilities of
-<em><a href="d.colors.html">d.colors</a></em> or
 <em><a href="r.colors.html">r.colors</a></em>.
 <em><a href="r.colors.html">r.colors</a></em>.
 Finally, the color is made somewhat gray-based on the
 Finally, the color is made somewhat gray-based on the
 <i>red</i> intensity of that cell in the
 <i>red</i> intensity of that cell in the
@@ -108,7 +107,6 @@ d.rgb red=esr.r green=esr.g blue=esr.b
 
 
 <em>
 <em>
 <a href="d.his.html">d.his</a>,
 <a href="d.his.html">d.his</a>,
-<a href="d.colors.html">d.colors</a>,
 <a href="d.colortable.html">d.colortable</a>,
 <a href="d.colortable.html">d.colortable</a>,
 <a href="d.rgb.html">d.rgb</a>,
 <a href="d.rgb.html">d.rgb</a>,
 <a href="r.blend.html">r.blend</a>,
 <a href="r.blend.html">r.blend</a>,

+ 4 - 4
scripts/i.spectral/i.spectral.html

@@ -39,10 +39,10 @@ NIR, and MIR channels.
 
 
 <h2>SEE ALSO</h2>
 <h2>SEE ALSO</h2>
 
 
-<em><a href="d.what.rast.html">d.what.rast</a></em><br>
-<em><a href="d.where.html">d.where</a></em><br>
-<em><a href="r.what.html">r.what</a></em><br>
-
+<em>
+<a href="d.where.html">d.where</a>,
+<a href="r.what.html">r.what</a>
+</em>
 
 
 <h2>AUTHOR</h2>
 <h2>AUTHOR</h2>
 
 

+ 0 - 1
tools/dep_tree2sql.sh

@@ -55,7 +55,6 @@
 # 	grass-> WHERE a.library = 'libgrass_form.6.1.cvs.so' AND a.symbol = b.symbol ;
 # 	grass-> WHERE a.library = 'libgrass_form.6.1.cvs.so' AND a.symbol = b.symbol ;
 # 	                          object                           
 # 	                          object                           
 # 	-----------------------------------------------------------
 # 	-----------------------------------------------------------
-# 	 display/d.what.vect/OBJ.i686-pc-linux-gnu/what.o
 # 	 vector/v.digit/OBJ.i686-pc-linux-gnu/attr.o
 # 	 vector/v.digit/OBJ.i686-pc-linux-gnu/attr.o
 # 	 vector/v.digit/OBJ.i686-pc-linux-gnu/line.o
 # 	 vector/v.digit/OBJ.i686-pc-linux-gnu/line.o
 # 	 vector/v.what/OBJ.i686-pc-linux-gnu/what.o
 # 	 vector/v.what/OBJ.i686-pc-linux-gnu/what.o

+ 2 - 2
vector/v.lrs/v.lrs.where/v.lrs.where.html

@@ -30,8 +30,8 @@ d.vect busstops disp=attr attr=cat size=10 bg=white lcol=blue yref=bottom
 d.vect busstops icon=basic/circle fcol=blue
 d.vect busstops icon=basic/circle fcol=blue
 d.vect newpoints col=red
 d.vect newpoints col=red
 
 
-# measure distance to previous bus stop
-d.measure
+# measure distance to previous bus stop:
+# use measuring tool in graphical user interface
 </pre></div>
 </pre></div>
 
 
 <h2>SEE ALSO</h2>
 <h2>SEE ALSO</h2>