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]

patches for geomview, mathoogl, pssnap



The appended shar file contains some patches for geomview, mathoogl and
pssnap.

1) I wrote a few days ago and asked whether it was possible to constrain
mouse-generated rotations in geomview so that the vertical axis was
preserved. I have now hacked this and the results seem pleasing so I'm
sending the patches (for src/bin/geomview/common/*)

There is a new `(transform ... rotate-horizontal ..)' subcommand. This
applies a spherical-polar-like rotation to the object in it's own frame:
the Y-component gives a rotation about the object-vertical, the
X-component then tilts the object toward or away from the camera, and
the Z-component rotates about the camera axis as usual. The effect is
like having the camera fly around the object in spherical polars, and is
very intuitive for objects with a definite vertical.

I've added the new mode "[R] Horiz Rotate" to motion-mode menu, but
haven't bothered to install an icon for it in the tools menu. The
patches are pretty small. Some of the new functions in
src/bin/geomview/common/transform.c actually belong in the Tm3 library -
I've left them in transform.c to keep everything compact.

I had to rewrite Tm3Align() to stop it crashing when the axes are
already aligned. The new version is much cleaner - I recommend using
reflections for similar tasks!  I've also left an unused function
Tm3AlignNormal() in, in case you're interested.


2) Patches to math2oogl to rotate the Mathematica vertical axis (Z) to the
geomview vertical (Y) (ie, XYZ->YZX). This is necessary to make horizontal
rotation work properly with Mathematica output.


3) Patches for running math2oogl on an old (version 1.2) Mathematica. I
had to hack OOGL.m (->OOGL1.m) and add 2 shell scripts: math12oogl to do
some filtering and run math2oogl, and xdisplayhost because I
couldn't get the quoting right in Mathematica RunThrough[].


4) The pssnap postscript header assumes the Level 2 function `rectclip'
which neither ghostscript nor any of our printers have, so here it is
(straight from the Postscript book).


A few further comments:

1) I haven't been able to get color postscript out of pssnap - it just
produces RGB-encoded greyscales. The objects are definitely colored in
geomview, but it seems that maybe the colors don't make it to pssnap. Is
this correct?

2) It would be nice if there were a make target to remove all binaries &
libraries from the geomview/src hierarchy, after everything is
installed. As it is quite a few megabytes of junk is left around.


Once again - thanks for geomview, it's a great tool!
------------------------------------------------------------
Bill Triggs                       | bill at robots.oxford.ac.uk
Oxford University Robotics Group  | tel +44-865-273157
19 Parks Rd, Oxford OX1 3PJ, G.B. | fax +44-865-273908
------------------------------------------------------------
#! /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:  README geomview-common.patches mathoogl
#   pssnap-common.patches mathoogl/OOGL12.m mathoogl/math12oogl
#   mathoogl/mathoogl.patches mathoogl/xdisplayhost
# Wrapped by bill at cassius.robots on Mon Dec 28 16:50:14 1992
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f README -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"README\"
else
echo shar: Extracting \"README\" \(2806 characters\)
sed "s/^X//" >README <<'END_OF_README'
XHere are some patches for geomview + utilities.
X
X1) I wrote a few days ago and asked whether it was possible to constrain
Xmouse-generated rotations in geomview so that the vertical axis was
Xpreserved. I have now hacked this and the results seem pleasing so I'm
Xsending the patches (for src/bin/geomview/common/*)
X
XThere is a new `(transform ... rotate-horizontal ..)' subcommand. This
Xapplies a spherical-polar-like rotation to the object in it's own frame:
Xthe Y-component gives a rotation about the object-vertical, the
XX-component then tilts the object toward or away from the camera, and
Xthe Z-component rotates about the camera axis as usual. The effect is
Xlike having the camera fly around the object in spherical polars, and is
Xvery intuitive for objects with a definite vertical.
X
XI've added the new mode "[R] Horiz Rotate" to motion-mode menu, but
Xhaven't bothered to install an icon for it in the tools menu. The
Xpatches are pretty small. Some of the new functions in
Xgeomview/common/transform.c actually belong in the Tm3 library - I've
Xleft them in transform.c to keep everything compact.
X
XI had to rewrite Tm3Align() to stop it crashing when the axes are
Xalready aligned. The new version is much cleaner - I recommend using
Xreflections for similar tasks!  I've also left an unused function
XTm3AlignNormal() in, in case you're interested.
X
X
X2) Patches to math2oogl to rotate the Mathematica vertical axis (Z) to the
Xgeomview vertical (Y) (ie, XYZ->YZX). This is necessary to make horizontal
Xrotation work properly with Mathematica output.
X
X
X3) Patches for running math2oogl on an old (version 1.2) Mathematica. I
Xhad to hack OOGL.m (->OOGL1.m) and add 2 shell scripts: math12oogl to do
Xsome filtering and run math2oogl, and xdisplayhost because I
Xcouldn't get the quoting right in Mathematica RunThrough[].
X
X
X4) The pssnap postscript header assumes the Level 2 function `rectclip'
Xwhich neither ghostscript nor any of our printers have, so here it is
X(straight from the Postscript book).
X
X
XA few further comments:
X
X1) I haven't been able to get color postscript out of pssnap - it just
Xproduces RGB-encoded greyscales. The objects are definitely colored in
Xgeomview, but it seems that maybe the colors don't make it to pssnap. Is
Xthis correct?
X
X2) It would be nice if there were a make target to remove all binaries &
Xlibraries from the geomview/src hierarchy, after everything is
Xinstalled. As it is quite a few megabytes of junk is left around.
X
X
XOnce again - thanks for geomview, it's a great tool!
X------------------------------------------------------------
XBill Triggs                       | bill at robots.oxford.ac.uk
XOxford University Robotics Group  | tel +44-865-273157
X19 Parks Rd, Oxford OX1 3PJ, G.B. | fax +44-865-273908
X------------------------------------------------------------
END_OF_README
echo shar: Missing newline added to \"README\"
if test 2806 -ne `wc -c <README`; then
    echo shar: \"README\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f geomview-common.patches -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"geomview-common.patches\"
else
echo shar: Extracting \"geomview-common.patches\" \(3617 characters\)
sed "s/^X//" >geomview-common.patches <<'END_OF_geomview-common.patches'
Xdiff ../old/lang.c ./lang.c
X1221c1221
X<   "(transform      objectID centerID frameID [rotate|translate|translate-scaled] x y z)\n\
X---
X>   "(transform      objectID centerID frameID [rotate|rotate-horizontal|translate|translate-scaled] x y z)\n\
Xdiff ../old/motion.c ./motion.c
X58a59,61
X> DLMC(ctl_rhxy_tcf_l,
X>   "(transform-incr target center focus rotate-horizontal %f %f 0)", rot90)
X> 
X95a99,104
X> boundctl bound_horiz_rotations[] = {
X>   {"leftmouse", ctl_rhxy_tcf_l},
X>   {"middlemouse", ctl_rz_tcf_l},
X>   {NULL, NULL}
X> };
X> 
X125a135,137
X> 
X> int minterp_horiz_rotate(Event *event)
X> { return minterp_switch(event, bound_horiz_rotations);}
Xdiff ../old/motion.h ./motion.h
X15a16
X> int minterp_horiz_rotate(Event *event);
Xdiff ../old/transform.c ./transform.c
X60a61,62
X>   else if (!strcmp(transform_type, "rotate-horizontal"))
X>     motion.transform = rotate_horizontal;
X146a149,154
X>   /* Rotate_horizontal needs the vertical axis to preserve. Perhaps
X>      it should use center-y rather than model-y-axis. */
X>   if (motion->transform == rotate_horizontal) {
X>     pt.x = T_R[1][0]; pt.y = T_R[1][1]; pt.z = T_R[1][2];
X>   }
X> 
X160c168
X<   
X---
X> 
X166c174
X< 	/* Apply the matrix to the moving object */
X---
X>   /* Apply the matrix to the moving object */
X242a251,311
X> 
X> /* xy-rotate, but preserve the vertical axis */
X> void rotate_horizontal(float amount[3], Point vertical, Transform T)
X> {
X>   Transform Tt, Ta, Rx, Ry, Tai;
X>   Tm3AlignY(Ta, &vertical);
X>   Tm3RotateX(Rx, amount[0]);
X>   Tm3RotateY(Ry, -amount[1]);
X>   Tm3Concat(Ta, Ry, Tt);
X>   Tm3Concat(Tt, Rx, Tt);
X>   Tm3Invert(Ta, Tai);
X>   Tm3Concat(Tt, Tai, T);  
X> }
X> 
X> #if 1	/* for Tm library */
X> /* Reflection in plane normal to axis */
X> void
X>   Tm3Reflect(Transform T, HPoint3* axis)
X> {
X>   float a = -2.0/(axis->x*axis->x + axis->y*axis->y + axis->z*axis->z);
X>   TmIdentity(T);
X>   T[0][0] = 1.0 + a * axis->x * axis->x;
X>   T[1][1] = 1.0 + a * axis->y * axis->y;
X>   T[2][2] = 1.0 + a * axis->z * axis->z;
X>   T[0][1] = T[1][0] = a * axis->x * axis->y;
X>   T[1][2] = T[2][1] = a * axis->y * axis->z;
X>   T[2][0] = T[0][2] = a * axis->z * axis->x;
X> }
X> 
X> /* Replacement for Tm3Align, using two reflections. Simpler & 
X>    well-behaved when newaxis==axis. There's a singularity at 
X>    newaxis==-axis where the rotation plane is undefined. */
X> void
X>   Tm3Align(Transform T, HPoint3* axis, HPoint3* newaxis)
X> {
X>   HPoint3 bisector;
X>   Transform Tb;
X>   Pt3Add(axis, newaxis, &bisector);
X>   Tm3Reflect(T, axis);
X>   Tm3Reflect(Tb, &bisector);
X>   Tm3Concat(T, Tb, T);
X> }
X> void
X> Tm3AlignY( T, axis )
X>     Transform3 T;
X>     HPoint3 *axis;
X> {
X>     Tm3Align( T, axis, (HPoint3 *)&TM3_YAXIS );
X> }
X> 
X> /* Rotation taking axis into plane normal to pole. Singularities
X>    at pole==+-axis since rotation plane is undefined. */
X> void
X>   Tm3AlignNormal(Transform T, HPoint3* axis, HPoint3* pole)
X> {
X>   HPoint3 normal, newaxis;
X>   Pt3Cross(pole, axis, &normal);
X>   Pt3Cross(&normal, pole, &newaxis);
X>   Tm3Align(T, axis, &newaxis);
X> }
X> #endif
Xdiff ../old/transform.h ./transform.h
X31a32
X> void rotate_horizontal(float amount[3], Point pt, Transform T);
Xdiff ../old/ui.c ./ui.c
X50a51
X> char OBJHORIZROTATE[]	=	"[R] Horiz Rotate";
X74a76
X>   ui_install_mode(OBJHORIZROTATE, minterp_horiz_rotate,	T_NONE);
Xdiff ../old/ui.h ./ui.h
X97a98
X> extern char OBJHORIZROTATE[];		/* Horizontal Rotate */
X112,115c113,117
X< #define TOOL_ZOOM	1
X< #define TOOL_TRANS	2
X< #define TOOL_FLY	3
X< #define TOOL_SCALE	4
X---
X> #define TOOL_HORIZROT	1
X> #define TOOL_ZOOM	2
X> #define TOOL_TRANS	3
X> #define TOOL_FLY	4
X> #define TOOL_SCALE	5
END_OF_geomview-common.patches
if test 3617 -ne `wc -c <geomview-common.patches`; then
    echo shar: \"geomview-common.patches\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test ! -d mathoogl ; then
    echo shar: Creating directory \"mathoogl\"
    mkdir mathoogl
fi
if test -f pssnap-common.patches -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"pssnap-common.patches\"
else
echo shar: Extracting \"pssnap-common.patches\" \(329 characters\)
sed "s/^X//" >pssnap-common.patches <<'END_OF_pssnap-common.patches'
Xdiff /usr/local/lib/geomview/src/bin/pssnap/common/pssnap.c ./pssnap.c
X115,127c115
X> #ifndef HAVE_LEVEL2
X>   fprintf(outfile, "/rectclip {\n\
X> 	/w exch def\n\
X> 	/h exch def\n\
X> 	newpath\n\
X> 	moveto\n\
X> 	w 0 rlineto\n\
X> 	0 h rlineto\n\
X> 	w neg 0 rlineto\n\
X> 	closepath\n\
X> 	clip\n\
X> 	newpath\n} def\n");
X> #endif
X---
X< 
END_OF_pssnap-common.patches
if test 329 -ne `wc -c <pssnap-common.patches`; then
    echo shar: \"pssnap-common.patches\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f mathoogl/OOGL12.m -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"mathoogl/OOGL12.m\"
else
echo shar: Extracting \"mathoogl/OOGL12.m\" \(2772 characters\)
sed "s/^X//" >mathoogl/OOGL12.m <<'END_OF_mathoogl/OOGL12.m'
X(* Copyright (c) 1992 The Geometry Center; University of Minnesota
X   1300 South Second Street;  Minneapolis, MN  55454, USA;
X   
XThis is file OOGL12.m.  OOGL12.m is free software.  You can redistribute
Xit and/or modify it only under the terms given in the file COPYING,
Xwhich you should have received along with this file.  this and other
Xrelated software may be obtained via anonymous ftp from geom.umn.edu;
Xemail: software@geom.umn.edu. *)
X
X(* Author: Nils McCarthy (nils at geom.umn.edu) *)
X
X(* To use this, you also need to install the math2oogl C program.
X   That actually does the grunt work, as mathematica is too slow
X   to do it in any reasonable amount of time. *)
X
X(* This is a modified version of OOGL.m to run with Mathematica-1.2
X   and the math12oogl shell-script <bill at robots.ox.ac.uk> *)
X
XBeginPackage["OOGL`"]
X
XWriteOOGL::usage = "
XWriteOOGL[filename,-Graphics3D-] writes a Graphics3D object to
Xfilename.  WriteOOGL understands Polygon, Line, and RGBColor
XGraphics3D directives.  If WriteOOGL encounters any errors in the
XGraphics3D object, it silently tries to cope.";
X
XGeomview::usage= "
XGeomview [-Graphics3D or SurfaceGraphics-]\n
XGeomview [\"name\", -Graphics3D or SurfaceGraphics-]
Xwrites the given graphics object to Geomview, starting a copy of geomview
Xif necessary.  Only Polygons and Lines are drawn from Graphics3D objects.
XGeomview[\"name\", ...] creates geomview object with that name;
Xdefault is \"Mathematica\"."
X
XBegin["`Private`"]
X
Xmath12oogl="math12oogl"
X
XOOGLConvFormat[foo_Graphics3D] := (
X  ToString[CForm[N[
X     #& /@
X  Flatten[foo[[1]]]]]]
X);
X
XWriteConv[filename_,foo_Graphics3D] :=(
X   WriteString[filename,OOGLConvFormat[foo]]
X);
X
XWriteConv[filename_, foo_SurfaceGraphics] :=(
X   WriteConv[filename, Graphics3D[foo]];
X);
X
XWriteOOGL[filename_String,foo_Graphics3D] :=(
X   bar=If[StringMatchQ[filename,"!*"],
X        OpenWrite[StringJoin["!", math12oogl, "|", 
X			     Apply[StringJoin,Drop[Characters[filename],1]]]],
X        OpenWrite[StringJoin["!", math12oogl, ">", filename]]];
X   WriteConv[bar,foo];
X   Close[bar];
X   foo
X);
X
XWriteOOGL[filename_String,foo_SurfaceGraphics] :=(
X   WriteOOGL[filename, Graphics3D[foo]];
X);
X
XtoGV := Block[{host = ""},
X		host = RunThrough["xdisplayhost",];
X                If[ValueQ[GVHost], host = GVHost];
X                If[ToString[host] != "",
X                    StringJoin["!rsh ", ToString[host],
X			       " env DISPLAY=:0.0 ", math12oogl, " -togeomview "],
X	            StringJoin["!", math12oogl, " -togeomview "]]];
X
X
XGeomview[ name_String, data_, options___Rule ] := Block[
X	  {out = OpenWrite[StringJoin[toGV, name]]},
X		WriteConv[ out, data, options ];
X		Close[out];
X		data
X	];
X
XGeomview[ data_, options___Rule ] := Geomview[ "Mathematica", data, options ];
X
X
X
XEnd[]
XEndPackage[]
END_OF_mathoogl/OOGL12.m
if test 2772 -ne `wc -c <mathoogl/OOGL12.m`; then
    echo shar: \"mathoogl/OOGL12.m\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f mathoogl/math12oogl -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"mathoogl/math12oogl\"
else
echo shar: Extracting \"mathoogl/math12oogl\" \(943 characters\)
sed "s/^X//" >mathoogl/math12oogl <<'END_OF_mathoogl/math12oogl'
X#!/bin/sh
X# math12oogl [-h display-or-host] -- script to adapt math2oogl filter
X# (which converts Mathematica Graphics3D to Geomview OFF format) to an 
X# old version 1.2 Mathematica. <bill at robots.ox.ac.uk>
X# You'll also need to install a modified OOGL.m file: "OOGL12.m" and the 
X# "xdisplayhost" script.
X
XMATH2OOGL=math2oogl
XSED=sed
X
X# quoting here probably fragile, but works on Iris & Sun:
Xnewline='\
X'
X
Xfor a in "$@"; do
X  if [ "$hostnext" ]; then
X    # host to run geomview on - strip any :0.0 junk off
X    displayhost="`expr \"$a\" : '\([^:]*\).*'`"
X    hostnext=
X  else
X    case "$a" in
X    -h) hostnext=true;;
X    *)  args="$args \"$a\"";;
X    esac
X  fi
Xdone
X
X$SED -e "s|-(|(-|g" -e "s|\*10\^|e|g" \
X     -e "s|List|$newline|g" \
X     -e "s|[][{}(), ][][{}(), ]*|$newline|g" | \
X{ 
X  if [ "$displayhost" ]; then 
X    eval "exec rsh \"$displayhost\" env DISPLAY=$DISPLAY $MATH2OOGL $args"
X  else
X    eval "exec $MATH2OOGL $args"
X  fi
X}
END_OF_mathoogl/math12oogl
if test 943 -ne `wc -c <mathoogl/math12oogl`; then
    echo shar: \"mathoogl/math12oogl\" unpacked with wrong size!
fi
chmod +x mathoogl/math12oogl
# end of overwriting check
fi
if test -f mathoogl/mathoogl.patches -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"mathoogl/mathoogl.patches\"
else
echo shar: Extracting \"mathoogl/mathoogl.patches\" \(5505 characters\)
sed "s/^X//" >mathoogl/mathoogl.patches <<'END_OF_mathoogl/mathoogl.patches'
Xdiff -c ../tmp/mathoogl/Makefile ./Makefile
X*** ../tmp/mathoogl/Makefile	Thu Sep 17 01:31:26 1992
X--- ./Makefile	Mon Dec 28 15:47:26 1992
X***************
X*** 6,11 ****
X--- 6,13 ----
X  #   all:	compiles math2oogl.c.
X  #   install:	installs OOGL.m and OOGL.doc in the locations specified
X  #		  below
X+ #   install12:  install a mathematica-1.2 compatible OOGL, rather than the 
X+ #		mathematica-2.0 version
X  #   clean:	removes unnecessary files
X  #   veryclean:	removes unnecessary and recreatable files
X  #   math2oogl.tar.Z:  creates math2oogl.tar.Z --- the distribution file
X***************
X*** 23,28 ****
X--- 25,39 ----
X  # to be installed; this is used by 'make install'.
X  DOCDIR = /u/geom/mathematica/Doc
X  
X+ # Define -DPRESERVE_VERTICAL in CFLAGS if you want the mathematica-Z-axis
X+ # to come out upright (geomview-Y-axis).
X+ 
X+ # for sun
X+ #CFLAGS = -O -DPRESERVE_VERTICAL -DFNONBLK=_FNONBLOCK -s
X+ #CC = gcc
X+ 
X+ # for SGI
X+ CFLAGS = -O2 -DPRESERVE_VERTICAL -s
X  ########################################################################
X  
X  DISTFILES = COPYING README Makefile OOGL.doc OOGL.m Geomview.m math2oogl.c 
X***************
X*** 29,35 ****
X  
X  all:	math2oogl
X  
X- CFLAGS = -O -s
X  math2oogl: math2oogl.c
X  	${CC} -o $@ $@.c ${CFLAGS}
X  
X--- 40,45 ----
X***************
X*** 39,45 ****
X  veryclean:	clean
X  	/bin/rm -f math2oogl.tar.Z math2oogl
X  
X! install: all
X  	/bin/rm -f ${PACKAGEDIR}/OOGL.m ${PACKAGEDIR}/Geomview.m
X  	/bin/cp OOGL.m Geomview.m ${PACKAGEDIR}
X  	chmod 444 ${PACKAGEDIR}/OOGL.m ${PACKAGEDIR}/Geomview.m
X--- 49,55 ----
X  veryclean:	clean
X  	/bin/rm -f math2oogl.tar.Z math2oogl
X  
X! install: all installdoc
X  	/bin/rm -f ${PACKAGEDIR}/OOGL.m ${PACKAGEDIR}/Geomview.m
X  	/bin/cp OOGL.m Geomview.m ${PACKAGEDIR}
X  	chmod 444 ${PACKAGEDIR}/OOGL.m ${PACKAGEDIR}/Geomview.m
X***************
X*** 46,61 ****
X  	@echo ''
X  	@echo 'OOGL.m and Geomview.m installed in ${PACKAGEDIR}'
X  	@echo ''
X  	/bin/rm -f ${DOCDIR}/OOGL.doc
X  	/bin/cp OOGL.doc ${DOCDIR}
X  	chmod 444 ${DOCDIR}/OOGL.doc
X  	@echo ''
X  	@echo 'OOGL.doc installed in ${DOCDIR}'
X- 	@echo ''
X- 	/bin/rm -f ${BINDIR}/math2oogl
X- 	cp math2oogl ${BINDIR}/math2oogl
X- 	chmod 555 ${BINDIR}/math2oogl
X- 	@echo ""; echo "math2oogl installed in ${BINDIR}"; echo ""
X  
X  math2oogl.tar.Z:	veryclean
X  	tar cvf - ${DISTFILES} | compress > /tmp/math2oogl.tar.Z
X--- 56,86 ----
X  	@echo ''
X  	@echo 'OOGL.m and Geomview.m installed in ${PACKAGEDIR}'
X  	@echo ''
X+ 	/bin/rm -f ${BINDIR}/math2oogl
X+ 	cp math2oogl ${BINDIR}/math2oogl
X+ 	chmod 555 ${BINDIR}/math2oogl
X+ 	@echo ""; echo "math2oogl installed in ${BINDIR}"; echo ""
X+ 
X+ install12: all installdoc
X+ 	/bin/rm -f ${PACKAGEDIR}/OOGL.m ${PACKAGEDIR}/Geomview.m
X+ 	/bin/cp OOGL12.m ${PACKAGEDIR}/OOGL.m
X+ 	/bin/cp Geomview.m ${PACKAGEDIR}
X+ 	chmod 444 ${PACKAGEDIR}/OOGL.m ${PACKAGEDIR}/Geomview.m
X+ 	@echo ''
X+ 	@echo 'OOGL12.m and Geomview.m installed in ${PACKAGEDIR}'
X+ 	@echo ''
X+ 	/bin/rm -f ${BINDIR}/math2oogl ${BINDIR}/math12oogl ${BINDIR}/xdisplayhost
X+ 	/bin/cp math2oogl math12oogl xdisplayhost ${BINDIR}
X+ 	chmod 555 ${BINDIR}/math2oogl ${BINDIR}/math12oogl ${BINDIR}/xdisplayhost
X+ 	@echo ""; echo "math2oogl, math12oogl, xdisplayhost installed in ${BINDIR}"; echo ""
X+ 
X+ installdoc: 
X+ 	@echo ''
X  	/bin/rm -f ${DOCDIR}/OOGL.doc
X  	/bin/cp OOGL.doc ${DOCDIR}
X  	chmod 444 ${DOCDIR}/OOGL.doc
X  	@echo ''
X  	@echo 'OOGL.doc installed in ${DOCDIR}'
X  
X  math2oogl.tar.Z:	veryclean
X  	tar cvf - ${DISTFILES} | compress > /tmp/math2oogl.tar.Z
XOnly in .: OOGL12.m
XOnly in .: math12oogl
XOnly in ../tmp/mathoogl: math2oogl
Xdiff -c ../tmp/mathoogl/math2oogl.c ./math2oogl.c
X*** ../tmp/mathoogl/math2oogl.c	Fri Nov 13 01:49:02 1992
X--- ./math2oogl.c	Mon Dec 28 14:30:03 1992
X***************
X*** 16,21 ****
X--- 16,28 ----
X  
X  char timedout[] = "Couldn't start geomview\n";
X  
X+ #ifdef PRESERVE_VERTICAL
X+ /* map mathematica-XYZ -> geomview-YZX to keep the vertical axis upright */
X+ int preserve_vertical = 1;
X+ #else
X+ int preserve_vertical = 0;
X+ #endif
X+ 
X  static void
X  interrupt(int sig) { 
X      write(2, timedout, sizeof(timedout));
X***************
X*** 197,202 ****
X--- 204,210 ----
X  	
X  	{
X  	  struct line *curline;
X+ 	  char* data[3];
X  	  enum st state=IGNORE;
X  	  char coordnum=0;
X  
X***************
X*** 207,217 ****
X  	      printf("\n");
X  	    } else
X  	      if (state == POLYGON) {
X! 		printf("%s",curline->data);
X! 		if(coordnum++%3 == 2)
X! 		  printf("\n");
X! 		else
X! 		  printf(" ");
X  	      }
X  	  }
X  	}
X--- 215,226 ----
X  	      printf("\n");
X  	    } else
X  	      if (state == POLYGON) {
X! 		data[coordnum%3] = curline->data;
X! 		if(++coordnum%3 == 0)
X! 		  if (preserve_vertical)
X! 		    printf("%s %s %s\n", data[1], data[2], data[0]);
X! 		  else
X! 		    printf("%s %s %s\n", data[0], data[1], data[2]);
X  	      }
X  	  }
X  	}
X***************
X*** 308,313 ****
X--- 317,323 ----
X  	}
X  	{
X  	  struct line *curline;
X+ 	  char* data[3];
X  	  enum st state=IGNORE;
X  	  int coordno=0;
X  	  
X***************
X*** 316,322 ****
X  	      state = curline->token;
X  	    else
X  	      if (state == LINE) {
X! 		printf("%s%c",curline->data,((++coordno)%3)?' ':'\n');
X  	      }
X  	  }
X  	}
X--- 326,337 ----
X  	      state = curline->token;
X  	    else
X  	      if (state == LINE) {
X! 		data[coordno%3] = curline->data;
X! 		if(++coordno%3 == 0)
X! 		  if (preserve_vertical)
X! 		    printf("%s %s %s\n", data[1], data[2], data[0]);
X! 		  else
X! 		    printf("%s %s %s\n", data[0], data[1], data[2]);
X  	      }
X  	  }
X  	}
XOnly in .: xdisplayhost
END_OF_mathoogl/mathoogl.patches
if test 5505 -ne `wc -c <mathoogl/mathoogl.patches`; then
    echo shar: \"mathoogl/mathoogl.patches\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f mathoogl/xdisplayhost -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"mathoogl/xdisplayhost\"
else
echo shar: Extracting \"mathoogl/xdisplayhost\" \(129 characters\)
sed "s/^X//" >mathoogl/xdisplayhost <<'END_OF_mathoogl/xdisplayhost'
X#!/bin/sh
X# get hostname from DISPLAY
X
Xif [ "$REMOTEHOST" ]; then
X  echo "$REMOTEHOST"
Xelse
X  expr "$DISPLAY" : '\([^:]*\).*'
Xfi
END_OF_mathoogl/xdisplayhost
if test 129 -ne `wc -c <mathoogl/xdisplayhost`; then
    echo shar: \"mathoogl/xdisplayhost\" unpacked with wrong size!
fi
chmod +x mathoogl/xdisplayhost
# end of overwriting check
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