Changeset 635
- Timestamp:
- Dec 4, 2007, 6:46:23 PM (17 years ago)
- Location:
- trunk/geant4
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/geant4/interfaces/basic/src/G4UIQt.cc
r633 r635 132 132 // Set layouts 133 133 134 #if QT_VERSION < 0x040000135 136 134 QWidget* topWidget = new QWidget(splitter); 137 135 QWidget* bottomWidget = new QWidget(splitter); … … 139 137 QVBoxLayout *layoutTop = new QVBoxLayout(topWidget); 140 138 QVBoxLayout *layoutBottom = new QVBoxLayout(bottomWidget); 141 #else142 QWidget* topWidget = new QWidget();143 QWidget* bottomWidget = new QWidget();144 145 QVBoxLayout *layoutTop = new QVBoxLayout;146 QVBoxLayout *layoutBottom = new QVBoxLayout;147 #endif148 139 149 140 // fill them … … 163 154 164 155 #if QT_VERSION < 0x040000 156 165 157 fCommandHistoryArea = new QListView(bottomWidget); 166 167 158 fCommandHistoryArea->setSorting (-1, FALSE); 168 159 fCommandHistoryArea->setSelectionMode(QListView::Single); … … 546 537 #if QT_VERSION < 0x040000 547 538 fHelpDialog = new QDialog(0,0,FALSE,Qt::WStyle_Title | Qt::WStyle_SysMenu | Qt::WStyle_MinMax ); 539 #else 540 fHelpDialog = new QDialog(0,Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint); 541 #endif 548 542 QVBoxLayout *vLayout = new QVBoxLayout(fHelpDialog); 549 #else550 QVBoxLayout *vLayout = new QVBoxLayout();551 fHelpDialog = new QDialog(0,Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint);552 #endif553 543 QSplitter *splitter = new QSplitter(Qt::Horizontal,fHelpDialog); 554 544 QPushButton *exitButton = new QPushButton("Exit",fHelpDialog); -
trunk/geant4/visualization/OpenGL/src/G4OpenGLQtExportDialog.cc
r633 r635 80 80 QGroupBox *imageGroupBox = new QGroupBox(tr("Image quality"),this); 81 81 QVBoxLayout *imageGroupBoxLayout = new QVBoxLayout(imageGroupBox); 82 QWidget *sliderBox = new QWidget ;83 84 QHBoxLayout *hSlider = new QHBoxLayout(sliderBox);82 QWidget *sliderBox = new QWidget(); 83 84 QHBoxLayout *hSliderLayout = new QHBoxLayout(sliderBox); 85 85 86 86 // qualityLabel = new QLabel( tr( "Image quality" ) ); 87 87 // imageGroupBoxLayout->addWidget(qualityLabel); 88 qualitySlider= new QSlider(Qt::Horizontal, this);88 qualitySlider= new QSlider(Qt::Horizontal,sliderBox); 89 89 #if QT_VERSION < 0x040000 90 90 qualitySlider->setMinValue(0); … … 97 97 #endif 98 98 qualitySlider->setValue(60); 99 hSlider ->addWidget(new QLabel("low",this));100 hSlider ->addWidget(qualitySlider);101 hSlider ->addWidget(new QLabel("Maximum",this));102 #if QT_VERSION >= 0x040000 103 sliderBox->setLayout(hSlider );99 hSliderLayout->addWidget(new QLabel("low",sliderBox)); 100 hSliderLayout->addWidget(qualitySlider); 101 hSliderLayout->addWidget(new QLabel("Maximum",sliderBox)); 102 #if QT_VERSION >= 0x040000 103 sliderBox->setLayout(hSliderLayout); 104 104 #endif 105 105 imageGroupBoxLayout->addWidget(sliderBox); … … 117 117 // transparencyEPS->setChecked( true ); 118 118 119 colorButton = new QRadioButton("Color",this);120 BWButton = new QRadioButton("Grayscale",this);121 122 119 QWidget * EPSWidgetGroupBox; // widget containing group button 123 120 QButtonGroup * EPSButtonGroupBox; // group button 124 #if QT_VERSION < 0x040000 121 122 123 #if QT_VERSION < 0x040000 124 colorButton = new QRadioButton("Color",EPSWidgetGroupBox); 125 BWButton = new QRadioButton("Grayscale",EPSWidgetGroupBox); 125 126 EPSButtonGroupBox = new QButtonGroup( 2,Qt::Vertical, tr("EPS options"),this); 126 127 EPSButtonGroupBox->insert(colorButton); 127 128 EPSButtonGroupBox->insert(BWButton); 128 129 EPSButtonGroupBox->setExclusive(true); 129 colorButton->setChecked( true );130 130 EPSWidgetGroupBox = EPSButtonGroupBox; 131 131 … … 133 133 EPSWidgetGroupBox = new QGroupBox(tr("EPS options")); 134 134 QVBoxLayout *EPSGroupBoxLayout = new QVBoxLayout(EPSWidgetGroupBox); 135 136 colorButton = new QRadioButton("Color",EPSWidgetGroupBox); 137 BWButton = new QRadioButton("Grayscale",EPSWidgetGroupBox); 138 135 139 EPSButtonGroupBox = new QButtonGroup(); 136 colorButton->setChecked( true );137 140 EPSButtonGroupBox->addButton(colorButton); 138 141 EPSButtonGroupBox->addButton(BWButton); … … 144 147 145 148 #endif 149 colorButton->setChecked( true ); 146 150 147 151 // EPSGroupBoxLayout->addWidget(transparencyEPS); … … 159 163 QVBoxLayout *transparencyGroupBoxLayout = new QVBoxLayout(transparencyGroupBox); 160 164 161 boxTransparency = new QCheckBox("Save transparency",t his);165 boxTransparency = new QCheckBox("Save transparency",transparencyGroupBox); 162 166 boxTransparency->setChecked( false ); 163 167 // boxTransparency->setEnabled(false); … … 172 176 173 177 // size box 174 QWidget* modifyAndRatioWidget = new QWidget ;178 QWidget* modifyAndRatioWidget = new QWidget(); 175 179 176 180 QHBoxLayout *modifyAndRatioLayout = new QHBoxLayout(modifyAndRatioWidget); 177 178 // original button179 original = new QRadioButton("Original",this);180 // modify and ratio181 modify = new QRadioButton("Modify",this);182 181 183 182 QWidget * sizeWidgetGroupBox; // widget containing group button … … 193 192 sizeButtonGroupBox->insert(modify); 194 193 sizeButtonGroupBox->setExclusive(true); 195 original->setChecked( true );196 194 sizeWidgetGroupBox = sizeButtonGroupBox; 197 195 sizeGroupBoxLayout = sizeWidgetGroupBox->layout(); … … 202 200 sizeGroupBoxLayout = new QVBoxLayout(sizeWidgetGroupBox); 203 201 sizeButtonGroupBox = new QButtonGroup(); 204 original->setChecked( true );205 202 206 203 original = new QRadioButton("Original"); … … 216 213 sizeWidgetGroupBox->setLayout(sizeGroupBoxLayout); 217 214 #endif 215 original->setChecked( true ); 218 216 219 217 … … 244 242 245 243 // height 246 heightWidget = new QWidget ;244 heightWidget = new QWidget(); 247 245 248 246 QHBoxLayout *heightLineLayout = new QHBoxLayout(heightWidget); … … 250 248 QString tmp; 251 249 252 heightLineLayout->addWidget(new QLabel("Height", this));253 height = new QLineEdit(tmp.setNum(originalHeight), this);250 heightLineLayout->addWidget(new QLabel("Height",heightWidget)); 251 height = new QLineEdit(tmp.setNum(originalHeight),heightWidget); 254 252 height->setMaxLength(5); 255 253 #if QT_VERSION < 0x040000 … … 270 268 271 269 // width 272 widthWidget = new QWidget ;270 widthWidget = new QWidget(); 273 271 274 272 QHBoxLayout *widthLineLayout = new QHBoxLayout(widthWidget); … … 279 277 widthLineLayout->addWidget(new QLabel("Width ",widthWidget)); 280 278 #endif 281 width = new QLineEdit(tmp.setNum(originalWidth), this);279 width = new QLineEdit(tmp.setNum(originalWidth),widthWidget); 282 280 width->setMaxLength(5); 283 281 #if QT_VERSION < 0x040000 -
trunk/geant4/visualization/OpenGL/src/G4OpenGLQtViewer.cc
r633 r635 36 36 #ifdef G4VIS_BUILD_OPENGLQT_DRIVER 37 37 38 //#define GEANT4_QT_DEBUG38 #define GEANT4_QT_DEBUG 39 39 40 40 #include "G4OpenGLQtViewer.hh" … … 1096 1096 1097 1097 QImage image; 1098 // if ((exportDialog->getWidth() !=fWindow->width()) || 1099 // (exportDialog->getHeight() !=fWindow->height())) { 1098 if ((exportDialog->getWidth() !=fWindow->width()) || 1099 (exportDialog->getHeight() !=fWindow->height())) { 1100 G4cerr << "Export->Change Size : This function is not implemented, to export in another size, please resize your frame to what you need" << G4endl; 1100 1101 1101 // rescaleImage(exportDialog->getWidth(),exportDialog->getHeight());// re-scale image 1102 #ifdef GEANT4_QT_DEBUG 1103 printf("rescaling\n"); 1104 #endif 1105 QGLWidget* glResized = fWindow; 1106 fWindow->renderPixmap (exportDialog->getWidth()*2,exportDialog->getHeight()*2 ).save("/Users/laurentgarnier/Desktop/zzz.jpg","jpg"); 1107 QPixmap * pixmap = new QPixmap(fWindow->renderPixmap (exportDialog->getWidth(),exportDialog->getHeight() )) ; 1108 // image = pixmap.toImage(); 1102 // rescaleImage(exportDialog->getWidth(),exportDialog->getHeight());// re-scale image 1103 // QGLWidget* glResized = fWindow; 1104 1105 // FIXME : 1106 // L.Garnier : I've try to implement change size function, but the problem is 1107 // the renderPixmap function call the QGLWidget to resize and it doesn't draw 1108 // the content of this widget... It only draw the background. 1109 1110 // fWindow->renderPixmap (exportDialog->getWidth()*2,exportDialog->getHeight()*2,true ); 1111 1112 // QPixmap pixmap = fWindow->renderPixmap (); 1113 1114 // image = pixmap->toImage(); 1109 1115 // glResized->resize(exportDialog->getWidth()*2,exportDialog->getHeight()*2); 1110 #ifdef GEANT4_QT_DEBUG1111 printf("rescaling after\n");1112 #endif1113 1116 // image = glResized->grabFrameBuffer(); 1114 1117 1115 //} else {1116 //image = fWindow->grabFrameBuffer();1117 //}1118 } else { 1119 image = fWindow->grabFrameBuffer(); 1120 } 1118 1121 // jpeg format 1119 1122 if (nomFich.endsWith(".jpg") || … … 1134 1137 nomFich.endsWith(".bmp") || 1135 1138 nomFich.endsWith(".xpm")) { 1136 image.save(nomFich,0,exportDialog->getSliderValue()); 1137 #ifdef GEANT4_QT_DEBUG 1138 printf("saving ELSE\n"); 1139 bool res = image.save(nomFich,0,exportDialog->getSliderValue()); 1140 if (res == false) { 1141 G4cerr << "Error while saving file..." << G4endl; 1142 } 1143 #ifdef GEANT4_QT_DEBUG 1144 printf("saving ELSE %d\n",res); 1139 1145 #endif 1140 1146 } else { -
trunk/geant4/visualization/OpenGL/src/G4OpenGLStoredQtViewer.cc
r632 r635 25 25 // 26 26 // 27 // $Id: G4OpenGLStoredQtViewer.cc,v 1. 7 2007/11/30 14:47:30lgarnier Exp $27 // $Id: G4OpenGLStoredQtViewer.cc,v 1.6 2007/11/15 18:24:28 lgarnier Exp $ 28 28 // GEANT4 tag $Name: $ 29 29 // … … 34 34 #ifdef G4VIS_BUILD_OPENGLQT_DRIVER 35 35 36 //#define GEANT4_QT_DEBUG36 #define GEANT4_QT_DEBUG 37 37 38 38 #include "G4OpenGLStoredQtViewer.hh" 39 #include "G4VisManager.hh" 39 40 40 41 #include "G4ios.hh" … … 304 305 void G4OpenGLStoredQtViewer::mouseMoveEvent(QMouseEvent *event) 305 306 { 306 #ifdef GEANT4_QT_DEBUG307 printf("G4OpenGLStoredQtViewer::mouseMoveEvent\n");308 #endif309 307 #if QT_VERSION < 0x040000 310 308 G4MouseMoveEvent(event->x(),event->y(),event->state()); … … 318 316 void G4OpenGLStoredQtViewer::contextMenuEvent(QContextMenuEvent *e) 319 317 { 318 #ifdef GEANT4_QT_DEBUG 319 printf("G4OpenGLStoredQtViewer::contextMenuEvent\n"); 320 #endif 320 321 manageContextMenuEvent(e); 321 322 } -
trunk/geant4/visualization/OpenGL/src/G4OpenGLStoredViewer.cc
r631 r635 126 126 void G4OpenGLStoredViewer::DrawDisplayLists () { 127 127 128 printf("*************************** CASE AA ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n"); 128 129 const G4Planes& cutaways = fVP.GetCutawayPlanes(); 129 130 G4bool cutawayUnion = fVP.IsCutaway() && … … 131 132 size_t nPasses = cutawayUnion? cutaways.size(): 1; 132 133 for (size_t i = 0; i < nPasses; ++i) { 134 printf("*************************** CASE A ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n"); 133 135 134 136 if (cutawayUnion) { … … 142 144 } 143 145 144 if (fG4OpenGLStoredSceneHandler.fTopPODL) 146 if (fG4OpenGLStoredSceneHandler.fTopPODL) { 145 147 glCallList (fG4OpenGLStoredSceneHandler.fTopPODL); 146 148 printf("*************************** CASE A1 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n"); 149 } 147 150 for (size_t i = 0; i < fG4OpenGLStoredSceneHandler.fTOList.size(); ++i) { 151 printf("*************************** CASE B1 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n"); 148 152 G4OpenGLStoredSceneHandler::TO& to = 149 153 fG4OpenGLStoredSceneHandler.fTOList[i]; 150 154 if (to.fEndTime >= fStartTime && to.fStartTime <= fEndTime) { 155 printf("*************************** CASE B2 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n"); 151 156 glPushMatrix(); 152 157 G4OpenGLTransform3D oglt (to.fTransform); … … 161 166 glCallList (to.fDisplayListId); 162 167 glPopMatrix(); 168 printf("*************************** CASE B3 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n"); 163 169 } 164 170 }
Note: See TracChangeset
for help on using the changeset viewer.