Browse Source

Remove d.out.file; it isn't meaningful without standalone monitors

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@32604 15284696-431f-4ddb-bdfa-cd5b030d7da7
Glynn Clements 17 years ago
parent
commit
f337eee00a
3 changed files with 0 additions and 470 deletions
  1. 0 7
      scripts/d.out.file/Makefile
  2. 0 374
      scripts/d.out.file/d.out.file
  3. 0 89
      scripts/d.out.file/description.html

+ 0 - 7
scripts/d.out.file/Makefile

@@ -1,7 +0,0 @@
-MODULE_TOPDIR = ../..
-
-PGM=d.out.file
-
-include $(MODULE_TOPDIR)/include/Make/Script.make
-
-default: script

+ 0 - 374
scripts/d.out.file/d.out.file

@@ -1,374 +0,0 @@
-#!/bin/sh
-#
-############################################################################
-#
-# MODULE:	d.out.file for GRASS 6 (2005/9/3; 2007/5/14)
-# AUTHOR(S):	Michael Barton and Hamish Bowman
-#		  Original routine to read current display geometry
-#		  written by Hamish Bowman & Glynn Clements
-# PURPOSE:	To redraw current displayed maps to graphics file output
-# COPYRIGHT:	(C) 2005-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.
-#
-#############################################################################
-
-#%Module
-#%  description: Saves the contents of the active display monitor to a graphics file.
-#%  keywords: display, export
-#%End
-#%option
-#% key: output
-#% type: string
-#% description: Name for output file (do NOT add extension)
-#% gisprompt: new_file,file,output
-#% required : yes
-#%end
-#%option
-#% key: format
-#% type: string
-#% options: png,ppm,tif,jpg,bmp,ps,eps,svg,pdf
-#% answer: png
-#% description: Graphics file format
-#% required : yes
-#%end
-#%option
-#% key: resolution
-#% type: integer
-#% answer: 1
-#% label: Dimensions of output file versus current window size
-#% description: (same=1, double size=2, quadruple size=4)
-#% guisection: Images
-#% required : no
-#%end
-#%option
-#% key: size
-#% type: integer
-#% key_desc: width,height
-#% description: Width and height of output image (overrides resolution setting)
-#% guisection: Images
-#% required : no
-#%end
-#%option
-#% key: compression
-#% type: integer
-#% options: 0-9
-#% answer: 9
-#% label: Compression for PNG files
-#% description: (0=none, 1=fastest, 9=most; lossless, only time vs. filesize)
-#% required : no
-#% guisection: Images
-#%end
-#%option
-#% key: quality
-#% type: integer
-#% answer: 75
-#% options: 10-100
-#% label: File size/quality for JPEG files
-#% description: (10=smallest/worst, 100=largest/best)
-#### 10 is hardcoded as smallest value in gdal/frmts/jpeg/jpgdataset.cpp. why not 0?
-#% required : no
-#% guisection: Images
-#%end
-#%option
-#% key: paper
-#% type: string
-#% answer: a4
-#% description: Paper size for PostScript output
-#% options: a4,a3,a2,a1,a0,us-letter,us-legal,us-tabloid
-#### Sizes from lib/psdriver/Graph_set.c
-#% guisection: PostScript
-#% required : no
-#%end
-#### margin setting not currently allowed in PS driver
-## #%option
-## #% key: margins
-## #% type: integer
-## #% key_desc: bottom,top,left,right
-## #% description: Margins (in points) for PostScript output
-## #% guisection: PostScript
-## #% required : no
-## #%end
-#%option
-#% key: ps_level
-#% type: integer
-#% options: 1-3
-#% answer: 2
-#% description: PostScript level (only limits functionality!)
-#% guisection: PostScript
-#% required : no
-#% end
-#%flag
-#% key: b
-#% description: Set background color to black (white default)
-#% end
-#%flag
-#% key: t
-#% description: Set transparent background
-#% guisection: Images
-#% end
-#%flag
-#% key: c
-#% description: Use the Cario driver to render images
-#% guisection: Images
-#% end
-#%flag
-#% key: r
-#% description: Set paper orientation to landscape (for PostScript output)
-#% guisection: PostScript
-#%end
-
-
-if  [ -z "$GISBASE" ] ; then
-   echo "You must be in GRASS GIS to run this program." 1>&2
-   exit 1
-fi
-
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-   exec g.parser "$0" "$@"
-fi
-
-#### set environment so that awk works properly in all languages
-unset LC_ALL
-LC_NUMERIC=C
-export LC_NUMERIC
-
-
-#### Check the current status of the monitor
-monitorcheck1="`d.mon -p | grep -v "No monitor currently selected"`"
-if [ -z "$monitorcheck1" ] ; then
-   g.message -e "You must select a display monitor."
-   exit 1
-fi
-
-curr_mon="`d.mon -p | cut -f2 -d: | awk '{print $1}'`"
-
-monitorcheck2="`d.mon -L | grep "^$curr_mon" | grep -v "not running"`"
-if [ -z "$monitorcheck2" ] ; then
-   g.message -e "Selected display monitor not running."
-   exit 1
-fi
-
-if [ `echo "$curr_mon" | grep -c '^x.$'` -ne 1 ] ; then
-   g.message -e "Only X monitors are supported."
-   exit 1
-fi
-
-case "$GIS_OPT_FORMAT" in
-   pdf | svg)
-     if [ $GIS_FLAG_C -eq 0 ] ; then
-	g.message "Using the Cairo driver."
-	GIS_FLAG_C=1
-     fi
-     ;;
-esac
-
-if [ $GIS_FLAG_C -eq 1 ] &&  [ `d.mon -l | grep -c '^cairo'` -eq 0 ] ; then
-   g.message -e "Cairo driver not present in this build of GRASS."
-   exit 1
-fi
-
-
-#### set variables
-res="$GIS_OPT_RESOLUTION"
-
-#capture current display monitor and geometry
-# identify current monitor
-currmon="`d.mon -L | grep "(selected)" | awk '{print $1}'`"
-curr_width="`d.info -d | cut -f2 -d' '`"
-curr_height="`d.info -d | cut -f3 -d' '`"
-
-if [ -z "$GIS_OPT_SIZE" ] ; then
-   #set dimension multiplier
-   out_width="`expr $res \* $curr_width`"
-   out_height="`expr $res \* $curr_height`"
-else
-   out_width="`echo $GIS_OPT_SIZE | cut -f1 -d,`"
-   out_height="`echo $GIS_OPT_SIZE | cut -f2 -d,`"
-fi
-
-#set output geometry
-GRASS_WIDTH="$out_width"
-export GRASS_WIDTH
-GRASS_HEIGHT="$out_height"
-export GRASS_HEIGHT
-
-
-#set other output options
-if [ "$GIS_FLAG_B" -eq 1 ] ; then
-    GRASS_BACKGROUNDCOLOR=000000
-else
-    GRASS_BACKGROUNDCOLOR=FFFFFF
-fi
-export GRASS_BACKGROUNDCOLOR
-
-if [ "$GIS_FLAG_T" -eq 1 ] ; then
-    GRASS_TRANSPARENT=TRUE
-else
-    GRASS_TRANSPARENT=FALSE
-fi
-export GRASS_TRANSPARENT
-
-
-#set output file name and format
-case "$GIS_OPT_FORMAT" in
-   png | ppm | ps | eps | svg | pdf)
-     output="${GIS_OPT_OUTPUT}.${GIS_OPT_FORMAT}"
-     ;;
-   tif | jpg)
-     output="`g.tempfile pid=$$`.ppm"
-     ;;
-   bmp)
-     if [ $GIS_FLAG_C -eq 1 ] ; then
-	output="${GIS_OPT_OUTPUT}.${GIS_OPT_FORMAT}"
-     else
-	output="`g.tempfile pid=$$`.ppm"
-     fi
-     ;;
-esac
-
-outname="${GIS_OPT_OUTPUT}.${GIS_OPT_FORMAT}"
-
-#is there a simpler way of testing for --overwrite?
-if [ -e "$outname" ] ; then
-   if [ -z "$GRASS_OVERWRITE" ] || [ "$GRASS_OVERWRITE" -ne 1 ] ; then
-      g.message -e "File <$outname> already exists"
-      exit 1
-   fi
-fi
-
-
-if [ "$GIS_OPT_FORMAT" = "ps" ] || [ "$GIS_OPT_FORMAT" = "eps" ] ; then
-    if [ $GIS_FLAG_C -eq 1 ] ; then
-	if [ $GIS_FLAG_R -eq 1 ] ; then
-	   g.message -w "Cairo driver doesn't know how to do landscape mode"
-	fi
-	if [ "$GIS_OPT_FORMAT" = "eps" ] ; then
-	   g.message -e "Cairo driver doesn't support EPS"
-	   exit 1
-	fi
-    fi
-
-    if [ $GIS_FLAG_C -eq 0 ] ; then
-	GRAPHICS_DRIVER=PS
-	GRASS_PSFILE="$output"
-	export GRASS_PSFILE
-    else
-	GRAPHICS_DRIVER=cairo
-	GRASS_CAIROFILE="$output"
-	export GRASS_CAIROFILE
-    fi
-
-    if [ "$GIS_OPT_FORMAT" = "ps" ] ; then
-	GRASS_PAPER="$GIS_OPT_PAPER"
-	export GRASS_PAPER
-    else
-	unset GRASS_PAPER
-	if [ `d.save -a | grep '^d.frame' | grep -c -v full_screen` -gt 0 ] ; then
-	    g.message -w 'Encapsulated PostScript and mutil-frame displays do not mix!'
-	fi
-    fi
-
-    if [ "$GIS_OPT_PS_LEVEL" -lt 2 ] ; then
-	GRASS_TRUECOLOR=FALSE
-    else
-	GRASS_TRUECOLOR=TRUE
-    fi
-    export GRASS_TRUECOLOR
-
-    if [ "$GIS_FLAG_R" -eq 1 ] ; then
-	GRASS_LANDSCAPE=TRUE
-	export GRASS_LANDSCAPE
-    else
-	unset GRASS_LANDSCAPE
-    fi
-
-else
-    if [ $GIS_FLAG_C -eq 0 ] ; then
-	GRAPHICS_DRIVER=PNG
-	GRASS_PNGFILE="$output"
-	export GRASS_PNGFILE
-    else
-	GRAPHICS_DRIVER=cairo
-	GRASS_CAIROFILE="$output"
-	export GRASS_CAIROFILE
-    fi
-
-    #make sure that output is 24 bit color
-    GRASS_TRUECOLOR=TRUE
-    export GRASS_TRUECOLOR
-
-    GRASS_PNG_COMPRESSION="$GIS_OPT_COMPRESSION"
-    export GRASS_PNG_COMPRESSION
-fi
-
-
-g.message "Saving display from Monitor: [$curr_mon] to <$outname>."
-# what does the Cairo/PS driver do?
-if [ "$GIS_OPT_FORMAT" != "ps" ] ; then
-    g.message "Image size [$out_width x $out_height]"
-else
-    g.message "Image size [$GRASS_PAPER]"
-fi
-
-################################
-#export display to PNG/PS driver
-dsave=`d.save -a`
-
-d.mon start=$GRAPHICS_DRIVER --quiet
-eval "$dsave"
-d.mon stop=$GRAPHICS_DRIVER --quiet
-################################
-
-g.message "Screen export complete. (writing the file may take a small amount of time)"
-
-d.mon select="$curr_mon"
-
-case "$GIS_OPT_FORMAT" in
-   png | ppm | ps | eps | svg | pdf)
-     g.message "Done."
-     exit
-     ;;
-   tif | jpg)
-     # delay not needed if using GRASS_PNG_AUTO_WRITE ?
-     g.message "Waiting for file to write ..."
-     sleep 5
-     ;;
-   bmp)
-     if [ $GIS_FLAG_C -eq 1 ] ; then
-	g.message "Done."
-	exit
-     else
-	# delay not needed if using GRASS_PNG_AUTO_WRITE ?
-	g.message "Waiting for file to write ..."
-	sleep 5
-     fi
-     ;;
-esac
-
-
-case "$GIS_OPT_FORMAT" in
-   tif)
-     g.message "Translating to TIFF format" 
-     gdal_translate "$output" "$outname" -of GTIFF
-     EXITCODE=$?
-     ;;
-   jpg)
-     g.message "Translating to JPEG format" 
-     gdal_translate "$output" "$outname" -of JPEG -co QUALITY="$GIS_OPT_QUALITY"
-     EXITCODE=$?
-     ;;
-   bmp)
-     g.message "Translating to BMP format" 
-     gdal_translate "$output" "$outname" -of BMP
-     EXITCODE=$?
-     ;;
-esac
-
-\rm "$output"
-
-g.message "Done."
-
-exit $EXITCODE

