Changeset 637 for trunk/geant4


Ignore:
Timestamp:
Dec 5, 2007, 2:41:42 PM (17 years ago)
Author:
garnier
Message:

amelioration du ticket #66

Location:
trunk/geant4/visualization/OpenGL/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/geant4/visualization/OpenGL/src/G4OpenGLQtExportDialog.cc

    r636 r637  
    111111  }
    112112 
    113   if ((nomFich.endsWith(".ps")) || (nomFich.endsWith(".pdf")) || (nomFich.endsWith(".eps"))) {
     113  // FIXME : L. Garnier 4/12/07
     114  // This is not working for PS and PDF images, it does nothing.
     115  // Image is staying in color mode
     116  //  if ((nomFich.endsWith(".ps")) || (nomFich.endsWith(".pdf")) || (nomFich.endsWith(".eps"))) {
     117  if ((nomFich.endsWith(".eps"))) {
    114118
    115119    //    transparencyEPS = new QCheckBox( "transparencyEPS" );
     
    361365int G4OpenGLQtExportDialog::getNbColor()
    362366{
     367  if (!colorButton) return -1;
    363368  // Black and white
    364369  if (!colorButton->isChecked())
     
    371376void G4OpenGLQtExportDialog::changeSizeBox()
    372377{
     378  if (!original) return;
     379  if (!heightWidget) return;
     380  if (!widthWidget) return;
     381  if (!ratioCheckBox) return;
     382
    373383  if ( original->isChecked()) {
    374384    heightWidget->hide();
     
    386396 )
    387397{
     398  if (!ratioCheckBox) return;
     399  if (!width) return;
     400
    388401  if (ratioCheckBox->isChecked()){
    389402    QString tmp;
     
    396409)
    397410{
     411  if (!ratioCheckBox) return;
     412  if (!width) return;
     413
    398414  if (ratioCheckBox->isChecked()){
    399415    QString tmp;
  • trunk/geant4/visualization/OpenGL/src/G4OpenGLQtViewer.cc

    r636 r637  
    13101310  if ((!aImage.isGrayscale ()) &&(aInColor ==1 )) {
    13111311#if QT_VERSION < 0x040000
    1312     aImage.convertDepth(1,Qt::MonoOnly);
    1313 #else
    1314     aImage.convertToFormat ( aImage.format(), Qt::MonoOnly);
     1312    aImage = aImage.convertDepth(1,Qt::MonoOnly);
     1313#else
     1314    aImage = aImage.convertToFormat ( aImage.format(), Qt::MonoOnly);
    13151315#endif
    13161316  }
     
    13971397    */
    13981398  } else if (depth == 8) {
    1399 #ifdef GEANT4_QT_DEBUG
    1400     printf("has 8 bit\n");
    1401 #endif
    14021399    for(int y=height-1; y >=0 ; y--) {
    14031400      const uchar * s = aImage.scanLine(y);
     
    14941491  QPrinter printer;
    14951492  //  printer.setPageSize(pageSize);
    1496   if (aInColor == 1) {
    1497     printer.setColorMode(QPrinter::GrayScale);
    1498   } else {
    1499     printer.setColorMode(QPrinter::Color);
    1500   }
     1493
     1494  // FIXME : L. Garnier 4/12/07
     1495  // This is not working, it does nothing. Image is staying in color mode
     1496  // So I have desactivate the B/W button in GUI
     1497  if ((!aImage.isGrayscale ()) &&(aInColor ==1 )) {
     1498#if QT_VERSION < 0x040000
     1499    aImage = aImage.convertDepth(1,Qt::MonoOnly);
     1500#else
     1501    aImage = aImage.convertToFormat ( aImage.format(), Qt::MonoOnly);
     1502#endif
     1503  }
     1504
    15011505
    15021506  if (aFilename.endsWith(".ps")) {
     
    15141518  //  printer.setFullPage ( true);
    15151519  QPainter paint(&printer);
    1516   paint.drawImage (0,0,aImage );
     1520  paint.drawImage (0,0,aImage);
    15171521  paint.end();
    15181522#endif
Note: See TracChangeset for help on using the changeset viewer.