go to www.geomview.org home page
 
Home

Overview
FAQ
Documentation

Download

Mailing List

Geomview For Windows?

Support
Users
Development

Bug Reporting
Contributing
Contact Us

Sponsors

 

Site Search

 

Advanced
Search

 
About the software@geom archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Closed REQ 6007]: display maple-geomview


  • To: software@geom.umn.edu
  • Subject: Re: [Closed REQ 6007]: display maple-geomview
  • From: daemon
  • Date: Sat, 5 Oct 1996 13:23:58 -0500 (CDT)


As we released it, there was no way for Maple to directly invoke geomview
on a different computer.  However, there's now a script which does this,
at least for me.  Briefly, you'd install this "remotegv" script somewhere
in your UNIX search path (e.g. /usr/local/bin) on the machine where Maple
runs, then in the Maple session say:

 readlib(gvplot);

 gvcommand := `remotegv`;

possibly giving other options to remotegv if it won't be able to guess
e.g. which machine to run geomview on, or which user name to use there,
or what program to run as geomview; if you had to specify all possible
options, you might say

 gvcommand := `remotegv -h person at machine -display xterminal:0 /u/person/bin/gv`;

This should allow you to use gvplot() as usual.

You could also make such a setting be the default.  In the "gvplot.mapleV3"
script included in the Geomview/maple directory, distribution, there's a line
    gvcommand := ``;
Edit gvplot.mapleV3 and try "make install_v3".

Here's the remotegv script:

