Ignore:
Timestamp:
Nov 5, 2010, 3:45:55 PM (14 years ago)
Author:
garnier
Message:

update ti head

Location:
trunk/source/visualization/externals
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/visualization/externals/gl2ps/CVS/Entries

    r1337 r1340  
    33/CMakeLists.txt/1.1/Wed Sep 29 19:14:00 2010//
    44/GNUmakefile/1.5/Thu Sep 30 06:17:28 2010//
    5 /History/1.16/Thu Sep 30 06:17:28 2010//
    65/sources.cmake/1.1/Wed Sep 29 19:14:08 2010//
     6/History/1.18/Wed Nov  3 16:40:34 2010//
  • trunk/source/visualization/externals/gl2ps/History

    r1246 r1340  
    1 $Id: History,v 1.16 2010/04/26 16:28:18 lgarnier Exp $
     1$Id: History,v 1.18 2010/11/03 16:40:34 lgarnier Exp $
    22-------------------------------------------------------------------
    33
     
    1717     * Reverse chronological order (last date on top), please *
    1818     ----------------------------------------------------------
     19
     20
     213rd November 2010, Laurent Garnier
     22- Update gl2ps to 1.3.5 (before it was 1.3.3)
     23
     246th October 2010, John Allison  (visexternal-V09-03-00)
     25- Tagged.
    1926
    202726th April 2010, Laurent Garnier
  • trunk/source/visualization/externals/gl2ps/include/CVS/Entries

    r1337 r1340  
    11/G4OpenGL2PSAction.hh/1.4/Thu Sep 30 06:17:28 2010//
    2 /Geant4_gl2ps.h/1.2/Mon Jul 12 14:53:17 2010//
    3 /gl2ps.h/1.2/Mon Jul 12 14:53:17 2010//
     2/Geant4_gl2ps.h/1.3/Wed Nov  3 15:19:14 2010//
     3/gl2ps.h/1.3/Wed Nov  3 16:40:15 2010//
    44D
  • trunk/source/visualization/externals/gl2ps/include/Geant4_gl2ps.h

    r937 r1340  
    2727#define Geant4_gl2ps_h
    2828
    29 // gl2ps-1.3.3
     29// gl2ps-1.3.5
    3030// The gl2ps code is prefixed by Geant4_ in order
    3131// to avoid clashes with other gl2ps code that may come at link
  • trunk/source/visualization/externals/gl2ps/include/gl2ps.h

    r937 r1340  
    5353 * to provide one.
    5454 *
    55  * For the latest info about gl2ps, see http://www.geuz.org/gl2ps/.
     55 * For the latest info about gl2ps and a full list of contributors,
     56 * see http://www.geuz.org/gl2ps/.
     57 *
    5658 * Please report all bugs and problems to <gl2ps@geuz.org>.
    5759 */
     
    6870#  if defined(_MSC_VER)
    6971#    pragma warning(disable:4115)
     72#    pragma warning(disable:4996)
    7073#  endif
    7174#  include <windows.h>
     
    103106#define GL2PS_MAJOR_VERSION 1
    104107#define GL2PS_MINOR_VERSION 3
    105 #define GL2PS_PATCH_VERSION 3
     108#define GL2PS_PATCH_VERSION 5
    106109#define GL2PS_EXTRA_VERSION ""
    107110
  • trunk/source/visualization/externals/gl2ps/src/CVS/Entries

    r1337 r1340  
    1 /G4OpenGL2PSAction.cc/1.5/Thu Sep 30 06:17:28 2010//
    2 /gl2ps.cc/1.8/Thu Sep 30 06:17:31 2010//
     1/G4OpenGL2PSAction.cc/1.6/Wed Nov  3 16:40:34 2010//
     2/gl2ps.cc/1.9/Wed Nov  3 15:22:18 2010//
    33D
  • trunk/source/visualization/externals/gl2ps/src/G4OpenGL2PSAction.cc

    r1337 r1340  
    2525//
    2626//
    27 // $Id: G4OpenGL2PSAction.cc,v 1.5 2010/04/26 16:28:18 lgarnier Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     27// $Id: G4OpenGL2PSAction.cc,v 1.6 2010/11/03 16:40:34 lgarnier Exp $
     28// GEANT4 tag $Name: $
    2929//
    3030//
     
    139139  if(!fFile) return;
    140140  int options = GL2PS_OCCLUSION_CULL |
    141      GL2PS_BEST_ROOT | GL2PS_SILENT | GL2PS_DRAW_BACKGROUND;
     141    GL2PS_BEST_ROOT | GL2PS_SILENT | GL2PS_DRAW_BACKGROUND | GL2PS_USE_CURRENT_VIEWPORT;
     142//   int options = GL2PS_OCCLUSION_CULL |
     143//      GL2PS_BEST_ROOT | GL2PS_SILENT | GL2PS_DRAW_BACKGROUND;
    142144  int sort = GL2PS_BSP_SORT;
    143145  //int sort = GL2PS_SIMPLE_SORT;
  • trunk/source/visualization/externals/gl2ps/src/gl2ps.cc

    r1228 r1340  
    6262 * to provide one.
    6363 *
    64  * Contributors:
    65  *   Michael Sweet <mike@easysw.com>
    66  *   Marc Ume <marc.ume@digitalgraphics.be>
    67  *   Jean-Francois Remacle <remacle@gce.ucl.ac.be>
    68  *   Bart Kaptein <B.L.Kaptein@lumc.nl>
    69  *   Quy Nguyen-Dai <quy@nguyendai.org>
    70  *   Sam Buss <sbuss@ucsd.edu>
    71  *   Shane Hill <Shane.Hill@dsto.defence.gov.au>
    72  *   Romain Boman <r_boman@yahoo.fr>
    73  *   Rouben Rostamian <rostamian@umbc.edu>
    74  *   Diego Santa Cruz <Diego.SantaCruz@epfl.ch>
    75  *   Shahzad Muzaffar <Shahzad.Muzaffar@cern.ch>
    76  *   Lassi Tuura <lassi.tuura@cern.ch>
    77  *   Guy Barrand <barrand@lal.in2p3.fr>
    78  *   Prabhu Ramachandran <prabhu@aero.iitm.ernet.in>
    79  *   Micha Bieber <bieber@traits.de>
    80  *   Olivier Couet <couet@mail.cern.ch>
    81  *   Shai Ayal <shaiay@gmail.com>
    82  *   Fabian Wenzel <wenzel@tu-harburg.de>
    83  *   Ian D. Gay <gay@sfu.ca>
    84  *   Cosmin Truta <cosmin@cs.toronto.edu>
    85  *   Baiju Devani <b.devani@gmail.com>
    86  *   Alexander Danilov <danilov@lanl.gov>
     64 * For the latest info about gl2ps and a full list of contributors,
     65 * see http://www.geuz.org/gl2ps/.
    8766 *
    88  * For the latest info about gl2ps, see http://www.geuz.org/gl2ps/.
    8967 * Please report all bugs and problems to <gl2ps@geuz.org>.
    9068 */
     
    9270#include "Geant4_gl2ps.h"
    9371
    94 #include <cmath>
     72#include <math.h>
    9573#include <string.h>
    9674#include <sys/types.h>
     
    11997#define GL2PS_ZOFFSET       5.0e-2F
    12098#define GL2PS_ZOFFSET_LARGE 20.0F
    121 #define GL2PS_ZERO(arg)     (std::fabs(arg) < 1.e-20)
     99#define GL2PS_ZERO(arg)     (fabs(arg) < 1.e-20)
    122100
    123101/* Primitive types */
     
    349327  void *ptr;
    350328
    351   if(!size) return(NULL);
     329  if(!size) return NULL;
    352330  ptr = malloc(size);
    353331  if(!ptr){
    354332    gl2psMsg(GL2PS_ERROR, "Couldn't allocate requested memory");
    355     exit(1);
    356   }
    357   return(ptr);
     333    return NULL;
     334  }
     335  return ptr;
    358336}
    359337
    360338static void *gl2psRealloc(void *ptr, size_t size)
    361339{
    362   if(!size) return(NULL);
     340  if(!size) return NULL;
    363341  ptr = realloc(ptr, size);
    364342  if(!ptr){
    365343    gl2psMsg(GL2PS_ERROR, "Couldn't reallocate requested memory");
    366     exit(1);
    367   }
    368   return(ptr);
     344    return NULL;
     345  }
     346  return ptr;
    369347}
    370348
     
    589567  list->array = NULL;
    590568  gl2psListRealloc(list, n);
    591   return(list);
     569  return list;
    592570}
    593571
     
    620598  if(!list)
    621599    return 0;
    622   return(list->n);
     600  return list->n;
    623601}
    624602
     
    633611    return NULL;
    634612  }
    635   return(&list->array[index * list->size]);
     613  return &list->array[index * list->size];
    636614}
    637615
     
    747725 
    748726  for(i = 1; i < n; i++){
    749     if(std::fabs(rgba[0][0] - rgba[i][0]) > threshold[0] ||
    750        std::fabs(rgba[0][1] - rgba[i][1]) > threshold[1] ||
    751        std::fabs(rgba[0][2] - rgba[i][2]) > threshold[2])
     727    if(fabs(rgba[0][0] - rgba[i][0]) > threshold[0] ||
     728       fabs(rgba[0][1] - rgba[i][1]) > threshold[1] ||
     729       fabs(rgba[0][2] - rgba[i][2]) > threshold[2])
    752730      return GL_FALSE;
    753731  }
     
    11051083static GLfloat gl2psComparePointPlane(GL2PSxyz point, GL2PSplane plane)
    11061084{
    1107   return(plane[0] * point[0] +
    1108          plane[1] * point[1] +
    1109          plane[2] * point[2] +
    1110          plane[3]);
     1085  return (plane[0] * point[0] +
     1086          plane[1] * point[1] +
     1087          plane[2] * point[2] +
     1088          plane[3]);
    11111089}
    11121090
    11131091static GLfloat gl2psPsca(GLfloat *a, GLfloat *b)
    11141092{
    1115   return(a[0]*b[0] + a[1]*b[1] + a[2]*b[2]);
     1093  return (a[0]*b[0] + a[1]*b[1] + a[2]*b[2]);
    11161094}
    11171095
     
    14511429  q = *(GL2PSprimitive**)a;
    14521430  w = *(GL2PSprimitive**)b;
    1453   return(q->type < w->type ? 1 : -1);
     1431  return (q->type < w->type ? 1 : -1);
    14541432}
    14551433
     
    14991477}
    15001478
    1501 static void gl2psFreeImagemap(GL2PSimagemap *list){
     1479static void gl2psFreeImagemap(GL2PSimagemap *list)
     1480{
    15021481  GL2PSimagemap *next;
    15031482  while(list != NULL){
     
    23932372        current += 2; used -= 2;
    23942373        node->image->height = (GLint)current[2];
    2395         prim->verts[0].xyz[0] = prim->verts[0].xyz[0] - (int)(node->image->width / 2) + 0.5;
    2396         prim->verts[0].xyz[1] = prim->verts[0].xyz[1] - (int)(node->image->height / 2) + 0.5;
     2374        prim->verts[0].xyz[0] = prim->verts[0].xyz[0] - (int)(node->image->width / 2) + 0.5F;
     2375        prim->verts[0].xyz[1] = prim->verts[0].xyz[1] - (int)(node->image->height / 2) + 0.5F;
    23972376        for(i = 1; i < 4; i++){
    23982377          for(v = 0; v < 3; v++){
     
    24902469      for(col = 0; col < width; col++){
    24912470        gl2psGetRGB(im, col, row, &dr, &dg, &db);
    2492         fgrey = (0.30 * dr + 0.59 * dg + 0.11 * db);
     2471        fgrey = (0.30F * dr + 0.59F * dg + 0.11F * db);
    24932472        grey = (unsigned char)(255. * fgrey);
    24942473        gl2psWriteByte(grey);
     
    33533332}
    33543333
    3355 static void gl2psPrintTeXBeginViewport(GLint [4])
     3334static void gl2psPrintTeXBeginViewport(GLint viewport[4])
    33563335{
    33573336  glRenderMode(GL_FEEDBACK);
     
    34463425static void gl2psPutPDFText(GL2PSstring *text, int cnt, GLfloat x, GLfloat y)
    34473426{
    3448   gl2ps->streamlength +=
    3449     gl2psPrintf("BT\n"
    3450                 "/F%d %d Tf\n"
    3451                 "%f %f Td\n"
    3452                 "(%s) Tj\n"
    3453                 "ET\n",
    3454                 cnt, text->fontsize, x, y, text->str); 
     3427  GLfloat rad, crad, srad;
     3428 
     3429  if(text->angle == 0.0F){
     3430    gl2ps->streamlength += gl2psPrintf
     3431      ("BT\n"
     3432       "/F%d %d Tf\n"
     3433       "%f %f Td\n"
     3434       "(%s) Tj\n"
     3435       "ET\n",
     3436       cnt, text->fontsize, x, y, text->str);
     3437  }
     3438  else{
     3439    rad = M_PI * text->angle / 180.0F;
     3440    srad = (GLfloat)sin(rad);
     3441    crad = (GLfloat)cos(rad);
     3442    gl2ps->streamlength += gl2psPrintf
     3443      ("BT\n"
     3444       "/F%d %d Tf\n"
     3445       "%f %f %f %f %f %f Tm\n"
     3446       "(%s) Tj\n"
     3447       "ET\n",
     3448       cnt, text->fontsize, crad, srad, -srad, crad, x, y, text->str);
     3449  }
    34553450}
    34563451
    34573452static void gl2psPutPDFImage(GL2PSimage *image, int cnt, GLfloat x, GLfloat y)
    34583453{
    3459   gl2ps->streamlength +=
    3460     gl2psPrintf("q\n"
    3461                 "%d 0 0 %d %f %f cm\n"
    3462                 "/Im%d Do\n"
    3463                 "Q\n",
    3464                 (int)image->width, (int)image->height, x, y, cnt);
     3454  gl2ps->streamlength += gl2psPrintf
     3455    ("q\n"
     3456     "%d 0 0 %d %f %f cm\n"
     3457     "/Im%d Do\n"
     3458     "Q\n",
     3459     (int)image->width, (int)image->height, x, y, cnt);
    34653460}
    34663461
     
    45264521                                         int gray)
    45274522{
    4528   int x, y;
     4523  int x, y, shift;
    45294524  GLfloat r, g, b, a;
    45304525
     
    45324527    return 0;
    45334528
    4534   if(gray && gray !=8 && gray != 16)
     4529  if(gray && gray != 8 && gray != 16)
    45354530    gray = 8;
    45364531
    45374532  gray /= 8;
    45384533 
     4534  shift = (sizeof(unsigned long) - 1) * 8;
     4535
    45394536  for(y = 0; y < im->height; ++y){
    45404537    for(x = 0; x < im->width; ++x){
    45414538      a = gl2psGetRGB(im, x, y, &r, &g, &b);
    45424539      if(im->format == GL_RGBA && gray){
    4543         (*action)((unsigned long)(a*255) << 24, gray);
     4540        (*action)((unsigned long)(a * 255) << shift, gray);
    45444541      }
    45454542      else{
    4546         (*action)((unsigned long)(r*255) << 24, 1);
    4547         (*action)((unsigned long)(g*255) << 24, 1);
    4548         (*action)((unsigned long)(b*255) << 24, 1);
     4543        (*action)((unsigned long)(r * 255) << shift, 1);
     4544        (*action)((unsigned long)(g * 255) << shift, 1);
     4545        (*action)((unsigned long)(b * 255) << shift, 1);
    45494546      }
    45504547    }
     
    49624959    for(i = 0; i < 3; i++){
    49634960      xyz2[0][i] = xyz[0][i];
    4964       xyz2[1][i] = 0.5 * (xyz[0][i] + xyz[1][i]);
    4965       xyz2[2][i] = 0.5 * (xyz[0][i] + xyz[2][i]);
     4961      xyz2[1][i] = 0.5F * (xyz[0][i] + xyz[1][i]);
     4962      xyz2[2][i] = 0.5F * (xyz[0][i] + xyz[2][i]);
    49664963    }
    49674964    for(i = 0; i < 4; i++){
    49684965      rgba2[0][i] = rgba[0][i];
    4969       rgba2[1][i] = 0.5 * (rgba[0][i] + rgba[1][i]);
    4970       rgba2[2][i] = 0.5 * (rgba[0][i] + rgba[2][i]);
     4966      rgba2[1][i] = 0.5F * (rgba[0][i] + rgba[1][i]);
     4967      rgba2[2][i] = 0.5F * (rgba[0][i] + rgba[2][i]);
    49714968    }
    49724969    gl2psPrintSVGSmoothTriangle(xyz2, rgba2);
    49734970    for(i = 0; i < 3; i++){
    4974       xyz2[0][i] = 0.5 * (xyz[0][i] + xyz[1][i]);
     4971      xyz2[0][i] = 0.5F * (xyz[0][i] + xyz[1][i]);
    49754972      xyz2[1][i] = xyz[1][i];
    4976       xyz2[2][i] = 0.5 * (xyz[1][i] + xyz[2][i]);
     4973      xyz2[2][i] = 0.5F * (xyz[1][i] + xyz[2][i]);
    49774974    }
    49784975    for(i = 0; i < 4; i++){
    4979       rgba2[0][i] = 0.5 * (rgba[0][i] + rgba[1][i]);
     4976      rgba2[0][i] = 0.5F * (rgba[0][i] + rgba[1][i]);
    49804977      rgba2[1][i] = rgba[1][i];
    4981       rgba2[2][i] = 0.5 * (rgba[1][i] + rgba[2][i]);
     4978      rgba2[2][i] = 0.5F * (rgba[1][i] + rgba[2][i]);
    49824979    }
    49834980    gl2psPrintSVGSmoothTriangle(xyz2, rgba2);
    49844981    for(i = 0; i < 3; i++){
    4985       xyz2[0][i] = 0.5 * (xyz[0][i] + xyz[2][i]);
     4982      xyz2[0][i] = 0.5F * (xyz[0][i] + xyz[2][i]);
    49864983      xyz2[1][i] = xyz[2][i];
    4987       xyz2[2][i] = 0.5 * (xyz[1][i] + xyz[2][i]);
     4984      xyz2[2][i] = 0.5F * (xyz[1][i] + xyz[2][i]);
    49884985    }
    49894986    for(i = 0; i < 4; i++){
    4990       rgba2[0][i] = 0.5 * (rgba[0][i] + rgba[2][i]);
     4987      rgba2[0][i] = 0.5F * (rgba[0][i] + rgba[2][i]);
    49914988      rgba2[1][i] = rgba[2][i];
    4992       rgba2[2][i] = 0.5 * (rgba[1][i] + rgba[2][i]);
     4989      rgba2[2][i] = 0.5F * (rgba[1][i] + rgba[2][i]);
    49934990    }
    49944991    gl2psPrintSVGSmoothTriangle(xyz2, rgba2);
    49954992    for(i = 0; i < 3; i++){
    4996       xyz2[0][i] = 0.5 * (xyz[0][i] + xyz[1][i]);
    4997       xyz2[1][i] = 0.5 * (xyz[1][i] + xyz[2][i]);
    4998       xyz2[2][i] = 0.5 * (xyz[0][i] + xyz[2][i]);
     4993      xyz2[0][i] = 0.5F * (xyz[0][i] + xyz[1][i]);
     4994      xyz2[1][i] = 0.5F * (xyz[1][i] + xyz[2][i]);
     4995      xyz2[2][i] = 0.5F * (xyz[0][i] + xyz[2][i]);
    49994996    }
    50004997    for(i = 0; i < 4; i++){
    5001       rgba2[0][i] = 0.5 * (rgba[0][i] + rgba[1][i]);
    5002       rgba2[1][i] = 0.5 * (rgba[1][i] + rgba[2][i]);
    5003       rgba2[2][i] = 0.5 * (rgba[0][i] + rgba[2][i]);
     4998      rgba2[0][i] = 0.5F * (rgba[0][i] + rgba[1][i]);
     4999      rgba2[1][i] = 0.5F * (rgba[1][i] + rgba[2][i]);
     5000      rgba2[2][i] = 0.5F * (rgba[0][i] + rgba[2][i]);
    50045001    }
    50055002    gl2psPrintSVGSmoothTriangle(xyz2, rgba2);
     
    50355032}
    50365033
    5037 #if defined(GL2PS_HAVE_LIBPNG)
    50385034static void gl2psPrintSVGPixmap(GLfloat x, GLfloat y, GL2PSimage *pixmap)
    5039 #else
    5040 static void gl2psPrintSVGPixmap(GLfloat, GLfloat, GL2PSimage *)
    5041 #endif
    50425035{
    50435036#if defined(GL2PS_HAVE_LIBPNG)
     
    50665059  gl2psListDelete(png);
    50675060#else
    5068   gl2psMsg(GL2PS_WARNING, "GL2PS has to be compiled with PNG support in "
     5061  gl2psMsg(GL2PS_WARNING, "GL2PS must be compiled with PNG support in "
    50695062           "order to embed images in SVG streams");
    50705063#endif
     
    51445137    gl2psPrintf("<text fill=\"%s\" x=\"%g\" y=\"%g\" font-size=\"%d\" ",
    51455138                col, xyz[0][0], xyz[0][1], prim->data.text->fontsize);
     5139    if(prim->data.text->angle)
     5140      gl2psPrintf("transform=\"rotate(%g, %g, %g)\" ",
     5141                  -prim->data.text->angle, xyz[0][0], xyz[0][1]);
    51465142    if(!strcmp(prim->data.text->fontname, "Times-Roman"))
    51475143      gl2psPrintf("font-family=\"Times\">");
  • trunk/source/visualization/externals/zlib/CVS/Entries

    r1337 r1340  
    11D/include////
    22D/src////
    3 /CMakeLists.txt/1.1/Wed Sep 29 19:14:16 2010//
    43/GNUmakefile/1.1/Thu Sep 30 06:17:31 2010//
    54/History/1.1/Thu Sep 30 06:17:31 2010//
    65/README/1.1/Mon Jul 12 14:53:17 2010//
    76/sources.cmake/1.1/Wed Sep 29 19:14:24 2010//
     7/CMakeLists.txt/1.2/Fri Oct  8 10:03:41 2010//
Note: See TracChangeset for help on using the changeset viewer.