Changeset 565 for trunk/geant4/visualization/OpenGL
- Timestamp:
- Aug 14, 2007, 4:57:05 PM (17 years ago)
- Location:
- trunk/geant4/visualization/OpenGL
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/geant4/visualization/OpenGL/include/G4OpenGLQtViewer.hh
r564 r565 92 92 void actionDrawingSurfaceRemoval(); 93 93 void actionDrawingLineSurfaceRemoval(); 94 void actionControlPanels(); 95 void actionExitG4(); 96 void actionCreateEPS(); 97 94 98 void toggleDrawingAction(int); 95 99 void toggleMouseAction(bool); -
trunk/geant4/visualization/OpenGL/src/G4OpenGLQtViewer.cc
r564 r565 51 51 #include <QtGui/qdialog.h> 52 52 #include <QtGui/qmenu.h> 53 #include <QFileDialog.h> 53 54 54 55 ////////////////////////////////////////////////////////////////////////////// … … 241 242 } 242 243 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())); 247 260 248 261 … … 261 274 // Action Menu 262 275 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 272 292 273 293 // Special Menu … … 395 415 396 416 /** 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 399 425 */ 400 426 void G4OpenGLQtViewer::toggleDrawingAction(int aAction) { … … 444 470 /** 445 471 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 446 476 @param check : 1 polyhedron, 0 nurbs 477 @see G4OpenGLStoredQtViewer::DrawView 478 @see G4XXXStoredViewer::CompareForKernelVisit 447 479 */ 448 480 void G4OpenGLQtViewer::toggleRepresentation(bool check) { … … 575 607 printf("G4OpenGLQtViewer::toggleRepresentation %d\n",check); 576 608 } 609 610 611 void G4OpenGLQtViewer::actionControlPanels() { 612 printf("G4OpenGLQtViewer::actionControlPanels \n"); 613 } 614 615 void G4OpenGLQtViewer::actionExitG4() { 616 printf("G4OpenGLQtViewer::actionExitG4() \n"); 617 } 618 619 void 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 577 628 578 629 -
trunk/geant4/visualization/OpenGL/src/G4OpenGLStoredQtViewer.cc
r564 r565 115 115 // /vis/viewer/rebuild, but if not, make decision and set flag only 116 116 // if necessary... 117 if (!fNeedKernelVisit) 118 printf("*************************** CASE 0 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n"); 119 117 120 if (!fNeedKernelVisit) KernelVisitDecision (); 121 printf("*************************** kernelVisit:%d ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n",fNeedKernelVisit); 122 118 123 G4bool kernelVisitWasNeeded = fNeedKernelVisit; // Keep (ProcessView resets). 119 124 ProcessView (); … … 131 136 132 137 DrawDisplayLists (); 138 FinishView (); 133 139 134 140 } else { 141 printf("*************************** CASE 1 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n"); 135 142 136 143 // If kernel visit was needed, drawing and FinishView will already 137 144 // have been done, so... 138 145 if (!kernelVisitWasNeeded) { 146 printf("*************************** CASE 2 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n"); 139 147 DrawDisplayLists (); 148 FinishView (); 140 149 } else { 150 printf("*************************** CASE 3 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n"); 141 151 // However, union cutaways are implemented in DrawDisplayLists, so make 142 152 // an extra pass... … … 145 155 ClearView(); 146 156 DrawDisplayLists (); 157 FinishView (); 158 printf("*************************** CASE 4 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n"); 159 } else { // ADD TO AVOID KernelVisit=1 and nothing to display 160 DrawDisplayLists (); 161 FinishView (); 147 162 } 148 163 } 149 164 } 150 165 151 FinishView (); 152 printf("G4OpenGLStoredQtViewer::DrawView %d %d ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n",WinSize_x, WinSize_y); 166 printf("G4OpenGLStoredQtViewer::DrawView %d %d ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n",WinSize_x, WinSize_y); 153 167 hasToRepaint =true; 154 168 }
Note: See TracChangeset
for help on using the changeset viewer.