<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[119764] trunk/dports/gis</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="https://trac.macports.org/changeset/119764">119764</a></dd>
<dt>Author</dt> <dd>pixilla@macports.org</dd>
<dt>Date</dt> <dd>2014-05-05 18:28:38 -0700 (Mon, 05 May 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>gis/terra:
- New port.</pre>

<h3>Added Paths</h3>
<ul>
<li>trunk/dports/gis/terra/</li>
<li><a href="#trunkdportsgisterraPortfile">trunk/dports/gis/terra/Portfile</a></li>
<li>trunk/dports/gis/terra/files/</li>
<li><a href="#trunkdportsgisterrafilesterrapatches">trunk/dports/gis/terra/files/terra.patches</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkdportsgisterraPortfile"></a>
<div class="addfile"><h4>Added: trunk/dports/gis/terra/Portfile (0 => 119764)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/gis/terra/Portfile                                (rev 0)
+++ trunk/dports/gis/terra/Portfile        2014-05-06 01:28:38 UTC (rev 119764)
</span><span class="lines">@@ -0,0 +1,45 @@
</span><ins>+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
+# $Id$
+
+PortSystem          1.0
+
+name                terra
+version             0.7
+
+categories          gis science
+maintainers         gmail.com:tlockhart1976 openmaintainer
+
+description         Generate polygonal approximations of terrains and other height fields.
+
+long_description \
+Generate polygonal approximations of terrains and other height fields. \
+Terra is based on algorithms described in: \
+Fast Polygonal Approximation of Terrains and Height Fields \
+by Michael Garland and Paul Heckbert (Technical Report CMU-CS-95-181).
+
+license             Public Domain
+platforms           darwin
+
+homepage            http://mgarland.org/software/scape.html
+master_sites        http://mgarland.org/dist/
+
+checksums           rmd160  885639282ffe5244f5289ef3f453390c8acdb30f \
+                    sha256  22470e13e1f0659d23dbf7e0ecbfd8f6490bcd1d0a953537c1dfec18f4df3bd7
+
+depends_lib         port:freeglut
+depends_build-append  port:freeglut
+
+worksrcdir          ${name}
+patch.pre_args      -p1
+patchfiles          terra.patches
+use_configure       no
+
+destroot {
+    xinstall -m 755 ${worksrcpath}/terra ${destroot}${prefix}/bin/terra
+    xinstall -m 755 ${worksrcpath}/xterra ${destroot}${prefix}/bin/xterra
+
+    # documentation
+    xinstall -m 755 -d ${destroot}${prefix}/share/${name}
+    xinstall -m 644 ${worksrcpath}/README.html ${destroot}${prefix}/share/${name}
+    xinstall -m 644 ${worksrcpath}/crater.pgm ${destroot}${prefix}/share/${name}
+}
</ins><span class="cx">Property changes on: trunk/dports/gis/terra/Portfile
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnkeywords"></a>
<div class="addfile"><h4>Added: svn:keywords</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkdportsgisterrafilesterrapatches"></a>
<div class="addfile"><h4>Added: trunk/dports/gis/terra/files/terra.patches (0 => 119764)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/gis/terra/files/terra.patches                                (rev 0)
+++ trunk/dports/gis/terra/files/terra.patches        2014-05-06 01:28:38 UTC (rev 119764)
</span><span class="lines">@@ -0,0 +1,545 @@
</span><ins>+diff -u ../terra.orig/Array.h ./Array.h
+--- ../terra.orig/Array.h        1995-12-19 11:24:31.000000000 -0800
++++ ./Array.h        2014-03-18 15:04:25.000000000 -0700
+@@ -1,6 +1,9 @@
+ #ifndef ARRAY_INCLUDED // -*- C++ -*-
+ #define ARRAY_INCLUDED

++#include &lt;memory.h&gt;
++
++
+ //
+ // Array classes
+ //
+diff -u ../terra.orig/GreedyInsert.cc ./GreedyInsert.cc
+--- ../terra.orig/GreedyInsert.cc        1996-01-19 09:07:18.000000000 -0800
++++ ./GreedyInsert.cc        2014-03-18 15:17:36.000000000 -0700
+@@ -1,9 +1,11 @@
+-#include &lt;iostream.h&gt;
++#include &lt;iostream&gt;
+ #include &quot;GreedyInsert.h&quot;
+-
++#include &lt;assert.h&gt;
+ #include &quot;Mask.h&quot;
+ extern ImportMask *MASK;

++using namespace std;
++
+ void TrackedTriangle::update(Subdivision&amp; s)
+ {
+     GreedySubdivision&amp; gs = (GreedySubdivision&amp;)s;
+@@ -209,7 +211,11 @@

+     is_used(sx,sy) = DATA_POINT_USED;
+     count++;
++#if 0
+     return insert(Vec2(sx,sy), t);
++#endif
++    Vec2 vec(sx,sy);
++    return insert(vec, t);
+ }


+Only in .: GreedyInsert.o
+diff -u ../terra.orig/Heap.cc ./Heap.cc
+--- ../terra.orig/Heap.cc        1996-01-09 13:19:08.000000000 -0800
++++ ./Heap.cc        2014-03-18 15:04:25.000000000 -0700
+@@ -1,7 +1,9 @@
+ #include &lt;assert.h&gt;
+-#include &lt;iostream.h&gt;
++#include &lt;iostream&gt;
+ #include &quot;Heap.h&quot;

++using namespace std;
++

+ void Heap::swap(int i,int j)
+ {
+Only in .: Heap.o
+diff -u ../terra.orig/Makefile ./Makefile
+--- ../terra.orig/Makefile        1996-01-30 08:35:20.000000000 -0800
++++ ./Makefile        2014-03-18 16:52:05.000000000 -0700
+@@ -4,23 +4,24 @@
+ # You should change these to fit your system.
+ #

+-CC = cc
+-C++ = CC
++CC = gcc
++C++ = g++

+ # For compiling on SGI's with the pre-5.3 (ie. cfront-based) compiler:
+ # add '-ptr/tmp/terra_ptrepository' to OPTFLAGS
+ # add '-pte.cc' to LFLAGS

+-OPTFLAGS = -g -mips2 
++# OPTFLAGS = -g -mips2 
+ # OPTFLAGS = -O2 -mips2
++OPTFLAGS = -g -Wall

+ GUI_LIBS = -lglut -lGLU -lGL -lXmu -lX11
+-LIBS = -lmalloc -lmx
++LIBS = # -lmalloc -lmx

+ #
+ # This defines the location of the GLUT libraries
+ #
+-ANIM = /afs/cs/project/anim/garland
++ANIM = /opt/local
+ GLUT_FLAGS = 
+ GLUT_INCDIR = $(ANIM)/include
+ GLUT_LIBDIR = $(ANIM)/lib
+@@ -34,7 +35,7 @@
+ #
+ # These are the flags for compilation (CFLAGS) and linking (LFLAGS) 
+ #
+-CFLAGS = $(INCDIR) $(OPTFLAGS) -DSAFETY
++CFLAGS = $(INCDIR) $(OPTFLAGS) -DIOSTREAMH # -DSAFETY
+ LFLAGS = $(LIBDIR) $(OPTFLAGS)


+@@ -81,7 +82,7 @@

+ depend :
+         touch Makefile.depend
+-        makedepend -fMakefile.depend $(INCDIR) -I/usr/include/CC $(BASE_SRCS) $(GUI_SRCS)
++        makedepend -fMakefile.depend $(INCDIR) $(BASE_SRCS) $(GUI_SRCS)
+         /bin/rm -f Makefile.depend.bak

+ sinclude Makefile.depend
+diff -u ../terra.orig/Map.h ./Map.h
+--- ../terra.orig/Map.h        1996-01-30 08:35:21.000000000 -0800
++++ ./Map.h        2014-03-18 15:09:08.000000000 -0700
+@@ -2,10 +2,13 @@
+ #define MAP_INCLUDED

+ #include &lt;stdlib.h&gt;
+-#include &lt;iostream.h&gt;
++#include &lt;iostream&gt;

+ #include &quot;Geom.h&quot;

++using namespace std;
++
++
+ class Map
+ {
+ public:
+Only in .: Map.o
+diff -u ../terra.orig/Mask.cc ./Mask.cc
+--- ../terra.orig/Mask.cc        1996-01-17 08:03:13.000000000 -0800
++++ ./Mask.cc        2014-03-18 15:04:25.000000000 -0700
+@@ -1,10 +1,12 @@
+ #include &lt;math.h&gt;
+ #include &lt;stdlib.h&gt;
+-#include &lt;iostream.h&gt;
++#include &lt;iostream&gt;

+ #include &quot;Geom.h&quot;
+ #include &quot;Mask.h&quot;

++using namespace std;
++

+ RealMask *readMask(istream&amp; in)
+ {
+diff -u ../terra.orig/Mask.h ./Mask.h
+--- ../terra.orig/Mask.h        1996-01-17 08:03:14.000000000 -0800
++++ ./Mask.h        2014-03-18 15:16:16.000000000 -0700
+@@ -1,6 +1,11 @@
+ #ifndef MASK_INCLUDED // -*- C++ -*-
+ #define MASK_INCLUDED

++#include &lt;istream&gt;
++
++using namespace std;
++
++
+ class ImportMask
+ {

+Only in .: Mask.o
+diff -u ../terra.orig/Quadedge.cc ./Quadedge.cc
+--- ../terra.orig/Quadedge.cc        1995-12-19 14:05:48.000000000 -0800
++++ ./Quadedge.cc        2014-03-18 15:04:25.000000000 -0700
+@@ -1,8 +1,10 @@
+ #include &lt;stdlib.h&gt;
+-#include &lt;iostream.h&gt;
++#include &lt;iostream&gt;

+ #include &quot;Quadedge.h&quot;

++using namespace std;
++
+ Edge::Edge(const Edge&amp;)
+ {
+     cerr &lt;&lt; &quot;Edge: Edge assignments are forbidden.&quot; &lt;&lt; endl;
+Only in .: Quadedge.o
+diff -u ../terra.orig/Subdivision.cc ./Subdivision.cc
+--- ../terra.orig/Subdivision.cc        1996-01-30 08:35:22.000000000 -0800
++++ ./Subdivision.cc        2014-04-01 17:12:59.000000000 -0700
+@@ -1,9 +1,10 @@
+ #include &lt;stdlib.h&gt;
+-#include &lt;iostream.h&gt;
++#include &lt;iostream&gt;
+ #include &lt;assert.h&gt;

+ #include &quot;Subdivision.h&quot;

++using namespace std;


+ Edge *Subdivision::makeEdge(Vec2&amp; org, Vec2&amp; dest)
+@@ -105,7 +106,7 @@

+ static void overEdge(Edge *e, edge_callback fn, void *closure)
+ {
+-    if( e-&gt;token != timestamp )
++    if( static_cast&lt;typeof(timestamp)&gt;(e-&gt;token) != timestamp )
+     {
+         e-&gt;token = timestamp;
+         e-&gt;Sym()-&gt;token = timestamp;
+@@ -214,7 +215,7 @@
+         real td = triArea(x, ed-&gt;Dest(), ed-&gt;Org());

+         if (td&gt;0)                       // x is below ed
+-            if (to&gt;0 || to==0 &amp;&amp; t==0) {// x is interior, or origin endpoint
++            if (to&gt;0 || (to==0 &amp;&amp; t==0)) {// x is interior, or origin endpoint
+                 startingEdge = e;
+                 return e;
+             }
+@@ -259,10 +260,12 @@

+     if ( (x == e-&gt;Org()) || (x == e-&gt;Dest()) ) {
+         // point is already in the mesh
++#if 0
+         //
+         cerr &lt;&lt; &quot;WARNING: Tried to reinsert point: &quot; &lt;&lt; x &lt;&lt; endl;
+         cerr &lt;&lt; &quot;         org: &quot; &lt;&lt; e-&gt;Org() &lt;&lt; endl;
+         cerr &lt;&lt; &quot;        dest: &quot; &lt;&lt; e-&gt;Dest() &lt;&lt; endl;
++#endif
+         return NULL;
+     }

+@@ -338,7 +341,9 @@
+     do {

+         Edge *e = spoke-&gt;Lnext();
++#if 0
+         Edge *t = e-&gt;Oprev();
++#endif

+         if( isInterior(e) &amp;&amp; shouldSwap(x, e) )
+             swap(e);
+Only in .: Subdivision.o
+diff -u ../terra.orig/Vec2.h ./Vec2.h
+--- ../terra.orig/Vec2.h        1996-01-30 08:35:24.000000000 -0800
++++ ./Vec2.h        2014-03-18 16:55:04.000000000 -0700
+@@ -1,6 +1,11 @@
+ #ifndef VEC2_INCLUDED // -*- C++ -*-
+ #define VEC2_INCLUDED

++#include &lt;iostream&gt;
++
++using namespace std;
++
++
+ class Vec2 {
+ protected:
+     real elt[2];
+@@ -163,7 +168,13 @@

+ inline istream&amp; operator&gt;&gt;(istream&amp; in, Vec2&amp; v)
+ {
++#if 0
+     return in &gt;&gt; &quot;[&quot; &gt;&gt; v[0] &gt;&gt; v[1] &gt;&gt; &quot;]&quot;;
++#endif
++    in.ignore(1, '[');
++    in &gt;&gt; v[0] &gt;&gt; v[1];
++    in.ignore(1, ']');
++    return in;
+ }
+ #endif

+diff -u ../terra.orig/Vec3.h ./Vec3.h
+--- ../terra.orig/Vec3.h        1995-12-19 11:24:37.000000000 -0800
++++ ./Vec3.h        2014-03-18 16:54:02.000000000 -0700
+@@ -1,6 +1,11 @@
+ #ifndef VEC3_INCLUDED // -*- C++ -*-
+ #define VEC3_INCLUDED

++#include &lt;iostream&gt;
++
++using namespace std;
++
++
+ class Vec3 {
+ protected:
+     real elt[3];
+@@ -173,7 +178,13 @@

+ inline istream&amp; operator&gt;&gt;(istream&amp; in, Vec3&amp; v)
+ {
++#if 0
+     return in &gt;&gt; &quot;[&quot; &gt;&gt; v[0] &gt;&gt; v[1] &gt;&gt; v[2] &gt;&gt; &quot;]&quot;;
++#endif
++    in.ignore(1, '[');
++    in &gt;&gt; v[0] &gt;&gt; v[1];
++    in.ignore(1, ']');
++    return in;
+ }
+ #endif

+Only in .: altadena-lake.osm
+Only in .: altadena.osm
+diff -u ../terra.orig/cmdline.cc ./cmdline.cc
+--- ../terra.orig/cmdline.cc        1996-01-19 10:34:14.000000000 -0800
++++ ./cmdline.cc        2014-04-01 17:11:47.000000000 -0700
+@@ -1,7 +1,9 @@
+ #include &lt;stdlib.h&gt;
+-#include &lt;fstream.h&gt;
++#include &lt;fstream&gt;
+ #include &lt;string.h&gt;
+ #include &quot;terra.h&quot;
++#include &lt;getopt.h&gt;
++

+ GreedySubdivision *mesh;
+ Map *DEM;
+@@ -18,9 +20,9 @@
+ char *mask_filename   = NULL;
+ char *script_filename = NULL;

+-static char *options = &quot;e:p:h:o:m:s:&quot;;
++static const char *options = &quot;e:p:h:o:m:s:&quot;;

+-static char *usage_string =
++static const char *usage_string =
+ &quot;-e &lt;thresh&gt;      Sets the tolerable error threshold\n&quot;
+ &quot;-p &lt;count&gt;       Sets the maximum number of allowable points\n&quot;
+ &quot;-h &lt;factor&gt;      Sets the height scaling factor.  For example,\n&quot;
+@@ -31,7 +33,7 @@
+ &quot;-s &lt;file&gt;        Execute preinsertion script from &lt;file&gt;\n&quot;
+ &quot;\n&quot;;

+-static void usage_error(char *msg = NULL)
++static void usage_error(const char *msg = NULL)
+ {
+     if( msg )
+         cerr &lt;&lt; msg &lt;&lt; endl;
+Only in .: cmdline.o
+diff -u ../terra.orig/glHacks.h ./glHacks.h
+--- ../terra.orig/glHacks.h        1996-01-30 08:35:27.000000000 -0800
++++ ./glHacks.h        2014-03-18 16:55:18.000000000 -0700
+@@ -4,6 +4,9 @@
+ #include &lt;GL/glx.h&gt;
+ #include &lt;GL/gl.h&gt;
+ #include &lt;GL/glu.h&gt;
++#include &lt;iostream&gt;
++
++using namespace std;


+ /*************************************************************************
+Only in .: glHacks.o
+diff -u ../terra.orig/greedy.cc ./greedy.cc
+--- ../terra.orig/greedy.cc        1996-01-19 10:34:15.000000000 -0800
++++ ./greedy.cc        2014-04-01 17:14:20.000000000 -0700
+@@ -1,4 +1,6 @@
+ #include &quot;terra.h&quot;
++#include &lt;fstream&gt;
++

+ void scripted_preinsertion(istream&amp; script)
+ {
+@@ -64,7 +66,7 @@
+ inline int goal_not_met()
+ {
+     return mesh-&gt;maxError() &gt; error_threshold &amp;&amp;
+-           mesh-&gt;pointCount() &lt; point_limit;
++      static_cast&lt;typeof(point_limit)&gt;(mesh-&gt;pointCount()) &lt; point_limit;
+ }

+ static void announce_goal()
+Only in .: greedy.o
+diff -u ../terra.orig/gui.cc ./gui.cc
+--- ../terra.orig/gui.cc        1996-01-30 08:35:28.000000000 -0800
++++ ./gui.cc        2014-04-01 17:10:12.000000000 -0700
+@@ -1,5 +1,5 @@
+-#include &lt;iostream.h&gt;
+-#include &lt;fstream.h&gt;
++#include &lt;iostream&gt;
++#include &lt;fstream&gt;

+ #include &lt;GL/glut.h&gt;
+ #include &quot;glHacks.h&quot;
+@@ -14,6 +14,7 @@
+ int will_draw_dem = False;


++void xglutResize(int width, int height);
+ // Prototype for our hack below.
+ //
+ void xglutKeepAspect(float width, float height);
+@@ -69,10 +70,10 @@
+ {
+     int toggle = glutCreateMenu(mesh_toggle_menu);

+-    glutAddMenuEntry(&quot;Draw DEM data&quot;, (int)&amp;will_draw_dem);
++    glutAddMenuEntry(&quot;Draw DEM data&quot;, will_draw_dem);


+-    int main = glutCreateMenu(mesh_main_menu);
++    glutCreateMenu(mesh_main_menu);
+     glutAddSubMenu(&quot;Toggle&quot;, toggle);

+     glutAddMenuEntry(&quot;Output Mesh EPS&quot;, MESH_MENU_EPS);
+@@ -141,6 +142,7 @@
+       glC(1.0, 0.15, 0.15);
+       mesh-&gt;overEdges(draw_edge);
+     glEnd();
++    glutSwapBuffers();
+ }

+ static inline void redisplay_all(int other)
+@@ -400,7 +402,8 @@

+     // ---------------------------------------------------------------------

+-    glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
++    // glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
++    glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB);
+     mesh_view = glutCreateWindow(&quot;TERRA: Mesh&quot;);

+     xglutKeepAspect(DEM-&gt;width, DEM-&gt;height);
+@@ -408,6 +411,7 @@
+     create_mesh_menus();

+     glutDisplayFunc(mesh_display);
++    glutReshapeFunc(xglutResize);
+     glutMouseFunc(mesh_mouse);

+     glMatrixMode(GL_PROJECTION);
+@@ -433,24 +437,38 @@
+ //
+ ////////////////////////////////////////////////////////////////////////

+-extern &quot;C&quot; {
+-#include &lt;GL/glutint.h&gt;
+-}
+-
+-void xglutKeepAspect(float width, float height)
++void xglutResize(int width, int height)
+ {
+-    Window win;
+-    XSizeHints hints;
++    Map&amp; map = mesh-&gt;getData();
++    real w = (real)map.width;
++    real h = (real)map.height;
++
++    // const float ar_origin = (float) WIDTH / (float) HEIGHT;
++    const float ar_origin = (float) w / (float) h;
++    const float ar_new = (float) width / (float) height;
++
++    float scale_w = (float) width / (float) w;
++    float scale_h = (float) height / (float) h;
++    if (ar_new &gt; ar_origin) {
++        scale_w = scale_h;
++    } else {
++        scale_h = scale_w;
++    }

+-    if( __glutCurrentWindow )
+-    {
+-        win = __glutCurrentWindow-&gt;win;
++    float margin_x = (width - w * scale_w) / 2;
++    float margin_y = (height - h * scale_h) / 2;

++    glViewport(margin_x, margin_y, w * scale_w, h * scale_h);
++    glMatrixMode(GL_PROJECTION);
++    glLoadIdentity();
++    glOrtho(0, w / ar_origin, 0, h / ar_origin, 0, 1.0);

+-        hints.flags = PAspect;
+-        hints.min_aspect.x = hints.max_aspect.x = (int)(1000*width);
+-        hints.min_aspect.y = hints.max_aspect.y = (int)(1000*height);
++    glMatrixMode(GL_MODELVIEW);
++    glLoadIdentity() ;
++}

+-        XSetWMNormalHints(__glutDisplay, win, &amp;hints);
+-    }
++void xglutKeepAspect(float width, float height)
++{
++    int w = glutGet(GLUT_WINDOW_WIDTH);
++    glutReshapeWindow(w, static_cast&lt;int&gt;(floor(width*(height/w)+0.5)));
+ }
+Only in .: gui.o
+Only in .: jpl.osm
+diff -u ../terra.orig/output.cc ./output.cc
+--- ../terra.orig/output.cc        1996-01-30 08:35:30.000000000 -0800
++++ ./output.cc        2014-04-01 17:08:47.000000000 -0700
+@@ -1,8 +1,8 @@
+ #include &quot;terra.h&quot;
+-#include &lt;fstream.h&gt;
++#include &lt;fstream&gt;


+-void generate_output(char *filename, FileFormat format)
++void generate_output(const char *filename, FileFormat format)
+ {
+     if( !filename )
+         filename = output_filename;
+Only in .: output.o
+Only in .: terra
+diff -u ../terra.orig/terra.cc ./terra.cc
+--- ../terra.orig/terra.cc        1996-01-10 13:22:59.000000000 -0800
++++ ./terra.cc        2014-03-18 15:09:42.000000000 -0700
+@@ -1,10 +1,12 @@
+ #include &quot;terra.h&quot;

+-main(int argc, char **argv)
++int main(int argc, char **argv)
+ {
+     process_cmdline(argc, argv);

+     greedy_insertion();

+     generate_output();
++
++    return 0;
+ }
+diff -u ../terra.orig/terra.h ./terra.h
+--- ../terra.orig/terra.h        1996-01-19 10:34:17.000000000 -0800
++++ ./terra.h        2014-04-01 17:08:42.000000000 -0700
+@@ -24,7 +24,7 @@
+ extern void scripted_preinsertion(istream&amp;);
+ extern void subsample_insertion(int target_width);

+-extern void generate_output(char *filename=NULL,
++extern void generate_output(const char *filename=NULL,
+                             FileFormat format=NULLfile);
+ extern void output_tin(ostream&amp;);
+ extern void output_eps(ostream&amp;);
+Only in .: terra.o
+Only in .: xterra
+diff -u ../terra.orig/xterra.cc ./xterra.cc
+--- ../terra.orig/xterra.cc        1995-12-15 11:26:34.000000000 -0800
++++ ./xterra.cc        2014-04-01 17:09:39.000000000 -0700
+@@ -5,7 +5,7 @@



+-main(int argc, char **argv)
++int main(int argc, char **argv)
+ {
+     glutInit(&amp;argc, argv);
+     process_cmdline(argc, argv);
+@@ -15,4 +15,6 @@


+     gui_interact();
++
++    return 0;
+ }
+Only in .: xterra.o
</ins></span></pre>
</div>
</div>

</body>
</html>