Ignore:
Timestamp:
Aug 14, 2007, 4:57:05 PM (17 years ago)
Author:
garnier
Message:

r570@mac-90108: laurentgarnier | 2007-08-14 17:00:14 +0200
debut de l'EPS

Location:
trunk/geant4/visualization/OpenGL
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/geant4/visualization/OpenGL/include/G4OpenGLQtViewer.hh

    r564 r565  
    9292  void actionDrawingSurfaceRemoval();
    9393  void actionDrawingLineSurfaceRemoval();
     94  void actionControlPanels();
     95  void actionExitG4();
     96  void actionCreateEPS();
     97
    9498  void toggleDrawingAction(int);
    9599  void toggleMouseAction(bool);
  • trunk/geant4/visualization/OpenGL/src/G4OpenGLQtViewer.cc

    r564 r565  
    5151#include <QtGui/qdialog.h>
    5252#include <QtGui/qmenu.h>
     53#include <QFileDialog.h>
    5354
    5455//////////////////////////////////////////////////////////////////////////////
     
    241242  }
    242243
    243   QObject ::connect(fDrawingWireframe, SIGNAL(triggered(bool)),this, SLOT(actionDrawingWireframe()));
    244   QObject ::connect(fDrawingLineRemoval, SIGNAL(triggered(bool)),this, SLOT(actionDrawingLineRemoval()));
    245   QObject ::connect(fDrawingSurfaceRemoval, SIGNAL(triggered(bool)),this, SLOT(actionDrawingSurfaceRemoval()));
    246   QObject ::connect(fDrawingLineSurfaceRemoval, SIGNAL(triggered(bool)),this, SLOT(actionDrawingLineSurfaceRemoval()));
     244  QObject ::connect(fDrawingWireframe,
     245                    SIGNAL(triggered(bool)),
     246                    this,
     247                    SLOT(actionDrawingWireframe()));
     248  QObject ::connect(fDrawingLineRemoval,
     249                    SIGNAL(triggered(bool)),
     250                    this,
     251                    SLOT(actionDrawingLineRemoval()));
     252  QObject ::connect(fDrawingSurfaceRemoval,
     253                    SIGNAL(triggered(bool)),
     254                    this,
     255                    SLOT(actionDrawingSurfaceRemoval()));
     256  QObject ::connect(fDrawingLineSurfaceRemoval,
     257                    SIGNAL(triggered(bool)),
     258                    this,
     259                    SLOT(actionDrawingLineSurfaceRemoval()));
    247260
    248261
     
    261274  // Action Menu
    262275  QMenu *mActions = fContextMenu->addMenu("&Actions");
    263   QAction *rotation = mActions->addAction("Rotation control panel");
    264   QAction *panning = mActions->addAction("Panning control panel");
    265   QAction *setControl = mActions->addAction("Set control panel limits");
    266 
    267   // Miscellany Menu
    268   QMenu * mMisc = fContextMenu->addMenu("&Miscellany");
    269   QAction *miscellany = mMisc->addAction("Miscellany control panel");
    270   QAction *exitG4 = mMisc->addAction("Exit to G4Vis >");
    271   QAction *createEPS = mMisc->addAction("Create .eps file");
     276  QAction *controlPanels = mActions->addAction("Control panels");
     277  QAction *exitG4 = mActions->addAction("Exit to G4Vis >");
     278  QAction *createEPS = mActions->addAction("Create .eps file");
     279  QObject ::connect(controlPanels,
     280                    SIGNAL(changed()),
     281                    this,
     282                    SLOT(actionControlPanels()));
     283  QObject ::connect(exitG4,
     284                    SIGNAL(changed()),
     285                    this,
     286                    SLOT(actionExitG4()));
     287  QObject ::connect(createEPS,
     288                    SIGNAL(changed()),
     289                    this,
     290                    SLOT(actionCreateEPS()));
     291
    272292
    273293  // Special Menu
     
    395415
    396416/**
    397   Slot activated when drawing menu is toggle
    398   @param aAction : 1 wireframe, 2 line removal, 3 surface removal, 4 line & surface removal
     417   Slot activated when drawing menu is toggle
     418   Warning : When G4OpenGLStoredQtViewer::DrawView() method call,
     419   KernelVisitDecision () will be call and will set the fNeedKernelVisit
     420   to 1. See G4XXXStoredViewer::CompareForKernelVisit for explanations.
     421   It will cause a redraw of the view
     422   @param aAction : 1 wireframe, 2 line removal, 3 surface removal, 4 line & surface removal
     423   @see G4OpenGLStoredQtViewer::DrawView
     424   @see G4XXXStoredViewer::CompareForKernelVisit
    399425 */
    400426void G4OpenGLQtViewer::toggleDrawingAction(int aAction) {
     
    444470/**
    445471   SLOT Activate by a click on the representation menu
     472   Warning : When G4OpenGLStoredQtViewer::DrawView() method call,
     473   KernelVisitDecision () will be call and will set the fNeedKernelVisit
     474   to 1. See G4XXXStoredViewer::CompareForKernelVisit for explanations.
     475   It will cause a redraw of the view
    446476   @param check : 1 polyhedron, 0 nurbs
     477   @see G4OpenGLStoredQtViewer::DrawView
     478   @see G4XXXStoredViewer::CompareForKernelVisit
    447479*/
    448480void G4OpenGLQtViewer::toggleRepresentation(bool check) {
     
    575607  printf("G4OpenGLQtViewer::toggleRepresentation %d\n",check);
    576608}
     609
     610
     611void G4OpenGLQtViewer::actionControlPanels() {
     612  printf("G4OpenGLQtViewer::actionControlPanels \n");
     613}
     614
     615void G4OpenGLQtViewer::actionExitG4() {
     616  printf("G4OpenGLQtViewer::actionExitG4() \n");
     617}
     618
     619void G4OpenGLQtViewer::actionCreateEPS() {
     620  QString nomFich = QFileDialog::getSaveFileName(GLWindow,
     621                                                 "Choisir un fichier",
     622                                                 ".", "Images (*.BMP *.GIF *.JPG *.JPEG *.PNG *.PBM *.PGM *.PPM *.TIFF *.XBM *.XPM)" );
     623
     624  fWindow->grabFrameBuffer().save(nomFich);
     625  printf("G4OpenGLQtViewer::actionCreateEPS() \n");
     626}
     627
    577628
    578629
  • trunk/geant4/visualization/OpenGL/src/G4OpenGLStoredQtViewer.cc

    r564 r565  
    115115   // /vis/viewer/rebuild, but if not, make decision and set flag only
    116116   // if necessary...
     117   if (!fNeedKernelVisit)
     118     printf("***************************  CASE 0 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n");
     119
    117120   if (!fNeedKernelVisit) KernelVisitDecision ();
     121   printf("***************************  kernelVisit:%d ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n",fNeedKernelVisit);
     122   
    118123   G4bool kernelVisitWasNeeded = fNeedKernelVisit; // Keep (ProcessView resets).
    119124   ProcessView ();
     
    131136
    132137     DrawDisplayLists ();
     138     FinishView ();
    133139
    134140   } else {
     141     printf("***************************  CASE 1 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n");
    135142     
    136143     // If kernel visit was needed, drawing and FinishView will already
    137144     // have been done, so...
    138145     if (!kernelVisitWasNeeded) {
     146       printf("***************************  CASE 2 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n");
    139147       DrawDisplayLists ();
     148       FinishView ();
    140149     } else {
     150       printf("***************************  CASE 3 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n");
    141151       // However, union cutaways are implemented in DrawDisplayLists, so make
    142152       // an extra pass...
     
    145155         ClearView();
    146156         DrawDisplayLists ();
     157         FinishView ();
     158         printf("***************************  CASE 4 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n");
     159       } else { // ADD TO AVOID KernelVisit=1 and nothing to display
     160         DrawDisplayLists ();
     161         FinishView ();
    147162       }
    148163     }
    149164   }
    150165
    151    FinishView ();
    152   printf("G4OpenGLStoredQtViewer::DrawView %d %d ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n",WinSize_x, WinSize_y);
     166   printf("G4OpenGLStoredQtViewer::DrawView %d %d ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n",WinSize_x, WinSize_y);
    153167   hasToRepaint =true;
    154168}
Note: See TracChangeset for help on using the changeset viewer.