<p><b>dwj07@fsu.edu</b> 2013-02-08 12:40:42 -0700 (Fri, 08 Feb 2013)</p><p><br>
        -- BRANCH COMMIT --<br>
<br>
        Adding the capability to having MpasDraw save a single screenshot and then exit.<br>
</p><hr noshade><pre><font color="gray">Modified: branches/tools/mpas_draw/README
===================================================================
--- branches/tools/mpas_draw/README        2013-02-07 17:03:30 UTC (rev 2456)
+++ branches/tools/mpas_draw/README        2013-02-08 19:40:42 UTC (rev 2457)
@@ -11,11 +11,13 @@
                 The program should build for you, and the executable will be named MpasDraw.x
 
         To Run:
-                ./MpasDraw.x [file-path]
+                ./MpasDraw.x [file-path] [arg]
 
                 [file-path] is an optional argument, that is the path to the mpas grid or output file you are trying to
                 visualize. Optinally, you can input this once the program is running.
 
+                [arg] is an optional argument. Enter any value to cause MpasDraw to save a single screenshot of the starting image and exit.
+
         Usage:
                 Once inside the program, you can use the following keys to control the plot.
 

Modified: branches/tools/mpas_draw/mpas_draw.cpp
===================================================================
--- branches/tools/mpas_draw/mpas_draw.cpp        2013-02-07 17:03:30 UTC (rev 2456)
+++ branches/tools/mpas_draw/mpas_draw.cpp        2013-02-08 19:40:42 UTC (rev 2457)
@@ -27,7 +27,7 @@
 void mouse ( int btn, int state, int x, int y );
 void gl_init ( );
 void myReshape ( int w, int h );
-void spin_image ( );
+void single_screenshot ( );
 void timestamp ( );
 
 void build_connectivity();
@@ -97,7 +97,8 @@
 double projElevation        = 0.0;
 double projAzimuth                = 0.0;
 
-bool spinning = false;
+bool single_ss = false;
+int loop_it = 0;
 static GLfloat theta[3] = { 0.0, 0.0, 0.0 };
 double theta_speed = 0.020;
 
@@ -227,10 +228,15 @@
 
                 cin &gt;&gt; filename;
         }
-        else
+        else if (argc == 2)
         {
                 filename = argv[1];
         }
+        else if (argc == 3)
+        {
+                filename = argv[1];
+                single_ss = true;
+        }
 
         build_connectivity();
         setup_ranges();
@@ -248,7 +254,7 @@
         window = glutCreateWindow ( filename.c_str ( ) );
         glutReshapeFunc ( myReshape );
         glutDisplayFunc ( display );
-        glutIdleFunc ( spin_image );
+        glutIdleFunc ( single_screenshot );
         glutMouseFunc ( mouse );
         glutKeyboardFunc( keyPressed );
         glutSpecialFunc( arrowKeys );
@@ -389,14 +395,6 @@
         if ( ( btn == GLUT_LEFT_BUTTON   &amp;&amp; state == GLUT_DOWN ) ||
                         ( btn == GLUT_MIDDLE_BUTTON &amp;&amp; state == GLUT_DOWN ) ||
                         ( btn == GLUT_RIGHT_BUTTON  &amp;&amp; state == GLUT_DOWN ) ) {
-                if ( spinning )        {
-                        spinning = false;
-                        theta_speed = 0.0;
-                } else {
-                        spinning = true;
-                        theta_speed = 0.020;
-                        axis = axis + 1;
-                }
         }
 
         axis = axis % 3;
@@ -530,37 +528,35 @@
 
         return;
 }/*}}}*/
-void spin_image ( ){/*{{{*/
+void single_screenshot ( ){/*{{{*/
 
         //****************************************************************************80
         //
         //  Purpose:
         //
-        //    SPIN_IMAGE adjusts the angle of rotation and redisplays the picture.
+        //    SINGLE_SCREENSHOT takes a single screenshot of the grid, and exits mpas_draw
         //
         //  Modified:
         //
-        //    15 December 2008
+        //    02/08/13
         //
         //  Author:
         //
-        //    John Burkardt
+        //    Doug Jacobsen
         //
-        //  Reference:
-        //
-        //    Edward Angel,
-        //    Interactive Computer Graphics:
-        //    A Top-Down Approach with OpenGL,
-        //    Second Edition,
-        //    Addison Wesley, 2000.
-        //
-        theta[axis] = theta[axis] + theta_speed;
+        
+        color_mesh();
+        glutPostRedisplay ( );
 
-        if ( 360.0 &lt; theta[axis] )
-        {
-                theta[axis] = theta[axis] - 360.0;
+        if(single_ss){
+                if(loop_it == 3){
+                        char filename[100];
+                        sprintf(filename, &quot;ss.%04d.tga&quot;, cur_screenshot);
+                        screenshot(filename, 800, 800);
+                        exit(0);
+                }
+                loop_it++;
         }
-        glutPostRedisplay ( );
 
         return;
 }/*}}}*/

</font>
</pre>