- Timestamp:
- Jan 19, 2009, 5:10:30 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/visualization/management/src/G4ViewParameters.cc
r909 r910 25 25 // 26 26 // 27 // $Id: G4ViewParameters.cc,v 1.3 2 2009/01/13 09:55:15lgarnier Exp $27 // $Id: G4ViewParameters.cc,v 1.33 2009/01/19 15:47:49 lgarnier Exp $ 28 28 // GEANT4 tag $Name: $ 29 29 // … … 532 532 533 533 534 void G4ViewParameters::SetXGeometryString (const G4String& geomString ) {534 void G4ViewParameters::SetXGeometryString (const G4String& geomStringArg) { 535 535 536 536 537 537 G4int x,y = 0; 538 538 unsigned int w,h = 0; 539 G4String geomString = geomStringArg; 540 // Parse windowSizeHintString for backwards compatibility... 541 const G4String delimiters("xX+-"); 542 G4String::size_type i = geomString.find_first_of(delimiters); 543 if (i == G4String::npos) { // Does not contain "xX+-". Assume single number 544 std::istringstream iss(geomString); 545 G4int size; 546 iss >> size; 547 if (!iss) { 548 size = 600; 549 G4cout << "Unrecognised windowSizeHint string: \"" 550 << geomString 551 << "\". Asuuming " << size << G4endl; 552 } 553 std::ostringstream oss; 554 oss << size << 'x' << size; 555 geomString = oss.str(); 556 } 557 539 558 G4int m = ParseGeometry( geomString, &x, &y, &w, &h ); 540 559 560 // Handle special case : 561 if ((m & fYValue) == 0) 562 { // Using default 563 y = fWindowLocationHintY; 564 } 565 if ((m & fXValue) == 0) 566 { // Using default 567 x = fWindowLocationHintX; 568 } 569 541 570 // Check errors 542 if ( ((m & fYValue) == 0)) 543 #ifdef G4DEBUG 544 printf("G4ViewParameters::SetXGeometryString YValue\n"); 545 #endif 546 547 if ( ((m & fXValue) == 0)) 548 #ifdef G4DEBUG 549 printf("G4ViewParameters::SetXGeometryString XValue\n"); 550 #endif 551 if ( ((m & fHeightValue) == 0 )) 552 #ifdef G4DEBUG 553 printf("G4ViewParameters::SetXGeometryString fHeightValue\n"); 554 #endif 555 if ( ((m & fWidthValue) == 0 )) 556 #ifdef G4DEBUG 557 printf("G4ViewParameters::SetXGeometryString fWidthValue\n"); 558 #endif 559 560 if ( ((m & fYValue) == 0) || 561 ((m & fXValue) == 0) || 562 ((m & fHeightValue) == 0 ) || 571 if ( ((m & fHeightValue) == 0 ) || 563 572 ((m & fWidthValue) == 0 )) { 564 573 G4cout << "ERROR: Unrecognised geometry string \"" … … 585 594 fWindowLocationHintYNegative = false; 586 595 } 587 588 596 } 589 597
Note: See TracChangeset
for help on using the changeset viewer.