Index: trunk/source/visualization/externals/gl2ps/CVS/Entries
===================================================================
--- trunk/source/visualization/externals/gl2ps/CVS/Entries	(revision 1337)
+++ trunk/source/visualization/externals/gl2ps/CVS/Entries	(revision 1340)
@@ -3,4 +3,4 @@
 /CMakeLists.txt/1.1/Wed Sep 29 19:14:00 2010//
 /GNUmakefile/1.5/Thu Sep 30 06:17:28 2010//
-/History/1.16/Thu Sep 30 06:17:28 2010//
 /sources.cmake/1.1/Wed Sep 29 19:14:08 2010//
+/History/1.18/Wed Nov  3 16:40:34 2010//
Index: trunk/source/visualization/externals/gl2ps/History
===================================================================
--- trunk/source/visualization/externals/gl2ps/History	(revision 1337)
+++ trunk/source/visualization/externals/gl2ps/History	(revision 1340)
@@ -1,3 +1,3 @@
-$Id: History,v 1.16 2010/04/26 16:28:18 lgarnier Exp $
+$Id: History,v 1.18 2010/11/03 16:40:34 lgarnier Exp $
 -------------------------------------------------------------------
 
@@ -17,4 +17,11 @@
      * Reverse chronological order (last date on top), please *
      ----------------------------------------------------------
+
+
+3rd November 2010, Laurent Garnier
+- Update gl2ps to 1.3.5 (before it was 1.3.3)
+
+6th October 2010, John Allison  (visexternal-V09-03-00)
+- Tagged.
 
 26th April 2010, Laurent Garnier
Index: trunk/source/visualization/externals/gl2ps/include/CVS/Entries
===================================================================
--- trunk/source/visualization/externals/gl2ps/include/CVS/Entries	(revision 1337)
+++ trunk/source/visualization/externals/gl2ps/include/CVS/Entries	(revision 1340)
@@ -1,4 +1,4 @@
 /G4OpenGL2PSAction.hh/1.4/Thu Sep 30 06:17:28 2010//
-/Geant4_gl2ps.h/1.2/Mon Jul 12 14:53:17 2010//
-/gl2ps.h/1.2/Mon Jul 12 14:53:17 2010//
+/Geant4_gl2ps.h/1.3/Wed Nov  3 15:19:14 2010//
+/gl2ps.h/1.3/Wed Nov  3 16:40:15 2010//
 D
Index: trunk/source/visualization/externals/gl2ps/include/Geant4_gl2ps.h
===================================================================
--- trunk/source/visualization/externals/gl2ps/include/Geant4_gl2ps.h	(revision 1337)
+++ trunk/source/visualization/externals/gl2ps/include/Geant4_gl2ps.h	(revision 1340)
@@ -27,5 +27,5 @@
 #define Geant4_gl2ps_h
 
-// gl2ps-1.3.3
+// gl2ps-1.3.5
 // The gl2ps code is prefixed by Geant4_ in order
 // to avoid clashes with other gl2ps code that may come at link
Index: trunk/source/visualization/externals/gl2ps/include/gl2ps.h
===================================================================
--- trunk/source/visualization/externals/gl2ps/include/gl2ps.h	(revision 1337)
+++ trunk/source/visualization/externals/gl2ps/include/gl2ps.h	(revision 1340)
@@ -53,5 +53,7 @@
  * to provide one.
  *
- * For the latest info about gl2ps, see http://www.geuz.org/gl2ps/.
+ * For the latest info about gl2ps and a full list of contributors,
+ * see http://www.geuz.org/gl2ps/.
+ *
  * Please report all bugs and problems to <gl2ps@geuz.org>.
  */
@@ -68,4 +70,5 @@
 #  if defined(_MSC_VER)
 #    pragma warning(disable:4115)
+#    pragma warning(disable:4996)
 #  endif
 #  include <windows.h>
