Changeset 599 for trunk/geant4/visualization/OpenGL
- Timestamp:
- Nov 12, 2007, 4:42:32 PM (17 years ago)
- Location:
- trunk/geant4/visualization/OpenGL/src
- Files:
-
- 2 added
- 2 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/geant4/visualization/OpenGL/src/G4OpenGLImmediateQtViewer.cc
r593 r599 159 159 ,int height) 160 160 { 161 int side = qMin(width, height); 161 int side = width; 162 if (width > height) { 163 side = height; 164 } 162 165 glViewport((width - side) / 2, (height - side) / 2, side, side); 163 166 glMatrixMode(GL_PROJECTION); -
trunk/geant4/visualization/OpenGL/src/G4OpenGLQtExportDialog.cc
r595 r599 25 25 // 26 26 // 27 // $Id: G4OpenGLQtExportDialog.cc,v 1. 2 2007/11/08 17:00:51 lgarnier Exp $27 // $Id: G4OpenGLQtExportDialog.cc,v 1.3 2007/11/09 15:03:21 lgarnier Exp $ 28 28 // GEANT4 tag $Name: $ 29 29 // … … 54 54 : QDialog( parent ) 55 55 { 56 #if QT_VERSION < 0x040000 57 setCaption( tr( " Export options" )); 58 #else 56 59 setWindowTitle( tr( " Export options" )); 60 #endif 57 61 originalWidth = aWidth; 58 62 originalHeight = aHeight; … … 66 70 67 71 // global layout 72 #if QT_VERSION < 0x040000 73 QVBoxLayout* globalVLayout = new QVBoxLayout(this); 74 #else 68 75 QVBoxLayout* globalVLayout = new QVBoxLayout(); 76 #endif 69 77 70 78 … … 73 81 74 82 QGroupBox *imageGroupBox = new QGroupBox(tr("Image quality")); 83 #if QT_VERSION < 0x040000 84 QVBoxLayout *imageGroupBoxLayout = new QVBoxLayout(imageGroupBox); 85 #else 75 86 QVBoxLayout *imageGroupBoxLayout = new QVBoxLayout; 76 87 #endif 77 88 QWidget *sliderBox = new QWidget; 89 90 #if QT_VERSION < 0x040000 91 QHBoxLayout *hSlider = new QHBoxLayout(sliderBox); 92 #else 78 93 QHBoxLayout *hSlider = new QHBoxLayout; 94 #endif 95 79 96 // qualityLabel = new QLabel( tr( "Image quality" ) ); 80 97 // imageGroupBoxLayout->addWidget(qualityLabel); 81 qualitySlider= new QSlider(Qt::Horizontal); 98 qualitySlider= new QSlider(Qt::Horizontal,0); 99 #if QT_VERSION < 0x040000 100 qualitySlider->setMinValue(0); 101 qualitySlider->setMaxValue(100); 102 qualitySlider->setTickmarks(QSlider::Below); 103 #else 82 104 qualitySlider->setMinimum(0); 83 105 qualitySlider->setMaximum(100); 84 106 qualitySlider->setTickPosition(QSlider::TicksBelow); 107 #endif 85 108 qualitySlider->setValue(60); 86 hSlider->addWidget(new QLabel("low" ));109 hSlider->addWidget(new QLabel("low",0)); 87 110 hSlider->addWidget(qualitySlider); 88 hSlider->addWidget(new QLabel("Maximum")); 111 hSlider->addWidget(new QLabel("Maximum",0)); 112 #if QT_VERSION >= 0x040000 89 113 sliderBox->setLayout(hSlider); 114 #endif 90 115 imageGroupBoxLayout->addWidget(sliderBox); 91 116 117 #if QT_VERSION >= 0x040000 92 118 imageGroupBox->setLayout(imageGroupBoxLayout); 119 #endif 93 120 globalVLayout->addWidget(imageGroupBox); 94 121 } … … 96 123 if(nomFich.endsWith(".eps")) { 97 124 QGroupBox *EPSGroupBox = new QGroupBox(tr("EPS options")); 125 126 #if QT_VERSION < 0x040000 127 QVBoxLayout *EPSGroupBoxLayout = new QVBoxLayout(EPSGroupBox); 128 #else 98 129 QVBoxLayout *EPSGroupBoxLayout = new QVBoxLayout; 130 #endif 99 131 100 132 // transparencyEPS = new QCheckBox( "transparencyEPS" ); … … 102 134 // transparencyEPS->setChecked( true ); 103 135 104 colorButton = new QRadioButton("Color" );105 BWButton = new QRadioButton("Grayscale" );136 colorButton = new QRadioButton("Color",0); 137 BWButton = new QRadioButton("Grayscale",0); 106 138 colorButton->setChecked( true ); 107 139 BWButton->setChecked( false ); … … 111 143 EPSGroupBoxLayout->addWidget(colorButton); 112 144 EPSGroupBoxLayout->addWidget(BWButton); 145 #if QT_VERSION >= 0x040000 113 146 EPSGroupBox->setLayout(EPSGroupBoxLayout); 147 #endif 114 148 globalVLayout->addWidget(EPSGroupBox); 115 149 … … 123 157 124 158 QGroupBox *transparencyGroupBox = new QGroupBox(tr("Transparency")); 159 #if QT_VERSION < 0x040000 160 QVBoxLayout *transparencyGroupBoxLayout = new QVBoxLayout(transparencyGroupBox); 161 #else 125 162 QVBoxLayout *transparencyGroupBoxLayout = new QVBoxLayout; 126 127 boxTransparency = new QCheckBox("Save transparency"); 163 #endif 164 165 boxTransparency = new QCheckBox("Save transparency",0); 128 166 boxTransparency->setChecked( false ); 129 167 // boxTransparency->setEnabled(false); 130 168 131 169 transparencyGroupBoxLayout->addWidget(boxTransparency); 170 #if QT_VERSION >= 0x040000 132 171 transparencyGroupBox->setLayout(transparencyGroupBoxLayout); 172 #endif 133 173 globalVLayout->addWidget(transparencyGroupBox); 134 174 … … 137 177 // size box 138 178 QGroupBox *sizeGroupBox = new QGroupBox(tr("Size")); 179 QWidget* modifyAndRatioWidget = new QWidget; 180 181 #if QT_VERSION < 0x040000 182 QHBoxLayout *modifyAndRatioLayout = new QHBoxLayout(modifyAndRatioWidget); 183 QVBoxLayout *sizeGroupBoxLayout = new QVBoxLayout(sizeGroupBox); 184 #else 185 QHBoxLayout *modifyAndRatioLayout = new QHBoxLayout; 139 186 QVBoxLayout *sizeGroupBoxLayout = new QVBoxLayout; 140 141 QHBoxLayout *modifyAndRatioLayout = new QHBoxLayout; 142 QWidget* modifyAndRatioWidget = new QWidget; 187 #endif 143 188 144 189 // original button 145 original = new QRadioButton("Original" );190 original = new QRadioButton("Original",0); 146 191 original->setChecked( true ); 147 192 sizeGroupBoxLayout->addWidget(original); 148 193 149 194 // modify and ratio 150 modify = new QRadioButton("Modify" );195 modify = new QRadioButton("Modify",0); 151 196 modify->setChecked( false ); 152 197 153 ratioCheckBox = new QCheckBox( "Keep ratio" );198 ratioCheckBox = new QCheckBox( "Keep ratio",0 ); 154 199 ratioCheckBox->setChecked( true ); 155 200 156 201 modifyAndRatioLayout->addWidget(modify); 157 202 modifyAndRatioLayout->addWidget(ratioCheckBox); 203 #if QT_VERSION >= 0x040000 158 204 modifyAndRatioWidget->setLayout(modifyAndRatioLayout); 205 #endif 159 206 sizeGroupBoxLayout->addWidget(modifyAndRatioWidget); 160 ratioCheckBox->setVisible(modify->isChecked()); 207 if (modify->isChecked()) { 208 ratioCheckBox->show(); 209 } else { 210 ratioCheckBox->hide(); 211 } 161 212 162 213 connect( original, SIGNAL( clicked(bool) ), this, SLOT( changeSizeBox(true)) ); … … 164 215 165 216 // height 217 heightWidget = new QWidget; 218 219 #if QT_VERSION < 0x040000 220 QHBoxLayout *heightLineLayout = new QHBoxLayout(heightWidget); 221 #else 166 222 QHBoxLayout *heightLineLayout = new QHBoxLayout; 167 heightWidget = new QWidget; 223 #endif 224 168 225 QString tmp; 169 226 170 heightLineLayout->addWidget(new QLabel("Height" ));171 height = new QLineEdit(tmp.setNum(originalHeight) );227 heightLineLayout->addWidget(new QLabel("Height",0)); 228 height = new QLineEdit(tmp.setNum(originalHeight),0); 172 229 height->setMaxLength(5); 173 230 heightLineLayout->addWidget(height); 231 #if QT_VERSION >= 0x040000 174 232 heightWidget->setLayout(heightLineLayout); 233 #endif 175 234 sizeGroupBoxLayout->addWidget(heightWidget); 176 235 connect( height, SIGNAL( textChanged ( const QString& ) ), this, SLOT( textHeightChanged(const QString &) ) ); … … 178 237 179 238 // width 239 widthWidget = new QWidget; 240 241 #if QT_VERSION < 0x040000 242 QHBoxLayout *widthLineLayout = new QHBoxLayout(widthWidget); 243 #else 180 244 QHBoxLayout *widthLineLayout = new QHBoxLayout; 181 widthWidget = new QWidget; 182 183 widthLineLayout->addWidget(new QLabel("Width " ));184 width = new QLineEdit(tmp.setNum(originalWidth) );245 #endif 246 247 widthLineLayout->addWidget(new QLabel("Width ",0)); 248 width = new QLineEdit(tmp.setNum(originalWidth),0); 185 249 width->setMaxLength(5); 186 250 widthLineLayout->addWidget(width); 251 #if QT_VERSION >= 0x040000 187 252 widthWidget->setLayout(widthLineLayout); 253 #endif 188 254 sizeGroupBoxLayout->addWidget(widthWidget); 189 255 connect( width, SIGNAL( textChanged ( const QString& ) ), this, SLOT( textWidthChanged(const QString &) ) ); 190 256 257 #if QT_VERSION >= 0x040000 191 258 sizeGroupBox->setLayout(sizeGroupBoxLayout); 259 #endif 192 260 globalVLayout->addWidget(sizeGroupBox); 193 261 194 heightWidget-> setVisible(false);195 widthWidget-> setVisible(false);262 heightWidget->hide(); 263 widthWidget->hide(); 196 264 197 265 // button ok/cancel box 198 266 199 267 QGroupBox *buttonGroupBox = new QGroupBox(); 268 269 #if QT_VERSION < 0x040000 270 QHBoxLayout *buttonGroupBoxLayout = new QHBoxLayout(buttonGroupBox); 271 #else 200 272 QHBoxLayout *buttonGroupBoxLayout = new QHBoxLayout; 201 202 buttonOk = new QPushButton( tr( "&OK" ) ); 273 #endif 274 275 buttonOk = new QPushButton( tr( "&OK" ),0 ); 203 276 buttonOk->setAutoDefault( TRUE ); 204 277 buttonOk->setDefault( TRUE ); 205 278 buttonGroupBoxLayout->addWidget(buttonOk); 206 279 207 buttonCancel = new QPushButton( tr( "&Cancel" ) );280 buttonCancel = new QPushButton( tr( "&Cancel" ),0 ); 208 281 buttonCancel->setAutoDefault( TRUE ); 209 282 buttonGroupBoxLayout->addWidget(buttonCancel); 210 283 284 #if QT_VERSION >= 0x040000 211 285 buttonGroupBox->setLayout(buttonGroupBoxLayout); 286 #endif 212 287 globalVLayout->addWidget(buttonGroupBox); 213 288 214 289 290 #if QT_VERSION >= 0x040000 215 291 setLayout(globalVLayout); 292 #endif 216 293 217 294 // signals and slots connections … … 264 341 } 265 342 if ( original->isChecked()) { 266 heightWidget-> setVisible(false);267 widthWidget-> setVisible(false);268 ratioCheckBox-> setVisible(false);343 heightWidget->hide(); 344 widthWidget->hide(); 345 ratioCheckBox->hide(); 269 346 } else { 270 heightWidget->s etVisible(true);271 widthWidget->s etVisible(true);272 ratioCheckBox->s etVisible(true);347 heightWidget->show(); 348 widthWidget->show(); 349 ratioCheckBox->show(); 273 350 } 274 351 } -
trunk/geant4/visualization/OpenGL/src/G4OpenGLQtViewer.cc
r595 r599 25 25 // 26 26 // 27 // $Id: G4OpenGLQtViewer.cc,v 1. 3 2007/11/08 17:00:51lgarnier Exp $27 // $Id: G4OpenGLQtViewer.cc,v 1.4 2007/11/09 15:03:22 lgarnier Exp $ 28 28 // GEANT4 tag $Name: $ 29 29 // … … 51 51 #include "G4UImanager.hh" 52 52 #include <qapplication.h> 53 #include <q boxLayout.h>53 #include <qlayout.h> 54 54 #include <qdialog.h> 55 56 #if QT_VERSION >= 0x040000 55 57 #include <qmenu.h> 56 58 #include <qimagewriter.h> 59 #else 60 #include <qaction.h> 61 #include <qwidgetlist.h> 62 #include <qmenudata.h> 63 #include <qpopupmenu.h> 64 #include <qimage.h> 65 #endif 66 57 67 #include <qmessagebox.h> 58 68 #include <qfiledialog.h> … … 62 72 #include <qdialog.h> 63 73 #include <qevent.h> //include <qcontextmenuevent.h> 64 #include <qmenu.h>65 #include <qimage.h>66 74 67 75 … … 100 108 G4cerr << "Visualization window not defined, please choose one before" << G4endl; 101 109 } else { 110 #if QT_VERSION < 0x040000 111 GLWindow->setActiveWindow(); 112 #else 102 113 GLWindow->activateWindow(); 114 #endif 103 115 printf("G4OpenGLQtViewer::ShowView -----------------------\n"); 104 116 } … … 145 157 // look for the main window 146 158 bool found = false; 159 #if QT_VERSION < 0x040000 160 QWidgetList *list = QApplication::allWidgets(); 161 QWidgetListIt it( *list ); // iterate over the widgets 162 QWidget * widget; 163 while ( (widget=it.current()) != 0 ) { // for each widget... 164 ++it; 165 if ((found== false) && (widget->inherits("QMainWindow"))) { 166 printf("G4OpenGLQtViewer::CreateMainWindow case Qapp exist\n"); 167 GLWindow = new QDialog(widget,0,FALSE,Qt::WStyle_Title | Qt::WStyle_SysMenu | Qt::WStyle_MinMax ); 168 found = true; 169 } 170 } 171 delete list; // delete the list, not the widgets 172 #else 147 173 foreach (QWidget *widget, QApplication::allWidgets()) { 148 174 if ((found== false) && (widget->inherits("QMainWindow"))) { … … 152 178 } 153 179 } 180 #endif 181 154 182 if (found==false) { 155 183 printf("G4OpenGLQtViewer::CreateMainWindow case Qapp exist, but not found\n"); … … 161 189 } 162 190 191 #if QT_VERSION < 0x040000 192 QHBoxLayout *mainLayout = new QHBoxLayout(GLWindow); 193 #else 163 194 QHBoxLayout *mainLayout = new QHBoxLayout; 195 #endif 164 196 165 197 mainLayout->addWidget(fWindow); 198 199 #if QT_VERSION < 0x040000 200 GLWindow->setCaption( tr( "QGl Viewer" )); 201 #else 166 202 GLWindow->setLayout(mainLayout); 167 GLWindow->setWindowTitle("QGl Viewer"); 203 GLWindow->setWindowTitle(tr("QGl Viewer")); 204 #endif 168 205 GLWindow->resize(300, 300); 169 206 GLWindow->move(900,300); … … 229 266 void G4OpenGLQtViewer::createPopupMenu() { 230 267 268 #if QT_VERSION < 0x040000 269 fContextMenu = new QPopupMenu( GLWindow,"All" ); 270 #else 231 271 fContextMenu = new QMenu("All"); 232 272 #endif 273 Q_CHECK_PTR( fContextMenu ); 274 275 #if QT_VERSION < 0x040000 276 // === Mouse menu === 277 QPopupMenu *mMouseAction = new QPopupMenu( fContextMenu ); 278 Q_CHECK_PTR( mMouseAction ); 279 280 QAction *rotate = new QAction("&Rotate scene",CTRL+Key_N,mMouseAction); 281 QAction *move = new QAction("&Move scene",CTRL+Key_M,mMouseAction); 282 rotate->addTo(mMouseAction); 283 move->addTo(mMouseAction); 284 285 fContextMenu->insertItem( "&Mouse action", mMouseAction); 286 287 #else 288 // === Mouse menu === 233 289 QMenu *mMouseAction = fContextMenu->addMenu("&Mouse action"); 290 234 291 QAction *rotate = mMouseAction->addAction("&Rotate scene"); 235 292 QAction *move = mMouseAction->addAction("&Move scene"); 293 #endif 294 236 295 // INIT mMouse 237 296 createRadioAction(rotate,move,SLOT(toggleMouseAction(bool)),1); 238 297 239 //Style Menu 298 #if QT_VERSION < 0x040000 299 // === Style Menu === 300 QPopupMenu *mStyle = new QPopupMenu(fContextMenu); 301 302 QPopupMenu *mRepresentation = new QPopupMenu(fContextMenu); 303 304 QAction *polyhedron = new QAction("&Polyhedron",CTRL+Key_P,mRepresentation); 305 QAction *nurbs = new QAction("&NURBS",CTRL+Key_N,mRepresentation); 306 polyhedron->addTo(mRepresentation); 307 nurbs->addTo(mRepresentation); 308 309 mStyle->insertItem("&Representation",mRepresentation); 310 fContextMenu->insertItem("&Style",mStyle); 311 312 #else 313 // === Style Menu === 240 314 QMenu *mStyle = fContextMenu->addMenu("&Style"); 241 315 … … 243 317 QAction *polyhedron = mRepresentation->addAction("Polyhedron"); 244 318 QAction *nurbs = mRepresentation->addAction("NURBS"); 319 #endif 245 320 // INIT mStyle 246 321 G4ViewParameters::RepStyle style; … … 255 330 256 331 332 #if QT_VERSION < 0x040000 333 // === Drawing Menu === 334 QPopupMenu *mDrawing = new QPopupMenu(fContextMenu); 335 fContextMenu->insertItem("&Drawing",mDrawing); 336 337 fDrawingWireframe = new QPopupMenu(mDrawing); 338 mDrawing->insertItem("&Wireframe",fDrawingWireframe); 339 340 mDrawing->setCheckable(true); 341 fDrawingWireframe->setCheckable(true); 342 343 fDrawingLineRemoval = new QPopupMenu(mDrawing); 344 mDrawing->insertItem("&Hidden line removal",fDrawingLineRemoval); 345 fDrawingLineRemoval->setCheckable(true); 346 347 fDrawingSurfaceRemoval = new QPopupMenu(mDrawing); 348 mDrawing->insertItem("&Hidden surface removal",fDrawingSurfaceRemoval); 349 fDrawingSurfaceRemoval->setCheckable(true); 350 351 fDrawingLineSurfaceRemoval = new QPopupMenu(mDrawing); 352 mDrawing->insertItem("&Hidden line and surface removal",fDrawingLineSurfaceRemoval); 353 fDrawingLineSurfaceRemoval->setCheckable(true); 354 355 #else 356 // === Drawing Menu === 257 357 QMenu *mDrawing = mStyle->addMenu("&Drawing"); 358 258 359 fDrawingWireframe = mDrawing->addAction("Wireframe"); 259 360 fDrawingWireframe->setCheckable(true); 260 fDrawingWireframe->setChecked(true); 361 261 362 fDrawingLineRemoval = mDrawing->addAction("Hidden line removal"); 262 363 fDrawingLineRemoval->setCheckable(true); 364 263 365 fDrawingSurfaceRemoval = mDrawing->addAction("Hidden Surface removal"); 264 366 fDrawingSurfaceRemoval->setCheckable(true); 367 265 368 fDrawingLineSurfaceRemoval = mDrawing->addAction("Hidden line and surface removal"); 266 369 fDrawingLineSurfaceRemoval->setCheckable(true); 370 #endif 267 371 // INIT Drawing 268 372 G4ViewParameters::DrawingStyle d_style; 269 373 d_style = fVP.GetDrawingStyle(); 270 374 271 fDrawingWireframe->setCheckable(true); 272 fDrawingLineRemoval->setCheckable(true); 273 fDrawingSurfaceRemoval->setCheckable(true); 274 fDrawingLineSurfaceRemoval->setCheckable(true); 275 375 #if QT_VERSION < 0x040000 376 if (d_style == G4ViewParameters::wireframe) { 377 fDrawingWireframe->setItemChecked(0,true); 378 } else if (d_style == G4ViewParameters::hlr) { 379 fDrawingLineRemoval->setItemChecked(0,true); 380 } else if (d_style == G4ViewParameters::hsr) { 381 fDrawingSurfaceRemoval->setItemChecked(0,true); 382 } else if (d_style == G4ViewParameters::hlhsr) { 383 fDrawingLineSurfaceRemoval->setItemChecked(0,true); 384 } else { 385 mDrawing->clear(); 386 } 387 #else 276 388 if (d_style == G4ViewParameters::wireframe) { 277 389 fDrawingWireframe->setChecked(true); … … 285 397 mDrawing->clear(); 286 398 } 399 #endif 287 400 288 401 QObject ::connect(fDrawingWireframe, … … 304 417 305 418 419 #if QT_VERSION < 0x040000 420 QPopupMenu *mBackground = new QPopupMenu(mStyle); 421 mStyle->insertItem("&Background color",mBackground); 422 423 QAction *white = new QAction("&White",CTRL+Key_W,mBackground); 424 QAction *black = new QAction("&Black",CTRL+Key_B,mBackground); 425 white->addTo(mBackground); 426 black->addTo(mBackground); 427 428 #else 306 429 QMenu *mBackground = mStyle->addMenu("&Background color"); 307 430 QAction *white = mBackground->addAction("White"); 308 431 QAction *black = mBackground->addAction("Black"); 432 433 #endif 309 434 if (background.GetRed() == 1. && 310 435 background.GetGreen() == 1. && … … 316 441 317 442 318 // Action Menu 443 #if QT_VERSION < 0x040000 444 // === Action Menu === 445 QPopupMenu *mActions = new QPopupMenu(fContextMenu); 446 fContextMenu->insertItem("&Actions",mActions); 447 448 QAction *controlPanels = new QAction("&Control panels",CTRL+Key_C,mActions); 449 QAction *exitG4 = new QAction("&Exit to G4Vis >",CTRL+Key_E,mActions); 450 QAction *createEPS = new QAction("&Save as ...",CTRL+Key_S,mActions); 451 controlPanels->addTo(mActions); 452 exitG4->addTo(mActions); 453 createEPS->addTo(mActions); 454 455 #else 456 // === Action Menu === 319 457 QMenu *mActions = fContextMenu->addMenu("&Actions"); 320 458 QAction *controlPanels = mActions->addAction("Control panels"); 321 459 QAction *exitG4 = mActions->addAction("Exit to G4Vis >"); 322 460 QAction *createEPS = mActions->addAction("Save as ..."); 461 #endif 462 323 463 QObject ::connect(controlPanels, 324 464 SIGNAL(triggered()), … … 335 475 336 476 337 // Special Menu 477 #if QT_VERSION < 0x040000 478 // === Special Menu === 479 QPopupMenu *mSpecial = new QPopupMenu(fContextMenu); 480 fContextMenu->insertItem("S&pecial",mSpecial); 481 482 QPopupMenu *mTransparency = new QPopupMenu(mSpecial); 483 mSpecial->insertItem("Transparency",mTransparency); 484 485 QAction *transparencyOn = new QAction("&On",CTRL+Key_O,mTransparency); 486 QAction *transparencyOff = new QAction("&Off",CTRL+Key_F,mTransparency); 487 transparencyOn->addTo(mTransparency); 488 transparencyOff->addTo(mTransparency); 489 490 #else 491 // === Special Menu === 338 492 QMenu *mSpecial = fContextMenu->addMenu("S&pecial"); 339 QMenu *transparency = mSpecial->addMenu("Transparency"); 340 QAction *transparencyOn = transparency->addAction("On"); 341 QAction *transparencyOff = transparency->addAction("Off"); 493 QMenu *mTransparency = mSpecial->addMenu("Transparency"); 494 QAction *transparencyOn = mTransparency->addAction("On"); 495 QAction *transparencyOff = mTransparency->addAction("Off"); 496 #endif 497 342 498 if (transparency_enabled == false) { 343 499 createRadioAction(transparencyOn,transparencyOff,SLOT(toggleTransparency(bool)),2); … … 349 505 350 506 507 #if QT_VERSION < 0x040000 508 QPopupMenu *mAntialiasing = new QPopupMenu(mSpecial); 509 mSpecial->insertItem("Antialiasing",mAntialiasing); 510 511 QAction *antialiasingOn = new QAction("&On",CTRL+Key_O,mAntialiasing); 512 QAction *antialiasingOff = new QAction("&Off",CTRL+Key_F,mAntialiasing); 513 antialiasingOn->addTo(mAntialiasing); 514 antialiasingOff->addTo(mAntialiasing); 515 516 #else 351 517 QMenu *mAntialiasing = mSpecial->addMenu("Antialiasing"); 352 518 QAction *antialiasingOn = mAntialiasing->addAction("On"); 353 519 QAction *antialiasingOff = mAntialiasing->addAction("Off"); 520 #endif 521 354 522 if (antialiasing_enabled == false) { 355 523 createRadioAction(antialiasingOn,antialiasingOff,SLOT(toggleAntialiasing(bool)),2); … … 360 528 } 361 529 530 #if QT_VERSION < 0x040000 531 QPopupMenu *mHaloing = new QPopupMenu(mSpecial); 532 mSpecial->insertItem("Haloing",mHaloing); 533 534 QAction *haloingOn = new QAction("&On",CTRL+Key_O,mHaloing); 535 QAction *haloingOff = new QAction("&Off",CTRL+Key_F,mHaloing); 536 haloingOn->addTo(mHaloing); 537 haloingOff->addTo(mHaloing); 538 #else 362 539 QMenu *mHaloing = mSpecial->addMenu("Haloing"); 363 540 QAction *haloingOn = mHaloing->addAction("On"); 364 541 QAction *haloingOff = mHaloing->addAction("Off"); 542 #endif 365 543 if (haloing_enabled == false) { 366 544 createRadioAction(haloingOn,haloingOff,SLOT(toggleHaloing(bool)),2); … … 371 549 } 372 550 551 #if QT_VERSION < 0x040000 552 QPopupMenu *mAux = new QPopupMenu(mSpecial); 553 mSpecial->insertItem("Auxiliairy edges",mAux); 554 555 QAction *auxOn = new QAction("&On",CTRL+Key_O,mAux); 556 QAction *auxOff = new QAction("&Off",CTRL+Key_F,mAux); 557 auxOn->addTo(mAux); 558 auxOff->addTo(mAux); 559 560 #else 373 561 QMenu *mAux = mSpecial->addMenu("Auxiliary edges"); 374 562 QAction *auxOn = mAux->addAction("On"); 375 563 QAction *auxOff = mAux->addAction("Off"); 564 #endif 376 565 if (!fVP.IsAuxEdgeVisible()) { 377 566 createRadioAction(auxOn,auxOff,SLOT(toggleAux(bool)),1); … … 381 570 382 571 572 #if QT_VERSION < 0x040000 573 QPopupMenu *mFullScreen = new QPopupMenu(mSpecial); 574 mSpecial->insertItem("Full screen",mFullScreen); 575 576 QAction *fullOn = new QAction("&On",CTRL+Key_O,mFullScreen); 577 QAction *fullOff = new QAction("&Off",CTRL+Key_F,mFullScreen); 578 fullOn->addTo(mFullScreen); 579 fullOff->addTo(mFullScreen); 580 #else 383 581 QMenu *mFullScreen = mSpecial->addMenu("Full screen"); 384 582 QAction *fullOn = mFullScreen->addAction("On"); 385 583 QAction *fullOff = mFullScreen->addAction("Off"); 584 #endif 386 585 createRadioAction(fullOn,fullOff,SLOT(toggleFullScreen(bool)),2); 387 586 … … 415 614 @param nCheck: 1 : first action will be set true. 2 : second action will be set true 416 615 */ 616 #if QT_VERSION < 0x040000 617 void G4OpenGLQtViewer::createRadioAction(QAction *action1,QAction *action2, const std::string& method,unsigned int nCheck) { 618 619 if (action1->parent()->inherits("QPopupMenu")){ 620 ((QPopupMenu*)action1->parent())->setCheckable(true); 621 } 622 ((QPopupMenu*)action1->parent())->setItemChecked(0,true); 623 ((QPopupMenu*)action1->parent())->setItemChecked(1,true); 624 625 if (nCheck ==1) 626 ((QPopupMenu*)action1->parent())->setItemChecked(0,true); 627 else 628 ((QPopupMenu*)action1->parent())->setItemChecked(1,true); 629 630 QObject ::connect(action1, SIGNAL(triggered(bool)),action2, SLOT(toggle())); 631 QObject ::connect(action2, SIGNAL(triggered(bool)),action1, SLOT(toggle())); 632 633 QObject ::connect(action1, SIGNAL(toggled(bool)),this, method.c_str()); 634 } 635 636 #else 417 637 void G4OpenGLQtViewer::createRadioAction(QAction *action1,QAction *action2, const std::string& method,unsigned int nCheck) { 418 638 … … 431 651 432 652 } 653 #endif 433 654 434 655 /** … … 770 991 @param mButtons mouse button active 771 992 */ 993 994 #if QT_VERSION < 0x040000 995 void G4OpenGLQtViewer::G4MouseMoveEvent(int pos_x, int pos_y,Qt::ButtonState mButtons) 996 #else 772 997 void G4OpenGLQtViewer::G4MouseMoveEvent(int pos_x, int pos_y,Qt::MouseButtons mButtons) 998 #endif 773 999 { 774 1000 int dx = pos_x - lastPos.x(); -
trunk/geant4/visualization/OpenGL/src/G4OpenGLStoredQt.cc
r595 r599 25 25 // 26 26 // 27 // $Id: G4OpenGLStoredQt.cc,v 1. 1 2007/09/28 14:44:13lgarnier Exp $27 // $Id: G4OpenGLStoredQt.cc,v 1.2 2007/11/09 15:03:22 lgarnier Exp $ 28 28 // GEANT4 tag $Name: $ 29 29 // -
trunk/geant4/visualization/OpenGL/src/G4OpenGLStoredQtViewer.cc
r595 r599 25 25 // 26 26 // 27 // $Id: G4OpenGLStoredQtViewer.cc,v 1. 2 2007/11/08 17:00:51lgarnier Exp $27 // $Id: G4OpenGLStoredQtViewer.cc,v 1.3 2007/11/09 15:03:22 lgarnier Exp $ 28 28 // GEANT4 tag $Name: $ 29 29 // -
trunk/geant4/visualization/OpenGL/src/G4OpenGLViewerMessenger.cc
r593 r599 25 25 // 26 26 // 27 // $Id: G4OpenGLViewerMessenger.cc,v 1. 9 2007/06/15 09:52:52 gcosmoExp $28 // GEANT4 tag $Name: geant4-09-00-ref-01$27 // $Id: G4OpenGLViewerMessenger.cc,v 1.10 2007/11/10 14:51:28 allison Exp $ 28 // GEANT4 tag $Name: $ 29 29 30 30 #include "G4OpenGLViewerMessenger.hh" … … 64 64 fpCommandPrintEPS->SetGuidance 65 65 ("Generates files with names G4OpenGL_n.eps, where n is a sequence" 66 "\nnumber, starting at 0."); 66 "\nnumber, starting at 0." 67 "\nCan be \"vectored\" or \"pixmap\" - see \"/vis/ogl/set/printMode\"."); 67 68 68 69 fpDirectorySet = new G4UIdirectory ("/vis/ogl/set/");
Note: See TracChangeset
for help on using the changeset viewer.