Changeset 913 for trunk/source/visualization/management
- Timestamp:
- Jan 22, 2009, 4:40:22 PM (15 years ago)
- Location:
- trunk/source/visualization/management
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/visualization/management/include/G4ViewParameters.hh
r907 r913 25 25 // 26 26 // 27 // $Id: G4ViewParameters.hh,v 1. 29 2009/01/13 09:55:15lgarnier Exp $27 // $Id: G4ViewParameters.hh,v 1.30 2009/01/21 16:59:22 lgarnier Exp $ 28 28 // GEANT4 tag $Name: $ 29 29 // … … 168 168 // GetXGeometryString and GetWindowSizeHint is guaranteed to be 169 169 // identical.) 170 bool IsWindowSizeHintX () const; 171 bool IsWindowSizeHintY () const; 172 bool IsWindowLocationHintX () const; 173 bool IsWindowLocationHintY () const; 174 170 175 G4bool IsAutoRefresh () const; 171 176 const G4Colour& GetBackgroundColour () const; … … 251 256 G4int fXNegative; // XValue is from left for XGeometry 252 257 G4int fYNegative; // YValue is from top for XGeometry 258 G4int fGeometryMask; // Mask for ParseGeometry 253 259 254 260 DrawingStyle fDrawingStyle; // Drawing style. -
trunk/source/visualization/management/include/G4ViewParameters.icc
r907 r913 25 25 // 26 26 // 27 // $Id: G4ViewParameters.icc,v 1.1 7 2009/01/13 09:55:15lgarnier Exp $27 // $Id: G4ViewParameters.icc,v 1.18 2009/01/21 16:59:22 lgarnier Exp $ 28 28 // GEANT4 tag $Name: $ 29 29 // … … 162 162 } 163 163 164 inline bool G4ViewParameters::IsWindowSizeHintX () const { 165 return (fGeometryMask & fWidthValue); 166 } 167 168 inline bool G4ViewParameters::IsWindowSizeHintY () const { 169 return (fGeometryMask & fHeightValue); 170 } 171 172 inline bool G4ViewParameters::IsWindowLocationHintX () const { 173 return (fGeometryMask & fXValue); 174 } 175 176 inline bool G4ViewParameters::IsWindowLocationHintY () const { 177 return (fGeometryMask & fYValue); 178 } 179 164 180 inline unsigned int G4ViewParameters::GetWindowSizeHintX () const { 165 181 return fWindowSizeHintX; -
trunk/source/visualization/management/src/G4ViewParameters.cc
r911 r913 25 25 // 26 26 // 27 // $Id: G4ViewParameters.cc,v 1.3 4 2009/01/19 16:26:40lgarnier Exp $27 // $Id: G4ViewParameters.cc,v 1.36 2009/01/21 17:05:12 lgarnier Exp $ 28 28 // GEANT4 tag $Name: $ 29 29 // … … 556 556 } 557 557 558 G4int m= ParseGeometry( geomString, &x, &y, &w, &h );558 fGeometryMask = ParseGeometry( geomString, &x, &y, &w, &h ); 559 559 560 560 // Handle special case : 561 if (( m& fYValue) == 0)561 if ((fGeometryMask & fYValue) == 0) 562 562 { // Using default 563 y = fWindowLocationHintY; 564 } 565 if (( m& fXValue) == 0)563 y = fWindowLocationHintY; 564 } 565 if ((fGeometryMask & fXValue) == 0) 566 566 { // Using default 567 x = fWindowLocationHintX; 567 x = fWindowLocationHintX; 568 568 } 569 569 570 570 // 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 \"" 574 582 << geomString 575 << "\". Using default"583 << "\". No Height found. Using Width value instead" 576 584 << 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) ) { 587 606 fWindowLocationHintXNegative = true; 588 607 } else { 589 608 fWindowLocationHintXNegative = false; 590 609 } 591 if ( ( m& fYNegative) ) {592 610 if ( (fGeometryMask & fYNegative) ) { 611 fWindowLocationHintYNegative = true; 593 612 } else { 594 613 fWindowLocationHintYNegative = false; 595 614 } 596 615 } 597 598 616 } 599 617
Note: See TracChangeset
for help on using the changeset viewer.