@@ -103,5 +106,5 @@
 #define GL2PS_MAJOR_VERSION 1
 #define GL2PS_MINOR_VERSION 3
-#define GL2PS_PATCH_VERSION 3
+#define GL2PS_PATCH_VERSION 5
 #define GL2PS_EXTRA_VERSION ""
 
Index: trunk/source/visualization/externals/gl2ps/src/CVS/Entries
===================================================================
--- trunk/source/visualization/externals/gl2ps/src/CVS/Entries	(revision 1337)
+++ trunk/source/visualization/externals/gl2ps/src/CVS/Entries	(revision 1340)
@@ -1,3 +1,3 @@
-/G4OpenGL2PSAction.cc/1.5/Thu Sep 30 06:17:28 2010//
-/gl2ps.cc/1.8/Thu Sep 30 06:17:31 2010//
+/G4OpenGL2PSAction.cc/1.6/Wed Nov  3 16:40:34 2010//
+/gl2ps.cc/1.9/Wed Nov  3 15:22:18 2010//
 D
Index: trunk/source/visualization/externals/gl2ps/src/G4OpenGL2PSAction.cc
===================================================================
--- trunk/source/visualization/externals/gl2ps/src/G4OpenGL2PSAction.cc	(revision 1337)
+++ trunk/source/visualization/externals/gl2ps/src/G4OpenGL2PSAction.cc	(revision 1340)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: G4OpenGL2PSAction.cc,v 1.5 2010/04/26 16:28:18 lgarnier Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// $Id: G4OpenGL2PSAction.cc,v 1.6 2010/11/03 16:40:34 lgarnier Exp $
+// GEANT4 tag $Name:  $
 //
 // 
@@ -139,5 +139,7 @@
   if(!fFile) return;
   int options = GL2PS_OCCLUSION_CULL | 
-     GL2PS_BEST_ROOT | GL2PS_SILENT | GL2PS_DRAW_BACKGROUND;
+    GL2PS_BEST_ROOT | GL2PS_SILENT | GL2PS_DRAW_BACKGROUND | GL2PS_USE_CURRENT_VIEWPORT;
+//   int options = GL2PS_OCCLUSION_CULL | 
+//      GL2PS_BEST_ROOT | GL2PS_SILENT | GL2PS_DRAW_BACKGROUND;
   int sort = GL2PS_BSP_SORT;
   //int sort = GL2PS_SIMPLE_SORT;
Index: trunk/source/visualization/externals/gl2ps/src/gl2ps.cc
===================================================================
--- trunk/source/visualization/externals/gl2ps/src/gl2ps.cc	(revision 1337)
+++ trunk/source/visualization/externals/gl2ps/src/gl2ps.cc	(revision 1340)
@@ -62,29 +62,7 @@
  * to provide one.
  *
- * Contributors:
- *   Michael Sweet <mike@easysw.com>
- *   Marc Ume <marc.ume@digitalgraphics.be>
- *   Jean-Francois Remacle <remacle@gce.ucl.ac.be>
- *   Bart Kaptein <B.L.Kaptein@lumc.nl>
- *   Quy Nguyen-Dai <quy@nguyendai.org>
- *   Sam Buss <sbuss@ucsd.edu>
- *   Shane Hill <Shane.Hill@dsto.defence.gov.au>
- *   Romain Boman <r_boman@yahoo.fr>
- *   Rouben Rostamian <rostamian@umbc.edu>
- *   Diego Santa Cruz <Diego.SantaCruz@epfl.ch>
- *   Shahzad Muzaffar <Shahzad.Muzaffar@cern.ch>
- *   Lassi Tuura <lassi.tuura@cern.ch>
- *   Guy Barrand <barrand@lal.in2p3.fr>
- *   Prabhu Ramachandran <prabhu@aero.iitm.ernet.in>
- *   Micha Bieber <bieber@traits.de>
- *   Olivier Couet <couet@mail.cern.ch>
- *   Shai Ayal <shaiay@gmail.com>
- *   Fabian Wenzel <wenzel@tu-harburg.de>
- *   Ian D. Gay <gay@sfu.ca>
- *   Cosmin Truta <cosmin@cs.toronto.edu>
- *   Baiju Devani <b.devani@gmail.com>
- *   Alexander Danilov <danilov@lanl.gov>
+ * For the latest info about gl2ps and a full list of contributors,
+ * see http://www.geuz.org/gl2ps/.
  *
