Changeset 893 for trunk/source/visualization/management/src
- Timestamp:
- Nov 27, 2008, 4:56:05 PM (16 years ago)
- Location:
- trunk/source/visualization/management/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/visualization/management/src/G4VisCommandsViewer.cc
r891 r893 685 685 windowSizeHintString = ossw.str(); 686 686 } 687 fpVisManager->SetWindowSizeHint (windowSizeHint, windowSizeHint);688 fpVisManager->SetXGeometryString(windowSizeHintString);689 687 // WindowSizeHint and XGeometryString are picked up from the vis 690 688 // manager in the G4VViewer constructor. They have to be held by … … 694 692 695 693 int x,y = 0; 696 unsigned int w,h = 9999999;694 unsigned int w,h = 0; 697 695 698 696 int m = ParseGeometry( windowSizeHintString, &x, &y, &w, &h ); 699 697 // QSize minSize = main_widget->minimumSize(); 700 698 // QSize maxSize = main_widget->maximumSize(); 701 if ( (m & XValue) == 0 ) 702 x = -1; 703 if ( (m & YValue) == 0 ) 704 y = -2; 705 if ( (m & WidthValue) == 0 ) 706 w = -3; 707 if ( (m & HeightValue) == 0 ) 708 h = -4; 709 // w = QMIN(w,maxSize.width()); 710 // h = QMIN(h,maxSize.height()); 711 // w = QMAX(w,minSize.width()); 712 // h = QMAX(h,minSize.height()); 713 // if ( (m & XNegative) ) { 714 // x = desktop()->width() + x - w; 715 // qt_widget_tlw_gravity = 3; 716 // } 717 // if ( (m & YNegative) ) { 718 // y = desktop()->height() + y - h; 719 // qt_widget_tlw_gravity = (m & XNegative) ? 9 : 7; 720 // } 721 // main_widget->setGeometry( x, y, w, h ); 699 if ( ((m & YValue) == 0) || 700 ((m & XValue) == 0) || 701 ((m & HeightValue) == 0 ) || 702 ((m & WidthValue) == 0 )) { 703 if (verbosity >= G4VisManager::errors) { 704 G4cout << "ERROR: Unrecognised geometry string \"" 705 << windowSizeHintString 706 << "\". Using 100 for X and Y location." 707 << "\". Using 600 for Width and Height." 708 << G4endl; 709 } 710 x = 100; 711 y = 100; 712 w = 600; 713 h = 600; 714 } 722 715 723 716 #ifdef G4DEBUG 724 717 printf ("Lecture X:%d Y:%d W:%d H:%d\n",x,y,w,h); 725 ////////726 718 #endif 719 727 720 728 721 // Create viewer. 729 722 fpVisManager -> CreateViewer (newName); 723 724 // set parameters AFTER 725 fpVisManager->SetWindowSizeHint (w,h); 726 fpVisManager->SetWindowLocationHint (x,y); 727 fpVisManager->SetXGeometryString(windowSizeHintString); 730 728 G4VViewer* newViewer = fpVisManager -> GetCurrentViewer (); 731 729 if (newViewer && newViewer -> GetName () == newName) { -
trunk/source/visualization/management/src/G4VisManager.cc
r850 r893 673 673 fpViewer = p; // Make current. 674 674 fpSceneHandler -> AddViewerToList (fpViewer); 675 #ifdef G4DEBUG 676 printf("G4VisManager::CreateViewer\n"); 677 #endif 675 678 fpSceneHandler -> SetCurrentViewer (fpViewer); 676 679
Note: See TracChangeset
for help on using the changeset viewer.