Changeset 1040 for trunk/source


Ignore:
Timestamp:
May 13, 2009, 12:15:37 PM (15 years ago)
Author:
garnier
Message:

avant modif pour CVS

Location:
trunk/source/visualization
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/visualization/HepRep/History

    r841 r1040  
    1 .$Id: History,v 1.128 2008/01/04 22:11:31 allison Exp $
     1.$Id: History,v 1.129 2009/05/08 09:29:23 gcosmo Exp $
    22-------------------------------------------------------------------
    33
     
    2121--------------------------------------------------
    2222
    23 4th January 2008  John Allison  (vis-HepRep-V09-01-00)
     238 May 2009  Gabriele Cosmo  (vis-HepRep-V09-02-00)
     24- Added inclusion of <cstdio> in DeflateOutputStreamBuffer.h to resolve
     25  compilation errors reported by gcc-4.4.0.
     26
     274 January 2008  John Allison  (vis-HepRep-V09-01-00)
    2428- Adapted to new BeginPrimitives2D signature.
    2529
    26 16 Nov 2007 Joseph Perl (vis-HepRep-V09-00-01)
     3016 November 2007 Joseph Perl (vis-HepRep-V09-00-01)
    2731- Adjust geometry hierarchy in G4HepRepFileSceneHandler to accomodate
    2832  parallel worlds.  Where used to just have world at top of hierarchy,
  • trunk/source/visualization/HepRep/include/cheprep/DeflateOutputStreamBuffer.h

    r834 r1040  
    66#include <iostream>
    77#include <string>
     8#include <cstdio>
    89
    910#ifndef CHEPREP_NO_ZLIB
     
    1314/**
    1415 * @author Mark Donszelmann
    15  * @version $Id: DeflateOutputStreamBuffer.h,v 1.5 2005/06/02 21:28:45 duns Exp $
     16 * @version $Id: DeflateOutputStreamBuffer.h,v 1.6 2009/05/08 09:26:58 gcosmo Exp $
    1617 */
    1718namespace cheprep {
  • trunk/source/visualization/History

    r1023 r1040  
    1 $Id: History,v 1.437 2009/04/27 16:23:06 allison Exp $
     1$Id: History,v 1.438 2009/04/29 20:06:39 allison Exp $
    22-------------------------------------------------------------------
    33
     
    2424History file for visualization category
    2525---------------------------------------
     26
     2729 April 2009, John Allison (vis-V09-02-03)
     28- visexternal-V09-02-04: Fix a circular dependency to G4OpenGL.
    2629
    273027th April 2009  John Allison (vis-V09-02-02)
  • trunk/source/visualization/OpenGL/History

    r1036 r1040  
    2020History file for visualization/OpenGL
    2121-------------------------------------
     22
     2313 May 2009, Laurent Garnier
     24 - G4OpenGLStoredQtViewer.cc: Fix a second view redraw at ShowView() call
     25 - G4OpenGLQtViewer : Remove unuseful variables, renaming others
     26
     27
    22286 May 2009, Laurent Garnier
    2329 - G4OpenGLQtViewer.cc: Fix compilation warning and error with gcc4.4
  • trunk/source/visualization/OpenGL/include/G4OpenGLQtViewer.hh

    r941 r1040  
    120120protected:
    121121  QGLWidget* fWindow;
    122   QDialog* GLWindow;
     122  QDialog* fGLWindow;
    123123  bool hasPendingEvents();
    124124  void savePPMToTemp();
     
    131131  float fDeltaRotationAngleZ;
    132132
    133   bool hasToRepaint;
    134   bool readyToPaint;
    135   bool zoomAction;
    136   QPoint beginZoom;
    137   QPoint endZoom;
     133  bool fHasToRepaint;
     134  bool fReadyToPaint;
    138135
    139136private:
  • trunk/source/visualization/OpenGL/include/G4OpenGLViewer.hh

    r1039 r1040  
    7575 
    7676  unsigned int getWinWidth();
     77  unsigned int getWinHeight();
    7778  G4bool sizeHasChanged();
    7879  // return true if size has change since last redraw
    79   unsigned int getWinHeight();
    8080  GLdouble getSceneNearWidth();
    8181  GLdouble getSceneFarWidth();
  • trunk/source/visualization/OpenGL/src/G4OpenGLImmediateQtViewer.cc

    r1039 r1040  
    5656  setFocusPolicy(Qt::StrongFocus); // enable keybord events
    5757#endif
    58   hasToRepaint =false;
     58  fHasToRepaint =false;
    5959
    6060  if (fViewId < 0) return;  // In case error in base class instantiation.
     
    6969  printf("G4OpenGLImmediateQtViewer::Initialise \n");
    7070#endif
    71   readyToPaint = false;
     71  fReadyToPaint = false;
    7272  CreateMainWindow (this,QString(fName));
    7373  CreateFontLists ();
    7474
    75   readyToPaint = true;
     75  fReadyToPaint = true;
    7676}
    7777
     
    9292
    9393  if (fSceneHandler.GetScene() == 0) {
    94     hasToRepaint =false;
     94    fHasToRepaint =false;
    9595  } else {
    96     hasToRepaint =true;
     96    fHasToRepaint =true;
    9797  }
    9898
     
    152152  printf("G4OpenGLImmediateQtViewer::ComputeView %d %d ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n",getWinWidth(), getWinHeight());
    153153#endif
    154   hasToRepaint = true;
     154  fHasToRepaint = true;
    155155}
    156156
     
    176176
    177177  ResizeWindow(aWidth,aHeight);
    178   hasToRepaint = sizeHasChanged();
     178  fHasToRepaint = sizeHasChanged();
    179179}
    180180
     
    185185  printf("\n\nG4OpenGLImmediateQtViewer::paintGL ??\n");
    186186#endif
    187   if (!readyToPaint) {
    188     readyToPaint= true;
     187  if (!fReadyToPaint) {
     188    fReadyToPaint= true;
    189189    return;
    190190  }
    191191  // DO NOT RESIZE IF SIZE HAS NOT CHANGE
    192   if ( !hasToRepaint) {
     192  if ( !fHasToRepaint) {
    193193    if (((getWinWidth() == (unsigned int)width())) &&(getWinHeight() == (unsigned int) height())) {
    194194      return;
     
    196196  }
    197197#ifdef G4DEBUG_VIS_OGL
    198   printf("G4OpenGLImmediateQtViewer::paintGL VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV ready %d\n",readyToPaint);
     198  printf("G4OpenGLImmediateQtViewer::paintGL VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV ready %d\n",fReadyToPaint);
    199199#endif
    200200
     
    204204  ComputeView();
    205205
    206   hasToRepaint = false; // could be set to false by ComputeView
    207 
    208 #ifdef G4DEBUG_VIS_OGL
    209   printf("G4OpenGLImmediateQtViewer::paintGL ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ready %d\n\n\n",readyToPaint);
     206  fHasToRepaint = false; // could be set to false by ComputeView
     207
     208#ifdef G4DEBUG_VIS_OGL
     209  printf("G4OpenGLImmediateQtViewer::paintGL ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ready %d\n\n\n",fReadyToPaint);
    210210#endif
    211211}
     
    252252
    253253void G4OpenGLImmediateQtViewer::updateQWidget() {
    254   hasToRepaint= true;
     254  fHasToRepaint= true;
    255255  updateGL();
    256   hasToRepaint= false;
     256  fHasToRepaint= false;
    257257}
    258258
  • trunk/source/visualization/OpenGL/src/G4OpenGLQtViewer.cc

    r1039 r1040  
    130130      ++it;
    131131      if ((found== false) && (widget->inherits("QMainWindow"))) {
    132         GLWindow = new QDialog(0,0,FALSE,Qt::WStyle_Title | Qt::WStyle_SysMenu | Qt::WStyle_MinMax );
     132        fGLWindow = new QDialog(0,0,FALSE,Qt::WStyle_Title | Qt::WStyle_SysMenu | Qt::WStyle_MinMax );
    133133        found = true;
    134134      }
     
    138138    foreach (QWidget *widget, QApplication::allWidgets()) {
    139139      if ((found== false) && (widget->inherits("QMainWindow"))) {
    140         GLWindow = new QDialog(0,Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint);
     140        fGLWindow = new QDialog(0,Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint);
    141141        found = true;
    142142      }
     
    145145
    146146#if QT_VERSION < 0x040000
    147     glWidget->reparent(GLWindow,0,QPoint(0,0)); 
    148 #else
    149     glWidget->setParent(GLWindow); 
     147    glWidget->reparent(fGLWindow,0,QPoint(0,0)); 
     148#else
     149    glWidget->setParent(fGLWindow); 
    150150#endif
    151151
     
    154154      printf("G4OpenGLQtViewer::CreateMainWindow case Qapp exist, but not found\n");
    155155#endif
    156       GLWindow = new QDialog();
     156      fGLWindow = new QDialog();
    157157    }
    158158  } else {
     
    160160    printf("G4OpenGLQtViewer::CreateMainWindow case Qapp exist\n");
    161161#endif
    162     GLWindow = new QDialog();
    163   }
    164 
    165   QHBoxLayout *mainLayout = new QHBoxLayout(GLWindow);
     162    fGLWindow = new QDialog();
     163  }
     164
     165  QHBoxLayout *mainLayout = new QHBoxLayout(fGLWindow);
    166166
    167167  mainLayout->addWidget(fWindow);
    168168
    169169#if QT_VERSION < 0x040000
    170   GLWindow->setCaption(name );
    171 #else
    172   GLWindow->setLayout(mainLayout);
    173   GLWindow->setWindowTitle( name);
     170  fGLWindow->setCaption(name );
     171#else
     172  fGLWindow->setLayout(mainLayout);
     173  fGLWindow->setWindowTitle( name);
    174174#endif
    175175  ResizeWindow(fVP.GetWindowSizeHintX(),fVP.GetWindowSizeHintY());
     
    183183    YPos = offset;
    184184  }
    185   GLWindow->resize(getWinWidth(), getWinHeight());
    186   GLWindow->move(fVP.GetWindowAbsoluteLocationHintX(QApplication::desktop()->width()),YPos);
    187   GLWindow->show();
     185  fGLWindow->resize(getWinWidth(), getWinHeight());
     186  fGLWindow->move(fVP.GetWindowAbsoluteLocationHintX(QApplication::desktop()->width()),YPos);
     187  fGLWindow->show();
    188188 
    189189  if(!fWindow) return;
     
    201201 */
    202202// void G4OpenGLQtViewer::dialogClosed() {
    203 //   //  GLWindow = NULL;
     203//   //  fGLWindow = NULL;
    204204// }
    205205#endif
     
    275275
    276276#if QT_VERSION < 0x040000
    277   fContextMenu = new QPopupMenu( GLWindow,"All" );
     277  fContextMenu = new QPopupMenu( fGLWindow,"All" );
    278278#else
    279279  fContextMenu = new QMenu("All");
     
    775775void G4OpenGLQtViewer::G4manageContextMenuEvent(QContextMenuEvent *e)
    776776{
    777   if (!GLWindow) {
     777  if (!fGLWindow) {
    778778    G4cerr << "Visualization window not defined, please choose one before" << G4endl;
    779779  } else {
     
    12341234*/
    12351235void G4OpenGLQtViewer::toggleFullScreen(bool check) {
    1236   if (check != GLWindow->isFullScreen()) { //toggle
     1236  if (check != fGLWindow->isFullScreen()) { //toggle
    12371237#if QT_VERSION >= 0x030200
    1238     GLWindow->setWindowState(GLWindow->windowState() ^ Qt::WindowFullScreen);
     1238    fGLWindow->setWindowState(fGLWindow->windowState() ^ Qt::WindowFullScreen);
    12391239#else
    12401240    G4cerr << "This version of Qt could not do fullScreen. Resizing the widget is the only solution available." << G4endl;
     
    12941294  fPrintFilename =  QFileDialog::getSaveFileName ( ".",
    12951295                                                    filters,
    1296                                                     GLWindow,
     1296                                                    fGLWindow,
    12971297                                                    "Save file dialog",
    12981298                                                    tr("Save as ..."),
    12991299                                                    selectedFormat ).ascii();
    13001300#else
    1301   fPrintFilename =  QFileDialog::getSaveFileName ( GLWindow,
     1301  fPrintFilename =  QFileDialog::getSaveFileName ( fGLWindow,
    13021302                                                    tr("Save as ..."),
    13031303                                                    ".",
     
    13161316  QString format = selectedFormat->toLower();
    13171317#endif
    1318   G4OpenGLQtExportDialog* exportDialog= new G4OpenGLQtExportDialog(GLWindow,format,fWindow->height(),fWindow->width());
     1318  G4OpenGLQtExportDialog* exportDialog= new G4OpenGLQtExportDialog(fGLWindow,format,fWindow->height(),fWindow->width());
    13191319  if(  exportDialog->exec()) {
    13201320
     
    13981398void G4OpenGLQtViewer::showMovieParametersDialog() {
    13991399  if (!fMovieParametersDialog) {
    1400     fMovieParametersDialog= new G4OpenGLQtMovieDialog(this,GLWindow);
     1400    fMovieParametersDialog= new G4OpenGLQtMovieDialog(this,fGLWindow);
    14011401    displayRecordingStatus();
    14021402    fMovieParametersDialog->checkEncoderSwParameters();
  • trunk/source/visualization/OpenGL/src/G4OpenGLStoredQtViewer.cc

    r1039 r1040  
    5757  setFocusPolicy(Qt::StrongFocus); // enable keybord events
    5858#endif
    59   hasToRepaint =false;
     59  fHasToRepaint =false;
    6060
    6161  if (fViewId < 0) return;  // In case error in base class instantiation.
     
    7373  printf("G4OpenGLStoredQtViewer::Initialise 1\n");
    7474#endif
    75   readyToPaint = false;
     75  fReadyToPaint = false;
    7676  CreateMainWindow (this,QString(fName));
    7777  CreateFontLists ();
    7878 
    79   readyToPaint = true;
     79  fReadyToPaint = true;
    8080}
    8181
     
    9696
    9797  if (fSceneHandler.GetScene() == 0) {
    98     hasToRepaint =false;
     98    fHasToRepaint =false;
    9999  } else {
    100     hasToRepaint =true;
     100    fHasToRepaint =true;
    101101  }
    102102
     
    197197  printf("G4OpenGLStoredQtViewer::ComputeView %d %d ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n",getWinWidth(), getWinHeight());
    198198#endif
    199   hasToRepaint =true;
     199  fHasToRepaint =true;
    200200}
    201201
     
    210210  // Set new size, it will be update when next Repaint()->SetView() called
    211211  ResizeWindow(aWidth,aHeight);
    212   hasToRepaint = sizeHasChanged();
     212  fHasToRepaint = sizeHasChanged();
    213213}
    214214
     
    217217{
    218218#ifdef G4DEBUG_VIS_OGL
    219   printf("G4OpenGLStoredQtViewer::paintGL ??\n");
    220 #endif
    221   if (!readyToPaint) {
    222     readyToPaint= true;
     219  printf("G4OpenGLStoredQtViewer::paintGL ready:%d fHasTo:%d??\n",fReadyToPaint,fHasToRepaint);
     220#endif
     221  if (!fReadyToPaint) {
     222    fReadyToPaint= true;
    223223    return;
    224224  }
     
    226226  //    WHEN CLICK ON THE FRAME FOR EXAMPLE
    227227  //    EXECEPT WHEN MOUSE MOVE EVENT
    228   if ( !hasToRepaint) {
     228  if ( !fHasToRepaint) {
    229229    if (((getWinWidth() == (unsigned int)width())) &&(getWinHeight() == (unsigned int) height())) {
    230230      return;
     
    232232  }
    233233#ifdef G4DEBUG_VIS_OGL
    234   printf("G4OpenGLStoredQtViewer::paintGL VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV ready %d\n",readyToPaint);
     234  printf("G4OpenGLStoredQtViewer::paintGL VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV ready %d\n",fReadyToPaint);
    235235#endif
    236236
     
    240240  ComputeView();
    241241     
    242   hasToRepaint =false;
     242  fHasToRepaint =false;
    243243     
    244244#ifdef G4DEBUG_VIS_OGL
    245   printf("G4OpenGLStoredQtViewer::paintGL ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ready %d\n",readyToPaint);
     245  printf("G4OpenGLStoredQtViewer::paintGL ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ready %d\n",fReadyToPaint);
    246246#endif
    247247}
     
    288288
    289289void G4OpenGLStoredQtViewer::updateQWidget() {
    290   hasToRepaint= true;
     290  fHasToRepaint= true;
    291291  updateGL();
    292   hasToRepaint= false;
     292  fHasToRepaint= false;
    293293}
    294294
     
    303303  activateWindow();
    304304#endif
    305   updateQWidget();
    306 }
    307 
    308 #endif
     305}
     306
     307#endif
  • trunk/source/visualization/OpenGL/src/G4OpenGLViewer.cc

    r1039 r1040  
    209209void G4OpenGLViewer::SetView () {
    210210
    211 #ifdef G4DEBUG_VIS_OGL
    212   printf("G4OpenGLViewer::SetView\n");
    213 #endif
    214211  if (!fSceneHandler.GetScene()) {
    215212    G4cerr << "G4OpenGLStoredViewer: Creating a Viewer without a scene is not allowed. \nPlease use /vis/scene/create before /vis/open/.... "
     
    350347  background = fVP.GetBackgroundColour ();
    351348
    352 #ifdef G4DEBUG_VIS_OGL
    353   printf("G4OpenGLViewer::SetView END\n");
    354 #endif
    355349}
    356350
     
    632626  }
    633627
    634   width=8192;
    635   height=8192;
    636 
    637628  if (!fGL2PSAction) return false;
    638629
  • trunk/source/visualization/externals/gl2ps/History

    r1038 r1040  
    1 $Id: History,v 1.8 2009/04/29 09:37:55 lgarnier Exp $
     1$Id: History,v 1.9 2009/04/29 19:23:10 allison Exp $
    22-------------------------------------------------------------------
    33
     
    1818     ----------------------------------------------------------
    1919
    20 29 April 2009, Laurent Garnier
     2029 April 2009, Laurent Garnier (visexternal-V09-02-04)
    2121 - G4OpenGL2PSAction : Fix a circular dependency to G4OpenGL on Linux
    2222
Note: See TracChangeset for help on using the changeset viewer.