- * For the latest info about gl2ps, see http://www.geuz.org/gl2ps/.
  * Please report all bugs and problems to <gl2ps@geuz.org>.
  */
@@ -92,5 +70,5 @@
 #include "Geant4_gl2ps.h"
 
-#include <cmath>
+#include <math.h>
 #include <string.h>
 #include <sys/types.h>
@@ -119,5 +97,5 @@
 #define GL2PS_ZOFFSET       5.0e-2F
 #define GL2PS_ZOFFSET_LARGE 20.0F
-#define GL2PS_ZERO(arg)     (std::fabs(arg) < 1.e-20)
+#define GL2PS_ZERO(arg)     (fabs(arg) < 1.e-20)
 
 /* Primitive types */
@@ -349,22 +327,22 @@
   void *ptr;
 
-  if(!size) return(NULL);
+  if(!size) return NULL;
   ptr = malloc(size);
   if(!ptr){
     gl2psMsg(GL2PS_ERROR, "Couldn't allocate requested memory");
-    exit(1);
-  }
-  return(ptr);
+    return NULL;
+  }
+  return ptr;
 }
 
 static void *gl2psRealloc(void *ptr, size_t size)
 {
-  if(!size) return(NULL);
+  if(!size) return NULL;
   ptr = realloc(ptr, size);
   if(!ptr){
     gl2psMsg(GL2PS_ERROR, "Couldn't reallocate requested memory");
-    exit(1);
-  }
-  return(ptr);
+    return NULL;
+  }
+  return ptr;
 }
 
@@ -589,5 +567,5 @@
   list->array = NULL;
   gl2psListRealloc(list, n);
-  return(list);
+  return list;
 }
 
@@ -620,5 +598,5 @@
   if(!list)
     return 0;
-  return(list->n);
+  return list->n;
 }
 
@@ -633,5 +611,5 @@
     return NULL;
   }
-  return(&list->array[index * list->size]);
+  return &list->array[index * list->size];
 }
 
@@ -747,7 +725,7 @@
   
   for(i = 1; i < n; i++){
-    if(std::fabs(rgba[0][0] - rgba[i][0]) > threshold[0] ||
-       std::fabs(rgba[0][1] - rgba[i][1]) > threshold[1] ||
-       std::fabs(rgba[0][2] - rgba[i][2]) > threshold[2])
+    if(fabs(rgba[0][0] - rgba[i][0]) > threshold[0] ||
+       fabs(rgba[0][1] - rgba[i][1]) > threshold[1] ||
+       fabs(rgba[0][2] - rgba[i][2]) > threshold[2])
       return GL_FALSE;
   }
@@ -1105,13 +1083,13 @@
 static GLfloat gl2psComparePointPlane(GL2PSxyz point, GL2PSplane plane)
 {
-  return(plane[0] * point[0] + 
-         plane[1] * point[1] + 
-         plane[2] * point[2] + 
-         plane[3]);
+  return (plane[0] * point[0] + 
+          plane[1] * point[1] + 
+          plane[2] * point[2] + 
+          plane[3]);
 }
 
 static GLfloat gl2psPsca(GLfloat *a, GLfloat *b)
 {
-  return(a[0]*b[0] + a[1]*b[1] + a[2]*b[2]);
+  return (a[0]*b[0] + a[1]*b[1] + a[2]*b[2]);
 }
 
@@ -1451,5 +1429,5 @@
   q = *(GL2PSprimitive**)a;
   w = *(GL2PSprimitive**)b;