+ 0 - 89
scripts/d.out.file/description.html

@@ -1,89 +0,0 @@
-<H2>DESCRIPTION</H2>
-<EM>(GRASS Shell Script)</EM>
-<P>
-<EM><b>d.out.file</b></EM> uses <em>d.save</em>, the GRASS PNG or PostScript
-driver, and <tt>gdal_translate</tt> to export the currently selected X display
-monitor to a graphics file of several formats. Output image size can be set
-prior to export.
-<P>
-PNG and PPM formats are supported directly by the GRASS PNG driver and
-PostScript output is supported directly by the GRASS PS driver.
-<P>
-TIFF, JPEG, and BMP formats are supported by using <tt>gdal_translate</tt>
-on PPM format files produced by the GRASS PNG driver. Different levels of
-compression/quality are supported for JPEG files.
-<P>
-Graphic files are exported to the user's current working directory by
-default, but different paths may be specified in the output field.
-<P>
-EPS files are not compatible with <em>d.frame</em>, as it is not possible to nest
-encapsulation. Only the first frame will be drawn. In these cases it is
-recommended to output to regular PostScript format and then use a utility
-like <tt>ps2epsi</tt> to convert to an EPS file.
-Output from this module using the regular PostScript format may contain
-subframes.
-
-
-<H2>EXAMPLES</H2>
-
-<h4>Speafish dataset</h4>
-
-<div class="code"><pre>
-  g.region rast=slope -p
-  d.mon x0
-  d.rast slope
-  d.vect streams type=area,line
-  d.barscale at=0,94.5
-  d.out.file spearfish_pic format=png size=800,600
-  d.out.file spearfish_pic format=ps -r paper=a4
-</pre></div>
-<BR>
-
-<h4>Multi-pane PostScript output using a shaded relief map and 
-<a href="http://grass.gdf-hannover.de/wiki/GRASS_AddOns#Display_add-ons">d.frame.quarter</a>
-from the Wiki-Addons site</h4>
-
-<div class="code"><pre>
-  g.region rast=elevation.dem
-  r.shaded.relief map=elevation.dem shad=elev.shad_relf
-  d.mon x1
-  d.frame.quarter
-  d.frame uno
-  d.his h=elevation.dem i=elev.shad_relf brighten=50
-  echo "A" | d.text -b color=black size=10 at=93,5
-  d.frame dos
-  d.his h=slope i=elev.shad_relf brighten=40
-  echo "B" | d.text -b color=black size=10 at=93,5
-  d.frame tres
-  d.his h=landcover.30m i=elev.shad_relf brighten=55
-  echo "C" | d.text -b color=black size=10 at=93,5
-  d.frame cuatro
-  d.his h=trn.sites i=elev.shad_relf brighten=15
-  echo "D" | d.text -b color=black size=10 at=93,5
-  d.frame full_screen
-  d.out.file spearfish_4 format=ps -r paper=a4
-</pre></div>
-
-
-<H2>SEE ALSO</H2>
-
-<EM>
-<A HREF="d.frame.html">d.frame</A>,
-<A HREF="d.mon.html">d.mon</A>,
-<A HREF="d.out.png.html">d.out.png</A>,
-<A HREF="d.save.html">d.save</A>,
-<A HREF="ps.map.html">ps.map</A></EM><BR>
-<A HREF="cairodriver.html">Cairo driver</A>,
-<A HREF="pngdriver.html">PNG driver</A>,
-<A HREF="psdriver.html">PostScript driver</A>,
-<A HREF="htmlmapdriver.html">HTML-map driver</A>,
-<A HREF="xdriver.html">X driver</A><BR>
-<A HREF="http://www.gdal.org">GDAL Homepage</a>
-
-
-<H2>AUTHORS</H2>
-
-Michael Barton, Arizona State University<BR>
-Hamish Bowman, Otago University, New Zealand
-<p>
-<i>Last changed: $Date$</i>