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

update ti head

Location:
trunk/source/visualization
Files:
47 edited

Legend:

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

    r1337 r1340  
    1313/CMakeLists.txt/1.1/Wed Sep 29 19:11:25 2010//
    1414/GNUmakefile/1.27/Thu Sep 30 11:54:25 2010//
    15 /History/1.481/Thu Sep 30 06:16:17 2010//
     15/History/1.484/Fri Nov  5 10:16:45 2010//
  • trunk/source/visualization/HepRep/CVS/Entries

    r1337 r1340  
    55/History/1.135/Thu Sep 30 06:16:21 2010//
    66/README/1.23/Mon Jul 12 14:53:10 2010//
    7 /sources.cmake/1.1/Wed Sep 29 19:11:58 2010//
     7/sources.cmake/1.2/Fri Oct  8 10:03:41 2010//
  • trunk/source/visualization/History

    r1315 r1340  
    1 $Id: History,v 1.481 2010/06/15 16:41:14 allison Exp $
     1$Id: History,v 1.484 2010/10/27 11:20:27 allison Exp $
    22-------------------------------------------------------------------
    33
     
    2424History file for visualization category
    2525---------------------------------------
     26
     2727th October 2010  John Allison
     28- vistest-V09-03-01: Replaced MyPhysicsList by QGSP_BERT.
     29
     308th October 2010  John Allison  (vis-V09-03-09 with co-working tags...)
     31- Co-working tags: interfaces-V09-03-12 + config-V09-03-08
     32- visman-V09-03-12:
     33  o Added /vis/viewer/set/defaultColour and defaultTextColour.
     34- opengl-V09-03-07/08:
     35  o Improved kernel visit trigger.
     36  o Time-slices fade to background colour.
     37  o Many improvements to Qt.
     38- openinventor-V09-03-01:
     39  o Improved kernel visit trigger.
     40- visXXX-V08-03-00:
     41  o Improved kernel visit trigger.
     42- visexternal-V09-03-00:
     43  o G4OpenGL2PSAction : add new method to set viewport.
     44- gMocren-V09-03-04:
     45  o Added missing inclusion of <sstream>.
    2646
    274715th June 2010  John Allison  (vis-V09-03-08)
  • trunk/source/visualization/OpenGL/CVS/Entries

    r1337 r1340  
    44/Doxyfile/1.4/Mon Jul 12 14:53:12 2010//
    55/GNUmakefile/1.13/Thu Sep 30 06:16:41 2010//
    6 /History/1.180/Thu Sep 30 11:54:25 2010//
    76/sources.cmake/1.1/Wed Sep 29 19:12:14 2010//
     7/History/1.187/Fri Nov  5 10:16:45 2010//
  • trunk/source/visualization/OpenGL/GNUmakefile

    r1337 r1340  
    1111
    1212# For debug mode
    13 # CPPFLAGS += -DG4DEBUG_VIS_OGL
     13CPPFLAGS += -DG4DEBUG_VIS_OGL
    1414
    1515GLOBLIBS  = libG4vis_management.lib libG4modeling.lib libG4gl2ps.lib
  • trunk/source/visualization/OpenGL/History

    r1337 r1340  
    1 $Id: History,v 1.180 2010/06/23 13:29:23 lgarnier Exp $
     1$Id: History,v 1.187 2010/11/05 06:25:23 allison Exp $
    22-------------------------------------------------------------------
    33
     
    1717     * Reverse chronological order (last date on top), please *
    1818     ----------------------------------------------------------
     19
     205th November 2010  John Allison
     21- G4OpenGLStoredSceneHandler, G4OpenGLViewerMessenger:
     22  o Introduced a display list limit to avoid memory exhaustion.
     23  o Introduced /vis/ogl/set/displayListLimit.
     24
     258th October 2010  Laurent Garnier
     26- G4OpenGQtViewer.cc:
     27  o Add menu for changing text color, default color, background color
     28  o Toogle projection now call directly command instead of redefinding it
     29
     306th October 2010  John Allison  (opengl-V09-03-08 with co-working tags...)
     31- Co-working tags: interfaces-V09-03-12 + config-V09-03-08
     32- G4OpenGLStoredViewer.cc:
     33  o Added default colour and default text colour to list of parameters
     34    that trigger a kernel visit.
     35
     365th October 2010  John Allison
     37- G4OpenGLStoredViewer.cc: Time-slices fade to background colour.
     38
     395th October 2010  Laurent Garnier
     40- Change lots of shortcuts in Qt
     41- Add 'google earth like' rotation
    1942
    204323th June 2010  Laurent Garnier
  • trunk/source/visualization/OpenGL/include/CVS/Entries

    r1337 r1340  
    1414/G4OpenGLQtExportDialog.hh/1.7/Thu Sep 30 06:16:49 2010//
    1515/G4OpenGLQtMovieDialog.hh/1.4/Thu Sep 30 06:16:49 2010//
    16 /G4OpenGLQtViewer.hh/1.23/Thu Sep 30 06:16:49 2010//
    1716/G4OpenGLSceneHandler.hh/1.30/Thu Sep 30 06:16:49 2010//
    1817/G4OpenGLSceneHandler.icc/1.9/Thu Sep 30 06:16:49 2010//
    1918/G4OpenGLStoredQt.hh/1.2/Thu Sep 30 06:16:49 2010//
    2019/G4OpenGLStoredQtViewer.hh/1.10/Thu Sep 30 06:16:49 2010//
    21 /G4OpenGLStoredSceneHandler.hh/1.28/Thu Sep 30 06:16:49 2010//
    2220/G4OpenGLStoredViewer.hh/1.10/Thu Sep 30 06:16:49 2010//
    2321/G4OpenGLStoredWin32.hh/1.8/Thu Sep 30 06:16:49 2010//
     
    2826/G4OpenGLStoredXmViewer.hh/1.8/Thu Sep 30 06:16:50 2010//
    2927/G4OpenGLTransform3D.hh/1.8/Thu Sep 30 06:16:50 2010//
    30 /G4OpenGLViewer.hh/1.32/Thu Sep 30 06:16:50 2010//
    31 /G4OpenGLViewerMessenger.hh/1.7/Thu Sep 30 06:16:50 2010//
    3228/G4OpenGLWin32Viewer.hh/1.15/Thu Sep 30 06:16:50 2010//
    3329/G4OpenGLXViewer.hh/1.32/Thu Sep 30 06:16:50 2010//
     
    4844/G4OpenGLXmViewer.hh/1.11/Thu Sep 30 06:16:50 2010//
    4945/G4OpenGLXmViewerMessenger.hh/1.5/Thu Sep 30 06:16:50 2010//
     46/G4OpenGLViewer.hh/1.33/Tue Oct  5 15:45:19 2010//
     47/G4OpenGLQtViewer.hh/1.25/Fri Oct  8 10:07:31 2010//
     48/G4OpenGLStoredSceneHandler.hh/1.29/Fri Nov  5 10:16:52 2010//
     49/G4OpenGLViewerMessenger.hh/1.8/Fri Nov  5 10:16:52 2010//
    5050D
  • trunk/source/visualization/OpenGL/include/G4OpenGLQtViewer.hh

    r1333 r1340  
    2525//
    2626//
    27 // $Id: G4OpenGLQtViewer.hh,v 1.23 2010/06/04 15:27:47 lgarnier Exp $
     27// $Id: G4OpenGLQtViewer.hh,v 1.25 2010/10/08 10:07:31 lgarnier Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    231231  void actionDrawingLineSurfaceRemoval();
    232232  void actionSaveImage();
     233  void actionChangeBackgroundColor();
     234  void actionChangeTextColor();
     235  void actionChangeDefaultColor();
    233236  void actionMovieParameters();
    234237
     
    238241  void toggleRepresentation(bool);
    239242  void toggleProjection(bool);
    240   void toggleBackground(bool);
    241243  void toggleTransparency(bool);
    242244  void toggleAntialiasing(bool);
  • trunk/source/visualization/OpenGL/include/G4OpenGLStoredSceneHandler.hh

    r1337 r1340  
    2525//
    2626//
    27 // $Id: G4OpenGLStoredSceneHandler.hh,v 1.28 2009/02/04 16:48:40 lgarnier Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     27// $Id: G4OpenGLStoredSceneHandler.hh,v 1.29 2010/11/05 06:25:23 allison Exp $
     28// GEANT4 tag $Name: $
    2929//
    3030//
     
    6969  void ClearTransientStore ();
    7070
     71  static G4int GetDisplayListLimit() {return fDisplayListLimit;}
     72  static void SetDisplayListLimit(G4int lim) {fDisplayListLimit = lim;}
     73
    7174protected:
    7275
     
    7780  static G4int     fSceneIdCount;   // static counter for OpenGLStored scenes.
    7881  G4int            fDisplayListId;  // Workspace.
    79   G4bool  fMemoryForDisplayLists;   // avoid memory overflow
     82  G4bool fMemoryForDisplayLists;    // avoid memory overflow
     83  static G4int fDisplayListLimit;   // avoid memory overflow
     84  static G4int fDisplayListBase;    // avoid memory overflow
    8085  G4int fAddPrimitivePreambleNestingDepth;
    8186 
  • trunk/source/visualization/OpenGL/include/G4OpenGLViewer.hh

    r1332 r1340  
    2525//
    2626//
    27 // $Id: G4OpenGLViewer.hh,v 1.32 2009/05/14 16:38:23 lgarnier Exp $
     27// $Id: G4OpenGLViewer.hh,v 1.33 2010/10/05 15:45:19 lgarnier Exp $
    2828// GEANT4 tag $Name:  $
    2929//
  • trunk/source/visualization/OpenGL/include/G4OpenGLViewerMessenger.hh

    r1337 r1340  
    2525//
    2626//
    27 // $Id: G4OpenGLViewerMessenger.hh,v 1.7 2009/05/18 09:07:12 lgarnier Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     27// $Id: G4OpenGLViewerMessenger.hh,v 1.8 2010/11/05 06:25:23 allison Exp $
     28// GEANT4 tag $Name: $
    2929
    3030#ifndef G4OPENGLVIEWERMESSENGER_HH
     
    4141class G4UIcmdWithABool;
    4242class G4UIcmdWithAString;
     43class G4UIcmdWithAnInteger;
    4344
    4445class G4OpenGLViewerMessenger: public G4UImessenger {
     
    5758  G4UIdirectory* fpDirectorySet;
    5859  G4UIcommand* fpCommandDisplayHeadTime;
     60  G4UIcmdWithAnInteger* fpCommandDisplayListLimit;
    5961  G4UIcommand* fpCommandDisplayLightFront;
    6062  G4UIcommand* fpCommandEndTime;
  • trunk/source/visualization/OpenGL/src/CVS/Entries

    r1337 r1340  
    1414/G4OpenGLSceneHandler.cc/1.59/Thu Sep 30 06:16:59 2010//
    1515/G4OpenGLStoredQt.cc/1.10/Thu Sep 30 06:16:59 2010//
    16 /G4OpenGLStoredSceneHandler.cc/1.42/Thu Sep 30 06:16:59 2010//
    17 /G4OpenGLStoredViewer.cc/1.26/Thu Sep 30 06:16:59 2010//
    1816/G4OpenGLStoredWin32.cc/1.15/Thu Sep 30 06:17:00 2010//
    1917/G4OpenGLStoredWin32Viewer.cc/1.22/Thu Sep 30 06:17:00 2010//
     
    2321/G4OpenGLStoredXmViewer.cc/1.26/Thu Sep 30 06:17:00 2010//
    2422/G4OpenGLTransform3D.cc/1.9/Thu Sep 30 06:17:00 2010//
    25 /G4OpenGLViewer.cc/1.62/Thu Sep 30 06:17:00 2010//
    26 /G4OpenGLViewerMessenger.cc/1.18/Thu Sep 30 06:17:00 2010//
    2723/G4OpenGLWin32Viewer.cc/1.20/Thu Sep 30 06:17:00 2010//
    2824/G4OpenGLXViewer.cc/1.55/Thu Sep 30 06:17:00 2010//
     
    4945/G4OpenGLXmWindowHandlingCallbacks.cc/1.11/Thu Sep 30 06:17:09 2010//
    5046/G4OpenGLImmediateQtViewer.cc/1.22/Thu Sep 30 11:54:33 2010//
    51 /G4OpenGLQtViewer.cc/1.52/Thu Sep 30 11:54:33 2010//
    5247/G4OpenGLStoredQtViewer.cc/1.32/Thu Sep 30 11:54:33 2010//
     48/G4OpenGLViewer.cc/1.63/Tue Oct  5 15:45:19 2010//
     49/G4OpenGLStoredViewer.cc/1.29/Wed Oct  6 15:59:03 2010//
     50/G4OpenGLQtViewer.cc/1.55/Fri Oct  8 10:07:31 2010//
     51/G4OpenGLStoredSceneHandler.cc/1.43/Fri Nov  5 10:16:52 2010//
     52/G4OpenGLViewerMessenger.cc/1.19/Fri Nov  5 10:16:52 2010//
    5353D
  • trunk/source/visualization/OpenGL/src/G4OpenGLQtViewer.cc

    r1335 r1340  
    2525//
    2626//
    27 // $Id: G4OpenGLQtViewer.cc,v 1.52 2010/06/23 13:29:23 lgarnier Exp $
     27// $Id: G4OpenGLQtViewer.cc,v 1.55 2010/10/08 10:07:31 lgarnier Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    7979#include <qgl.h> // include <qglwidget.h>
    8080#include <qdialog.h>
     81#include <qcolordialog.h>
    8182#include <qevent.h> //include <qcontextmenuevent.h>
    8283
     
    111112  //  fWindow->makeCurrent();
    112113
    113 #ifdef G4DEBUG_VIS_OGL
    114 #if QT_VERSION < 0x040000
    115   printf("G4OpenGLQtViewer::CreateMainWindow :: ++++++++++++++ add new TAB %s  W:%d H:%d SizeHinX:%d SizeHintY:%d\n",name.ascii(),getWinWidth(),getWinHeight(),fVP.GetWindowSizeHintX(),fVP.GetWindowSizeHintY());
    116 #else
    117   printf("G4OpenGLQtViewer::CreateMainWindow :: ++++++++++++++ add new TAB %s  W:%d H:%d SizeHinX:%d SizeHintY:%d\n",name.toStdString().c_str(),getWinWidth(),getWinHeight(),fVP.GetWindowSizeHintX(),fVP.GetWindowSizeHintY());
    118 #endif
    119 #endif
    120114  //G4Qt* interactorManager = G4Qt::getInstance ();
    121115
     
    552546#endif
    553547
    554 
    555 
    556 #if QT_VERSION < 0x040000
    557   QPopupMenu *mBackground = new QPopupMenu(mStyle);
    558   mStyle->insertItem("&Background color",mBackground);
     548  // Background Color
     549
     550  QAction *backgroundColorChooser ;
     551#if QT_VERSION < 0x040000
     552  QPopupMenu *mBackgroundColor = new QPopupMenu(mStyle);
     553  mStyle->insertItem("&Background color",mBackgroundColor);
    559554
    560555#if QT_VERSION < 0x030200
    561   QAction *white = new QAction("&White","&White",CTRL+Key_W,mBackground,0,true);
    562   QAction *black =  new QAction("&Black","&Black",CTRL+Key_B,mBackground,0,true);
    563 #else
    564   QAction *white = new QAction("&White",CTRL+Key_W,mBackground);
    565   QAction *black =  new QAction("&Black",CTRL+Key_B,mBackground);
    566   white->setToggleAction(true);
    567   black->setToggleAction(true);
    568 #endif
    569   white->addTo(mBackground);
    570   black->addTo(mBackground);
    571 
    572 #else
    573   QMenu *mBackground = mStyle->addMenu("&Background color");
    574   QAction *white = mBackground->addAction("White");
    575   QAction *black = mBackground->addAction("Black");
    576 
    577 #endif
    578   if (background.GetRed() == 1. &&
    579       background.GetGreen() == 1. &&
    580       background.GetBlue() == 1.) {
    581     createRadioAction(white,black,SLOT(toggleBackground(bool)),1);
    582   } else {
    583     createRadioAction(white,black,SLOT(toggleBackground(bool)),2);
    584   }
     556  backgroundColorChooser =  new QAction("&Choose ...","&Choose ...",CTRL+Key_C,mBackgroundColor,0,true);
     557#else
     558  backgroundColorChooser =  new QAction("&Choose ...","&Choose ...",CTRL+Key_C,mBackgroundColor);
     559#endif
     560  backgroundColorChooser->addTo(mBackgroundColor);
     561  QObject ::connect(backgroundColorChooser,
     562                    SIGNAL(activated()),
     563                    this,
     564                    SLOT(actionChangeBackgroundColor()));
     565
     566#else
     567  // === Action Menu ===
     568  backgroundColorChooser = mStyle->addAction("Background color");
     569  QObject ::connect(backgroundColorChooser,
     570                    SIGNAL(triggered()),
     571                    this,
     572                    SLOT(actionChangeBackgroundColor()));
     573#endif
     574
     575  // Text Color
     576
     577  QAction *textColorChooser ;
     578#if QT_VERSION < 0x040000
     579  QPopupMenu *mTextColor = new QPopupMenu(mStyle);
     580  mStyle->insertItem("&Text color",mTextColor);
     581
     582#if QT_VERSION < 0x030200
     583  textColorChooser =  new QAction("&Choose ...","&Choose ...",CTRL+Key_C,mTextColor,0,true);
     584#else
     585  textColorChooser =  new QAction("&Choose ...","&Choose ...",CTRL+Key_C,mTextColor);
     586#endif
     587  textColorChooser->addTo(mTextColor);
     588  QObject ::connect(textColorChooser,
     589                    SIGNAL(activated()),
     590                    this,
     591                    SLOT(actionChangeTextColor()));
     592
     593#else
     594  // === Action Menu ===
     595  textColorChooser = mStyle->addAction("Text color");
     596  QObject ::connect(textColorChooser,
     597                    SIGNAL(triggered()),
     598                    this,
     599                    SLOT(actionChangeTextColor()));
     600#endif
     601
     602  // Default Color
     603
     604  QAction *defaultColorChooser ;
     605#if QT_VERSION < 0x040000
     606  QPopupMenu *mDefaultColor = new QPopupMenu(mStyle);
     607  mStyle->insertItem("&Default color",mDefaultColor);
     608
     609#if QT_VERSION < 0x030200
     610  defaultColorChooser =  new QAction("&Choose ...","&Choose ...",CTRL+Key_C,mDefaultColor,0,true);
     611#else
     612  defaultColorChooser =  new QAction("&Choose ...","&Choose ...",CTRL+Key_C,mDefaultColor);
     613#endif
     614  defaultColorChooser->addTo(mDefaultColor);
     615  QObject ::connect(defaultColorChooser,
     616                    SIGNAL(activated()),
     617                    this,
     618                    SLOT(actionChangeDefaultColor()));
     619
     620#else
     621  // === Action Menu ===
     622  defaultColorChooser = mStyle->addAction("Default color");
     623  QObject ::connect(defaultColorChooser,
     624                    SIGNAL(triggered()),
     625                    this,
     626                    SLOT(actionChangeDefaultColor()));
     627#endif
    585628
    586629
     
    11011144
    11021145  if (check == 1) {
    1103     fVP.SetFieldHalfAngle (0);
     1146    G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/set/projection o");
    11041147  } else {
    1105 
    1106     // look for the default parameter hidden in G4UIcommand parameters
    1107     G4UImanager* UI = G4UImanager::GetUIpointer();
    1108     if(UI==NULL)
    1109       return;
    1110     G4UIcommandTree * treeTop = UI->GetTree();
    1111 
    1112     // find command
    1113     G4UIcommand* command = treeTop->FindPath("/vis/viewer/set/projection");
    1114     if (!command)
    1115       return;
    1116 
    1117     // find param
    1118     G4UIparameter * angleParam = NULL;
    1119     for(G4int i=0;  i<command->GetParameterEntries(); i++)
    1120     {
    1121       if( command->GetParameter(i)->GetParameterName() == "field-half-angle" ) {
    1122         angleParam = command->GetParameter(i);
    1123       }
    1124     }
    1125     if (!angleParam)
    1126       return;
    1127 
    1128     // find unit
    1129     G4UIparameter * unitParam = NULL;
    1130     for(G4int i=0;  i<command->GetParameterEntries(); i++)
    1131     {
    1132       if( command->GetParameter(i)->GetParameterName() == "unit" ) {
    1133         unitParam = command->GetParameter(i);
    1134       }
    1135     }
    1136     if (!unitParam)
    1137       return;
    1138 
    1139     G4double defaultValue = command->ConvertToDouble(angleParam->GetDefaultValue())
    1140                             * G4UnitDefinition::GetValueOf(unitParam->GetDefaultValue());
    1141     if (defaultValue > 89.5 || defaultValue <= 0.0) {
    1142       G4cerr << "Field half angle should be 0 < angle <= 89.5 degrees. Check your default Field half angle parameter";
    1143     } else {
    1144       G4cout << "Perspective view has been set to default value. Field half angle="<<angleParam->GetDefaultValue() <<" " << G4endl;
    1145       fVP.SetFieldHalfAngle (defaultValue);
    1146       SetView ();
    1147     }
     1148    G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/set/projection p");
    11481149  } 
    11491150  updateQWidget();
    11501151}
    11511152
    1152 
    1153 /**
    1154    SLOT Activate by a click on the background menu
    1155 @param check : 1 white, 0 black
    1156 */
    1157 void G4OpenGLQtViewer::toggleBackground(bool check) {
    1158 
    1159   //   //I need to revisit the kernel if the background colour changes and
    1160   //   //hidden line removal is enabled, because hlr drawing utilises the
    1161   //   //background colour in its drawing...
    1162   //   // (Note added by JA 13/9/2005) Background now handled in view
    1163   //   // parameters.  A kernel visit is triggered on change of background.
    1164   if (check == 1) {
    1165     ((G4ViewParameters&)this->GetViewParameters()).
    1166       SetBackgroundColour(G4Colour(1.,1.,1.));  // White
    1167   } else {
    1168     ((G4ViewParameters&)this->GetViewParameters()).
    1169       SetBackgroundColour(G4Colour(0.,0.,0.));  // Black
    1170   }
    1171   updateQWidget();
    1172 }
    11731153
    11741154/**
     
    12301210void G4OpenGLQtViewer::toggleAux(bool check) {
    12311211  if (check) {
     1212    fVP.SetAuxEdgeVisible(true);
     1213  } else {
    12321214    fVP.SetAuxEdgeVisible(false);
    1233   } else {
    1234     fVP.SetAuxEdgeVisible(true);
    12351215  }
    12361216  SetNeedKernelVisit (true);
     
    13971377  }
    13981378 
     1379}
     1380
     1381
     1382void G4OpenGLQtViewer::actionChangeBackgroundColor() {
     1383
     1384  //   //I need to revisit the kernel if the background colour changes and
     1385  //   //hidden line removal is enabled, because hlr drawing utilises the
     1386  //   //background colour in its drawing...
     1387  //   // (Note added by JA 13/9/2005) Background now handled in view
     1388  //   // parameters.  A kernel visit is triggered on change of background.
     1389
     1390  QColor color;
     1391  color = QColorDialog::getColor(Qt::black, fGLWindow);
     1392  if (color.isValid()) {
     1393    QString com = "/vis/viewer/set/background ";
     1394    QString num;
     1395    com += num.setNum(((float)color.red())/256)+" ";
     1396    com += num.setNum(((float)color.green())/256)+" ";
     1397    com += num.setNum(((float)color.blue())/256)+" ";
     1398    G4UImanager::GetUIpointer()->ApplyCommand(com.toStdString().c_str());
     1399    updateQWidget();
     1400  }
     1401}
     1402
     1403void G4OpenGLQtViewer::actionChangeTextColor() {
     1404
     1405  QColor color;
     1406  color = QColorDialog::getColor(Qt::yellow, fGLWindow);
     1407  if (color.isValid()) {
     1408    QString com = "/vis/viewer/set/defaultTextColour ";
     1409    QString num;
     1410    com += num.setNum(((float)color.red())/256)+" ";
     1411    com += num.setNum(((float)color.green())/256)+" ";
     1412    com += num.setNum(((float)color.blue())/256)+" ";
     1413    G4UImanager::GetUIpointer()->ApplyCommand(com.toStdString().c_str());
     1414    updateQWidget();
     1415  }
     1416}
     1417
     1418void G4OpenGLQtViewer::actionChangeDefaultColor() {
     1419
     1420  QColor color;
     1421  color = QColorDialog::getColor(Qt::white, fGLWindow);
     1422  printf("actionChangeDefaultColor\n");
     1423  if (color.isValid()) {
     1424    QString com = "/vis/viewer/set/defaultColour ";
     1425    QString num;
     1426    com += num.setNum(((float)color.red())/256)+" ";
     1427    com += num.setNum(((float)color.green())/256)+" ";
     1428    com += num.setNum(((float)color.blue())/256)+" ";
     1429    G4UImanager::GetUIpointer()->ApplyCommand(com.toStdString().c_str());
     1430    updateQWidget();
     1431  }
    13991432}
    14001433
     
    15101543
    15111544        if (fMouseAction == STYLE1) {  // rotate
    1512 #ifdef G4DEBUG_VIS_OGL
    1513           printf("G4OpenGLQtViewer:: ___________________________________\n");
    1514           printf("G4OpenGLQtViewer:: mouse move\n");
    1515 #endif
    15161545          if (fNoKeyPress) {
    1517 #ifdef G4DEBUG_VIS_OGL
    1518             printf("G4OpenGLQtViewer:: rotate normal\n");
    1519 #endif
    15201546            rotateQtScene(((float)delta.x())/correctionFactor,((float)delta.y())/correctionFactor);
    15211547          } else if (fAltKeyPress) {
    1522 #ifdef G4DEBUG_VIS_OGL
    1523             printf("G4OpenGLQtViewer:: rotate view\n");
    1524 #endif
    15251548            rotateQtSceneInViewDirection(((float)delta.x())/correctionFactor,((float)delta.y())/correctionFactor);
    15261549          }
     
    15291552          moveScene(-((float)delta.x())/correctionFactor,-((float)delta.y())/correctionFactor,0,true);
    15301553        }
    1531 #ifdef G4DEBUG_VIS_OGL
    1532         printf("G4OpenGLQtViewer::G4MouseReleaseEvent Fps:%f x:%d y:%d cycle:%f\n",(float)1000/lastMoveTime.elapsed(),delta.x(),delta.y(),correctionFactor);
    1533 #endif
    15341554        lastMoveTime.start();
    15351555      }
     
    15831603  if (fMouseAction == STYLE1) {  // rotate
    15841604    if (mButtons & Qt::LeftButton) {
    1585 #ifdef G4DEBUG_VIS_OGL
    1586       printf("G4OpenGLQtViewer:: ___________________________________\n");
    1587       printf("G4OpenGLQtViewer:: mouse move %f %f\n",((float)deltaX),((float)deltaY));
    1588 #endif
    15891605      if (fNoKeyPress) {
    1590 #ifdef G4DEBUG_VIS_OGL
    1591         printf("G4OpenGLQtViewer:: rotate normal\n");
    1592 #endif
    15931606        rotateQtScene(((float)deltaX),((float)deltaY));
    15941607      } else if (fAltKeyPress) {
    1595 #ifdef G4DEBUG_VIS_OGL
    1596         printf("G4OpenGLQtViewer:: rotate view\n");
    1597 #endif
    15981608        rotateQtSceneInViewDirection(((float)deltaX),((float)deltaY));
    15991609      } else if (fShiftKeyPress) {
     
    16081618        moveScene(-(float)deltaX*factor,-(float)deltaY*factor,0,false);
    16091619      } else if (fControlKeyPress) {
    1610 #ifdef G4DEBUG_VIS_OGL
    1611         printf("G4OpenGLQtViewer:: zoom\n");
    1612 #endif
    16131620        fVP.SetZoomFactor(fVP.GetZoomFactor()*(1+((float)deltaY)));
    16141621      }
     
    20242031  }
    20252032#else
    2026 #ifdef G4DEBUG_VIS_OGL
    2027   printf("G4OpenGLQtViewer:: ________________Key Press\n");
    2028 #endif
    20292033  if (modifier & Qt::AltModifier ) {
    20302034    fAltKeyPress = true;
    20312035    fNoKeyPress = false;
    2032 #ifdef G4DEBUG_VIS_OGL
    2033     printf("G4OpenGLQtViewer:: ________________ALT\n");
    2034 #endif
    20352036  }
    20362037  if (modifier & Qt::ShiftModifier ) {
    20372038    fShiftKeyPress = true;
    20382039    fNoKeyPress = false;
    2039 #ifdef G4DEBUG_VIS_OGL
    2040     printf("G4OpenGLQtViewer:: ________________Shift\n");
    2041 #endif
    20422040  }
    20432041  if (modifier & Qt::ControlModifier ) {
    20442042    fControlKeyPress = true;
    20452043    fNoKeyPress = false;
    2046 #ifdef G4DEBUG_VIS_OGL
    2047     printf("G4OpenGLQtViewer:: ________________Control\n");
    2048 #endif
    20492044  }
    20502045#endif
     
    28482843  // G4UImanager* UI =
    28492844  G4UImanager::GetUIpointer();
    2850 #ifdef G4DEBUG_VIS_OGL
    2851   //  printf("G4OpenGLQtViewer::getParentWidget :: UImanager %d  G4Qt:%d et via GetUIQt:%d---------------------\n",UI,UI->GetSession(),interactorManager,interactorManager->GetUIVisWidget());
    2852 #endif
    28532845 
    28542846  bool found = false;
  • trunk/source/visualization/OpenGL/src/G4OpenGLStoredQtViewer.cc

    r1332 r1340  
    4848{
    4949
    50 #ifdef G4DEBUG_VIS_OGL
    51   printf("G4OpenGLStoredQtViewer::constructor VVVVVVVVVVVV\n");
    52 #endif
    5350#if QT_VERSION < 0x040000
    5451  setFocusPolicy(QWidget::StrongFocus); // enable keybord events
     
    5956  fIsRepainting = false;
    6057
    61 #ifdef G4DEBUG_VIS_OGL
    62   printf("G4OpenGLStoredQtViewer::constructor ^^^^^^^^^^^^\n");
    63 #endif
    6458  if (fViewId < 0) return;  // In case error in base class instantiation.
    6559}
     
    7367
    7468void G4OpenGLStoredQtViewer::Initialise() {
    75 #ifdef G4DEBUG_VIS_OGL
    76   printf("G4OpenGLStoredQtViewer::Initialise VVVVVVVVVVVV\n");
    77 #endif
    7869  fReadyToPaint = false;
    7970  CreateMainWindow (this,QString(GetName()));
     
    8172 
    8273  fReadyToPaint = true;
    83 #ifdef G4DEBUG_VIS_OGL
    84   printf("G4OpenGLStoredQtViewer::Initialise ^^^^^^^^^^^^\n");
    85 #endif
    8674}
    8775
    8876void G4OpenGLStoredQtViewer::initializeGL () {
    8977
    90 #ifdef G4DEBUG_VIS_OGL
    91   printf("G4OpenGLStoredQtViewer::InitialiseGL () 0\n");
    92 #endif
    9378  //  return;
    9479  InitializeGLView ();
    9580
    96 #ifdef G4DEBUG_VIS_OGL
    97   printf("G4OpenGLStoredQtViewer::InitialiseGL () 1\n");
    98 #endif
    9981
    10082  // clear the buffers and window.
  • trunk/source/visualization/OpenGL/src/G4OpenGLStoredSceneHandler.cc

    r1337 r1340  
    2525//
    2626//
    27 // $Id: G4OpenGLStoredSceneHandler.cc,v 1.42 2010/06/03 08:23:02 allison Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     27// $Id: G4OpenGLStoredSceneHandler.cc,v 1.43 2010/11/05 06:25:23 allison Exp $
     28// GEANT4 tag $Name: $
    2929//
    3030//
     
    106106  if (fMemoryForDisplayLists) {
    107107    fDisplayListId = glGenLists (1);
    108     if (glGetError() == GL_OUT_OF_MEMORY) {  // Could pre-allocate?
     108    if (glGetError() == GL_OUT_OF_MEMORY ||
     109        fDisplayListId > fDisplayListLimit + fDisplayListBase) {
    109110      G4cout <<
    110111        "********************* WARNING! ********************"
    111         "\nUnable to allocate any more display lists in OpenGL."
    112         "\n     Continuing drawing in IMMEDIATE MODE."
     112        "\n  Display list limit reached in OpenGL."
     113        "\n  Continuing drawing in IMMEDIATE MODE."
     114        "\n  Current limit: "
     115             << fDisplayListLimit <<
     116        ".  Change with \"/vis/ogl/set/displayListLimit\"."
    113117        "\n***************************************************"
    114118             << G4endl;
     
    351355    glDeleteLists(fTOList[i].fDisplayListId, 1);
    352356  fTOList.clear ();
     357
     358  fDisplayListBase = fDisplayListId;
    353359}
    354360
     
    361367    glDeleteLists(fTOList[i].fDisplayListId, 1);
    362368  fTOList.clear ();
     369
     370  fDisplayListBase = fDisplayListId;
    363371
    364372  // Make sure screen corresponds to graphical database...
     
    463471G4int G4OpenGLStoredSceneHandler::fSceneIdCount = 0;
    464472
     473G4int G4OpenGLStoredSceneHandler::fDisplayListLimit = 50000;
     474
     475G4int G4OpenGLStoredSceneHandler::fDisplayListBase = 0;
     476
    465477#endif
  • trunk/source/visualization/OpenGL/src/G4OpenGLStoredViewer.cc

    r1314 r1340  
    2525//
    2626//
    27 // $Id: G4OpenGLStoredViewer.cc,v 1.26 2009/04/08 16:55:44 lgarnier Exp $
    28 // GEANT4 tag $Name: vis-V09-03-06 $
     27// $Id: G4OpenGLStoredViewer.cc,v 1.29 2010/10/06 10:05:52 allison Exp $
     28// GEANT4 tag $Name: $
    2929//
    3030//
     
    8888      (lastVP.GetNoOfSides ()       != fVP.GetNoOfSides ())       ||
    8989      (lastVP.IsMarkerNotHidden ()  != fVP.IsMarkerNotHidden ())  ||
     90      (lastVP.GetDefaultVisAttributes()->GetColour() !=
     91       fVP.GetDefaultVisAttributes()->GetColour())                ||
     92      (lastVP.GetDefaultTextVisAttributes()->GetColour() !=
     93       fVP.GetDefaultTextVisAttributes()->GetColour())            ||
    9094      (lastVP.GetBackgroundColour ()!= fVP.GetBackgroundColour ())||
    9195      (lastVP.IsPicking ()          != fVP.IsPicking ())
     
    165169        glMultMatrixd (oglt.GetGLMatrix ());
    166170        if (fVP.IsPicking()) glLoadName(to.fPickName);
    167         G4Colour& c = to.fColour;
     171        const G4Colour& c = to.fColour;
     172        const G4Colour& bg = fVP.GetBackgroundColour();
    168173        G4double bsf = 1.;  // Brightness scaling factor.
    169174        if (fFadeFactor > 0. && to.fEndTime < fEndTime)
    170175          bsf = 1. - fFadeFactor *
    171176            ((fEndTime - to.fEndTime) / (fEndTime - fStartTime));
    172         glColor3d(bsf * c.GetRed (), bsf * c.GetGreen (), bsf * c.GetBlue ());
     177        glColor3d
     178          (bsf * c.GetRed() + (1. - bsf) * bg.GetRed(),
     179           bsf * c.GetGreen() + (1. - bsf) * bg.GetGreen(),
     180           bsf * c.GetBlue() + (1. - bsf) * bg.GetBlue());
    173181        glCallList (to.fDisplayListId);
    174182        glPopMatrix();
  • trunk/source/visualization/OpenGL/src/G4OpenGLViewer.cc

    r1335 r1340  
    2525//
    2626//
    27 // $Id: G4OpenGLViewer.cc,v 1.62 2010/05/11 10:22:37 allison Exp $
     27// $Id: G4OpenGLViewer.cc,v 1.63 2010/10/05 15:45:19 lgarnier Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    113113  glDisable (GL_POLYGON_SMOOTH);
    114114
    115   //  if (fVP != NULL) {
    116     fWinSize_x = fVP.GetWindowSizeHintX();
    117     fWinSize_y = fVP.GetWindowSizeHintY();
    118     //  }
     115  fWinSize_x = fVP.GetWindowSizeHintX();
     116  fWinSize_y = fVP.GetWindowSizeHintY();
    119117
    120118
     
    177175  }
    178176   
    179   glViewport(0, 0, fWinSize_x,fWinSize_y);
    180 
    181 #ifdef G4DEBUG_VIS_OGL
    182   printf("G4OpenGLViewer::ResizeGLView END %d %d &:%d\n",fWinSize_x,fWinSize_y,this);
    183 #endif
    184  
     177#ifdef G4DEBUG_VIS_OGL
     178  printf("G4OpenGLViewer::ResizeGLView viewport X:%d Y:%d\n",fWinSize_x,fWinSize_y);
     179#endif
     180  glViewport(0, 0, fWinSize_x,fWinSize_y);   
     181
     182
    185183}
    186184
     
    191189    return;
    192190  }
    193 #ifdef G4DEBUG_VIS_OGL
    194   printf("G4OpenGLViewer::SetView\n");
    195 #endif
    196191  // Calculates view representation based on extent of object being
    197192  // viewed and (initial) viewpoint.  (Note: it can change later due
     
    338333  background = fVP.GetBackgroundColour ();
    339334
    340 #ifdef G4DEBUG_VIS_OGL
    341   printf("G4OpenGLViewer::SetView END\n");
    342 #endif
    343335}
    344336
     
    461453  glGetIntegerv (GL_UNPACK_ALIGNMENT, &alignment);
    462454
     455#ifdef G4DEBUG_VIS_OGL
     456  printf("G4OpenGLViewer::grabPixels colors:%d swap:%d lsb:%d rowlenght:%d sr:%d sp:%d align:%d\n",inColor,swapbytes, lsbfirst, rowlength,skiprows, skippixels, alignment);
     457#endif
     458
     459
    463460  glPixelStorei (GL_UNPACK_SWAP_BYTES, GL_FALSE);
    464461  glPixelStorei (GL_UNPACK_LSB_FIRST, GL_FALSE);
     
    469466  glPixelStorei (GL_UNPACK_ALIGNMENT, 1);
    470467
     468  glFlush();
    471469  glReadBuffer(GL_FRONT);
    472470  glReadPixels (0, 0, (GLsizei)width, (GLsizei)height, format, GL_UNSIGNED_BYTE, (GLvoid*) buffer);
    473 
     471  //  glReadPixels (0, 0, (GLsizei)width, (GLsizei)height, GL_RGB, GL_UNSIGNED_BYTE, (GLvoid*) buffer);
    474472  glPixelStorei (GL_UNPACK_SWAP_BYTES, swapbytes);
    475473  glPixelStorei (GL_UNPACK_LSB_FIRST, lsbfirst);
     
    529527bool G4OpenGLViewer::printNonVectoredEPS () {
    530528
    531   int width = getRealPrintSizeX();
    532   int height = getRealPrintSizeY();
    533 
    534 #ifdef G4DEBUG_VIS_OGL
    535   printf("G4OpenGLViewer::printNonVectoredEPS file:%s Vec:%d X:%d Y:%d col:%d fWinX:%d fWinY:%d\n",getRealPrintFilename().c_str(),fVectoredPs,width,height,fPrintColour,fWinSize_x,fWinSize_y);
     529  GLint viewport[4];
     530  glGetIntegerv(GL_VIEWPORT, viewport);
     531
     532  int width2 = getRealPrintSizeX();
     533  int height2 = getRealPrintSizeY();
     534  int width = viewport[2]; // FIXME : Why -1 ????
     535  int height = viewport[3];
     536
     537#ifdef G4DEBUG_VIS_OGL
     538  printf("G4OpenGLViewer::printNonVectoredEPS file:%s Vec:%d X:%d Y:%d X2:%d Y2:%d col:%d fWinX:%d fWinY:%d\n",getRealPrintFilename().c_str(),fVectoredPs,width,height,width2,height2,fPrintColour,fWinSize_x,fWinSize_y);
    536539#endif
    537540  FILE* fp;
     
    621624  int height = getRealPrintSizeY();
    622625
     626#ifdef G4DEBUG_VIS_OGL
     627  printf("G4OpenGLViewer::printGl2PS file:%s Vec:%d X:%d Y:%d col:%d fWinX:%d fWinY:%d\n",getRealPrintFilename().c_str(),fVectoredPs,width,height,fPrintColour,fWinSize_x,fWinSize_y);
     628#endif
     629
    623630  if (!fGL2PSAction) return false;
    624631
     
    643650
    644651    // Set the viewport
    645     //    fGL2PSAction->setViewport(0, 0, getRealPrintSizeX(),getRealPrintSizeY()); 
     652    //    fGL2PSAction->setViewport(0, 0, width, height); 
    646653    // By default, we choose the line width (trajectories...)
    647654    fGL2PSAction->setLineWidth(1);
     
    693700    return 0;
    694701  }
     702#ifdef G4DEBUG_VIS_OGL
     703  printf("G4OpenGLViewer::getRealPrintSizeX %d\n",fPrintSizeX);
     704#endif
    695705  return fPrintSizeX;
    696706}
     
    712722    return 0;
    713723  }
     724#ifdef G4DEBUG_VIS_OGL
     725  printf("G4OpenGLViewer::getRealPrintSizeY %d\n",fPrintSizeY);
     726#endif
    714727  return fPrintSizeY;
    715728}
     
    825838  //phi spin stuff here
    826839 
    827 
    828 #ifdef G4DEBUG_VIS_OGL
    829   printf("G4OpenGLViewer::rotateScene dx:%f dy:%f delta:%f\n",dx,dy, deltaRotation);
    830 #endif
    831 
    832840  vp = fVP.GetViewpointDirection ().unit ();
    833841  up = fVP.GetUpVector ().unit ();
    834842 
    835 #ifdef G4DEBUG_VIS_OGL
    836   printf("G4OpenGLViewer::rotateScene     vp: %f %f %f\n",vp.x(),vp.y(),vp.z());
    837 #endif
    838843  yprime = (up.cross(vp)).unit();
    839844  zprime = (vp.cross(yprime)).unit();
     
    855860  // to allow more than 360° rotation
    856861
    857   //   const G4Point3D targetPoint
    858   //     = fSceneHandler.GetScene()->GetStandardTargetPoint()
    859   //     + fVP.GetCurrentTargetPoint ();
    860   //   G4double radius = fSceneHandler.GetScene()->GetExtent().GetExtentRadius();
    861   //   if(radius<=0.) radius = 1.;
    862   //  const G4double cameraDistance = fVP.GetCameraDistance (radius);
    863   //  const G4Point3D cameraPosition =
    864   //    targetPoint + cameraDistance * fVP.GetViewpointDirection().unit();
    865 
    866862  if (fVP.GetLightsMoveWithCamera()) {
    867 #ifdef G4DEBUG_VIS_OGL
    868   printf("G4OpenGLViewer::rotateScene GetLightsMoveWithCamera: %f \n",new_vp.z()*vp.z());
    869 #endif
    870863    new_up = (new_vp.cross(yprime)).unit();
    871864    if (new_vp.z()*vp.z() <0) {
    872 #ifdef G4DEBUG_VIS_OGL
    873       printf("G4OpenGLViewer::rotateScene  R_____________________________________________\n");
    874 #endif
    875865      new_up.set(new_up.x(),-new_up.y(),new_up.z());
    876866    }
    877867  } else {
    878 #ifdef G4DEBUG_VIS_OGL
    879     printf("G4OpenGLViewer::rotateScene : %f \n",new_vp.z()*vp.z());
    880 #endif
    881868    new_up = up;
    882869    if (new_vp.z()*vp.z() <0) {
    883 #ifdef G4DEBUG_VIS_OGL
    884       printf("G4OpenGLViewer::rotateScene  X_____________________________________________\n");
    885 #endif
    886870      new_up.set(new_up.x(),-new_up.y(),new_up.z());
    887871    }
     
    902886  delta = a2 - a1;
    903887  // So new viewpoint is...
    904 
    905888  viewPoint = new_vp.unit() + delta;
    906 
    907 #ifdef G4DEBUG_VIS_OGL
    908   printf("G4OpenGLViewer::rotateScene     up: %f %f %f\n",up.x(),up.y(),up.z());
    909   printf("G4OpenGLViewer::rotateScene new up: %f %f %f\n",new_up.x(),new_up.y(),new_up.z());
    910   printf("G4OpenGLViewer::rotateScene new vp: %f %f %f delta:%f %f %f\n",new_vp.x(),new_vp.y(),new_vp.z(),delta.x(),delta.y(),delta.z());
    911 #endif
    912  
    913 
     889 
    914890  fVP.SetViewAndLights (viewPoint);
    915 
    916 
    917891}
    918892
  • trunk/source/visualization/OpenGL/src/G4OpenGLViewerMessenger.cc

    r1337 r1340  
    2525//
    2626//
    27 // $Id: G4OpenGLViewerMessenger.cc,v 1.18 2009/05/14 16:38:23 lgarnier Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     27// $Id: G4OpenGLViewerMessenger.cc,v 1.19 2010/11/05 06:25:23 allison Exp $
     28// GEANT4 tag $Name: $
    2929
    3030#ifdef G4VIS_BUILD_OPENGL_DRIVER
     
    4141#include "G4UIcmdWithABool.hh"
    4242#include "G4UIcmdWithAString.hh"
     43#include "G4UIcmdWithAnInteger.hh"
    4344#include "G4VisManager.hh"
    4445#include <sstream>
     
    179180  fpCommandDisplayLightFront->SetParameter(parameter);
    180181
     182  fpCommandDisplayListLimit =
     183    new G4UIcmdWithAnInteger("/vis/ogl/set/displayListLimit", this);
     184  fpCommandDisplayListLimit->SetGuidance
     185    ("Set/reset display list limit (to avoid memory exhaustion).");
     186  fpCommandDisplayListLimit->SetParameterName
     187    ("displayListLimit", omitable = true);
     188  fpCommandDisplayListLimit->SetDefaultValue(50000);
     189
    181190  fpCommandEndTime =
    182191    new G4UIcommand("/vis/ogl/set/endTime", this);
     
    241250  delete fpCommandFade;
    242251  delete fpCommandEndTime;
     252  delete fpCommandDisplayListLimit;
    243253  delete fpCommandDisplayLightFront;
    244254  delete fpCommandDisplayHeadTime;
     
    322332      G4cout <<
    323333  "G4OpenGLViewerMessenger::SetNewValue: Current viewer is not of type OGLS."
    324   "\n  The time slice viewing feature is only implemented for OGL Stored"
    325   "\n  viewers at present.  Use \"/vis/viewer/select\" or \"/vis/open OGLS...\"."
     334  "\n  This feature is only implemented for OGL Stored viewers."
     335  "\n  Use \"/vis/viewer/select\" or \"/vis/open OGLS...\"."
    326336             << G4endl;
    327337      return;
     
    414424    }
    415425
     426  G4OpenGLSceneHandler* pOGLSceneHandler =
     427    dynamic_cast<G4OpenGLSceneHandler*>(pViewer->GetSceneHandler());
     428
     429  if (!pOGLSceneHandler) {
     430    G4cout <<
     431  "G4OpenGLViewerMessenger::SetNewValue: Current scene handler is not of type"
     432  "\n  OGL.  Use \"/vis/sceneHandler/select\" or \"/vis/open\"."
     433           << G4endl;
     434    return;
     435  }
     436
     437  G4OpenGLStoredSceneHandler* pOGLSSceneHandler =
     438    dynamic_cast<G4OpenGLStoredSceneHandler*>(pViewer->GetSceneHandler());
     439
     440  if (!pOGLSSceneHandler) {
     441    G4cout <<
     442  "G4OpenGLViewerMessenger::SetNewValue: Current scene handler is not of type"
     443  "\n  OGLS (Stored).  This feature is only implemented for OGL Stored"
     444  "\n  scene handlers.  Use \"/vis/viewer/select\" or \"/vis/open OGLS...\"."
     445           << G4endl;
     446    return;
     447  }
     448
     449  if (command == fpCommandDisplayListLimit)
     450    {
     451      G4int displayListLimit =
     452        fpCommandDisplayListLimit->GetNewIntValue(newValue);
     453      pOGLSSceneHandler->SetDisplayListLimit(displayListLimit);
     454    }
    416455}
    417456
  • trunk/source/visualization/OpenInventor/CVS/Entries

    r1337 r1340  
    33/CMakeLists.txt/1.1/Wed Sep 29 19:12:22 2010//
    44/GNUmakefile/1.10/Thu Sep 30 06:17:09 2010//
    5 /History/1.105/Thu Sep 30 06:17:09 2010//
    65/sources.cmake/1.1/Wed Sep 29 19:12:30 2010//
     6/History/1.107/Wed Oct  6 15:53:50 2010//
  • trunk/source/visualization/OpenInventor/History

    r1288 r1340  
    1 $Id: History,v 1.105 2010/05/26 14:30:46 allison Exp $
     1$Id: History,v 1.107 2010/10/06 15:46:21 allison Exp $
    22-------------------------------------------------------------------
    33
     
    2020History file for visualization/OpenInventor
    2121-------------------------------------------
     22
     236th October 2010  John Allison  (openinventor-V09-03-01)
     24- G4OpenInventorViewer.cc:
     25  o Added default colour and default text colour to list of parameters
     26    that trigger a kernel visit.
    2227
    232826th May 2010  John Allison  (openinventor-V09-03-00)
  • trunk/source/visualization/OpenInventor/src/CVS/Entries

    r1337 r1340  
    22/G4OpenInventorSceneHandler.cc/1.55/Thu Sep 30 06:17:10 2010//
    33/G4OpenInventorTransform3D.cc/1.8/Thu Sep 30 06:17:10 2010//
    4 /G4OpenInventorViewer.cc/1.60/Thu Sep 30 06:17:10 2010//
    54/G4OpenInventorWin.cc/1.8/Thu Sep 30 06:17:10 2010//
    65/G4OpenInventorWinViewer.cc/1.26/Thu Sep 30 06:17:10 2010//
     
    2221/SoTrd.cc/1.8/Thu Sep 30 06:17:12 2010//
    2322/SoTubs.cc/1.8/Thu Sep 30 06:17:12 2010//
     23/G4OpenInventorViewer.cc/1.61/Wed Oct  6 15:53:54 2010//
    2424D
  • trunk/source/visualization/OpenInventor/src/G4OpenInventorViewer.cc

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 // $Id: G4OpenInventorViewer.cc,v 1.60 2009/02/16 15:31:05 lgarnier Exp $
    27 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4OpenInventorViewer.cc,v 1.61 2010/10/06 10:09:57 allison Exp $
     27// GEANT4 tag $Name: $
    2828
    2929#ifdef G4VIS_BUILD_OI_DRIVER
     
    177177      (vp.GetNoOfSides ()       != fVP.GetNoOfSides ())       ||
    178178      (vp.IsMarkerNotHidden ()  != fVP.IsMarkerNotHidden ())  ||
     179      (vp.GetDefaultVisAttributes()->GetColour() !=
     180       fVP.GetDefaultVisAttributes()->GetColour())            ||
     181      (vp.GetDefaultTextVisAttributes()->GetColour() !=
     182       fVP.GetDefaultTextVisAttributes()->GetColour())        ||
    179183      (vp.GetBackgroundColour ()!= fVP.GetBackgroundColour ())||
    180184      (vp.IsPicking ()          != fVP.IsPicking ())          ||
  • trunk/source/visualization/XXX/CVS/Entries

    r1337 r1340  
    33/CMakeLists.txt/1.1/Wed Sep 29 19:13:27 2010//
    44/GNUmakefile/1.8/Thu Sep 30 06:17:20 2010//
    5 /History/1.28/Thu Sep 30 06:17:20 2010//
    65/sources.cmake/1.1/Wed Sep 29 19:13:35 2010//
     6/History/1.30/Wed Oct  6 15:58:25 2010//
  • trunk/source/visualization/XXX/History

    r1140 r1340  
    1 $Id: History,v 1.28 2009/10/21 15:28:53 allison Exp $
     1$Id: History,v 1.30 2010/10/06 15:49:24 allison Exp $
    22-------------------------------------------------------------------
    33
     
    2020History file for visualization/XXX sub-category (a template graphics system)
    2121---------------------------------------------------------------------------
     22
     236th October 2010  John Allison  (visXXX-V08-03-00)
     24- G4XXXSGViewer.cc, G4XXXStoredViewer.cc:
     25  o Added default colour and default text colour to list of parameters
     26    that trigger a kernel visit.
    2227
    232821st October 2009  John Allison  (visXXX-V09-02-00 coworks greps-V09-02-02)
  • trunk/source/visualization/XXX/src/CVS/Entries

    r1337 r1340  
    55/G4XXXSG.cc/1.2/Thu Sep 30 06:17:21 2010//
    66/G4XXXSGSceneHandler.cc/1.6/Thu Sep 30 06:17:21 2010//
    7 /G4XXXSGViewer.cc/1.4/Thu Sep 30 06:17:21 2010//
    87/G4XXXSceneHandler.cc/1.32/Thu Sep 30 06:17:21 2010//
    98/G4XXXStored.cc/1.2/Thu Sep 30 06:17:21 2010//
    109/G4XXXStoredSceneHandler.cc/1.9/Thu Sep 30 06:17:21 2010//
    11 /G4XXXStoredViewer.cc/1.5/Thu Sep 30 06:17:28 2010//
    1210/G4XXXViewer.cc/1.9/Thu Sep 30 06:17:28 2010//
     11/G4XXXSGViewer.cc/1.5/Wed Oct  6 10:14:06 2010//
     12/G4XXXStoredViewer.cc/1.6/Wed Oct  6 10:14:07 2010//
    1313D
  • trunk/source/visualization/XXX/src/G4XXXSGViewer.cc

    r1337 r1340  
    2525//
    2626//
    27 // $Id: G4XXXSGViewer.cc,v 1.4 2006/08/29 16:11:25 allison Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     27// $Id: G4XXXSGViewer.cc,v 1.5 2010/10/06 10:12:03 allison Exp $
     28// GEANT4 tag $Name: $
    2929//
    3030//
     
    133133      (lastVP.GetNoOfSides ()       != fVP.GetNoOfSides ())       ||
    134134      (lastVP.IsMarkerNotHidden ()  != fVP.IsMarkerNotHidden ())  ||
     135      (lastVP.GetDefaultVisAttributes()->GetColour() !=
     136       fVP.GetDefaultVisAttributes()->GetColour())                ||
     137      (lastVP.GetDefaultTextVisAttributes()->GetColour() !=
     138       fVP.GetDefaultTextVisAttributes()->GetColour())            ||
    135139      (lastVP.GetBackgroundColour ()!= fVP.GetBackgroundColour ())
    136140      ) {
  • trunk/source/visualization/XXX/src/G4XXXStoredViewer.cc

    r1337 r1340  
    2525//
    2626//
    27 // $Id: G4XXXStoredViewer.cc,v 1.5 2006/08/29 16:11:25 allison Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     27// $Id: G4XXXStoredViewer.cc,v 1.6 2010/10/06 10:12:03 allison Exp $
     28// GEANT4 tag $Name: $
    2929//
    3030//
     
    129129      (lastVP.GetNoOfSides ()       != fVP.GetNoOfSides ())       ||
    130130      (lastVP.IsMarkerNotHidden ()  != fVP.IsMarkerNotHidden ())  ||
     131      (lastVP.GetDefaultVisAttributes()->GetColour() !=
     132       fVP.GetDefaultVisAttributes()->GetColour())                ||
     133      (lastVP.GetDefaultTextVisAttributes()->GetColour() !=
     134       fVP.GetDefaultTextVisAttributes()->GetColour())            ||
    131135      (lastVP.GetBackgroundColour ()!= fVP.GetBackgroundColour ())
    132136      ) {
  • 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//
  • trunk/source/visualization/management/CVS/Entries

    r1337 r1340  
    44/Doxyfile/1.2/Mon Jul 12 14:53:19 2010//
    55/GNUmakefile/1.17/Thu Sep 30 06:17:35 2010//
    6 /History/1.153/Thu Sep 30 11:54:27 2010//
    76/sources.cmake/1.1/Wed Sep 29 19:15:02 2010//
     7/History/1.155/Fri Oct  8 10:03:41 2010//
  • trunk/source/visualization/management/History

    r1337 r1340  
    1 $Id: History,v 1.153 2010/09/03 15:57:22 gcosmo Exp $
     1$Id: History,v 1.155 2010/10/07 07:31:43 allison Exp $
    22
    33-------------------------------------------------------------------
     
    2626History file for visualization management sub-category
    2727------------------------------------------------------
     28
     294th November 2010  Laurent Garnier Allison
     30- Added initialization of fGeometryMask (according to coverity.cern.ch)
     31
     326th October 2010  John Allison  (visman-V09-03-12)
     33- Added /vis/viewer/set/defaultColour and /vis/viewer/set/defaultTextColour.
    2834
    29353rd September 2010  Gabriele Cosmo  (visman-V09-03-11)
  • trunk/source/visualization/management/include/CVS/Entries

    r1337 r1340  
    2626/G4VisCommandsSceneHandler.hh/1.8/Thu Sep 30 06:17:37 2010//
    2727/G4VisCommandsViewer.hh/1.23/Thu Sep 30 06:17:37 2010//
    28 /G4VisCommandsViewerSet.hh/1.23/Thu Sep 30 06:17:37 2010//
    2928/G4VisExecutive.hh/1.10/Thu Sep 30 06:17:38 2010//
    3029/G4VisExecutive.icc/1.26/Thu Sep 30 06:17:38 2010//
     
    3938/G4VisModelManager.hh/1.4/Thu Sep 30 06:17:38 2010//
    4039/G4VisStateDependent.hh/1.5/Thu Sep 30 06:17:38 2010//
     40/G4VisCommandsViewerSet.hh/1.24/Wed Oct  6 15:52:57 2010//
    4141D
  • trunk/source/visualization/management/include/G4VisCommandsViewerSet.hh

    r1337 r1340  
    2525//
    2626//
    27 // $Id: G4VisCommandsViewerSet.hh,v 1.23 2009/05/13 18:17:25 allison Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     27// $Id: G4VisCommandsViewerSet.hh,v 1.24 2010/10/06 10:15:38 allison Exp $
     28// GEANT4 tag $Name: $
    2929
    3030// /vis/viewer/set commands - John Allison  16th May 2000
     
    5959  G4UIcommand*          fpCommandCulling;
    6060  G4UIcmdWithAString*   fpCommandCutawayMode;
     61  G4UIcommand*          fpCommandDefaultColour;
     62  G4UIcommand*          fpCommandDefaultTextColour;
    6163  G4UIcmdWithABool*     fpCommandEdge;
    6264  G4UIcommand*          fpCommandExplodeFactor;
  • trunk/source/visualization/management/src/CVS/Entries

    r1337 r1340  
    1616/G4VisCommandsSceneHandler.cc/1.32/Thu Sep 30 06:17:41 2010//
    1717/G4VisCommandsViewer.cc/1.76/Thu Sep 30 06:17:42 2010//
    18 /G4VisCommandsViewerSet.cc/1.50/Thu Sep 30 06:17:42 2010//
    1918/G4VisFeaturesOfDAWNFILE.cc/1.6/Thu Sep 30 06:17:42 2010//
    2019/G4VisFeaturesOfFukuiRenderer.cc/1.5/Thu Sep 30 06:17:42 2010//
     
    2423/G4VisStateDependent.cc/1.6/Thu Sep 30 06:17:43 2010//
    2524/G4ViewParameters.cc/1.37/Thu Sep 30 11:54:33 2010//
     25/G4VisCommandsViewerSet.cc/1.52/Mon Oct 11 09:00:12 2010//
    2626D
  • trunk/source/visualization/management/src/G4ViewParameters.cc

    r1337 r1340  
    4949  fXNegative(0x0010),
    5050  fYNegative(0x0020),
     51  fGeometryMask(0),
    5152  fDrawingStyle (wireframe),
    5253  fAuxEdgeVisible (false),
  • trunk/source/visualization/management/src/G4VisCommandsViewerSet.cc

    r1337 r1340  
    2525//
    2626//
    27 // $Id: G4VisCommandsViewerSet.cc,v 1.50 2009/05/13 18:17:25 allison Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     27// $Id: G4VisCommandsViewerSet.cc,v 1.52 2010/10/08 12:41:52 allison Exp $
     28// GEANT4 tag $Name: $
    2929
    3030// /vis/viewer/set commands - John Allison  16th May 2000
     
    143143  fpCommandCutawayMode->SetDefaultValue("union");
    144144
     145  fpCommandDefaultColour = new G4UIcommand
     146    ("/vis/viewer/set/defaultColour",this);
     147  fpCommandDefaultColour->SetGuidance
     148    ("Set defaultColour colour and transparency (default white and opaque).");
     149  fpCommandDefaultColour->SetGuidance
     150    ("Accepts (a) RGB triplet. e.g., \".3 .4 .5\", or"
     151     "\n(b) string such as \"white\", \"black\", \"grey\", \"red\"..."
     152     "\n(c) an additional number for opacity, e.g., \".3 .4 .5 .6\""
     153     "\n    or \"grey ! ! .6\" (note \"!\"'s for unused green and blue parameters),"
     154     "\n    e.g. \"! ! ! 0.\" for a transparent colour.");
     155  parameter = new G4UIparameter("red_or_string", 's', omitable = true);
     156  parameter -> SetDefaultValue ("1.");
     157  fpCommandDefaultColour -> SetParameter (parameter);
     158  parameter = new G4UIparameter("green", 'd', omitable = true);
     159  parameter -> SetDefaultValue (1.);
     160  fpCommandDefaultColour -> SetParameter (parameter);
     161  parameter = new G4UIparameter ("blue", 'd', omitable = true);
     162  parameter -> SetDefaultValue (1.);
     163  fpCommandDefaultColour -> SetParameter (parameter);
     164  parameter = new G4UIparameter ("opacity", 'd', omitable = true);
     165  parameter -> SetDefaultValue (1.);
     166  fpCommandDefaultColour -> SetParameter (parameter);
     167
     168  fpCommandDefaultTextColour = new G4UIcommand
     169    ("/vis/viewer/set/defaultTextColour",this);
     170  fpCommandDefaultTextColour->SetGuidance
     171    ("Set defaultTextColour colour and transparency (default white and opaque).");
     172  fpCommandDefaultTextColour->SetGuidance
     173    ("Accepts (a) RGB triplet. e.g., \".3 .4 .5\", or"
     174     "\n(b) string such as \"white\", \"black\", \"grey\", \"red\"..."
     175     "\n(c) an additional number for opacity, e.g., \".3 .4 .5 .6\""
     176     "\n    or \"grey ! ! .6\" (note \"!\"'s for unused green and blue parameters),"
     177     "\n    e.g. \"! ! ! 0.\" for a transparent colour.");
     178  parameter = new G4UIparameter("red_or_string", 's', omitable = true);
     179  parameter -> SetDefaultValue ("1.");
     180  fpCommandDefaultTextColour -> SetParameter (parameter);
     181  parameter = new G4UIparameter("green", 'd', omitable = true);
     182  parameter -> SetDefaultValue (1.);
     183  fpCommandDefaultTextColour -> SetParameter (parameter);
     184  parameter = new G4UIparameter ("blue", 'd', omitable = true);
     185  parameter -> SetDefaultValue (1.);
     186  fpCommandDefaultTextColour -> SetParameter (parameter);
     187  parameter = new G4UIparameter ("opacity", 'd', omitable = true);
     188  parameter -> SetDefaultValue (1.);
     189  fpCommandDefaultTextColour -> SetParameter (parameter);
     190
    145191  fpCommandEdge = new G4UIcmdWithABool("/vis/viewer/set/edge",this);
    146192  fpCommandEdge->SetGuidance
     
    267313  parameter = new G4UIparameter("field-half-angle",'d',omitable = true);
    268314  parameter->SetDefaultValue(30.);
     315  parameter->SetCurrentAsDefault(true);
    269316  fpCommandProjection->SetParameter(parameter);
    270317  parameter = new G4UIparameter("unit",'s',omitable = true);
    271318  parameter->SetDefaultValue("deg");
     319  parameter->SetCurrentAsDefault(true);
    272320  fpCommandProjection->SetParameter(parameter);
    273321
     
    401449  delete fpCommandCulling;
    402450  delete fpCommandCutawayMode;
     451  delete fpCommandDefaultColour;
     452  delete fpCommandDefaultTextColour;
    403453  delete fpCommandEdge;
    404454  delete fpCommandExplodeFactor;
     
    611661  }
    612662
     663  else if (command == fpCommandDefaultColour) {
     664    G4String redOrString;
     665    G4double green, blue, opacity;
     666    std::istringstream iss(newValue);
     667    iss >> redOrString >> green >> blue >> opacity;
     668    G4Colour colour(1.,1.,1.);  // Default white and opaque.
     669    const size_t iPos0 = 0;
     670    if (std::isalpha(redOrString[iPos0])) {
     671      G4Colour::GetColour(redOrString, colour); // Remains default (white) if
     672                                                // not found.
     673    } else {
     674      colour = G4Colour(G4UIcommand::ConvertTo3Vector(newValue));
     675    }
     676    colour = G4Colour(colour.GetRed(), colour.GetGreen(), colour.GetBlue(), opacity);
     677    G4VisAttributes va = vp.GetDefaultVisAttributes();
     678    va.SetColour(colour);
     679    vp.SetDefaultVisAttributes(va);
     680    if (verbosity >= G4VisManager::confirmations) {
     681      G4cout << "Default colour "
     682             << vp.GetDefaultVisAttributes()->GetColour()
     683             << " requested."
     684             << G4endl;
     685    }
     686  }
     687
     688  else if (command == fpCommandDefaultTextColour) {
     689    G4String redOrString;
     690    G4double green, blue, opacity;
     691    std::istringstream iss(newValue);
     692    iss >> redOrString >> green >> blue >> opacity;
     693    G4Colour colour(1.,1.,1.);  // Default white and opaque.
     694    const size_t iPos0 = 0;
     695    if (std::isalpha(redOrString[iPos0])) {
     696      G4Colour::GetColour(redOrString, colour); // Remains default (white) if
     697                                                // not found.
     698    } else {
     699      colour = G4Colour(G4UIcommand::ConvertTo3Vector(newValue));
     700    }
     701    colour = G4Colour(colour.GetRed(), colour.GetGreen(), colour.GetBlue(), opacity);
     702    G4VisAttributes va = vp.GetDefaultTextVisAttributes();
     703    va.SetColour(colour);
     704    vp.SetDefaultTextVisAttributes(va);
     705    if (verbosity >= G4VisManager::confirmations) {
     706      G4cout << "Default colour "
     707             << vp.GetDefaultTextVisAttributes()->GetColour()
     708             << " requested."
     709             << G4endl;
     710    }
     711  }
     712
    613713  else if (command == fpCommandEdge) {
    614714    G4ViewParameters::DrawingStyle existingStyle = vp.GetDrawingStyle();
  • trunk/source/visualization/test/G4History.macro

    r1197 r1340  
    66/vis/scene/create
    77/vis/scene/add/volume
    8 /vis/sceneHandler/create OGLSXm
     8/vis/sceneHandler/create OGLIQt
    99/vis/sceneHandler/attach
    1010/vis/scene/add/volume
     
    2525/vis/viewer/refresh viewer-0
    2626/vis/viewer/update viewer-0
     27/vis/ogl/set/printMode vectored
     28/vis/ogl/set/printFilename output-OGLIQt/output-test19-1
     29/vis/ogl/printEPS
    2730/vis/viewer/create
    2831/vis/viewer/refresh
     
    3235/vis/viewer/refresh
    3336/vis/viewer/set/projection perspective 30
    34 /vis/viewer/refresh
    3537/vis/viewer/flush
    3638/vis/viewer/refresh viewer-1
    3739/vis/viewer/update viewer-1
     40/vis/ogl/set/printMode vectored
     41/vis/ogl/set/printFilename output-OGLIQt/output-test19-2
     42/vis/ogl/printEPS
    3843/vis/viewer/create
    3944/vis/viewer/refresh
     
    4550/vis/viewer/refresh
    4651/vis/viewer/set/projection perspective 30
    47 /vis/viewer/refresh
    4852/vis/viewer/flush
    4953/vis/viewer/refresh viewer-2
    5054/vis/viewer/update viewer-2
     55/vis/ogl/set/printMode vectored
     56/vis/ogl/set/printFilename output-OGLIQt/output-test19-3
     57/vis/ogl/printEPS
    5158/vis/viewer/create
    5259/vis/viewer/refresh
     
    5865/vis/viewer/refresh
    5966/vis/viewer/set/projection perspective 30
    60 /vis/viewer/refresh
    6167/vis/viewer/flush
    6268/vis/viewer/refresh viewer-3
    6369/vis/viewer/update viewer-3
     70/vis/ogl/set/printMode vectored
     71/vis/ogl/set/printFilename output-OGLIQt/output-test19-4
     72/vis/ogl/printEPS
    6473/run/beamOn
    6574/vis/scene/create
    6675/vis/scene/add/logicalVolume expHall_L
    6776/vis/scene/notifyHandlers
    68 /vis/sceneHandler/create OGLIQt
    69 /vis/sceneHandler/attach
    7077/vis/viewer/create
    7178/vis/viewer/refresh
     
    7683/vis/viewer/refresh viewer-4
    7784/vis/viewer/update viewer-4
     85/vis/ogl/set/printMode vectored
     86/vis/ogl/set/printFilename output-OGLIQt/output-test19-5
     87/vis/ogl/printEPS
    7888/vis/scene/create
    7989/vis/scene/add/logicalVolume intersection_L
    8090/vis/scene/notifyHandlers
    81 /vis/sceneHandler/create OGLIQt
    82 /vis/sceneHandler/attach
    8391/vis/viewer/create
    8492/vis/viewer/refresh
     
    9199/vis/viewer/refresh viewer-5
    92100/vis/viewer/update viewer-5
     101/vis/ogl/set/printMode vectored
     102/vis/ogl/set/printFilename /output-OGLIQtoutput-test19-6
     103/vis/ogl/printEPS
    93104/vis/scene/create
    94105/vis/scene/add/logicalVolume subtraction_L
     
    102113/vis/viewer/refresh viewer-5
    103114/vis/viewer/update viewer-5
     115/vis/ogl/set/printMode vectored
     116/vis/ogl/set/printFilename output-OGLIQt/output-test19-7
     117/vis/ogl/printEPS
    104118/vis/scene/create
    105119/vis/scene/add/logicalVolume union_L
     
    113127/vis/viewer/refresh viewer-5
    114128/vis/viewer/update viewer-5
     129/vis/ogl/set/printMode vectored
     130/vis/ogl/set/printFilename /output-OGLIQtoutput-test19-8
     131/vis/ogl/printEPS
    115132/vis/scene/create
    116133/vis/scene/endOfEventAction accumulate
     
    121138/tracking/storeTrajectory 1
    122139/vis/scene/notifyHandlers
    123 /vis/sceneHandler/create OGLIQt
    124 /vis/sceneHandler/attach
    125140/vis/viewer/create
    126141/vis/viewer/refresh
     
    136151/vis/viewer/refresh viewer-6
    137152/vis/viewer/update viewer-6
     153/vis/ogl/set/printMode vectored
     154/vis/ogl/set/printFilename output-OGLIQt/output-test19-9
     155/vis/ogl/printEPS
    138156/vis/viewer/reset
    139157/vis/viewer/refresh
     
    157175/vis/viewer/refresh viewer-6
    158176/vis/viewer/update viewer-6
     177/vis/ogl/set/printMode vectored
     178/vis/ogl/set/printFilename output-OGLIQt/output-test19-10
     179/vis/ogl/printEPS
    159180/vis/viewer/reset
    160181/vis/viewer/refresh
     
    202223/vis/viewer/refresh viewer-6
    203224/vis/viewer/update viewer-6
     225/vis/ogl/set/printMode vectored
     226/vis/ogl/set/printFilename output-OGLIQt/output-test19-11
     227/vis/ogl/printEPS
    204228/vis/viewer/reset
    205229/vis/viewer/refresh
     
    231255/vis/viewer/refresh viewer-6
    232256/vis/viewer/update viewer-6
     257/vis/ogl/set/printMode vectored
     258/vis/ogl/set/printFilename output-OGLIQt/output-test19-12
     259/vis/ogl/printEPS
    233260/vis/viewer/reset
    234261/vis/viewer/refresh
     
    244271/vis/viewer/refresh viewer-6
    245272/vis/viewer/update viewer-6
     273/vis/ogl/set/printMode vectored
     274/vis/ogl/set/printFilename output-OGLIQt/output-test19-13
     275/vis/ogl/printEPS
    246276/vis/viewer/reset
    247277/vis/viewer/refresh
     
    307337/vis/viewer/refresh viewer-6
    308338/vis/viewer/update viewer-6
     339/vis/ogl/set/printMode vectored
     340/vis/ogl/set/printFilename output-OGLIQt/output-test19-14
     341/vis/ogl/printEPS
    309342/vis/viewer/reset
    310343/vis/viewer/refresh
     
    345378/vis/viewer/refresh viewer-6
    346379/vis/viewer/update viewer-6
     380/vis/ogl/set/printMode vectored
     381/vis/ogl/set/printFilename output-OGLIQt/output-test19-15
     382/vis/ogl/printEPS
    347383/vis/viewer/set/viewpointThetaPhi 30 30
    348384/vis/viewer/refresh
    349385/vis/viewer/set/projection perspective 30
    350 /vis/viewer/refresh
    351 /vis/viewer/flush
    352 /vis/viewer/refresh viewer-6
    353 /vis/viewer/update viewer-6
    354 /vis/sceneHandler/create OGLIQt
    355 /vis/sceneHandler/attach
     386/vis/viewer/flush
     387/vis/viewer/refresh viewer-6
     388/vis/viewer/update viewer-6
     389/vis/ogl/set/printMode vectored
     390/vis/ogl/set/printFilename output-OGLIQt/output-test19-16
     391/vis/ogl/printEPS
    356392/vis/viewer/create ! ! 200
    357393/vis/viewer/refresh
     
    361397/vis/viewer/refresh viewer-7
    362398/vis/viewer/update viewer-7
     399/vis/ogl/set/printMode vectored
     400/vis/ogl/set/printFilename output-OGLIQt/output-test19-17
     401/vis/ogl/printEPS
    363402/vis/rayTracer/column 150
    364403/vis/rayTracer/row 100
     
    368407/vis/viewer/refresh
    369408/vis/viewer/set/projection perspective 30
    370 /vis/viewer/refresh
    371409/vis/viewer/set/viewpointThetaPhi 45 45
    372410/vis/viewer/refresh
     
    374412/vis/viewer/refresh viewer-8
    375413/vis/viewer/update viewer-8
     414/vis/ogl/set/printMode vectored
     415/vis/ogl/set/printFilename output-OGLIQt/output-test19-18
     416/vis/ogl/printEPS
    376417/vis/viewer/create ! ! 200
    377418/vis/viewer/refresh
     
    379420/vis/viewer/refresh viewer-9
    380421/vis/viewer/update viewer-9
     422/vis/ogl/set/printMode vectored
     423/vis/ogl/set/printFilename output-OGLIQt/output-test19-19
     424/vis/ogl/printEPS
  • trunk/source/visualization/test/History

    r1274 r1340  
    1 $Id: History,v 1.123 2010/05/11 12:06:08 allison Exp $
     1$Id: History,v 1.126 2010/10/27 11:17:48 allison Exp $
    22
    33History file for visualization/test subdirectory
     
    55
    66$Log: History,v $
     7Revision 1.126  2010/10/27 11:17:48  allison
     8Sorry.. vistest-V09-03-01
     9
     10Revision 1.125  2010/10/27 11:16:59  allison
     11vistest-V09-03-00
     12
     13Revision 1.124  2010/10/26 16:17:44  allison
     14Replaced MyPhysicsList by QGSP_BERT.
     15
    716Revision 1.123  2010/05/11 12:06:08  allison
    817vistest-V09-03-00
  • trunk/source/visualization/test/test19.cc

    r1228 r1340  
    2525//
    2626//
    27 // $Id: test19.cc,v 1.32 2009/11/06 16:01:57 allison Exp $
     27// $Id: test19.cc,v 1.34 2010/10/26 16:17:44 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    4040//#include "SharedSolidDetectorConstruction.hh"
    4141#include "test19DetectorConstruction.hh"
    42 #include "MyPhysicsList.hh"
     42#include "QGSP_BERT.hh"
    4343#include "MyRunAction.hh"
    4444#include "MyPrimaryGeneratorAction.hh"
     
    9090  runManager -> SetUserInitialization (new test19DetectorConstruction);
    9191  //runManager -> SetUserInitialization (new SharedSolidDetectorConstruction);
    92   runManager -> SetUserInitialization (new MyPhysicsList);
     92  runManager -> SetUserInitialization (new QGSP_BERT);
    9393
    9494  // UserAction classes.
  • trunk/source/visualization/test/test19.g4m

    r1274 r1340  
    66/control/saveHistory
    77/vis/verbose confirmations
    8 #
    9 # See list of detector possibilities.
    10 /test19det/detector
    11 # Select detector.
    12 #/test19det/detector 1
    13 #/test19det/detector 4
    14 #
    15 # Initialise run, i.e., create geometry, set cuts, etc.
    16 /run/initialize
    17 #
    18 # Set gun for demo (detector 1)
    19 #/gun/particle e+
    20 #/gun/position 0 -100 0 cm
    21 #/gun/direction 0 1 0
    22 #
    23 # for drawing the tracks
    24 /tracking/storeTrajectory 1
    25 # if too many tracks cause core dump =storeTrajectory 0
    26 #
    27 # Create empty scene.
    28 /vis/scene/create
    29 #
    30 # Add volume to scene - "world" is default.
    31 /vis/scene/add/volume
    32 #
    33 # See list of graphics systems possibilities.
    34 # help /vis/sceneHandler/create
    35 #
    36 # Create a scene handler for a specific graphics system.
    37 # Edit the next line(s) to choose another graphic system
    38 #/vis/sceneHandler/create DAWNFILE
    39 #/vis/sceneHandler/create DAWN
    40 #/vis/sceneHandler/create OGLIXm
    41 #/vis/sceneHandler/create OGLSXm
    42 #/vis/sceneHandler/create OGLIX
    43 /vis/sceneHandler/create OGLSX
    44 #/vis/sceneHandler/create OGLSXm
    45 #/vis/sceneHandler/create VRML1
    46 #/vis/sceneHandler/create VRML1FILE
    47 #
    48 # Add world volume.
    49 /vis/scene/add/volume
    50 /vis/scene/add/axes 0 0 0 2 m
    51 /vis/scene/add/text 0 0 0 mm 50 -120 -200 test19 example text
    52 #
    53 # Add logo
    54 /vis/scene/add/logo
    55 #
    56 # Add scale
    57 /vis/scene/add/scale
    58 #
    59 # Add event id
    60 /vis/scene/add/eventID
    61 #
    62 # Create a viewer.
    63 /vis/viewer/create
    64 #
    65 # John's personal preferences
    66 /vis/viewer/set/lightsMove camera
    67 /vis/viewer/set/hiddenMarker true
    68 #
    69 /vis/viewer/set/lineSegmentsPerCircle 100
    70 # flush not necessary for auto-refresh drivers like OGL abd OI, but leave
    71 # (all that happens is an extra refresh).
    72 /vis/viewer/flush
    73 /vis/ogl/set/printMode vectored
    74 /vis/ogl/set/printSize 800 600
    75 /vis/ogl/set/printFilename output-test19-1
    76 /vis/ogl/printEPS
    77 #
    78 # Create another viewer.
    79 /vis/viewer/create
    80 #
    81 /vis/viewer/set/viewpointThetaPhi 35 35
    82 /vis/viewer/set/style surface
    83 /vis/viewer/set/projection perspective 30
    84 #
    85 /vis/viewer/flush
    86 /vis/ogl/set/printMode vectored
    87 /vis/ogl/set/printSize 800 600
    88 /vis/ogl/set/printFilename output-test19-2
    89 /vis/ogl/printEPS
    90 #
    91 # Now hidden line removal.
    92 /vis/viewer/create
    93 #
    94 /vis/viewer/set/viewpointThetaPhi 35 35
    95 /vis/viewer/set/style wireframe
    96 /vis/viewer/set/hiddenEdge
    97 /vis/viewer/set/projection perspective 30
    98 #
    99 /vis/viewer/flush
    100 /vis/ogl/set/printMode vectored
    101 /vis/ogl/set/printSize 800 600
    102 /vis/ogl/set/printFilename output-test19-3
    103 /vis/ogl/printEPS
    104 #
    105 # Now hidden line *and* hidden surface removal.
    106 /vis/viewer/create
    107 #
    108 /vis/viewer/set/viewpointThetaPhi 35 35
    109 /vis/viewer/set/style surface
    110 /vis/viewer/set/hiddenEdge
    111 /vis/viewer/set/projection perspective 30
    112 #
    113 /vis/viewer/flush
    114 /vis/ogl/set/printMode vectored
    115 /vis/ogl/set/printSize 800 600
    116 /vis/ogl/set/printFilename output-test19-4
    117 /vis/ogl/printEPS
    118 #
    119 # Start a run to initialise/optimise geometry and draw user-drawn transients.
    120 /run/beamOn
    121 #
    122 # Test logical volume model...
    123 /vis/scene/create
    124 /vis/scene/add/logicalVolume expHall_L
    125 /vis/sceneHandler/create OGLIQt
    126 /vis/viewer/create
    127 /vis/viewer/set/viewpointThetaPhi 35 35
    128 /vis/scene/notifyHandlers
    129 /vis/viewer/flush
    130 /vis/ogl/set/printMode vectored
    131 /vis/ogl/set/printSize 800 600
    132 /vis/ogl/set/printFilename output-test19-5
    133 /vis/ogl/printEPS
    134 #
    135 # Logical volume of Boolean solids...
    136 /vis/scene/create
    137 /vis/scene/add/logicalVolume intersection_L
    138 /vis/sceneHandler/create OGLIQt
    139 /vis/viewer/create
    140 /vis/viewer/reset
    141 /vis/viewer/set/viewpointThetaPhi 35 35
    142 /vis/scene/notifyHandlers
    143 /vis/viewer/flush
    144 /vis/ogl/set/printMode vectored
    145 /vis/ogl/set/printSize 800 600
    146 /vis/ogl/set/printFilename output-test19-6
    147 /vis/ogl/printEPS
    148 #
    149 /vis/scene/create
    150 /vis/scene/add/logicalVolume subtraction_L
    151 /vis/sceneHandler/attach
    152 /vis/viewer/reset
    153 /vis/viewer/set/viewpointThetaPhi 35 35
    154 /vis/viewer/flush
    155 /vis/ogl/set/printMode vectored
    156 /vis/ogl/set/printSize 800 600
    157 /vis/ogl/set/printFilename output-test19-7
    158 /vis/ogl/printEPS
    159 #
    160 /vis/scene/create
    161 /vis/scene/add/logicalVolume union_L
    162 /vis/sceneHandler/attach
    163 /vis/viewer/reset
    164 /vis/viewer/set/viewpointThetaPhi 35 35
    165 /vis/viewer/flush
    166 /vis/ogl/set/printMode vectored
    167 /vis/ogl/set/printSize 800 600
    168 /vis/ogl/set/printFilename output-test19-8
    169 /vis/ogl/printEPS
    170 #
    171 # Send geantino through...
    172 /vis/scene/create
    173 /vis/scene/endOfEventAction accumulate
    174 /vis/scene/endOfRunAction accumulate
    175 /vis/scene/add/volume
    176 /vis/scene/add/trajectories 5000
    177 #/vis/sceneHandler/create OGLSX
    178 /vis/sceneHandler/create OGLIQt
    179 /vis/viewer/create
    180 /vis/viewer/reset
    181 /vis/viewer/set/viewpointThetaPhi 35 35
    182 /vis/scene/notifyHandlers
    183 /tracking/verbose 2
    184 /run/beamOn 1
    185 /tracking/verbose 0
    186 /vis/viewer/flush
    187 /vis/ogl/set/printMode vectored
    188 /vis/ogl/set/printSize 800 600
    189 /vis/ogl/set/printFilename output-test19-9
    190 /vis/ogl/printEPS
    191 #
    192 # Rotated tracker tube
    193 /vis/viewer/reset
    194 #/vis/viewer/panTo 0 -200 cm
    195 /vis/viewer/set/upVector 1 0 0
    196 /vis/viewer/set/viewpointVector 0 1 0
    197 #/vis/viewer/zoom 5
    198 /vis/viewer/set/auxiliaryEdge true
    199 /vis/viewer/refresh
    200 /gun/direction 1 0 0
    201 /gun/position -200 -200 150 cm
    202 /run/beamOn
    203 /gun/position -200 -200 200 cm
    204 /run/beamOn
    205 /gun/position -200 -200 250 cm
    206 /run/beamOn
    207 /gun/position -200 -200 300 cm
    208 /run/beamOn
    209 /vis/viewer/flush
    210 /vis/ogl/set/printMode vectored
    211 /vis/ogl/set/printSize 800 600
    212 /vis/ogl/set/printFilename output-test19-10
    213 /vis/ogl/printEPS
    214 #
    215 # G4Trap1
    216 /vis/viewer/reset
    217 #/vis/viewer/panTo -200 200 cm  # Originally intended to be absolute coords.
    218 /vis/viewer/pan -275 75 cm
    219 /vis/viewer/zoom 5
    220 /vis/viewer/refresh
    221 /gun/direction -1 0 0
    222 /gun/position -20 120 -200 cm
    223 /run/beamOn
    224 /gun/position -20 130 -200 cm
    225 /run/beamOn
    226 /gun/position -20 140 -200 cm
    227 /run/beamOn
    228 /gun/position -20 150 -200 cm
    229 /run/beamOn
    230 /gun/position -20 160 -200 cm
    231 /run/beamOn
    232 /gun/position -20 170 -200 cm
    233 /run/beamOn
    234 /gun/position -20 180 -200 cm
    235 /run/beamOn
    236 /gun/position -20 190 -200 cm
    237 /run/beamOn
    238 /gun/position -20 200 -200 cm
    239 /run/beamOn
    240 /gun/position -20 210 -200 cm
    241 /run/beamOn
    242 /gun/position -20 220 -200 cm
    243 /run/beamOn
    244 /gun/position -20 230 -200 cm
    245 /run/beamOn
    246 /gun/position -20 240 -200 cm
    247 /run/beamOn
    248 /gun/position -20 250 -200 cm
    249 /run/beamOn
    250 /gun/position -20 260 -200 cm
    251 /run/beamOn
    252 /gun/position -20 270 -200 cm
    253 /run/beamOn
    254 /gun/position -20 280 -200 cm
    255 /run/beamOn
    256 /vis/viewer/flush
    257 /vis/ogl/set/printMode vectored
    258 /vis/ogl/set/printSize 800 600
    259 /vis/ogl/set/printFilename output-test19-11
    260 /vis/ogl/printEPS
    261 #
    262 # G4Trap2
    263 /vis/viewer/reset
    264 #/vis/viewer/panTo -200 400 cm
    265 /vis/viewer/pan -275 275 cm
    266 /vis/viewer/set/viewpointThetaPhi 90 180
    267 #/vis/viewer/panTo -200 0 cm
    268 /vis/viewer/pan -200 0 cm
    269 /vis/viewer/zoom 5
    270 /vis/viewer/refresh
    271 /gun/direction 0 0 -1
    272 /gun/position -200 400 -20 cm
    273 /run/beamOn
    274 /gun/position -200 380 -20 cm
    275 /run/beamOn
    276 /gun/position -200 420 -20 cm
    277 /run/beamOn
    278 /gun/position -200 360 -20 cm
    279 /run/beamOn
    280 /gun/position -200 440 -20 cm
    281 /run/beamOn
    282 /gun/position -200 340 -20 cm
    283 /run/beamOn
    284 /gun/position -200 460 -20 cm
    285 /run/beamOn
    286 /vis/viewer/flush
    287 /vis/ogl/set/printMode vectored
    288 /vis/ogl/set/printSize 800 600
    289 /vis/ogl/set/printFilename output-test19-12
    290 /vis/ogl/printEPS
    291 #
    292 # Displaced solid.
    293 /vis/viewer/reset
    294 #/vis/viewer/panTo 200 -200 cm
    295 /vis/viewer/pan 125 -325 cm
    296 /vis/viewer/zoom 5
    297 /vis/viewer/refresh
    298 /gun/position 100 -180 0 cm
    299 /gun/direction 1 0 0
    300 /run/beamOn
    301 /vis/viewer/flush
    302 /vis/ogl/set/printMode vectored
    303 /vis/ogl/set/printSize 800 600
    304 /vis/ogl/set/printFilename output-test19-13
    305 /vis/ogl/printEPS
    306 #
    307 # Boolean solid.
    308 /vis/viewer/reset
    309 #/vis/viewer/panTo 250 -50 cm
    310 /vis/viewer/pan 175 -175 cm
    311 /vis/viewer/zoom 3
    312 /vis/viewer/refresh
    313 /gun/direction 1 0 0
    314 /gun/position 50 -105 0 cm
    315 /run/beamOn
    316 /gun/position 50 -100 0 cm
    317 /run/beamOn
    318 /gun/position 50 -95 0 cm
    319 /run/beamOn
    320 /gun/position 50 -90 0 cm
    321 /run/beamOn
    322 /gun/position 50 -85 0 cm
    323 /run/beamOn
    324 /gun/position 50 -80 0 cm
    325 /run/beamOn
    326 /gun/position 50 -75 0 cm
    327 /run/beamOn
    328 /gun/position 50 -70 0 cm
    329 /run/beamOn
    330 /gun/position 50 -65 0 cm
    331 /run/beamOn
    332 /gun/position 50 -60 0 cm
    333 /run/beamOn
    334 /gun/position 50 -55 0 cm
    335 /run/beamOn
    336 /gun/position 50 -50 0 cm
    337 /run/beamOn
    338 /gun/position 50 -45 0 cm
    339 /run/beamOn
    340 /gun/position 50 -40 0 cm
    341 /run/beamOn
    342 /gun/position 50 -35 0 cm
    343 /run/beamOn
    344 /gun/position 50 -30 0 cm
    345 /run/beamOn
    346 /gun/position 50 -25 0 cm
    347 /run/beamOn
    348 /gun/position 50 -20 0 cm
    349 /run/beamOn
    350 /gun/position 50 -15 0 cm
    351 /run/beamOn
    352 /gun/position 50 -10 0 cm
    353 /run/beamOn
    354 /gun/position 50 -5 0 cm
    355 /run/beamOn
    356 /gun/position 50 0 0 cm
    357 /run/beamOn
    358 /gun/position 50 5 0 cm
    359 /run/beamOn
    360 /gun/position 50 10 0 cm
    361 /run/beamOn
    362 /gun/position 50 15 0 cm
    363 /run/beamOn
    364 /gun/position 50 20 0 cm
    365 /run/beamOn
    366 /vis/viewer/flush
    367 /vis/ogl/set/printMode vectored
    368 /vis/ogl/set/printSize 800 600
    369 /vis/ogl/set/printFilename output-test19-14
    370 /vis/ogl/printEPS
    371 #
    372 # To view replicas...
    373 # Investigating BaBar problem...
    374 # G4SmartVoxelHeader::BuildNodes - PANIC! Daughter physical volume
    375 # name = EB20 is entirely outside mother logical volume name = EBMX
    376 /vis/viewer/reset
    377 #/vis/viewer/panTo -200 0 cm
    378 /vis/viewer/pan -275 -125 cm
    379 /vis/viewer/zoom 7
    380 /vis/viewer/refresh
    381 /gun/direction 0 1 0
    382 # The following just crash with replicas...
    383 /gun/position -200 -100 0 cm
    384 /run/beamOn
    385 /gun/position -195 -100 0 cm
    386 /run/beamOn
    387 /gun/position -190 -100 0 cm
    388 /run/beamOn
    389 /gun/position -185 -100 0 cm
    390 /run/beamOn
    391 /gun/position -180 -100 0 cm
    392 /run/beamOn
    393 /gun/position -160 -100 0 cm
    394 /run/beamOn
    395 #...end
    396 /gun/position -200 0 0 cm
    397 # The following just crash with replicas...
    398 /gun/direction 1 1 0
    399 /run/beamOn
    400 /gun/direction 0 1 0
    401 /run/beamOn
    402 /gun/direction 1 .2 0
    403 /run/beamOn
    404 /gun/direction -1 1 0
    405 /run/beamOn
    406 /gun/direction -1 -1 0
    407 /run/beamOn
    408 /gun/direction 0 -1 0
    409 /run/beamOn
    410 /gun/direction 1 -1 0
    411 /run/beamOn
    412 /vis/viewer/flush
    413 /vis/ogl/set/printMode vectored
    414 /vis/ogl/set/printSize 800 600
    415 /vis/ogl/set/printFilename output-test19-15
    416 /vis/ogl/printEPS
    417 #...end
    418 #
    419 /vis/viewer/set/viewpointThetaPhi 30 30
    420 /vis/viewer/set/projection perspective 30
    421 /vis/viewer/flush
    422 /vis/ogl/set/printMode vectored
    423 /vis/ogl/set/printSize 800 600
    424 /vis/ogl/set/printFilename output-test19-16
    425 /vis/ogl/printEPS
    426 #
    427 #/vis/sceneHandler/create OIX
    428 /vis/sceneHandler/create OGLIQt
    429 #/vis/viewer/create
    430 /vis/viewer/create ! ! 200
    431 /vis/viewer/set/viewpointThetaPhi 30 30
    432 /vis/viewer/flush
    433 /vis/ogl/set/printMode vectored
    434 /vis/ogl/set/printSize 800 600
    435 /vis/ogl/set/printFilename output-test19-17
    436 /vis/ogl/printEPS
    437 #
    438 # You can use /vis/rayTracer/... commands
    439 /vis/rayTracer/column 150
    440 /vis/rayTracer/row 100
    441 /vis/rayTracer/backgroundColour .3 .2 .1
    442 /vis/rayTracer/trace
    443 #
    444 /vis/viewer/create ! ! 200x300
    445 /vis/viewer/set/projection perspective  30
    446 /vis/viewer/set/viewpointThetaPhi 45 45
    447 /vis/viewer/flush
    448 /vis/ogl/set/printMode vectored
    449 /vis/ogl/set/printSize 800 600
    450 /vis/ogl/set/printFilename output-test19-18
    451 /vis/ogl/printEPS
    452 #
    453 # Odd!!?  JPEG image seems upside down for default view direction...
    454 /vis/viewer/create ! ! 200
    455 /vis/viewer/flush
    456 /vis/ogl/set/printMode vectored
    457 /vis/ogl/set/printSize 800 600
    458 /vis/ogl/set/printFilename output-test19-19
    459 /vis/ogl/printEPS
     8
     9#/control/execute test19-OGLSX.g4m
     10#/control/execute test19-OGLIX.g4m
     11/control/execute test19-OGLIQt.g4m
     12#/control/execute test19-OGLSQt.g4m
    46013exit
Note: See TracChangeset for help on using the changeset viewer.