-  return(q->type < w->type ? 1 : -1);
+  return (q->type < w->type ? 1 : -1);
 }
 
@@ -1499,5 +1477,6 @@
 }
 
-static void gl2psFreeImagemap(GL2PSimagemap *list){
+static void gl2psFreeImagemap(GL2PSimagemap *list)
+{
   GL2PSimagemap *next;
   while(list != NULL){
@@ -2393,6 +2372,6 @@
         current += 2; used -= 2;
         node->image->height = (GLint)current[2];
-        prim->verts[0].xyz[0] = prim->verts[0].xyz[0] - (int)(node->image->width / 2) + 0.5;
-        prim->verts[0].xyz[1] = prim->verts[0].xyz[1] - (int)(node->image->height / 2) + 0.5;
+        prim->verts[0].xyz[0] = prim->verts[0].xyz[0] - (int)(node->image->width / 2) + 0.5F;
+        prim->verts[0].xyz[1] = prim->verts[0].xyz[1] - (int)(node->image->height / 2) + 0.5F;
         for(i = 1; i < 4; i++){
           for(v = 0; v < 3; v++){
@@ -2490,5 +2469,5 @@
       for(col = 0; col < width; col++){ 
         gl2psGetRGB(im, col, row, &dr, &dg, &db);
-        fgrey = (0.30 * dr + 0.59 * dg + 0.11 * db);
+        fgrey = (0.30F * dr + 0.59F * dg + 0.11F * db);
         grey = (unsigned char)(255. * fgrey);
         gl2psWriteByte(grey);
@@ -3353,5 +3332,5 @@
 }
 
-static void gl2psPrintTeXBeginViewport(GLint [4])
+static void gl2psPrintTeXBeginViewport(GLint viewport[4])
 {
   glRenderMode(GL_FEEDBACK);
@@ -3446,21 +3425,37 @@
 static void gl2psPutPDFText(GL2PSstring *text, int cnt, GLfloat x, GLfloat y)
 {
-  gl2ps->streamlength += 
-    gl2psPrintf("BT\n"
-                "/F%d %d Tf\n"
-                "%f %f Td\n"
-                "(%s) Tj\n"
-                "ET\n", 
-                cnt, text->fontsize, x, y, text->str);  
+  GLfloat rad, crad, srad;
+  
+  if(text->angle == 0.0F){
+    gl2ps->streamlength += gl2psPrintf
+      ("BT\n"
+       "/F%d %d Tf\n"
+       "%f %f Td\n"
+       "(%s) Tj\n"
+       "ET\n", 
+       cnt, text->fontsize, x, y, text->str);
+  }
+  else{
+    rad = M_PI * text->angle / 180.0F;
+    srad = (GLfloat)sin(rad);
+    crad = (GLfloat)cos(rad);
+    gl2ps->streamlength += gl2psPrintf
+      ("BT\n"
+       "/F%d %d Tf\n"
+       "%f %f %f %f %f %f Tm\n"
+       "(%s) Tj\n"
+       "ET\n",
+       cnt, text->fontsize, crad, srad, -srad, crad, x, y, text->str);
+  }
 }
 
 static void gl2psPutPDFImage(GL2PSimage *image, int cnt, GLfloat x, GLfloat y)
 {
-  gl2ps->streamlength += 
-    gl2psPrintf("q\n"
-                "%d 0 0 %d %f %f cm\n"
-                "/Im%d Do\n"
-                "Q\n",
-                (int)image->width, (int)image->height, x, y, cnt);
+  gl2ps->streamlength += gl2psPrintf
+    ("q\n"
+     "%d 0 0 %d %f %f cm\n"
+     "/Im%d Do\n"
+     "Q\n",
+     (int)image->width, (int)image->height, x, y, cnt);
 }
 
@@ -4526,5 +4521,5 @@
                                          int gray)
 {
-  int x, y;
+  int x, y, shift;
   GLfloat r, g, b, a;
 
@@ -4532,19 +4527,21 @@
     return 0;
 
-  if(gray && gray !=8 && gray != 16)
+  if(gray && gray != 8 && gray != 16)
     gray = 8;
 
   gray /= 8;
   
+  shift = (sizeof(unsigned long) - 1) * 8;
+
   for(y = 0; y < im->height; ++y){
     for(x = 0; x < im->width; ++x){
       a = gl2psGetRGB(im, x, y, &r, &g, &b);
       if(im->format == GL_RGBA && gray){
-        (*action)((unsigned long)(a*255) << 24, gray);
+        (*action)((unsigned long)(a * 255) << shift, gray);
       }
       else{
-        (*action)((unsigned long)(r*255) << 24, 1);
-        (*action)((unsigned long)(g*255) << 24, 1);
-        (*action)((unsigned long)(b*255) << 24, 1);
+        (*action)((unsigned long)(r * 255) << shift, 1);
+        (*action)((unsigned long)(g * 255) << shift, 1);
+        (*action)((unsigned long)(b * 255) << shift, 1);
       }
     }
@@ -4962,44 +4959,44 @@
     for(i = 0; i < 3; i++){
       xyz2[0][i] = xyz[0][i]; 
-      xyz2[1][i] = 0.5 * (xyz[0][i] + xyz[1][i]);
-      xyz2[2][i] = 0.5 * (xyz[0][i] + xyz[2][i]);
+      xyz2[1][i] = 0.5F * (xyz[0][i] + xyz[1][i]);
+      xyz2[2][i] = 0.5F * (xyz[0][i] + xyz[2][i]);
     }
     for(i = 0; i < 4; i++){
       rgba2[0][i] = rgba[0][i]; 
-      rgba2[1][i] = 0.5 * (rgba[0][i] + rgba[1][i]);
-      rgba2[2][i] = 0.5 * (rgba[0][i] + rgba[2][i]);
+      rgba2[1][i] = 0.5F * (rgba[0][i] + rgba[1][i]);
+      rgba2[2][i] = 0.5F * (rgba[0][i] + rgba[2][i]);
     }
     gl2psPrintSVGSmoothTriangle(xyz2, rgba2);
     for(i = 0; i < 3; i++){
-      xyz2[0][i] = 0.5 * (xyz[0][i] + xyz[1][i]);
+      xyz2[0][i] = 0.5F * (xyz[0][i] + xyz[1][i]);
       xyz2[1][i] = xyz[1][i]; 
-      xyz2[2][i] = 0.5 * (xyz[1][i] + xyz[2][i]);
+      xyz2[2][i] = 0.5F * (xyz[1][i] + xyz[2][i]);
     }
     for(i = 0; i < 4; i++){
-      rgba2[0][i] = 0.5 * (rgba[0][i] + rgba[1][i]);
+      rgba2[0][i] = 0.5F * (rgba[0][i] + rgba[1][i]);
       rgba2[1][i] = rgba[1][i]; 
-      rgba2[2][i] = 0.5 * (rgba[1][i] + rgba[2][i]);
+      rgba2[2][i] = 0.5F * (rgba[1][i] + rgba[2][i]);
     }
     gl2psPrintSVGSmoothTriangle(xyz2, rgba2);
     for(i = 0; i < 3; i++){
-      xyz2[0][i] = 0.5 * (xyz[0][i] + xyz[2][i]);
+      xyz2[0][i] = 0.5F * (xyz[0][i] + xyz[2][i]);
       xyz2[1][i] = xyz[2][i]; 
-      xyz2[2][i] = 0.5 * (xyz[1][i] + xyz[2][i]);
+      xyz2[2][i] = 0.5F * (xyz[1][i] + xyz[2][i]);
     }
     for(i = 0; i < 4; i++){
-      rgba2[0][i] = 0.5 * (rgba[0][i] + rgba[2][i]);
+      rgba2[0][i] = 0.5F * (rgba[0][i] + rgba[2][i]);
       rgba2[1][i] = rgba[2][i]; 
-      rgba2[2][i] = 0.5 * (rgba[1][i] + rgba[2][i]);
+      rgba2[2][i] = 0.5F * (rgba[1][i] + rgba[2][i]);
     }
     gl2psPrintSVGSmoothTriangle(xyz2, rgba2);
     for(i = 0; i < 3; i++){
-      xyz2[0][i] = 0.5 * (xyz[0][i] + xyz[1][i]);
-      xyz2[1][i] = 0.5 * (xyz[1][i] + xyz[2][i]); 
-      xyz2[2][i] = 0.5 * (xyz[0][i] + xyz[2][i]);
+      xyz2[0][i] = 0.5F * (xyz[0][i] + xyz[1][i]);
+      xyz2[1][i] = 0.5F * (xyz[1][i] + xyz[2][i]); 
+      xyz2[2][i] = 0.5F * (xyz[0][i] + xyz[2][i]);
     }
     for(i = 0; i < 4; i++){
-      rgba2[0][i] = 0.5 * (rgba[0][i] + rgba[1][i]);
-      rgba2[1][i] = 0.5 * (rgba[1][i] + rgba[2][i]); 
-      rgba2[2][i] = 0.5 * (rgba[0][i] + rgba[2][i]);
+      rgba2[0][i] = 0.5F * (rgba[0][i] + rgba[1][i]);
+      rgba2[1][i] = 0.5F * (rgba[1][i] + rgba[2][i]); 
+      rgba2[2][i] = 0.5F * (rgba[0][i] + rgba[2][i]);
     }
     gl2psPrintSVGSmoothTriangle(xyz2, rgba2);
@@ -5035,9 +5032,5 @@
 }
 
-#if defined(GL2PS_HAVE_LIBPNG)
 static void gl2psPrintSVGPixmap(GLfloat x, GLfloat y, GL2PSimage *pixmap)
-#else
-static void gl2psPrintSVGPixmap(GLfloat, GLfloat, GL2PSimage *)
-#endif
 {
 #if defined(GL2PS_HAVE_LIBPNG)
@@ -5066,5 +5059,5 @@
   gl2psListDelete(png);
 #else
-  gl2psMsg(GL2PS_WARNING, "GL2PS has to be compiled with PNG support in "
+  gl2psMsg(GL2PS_WARNING, "GL2PS must be compiled with PNG support in "
            "order to embed images in SVG streams");
 #endif
@@ -5144,4 +5137,7 @@
     gl2psPrintf("<text fill=\"%s\" x=\"%g\" y=\"%g\" font-size=\"%d\" ",
                 col, xyz[0][0], xyz[0][1], prim->data.text->fontsize);
+    if(prim->data.text->angle)
+      gl2psPrintf("transform=\"rotate(%g, %g, %g)\" ",
+                  -prim->data.text->angle, xyz[0][0], xyz[0][1]);
     if(!strcmp(prim->data.text->fontname, "Times-Roman"))
       gl2psPrintf("font-family=\"Times\">");
Index: trunk/source/visualization/externals/zlib/CVS/Entries
===================================================================
--- trunk/source/visualization/externals/zlib/CVS/Entries	(revision 1337)
+++ trunk/source/visualization/externals/zlib/CVS/Entries	(revision 1340)
@@ -1,7 +1,7 @@
 D/include////
 D/src////
-/CMakeLists.txt/1.1/Wed Sep 29 19:14:16 2010//
 /GNUmakefile/1.1/Thu Sep 30 06:17:31 2010//
 /History/1.1/Thu Sep 30 06:17:31 2010//
 /README/1.1/Mon Jul 12 14:53:17 2010//
 /sources.cmake/1.1/Wed Sep 29 19:14:24 2010//
+/CMakeLists.txt/1.2/Fri Oct  8 10:03:41 2010//