#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of shell archive."
# Contents:  remotegv
# Wrapped by slevy at euclid on Sat Oct  5 13:20:21 1996
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'remotegv' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'remotegv'\"
else
echo shar: Extracting \"'remotegv'\" \(4578 characters\)
sed "s/^X//" >'remotegv' <<'END_OF_FILE'
X#! /bin/sh
X
X# Invoke geomview possibly remotely.
X# For use within Maple, install this remotegv script somewhere in users'
X# search paths (e.g. in /usr/local/bin).
X# This script attempts to guess which machine to invoke geomview on by
X# examining the DISPLAY environment variable.  If DISPLAY isn't set or
X# if geomview should run on a different machine, use the -h host option.
X#
X# The script also assumes that geomview should display on the machine where
X# it is invoked, so for that copy of geomview, it sets DISPLAY to ":0".
X# If the display should appear elsewhere (on an X terminal, say),
X# use the -display option.
X#
X# We use "rsh" (remote shell) to pass data to the other computer, so 
X# the remote computer must allow this -- either with an entry in
X# /etc/hosts.equiv, or in a .rhosts file in the user's home directory
X# on the machine where geomview will run.  The account name on the other
X# machine is assumed to be the same as on this machine; if different,
X# use the -l username or -h username at othermachine options.
X#
X# In case permissions are not set up correctly, the symptom
X# is liable to be a "Permission denied." message followed by the
X# immediate termination of the Maple process -- so if you're using it for
X# the first time, check it out before doing much else in your Maple session!
X# Sorry, but MapleV3 is just not very good at connecting to other programs.
X#
X# Note that togeomview and geomview MUST BE IN THE USER'S DEFAULT SEARCH PATH
X# on the remote machine.
X#
X# To use this script within Maple, you'd say:
X#    readlib(gvplot);
X# then
X#    gvcommand := `remotegv`;
X# or e.g.
X#    gvcommand := `remotegv -h othermachine -display myxterm:0`;
X# or, if the account on the other machine is different from yours,
X#    gvcommand := `remotegv -l otheraccount`;
X# or
X#    gvcommand := `remotegv -h otheraccount at othermachine`;
X# Following any remotegv options, you can add the command to be invoked as
X# geomview, possibly including options, as in:
X#    gvcommand := `remotegv -l person /u/person/bin/gv -wpos 300x200`;
X#
X# Then use gvplot() as usual.
X#
X# Normally, error messages reporting problems on the other machine (for
X# example, being unable to run geomview) are suppressed; this is unfortunately
X# necessary, or you'd never get another Maple prompt until quitting from
X# geomview.  There's a test mode to aid in tracing problems; use it as in
X#    gvcommand := `remotegv -test -h othermachine`;
X# i.e. add "-test" to whatever other options you'd give to remotegv.
X# 
X# Option summary:
X# -l user  or  -l user at host
X# -h host  or  -h user at host
X# -display host:number		(set display on remote end)
X# -test
X# also accepts togeomview's options (-g, -M[c][g][p][s]).
X
X# Invokes rsh to specified machine, invokes togeomview there by default.
X#
X# By default, we assume DISPLAY points to the machine where we'd like to be;
X#   -h {host-portion-of-DISPLAY} -display :0
X# Incorporates settings from "$RGVOPTS" environment variable.
X
Xset -- $RGVOPTS "$@"
X
Xwhile
X  case "$1" in
X  -l)
X	case "$2" in
X	*@*) user="`expr match "$2" '\([^@]*\)'`"
X	     host="`expr match "$2" '.*@\(.*\)'`" ;;
X	*) user="$2" ;;
X	esac
X	shift 2 ;;
X
X  -h)   case "$2" in
X	*@*) user="`expr match "$2" '\([^@]*\)'`"
X	     host="`expr match "$2" '.*@\(.*\)'`" ;;
X	*) host="$2" ;;
X	esac
X	shift 2 ;;
X
X  -test) testopt=-test; shift ;;
X  -display) rdisplay="$2"; shift 2 ;;
X  -M*) togvopts="$togvopts $1";
X	 inpipe="$2"
X	 shift 2 ;;
X  -g)  gopt=-g; shift ;;
X  "") test ;;
X  *) togvargs="$togvargs $1"; shift ;;
X  esac
Xdo :
Xdone
X
X# Apply defaults
X
Xif [ -z "$host" ]; then
X  host="`expr match "$DISPLAY" '\([^:]*\)'`"
Xfi
X
Xif [ -z "$rdisplay" ]; then
X  rdisplay=":0.0"
Xfi
X
Xcase "$inpipe" in
X  /*) ;;
X  ?*) inpipe=/tmp/geomview/$inpipe ;;
Xesac
X
Xuser=${user+"-l $user"}
Xcmd="${host+rsh $host $user}"
X
Xif [ -n "$host" ]; then
X  redirect=">/dev/null 2>&1"
X  if [ -n "$testopt" ]; then
X    echo "Testing setup to $host.  If geomview or togeomview can't be started
Xthere, you should see messages explaining why.  Unfortunately this command
Xmay not finish on its own -- you may need to interrupt (perhaps with control-C)
Xafter seeing the results, before you get another Maple prompt." >&2
X    redirect=""
X  fi
X  if [ -n "$inpipe" ]; then
X    rsh $host $user sh -c "\"DISPLAY=$rdisplay togeomview $gopt ${togvopts} $inpipe $togvargs $redirect\"" <$inpipe
X  else
X    rsh $host $user sh -c "\"DISPLAY=$rdisplay togeomview $gopt ${togvopts} $togvargs $redirect\""
X  fi
Xelse
X  case "$1" in
X    ""|-*) DISPLAY=$rdisplay geomview ${togvopts} $togvargs ;;
X    *) DISPLAY=$rdisplay ${togvopts} $togvargs;;
X  esac
Xfi
END_OF_FILE
if test 4578 -ne `wc -c <'remotegv'`; then
    echo shar: \"'remotegv'\" unpacked with wrong size!
fi
chmod +x 'remotegv'
# end of 'remotegv'
fi
echo shar: End of shell archive.
exit 0


--


 
Home | Overview | FAQ | Documentation | Support | Download | Mailing List
Windows? | Development | Bug Reporting | Contributing | Contact Us | Sponsors
 
site hosted by
SourceForge Logo