Ignore:
Timestamp:
Jan 22, 2009, 4:40:22 PM (15 years ago)
Author:
garnier
Message:

History change, and a Warning added

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/visualization/management/src/G4ViewParameters.cc

    r911 r913  
    2525//
    2626//
    27 // $Id: G4ViewParameters.cc,v 1.34 2009/01/19 16:26:40 lgarnier Exp $
     27// $Id: G4ViewParameters.cc,v 1.36 2009/01/21 17:05:12 lgarnier Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    556556  }
    557557 
    558   G4int m = ParseGeometry( geomString, &x, &y, &w, &h );
     558  fGeometryMask = ParseGeometry( geomString, &x, &y, &w, &h );
    559559
    560560  // Handle special case :
    561   if ((m & fYValue) == 0)
     561  if ((fGeometryMask & fYValue) == 0)
    562562    {  // Using default
    563       y =  fWindowLocationHintY;     
    564     }
    565   if ((m & fXValue) == 0)
     563      y =  fWindowLocationHintY;
     564    }
     565  if ((fGeometryMask & fXValue) == 0)
    566566    {  // Using default
    567       x =  fWindowLocationHintX;     
     567      x =  fWindowLocationHintX;
    568568    }
    569569
    570570  // Check errors
    571   if ( ((m & fHeightValue) == 0 ) ||
    572        ((m & fWidthValue)  == 0 )) {
    573     G4cout << "ERROR: Unrecognised geometry string \""
     571  // if there is no Width and Height
     572  if ( ((fGeometryMask & fHeightValue) == 0 ) &&
     573       ((fGeometryMask & fWidthValue)  == 0 )) {
     574    h = fWindowSizeHintY;
     575    w = fWindowSizeHintX;
     576  } else  if ((fGeometryMask & fHeightValue) == 0 ) {
     577
     578    // if there is only Width. Special case to be backward compatible
     579    // We set Width and Height the same to obtain a square windows.
     580   
     581    G4cout << "Unrecognised geometry string \""
    574582           << geomString
    575            << "\".  Using default"
     583           << "\".  No Height found. Using Width value instead"
    576584           << G4endl;
    577   } else {
    578     // Set the string
    579     fXGeometryString = geomString;
    580 
    581     // Set values
    582     fWindowSizeHintX = w;
    583     fWindowSizeHintY = h;
    584     fWindowLocationHintX = x;
    585     fWindowLocationHintY = y;
    586     if ( (m & fXNegative) ) {
     585    h = w;
     586  }
     587  if ( ((fGeometryMask & fXValue) == 0 ) ||
     588       ((fGeometryMask & fYValue)  == 0 )) {
     589    //Using defaults
     590    x = fWindowLocationHintX;
     591    y = fWindowLocationHintY;
     592  }
     593  // Set the string
     594  fXGeometryString = geomString;
     595 
     596  // Set values
     597  fWindowSizeHintX = w;
     598  fWindowSizeHintY = h;
     599  fWindowLocationHintX = x;
     600  fWindowLocationHintY = y;
     601
     602  if ( ((fGeometryMask & fXValue)) &&
     603       ((fGeometryMask & fYValue))) {
     604
     605    if ( (fGeometryMask & fXNegative) ) {
    587606      fWindowLocationHintXNegative = true;
    588607    } else {
    589608      fWindowLocationHintXNegative = false;
    590609    }
    591     if ( (m & fYNegative) ) {
    592       fWindowLocationHintYNegative = true;
     610    if ( (fGeometryMask & fYNegative) ) {
     611    fWindowLocationHintYNegative = true;
    593612    } else {
    594613      fWindowLocationHintYNegative = false;
    595614    }
    596615  }
    597 
    598616}
    599617
Note: See TracChangeset for help on using the changeset viewer.