Changeset 893 for trunk/source
- Timestamp:
- Nov 27, 2008, 4:56:05 PM (16 years ago)
- Location:
- trunk/source/visualization
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/visualization/OpenGL/src/G4OpenGLXViewer.cc
r891 r893 255 255 256 256 #ifdef G4DEBUG 257 printf(" CreateWindow Size:%d=%d - %d=%d \n",width,fVP.GetWindowSizeHintX(),height, fVP.GetWindowSizeHintY());257 printf("G4OpenGLXViewer::CreateMainWindow CreateWindow Mauvais Size:W:%d X:%d H:%d Y:%d \n",width,fVP.GetWindowSizeHintX(),height, fVP.GetWindowSizeHintY()); 258 258 #endif 259 259 … … 264 264 // G4int WinSize_x; 265 265 // G4int WinSize_y; 266 WinSize_x = width; 267 WinSize_y = height; 266 WinSize_x = fVP.GetWindowSizeHintX(); 267 WinSize_y = fVP.GetWindowSizeHintY(); 268 x_origin = fVP.GetWindowLocationHintX(); 269 y_origin = fVP.GetWindowLocationHintY(); 270 271 #ifdef G4DEBUG 272 printf("G4OpenGLXViewer::CreateMainWindow CreateWindow Size:W:%d H:%d X:%d Y:%d \n",WinSize_x,WinSize_y,x_origin,y_origin); 273 #endif 268 274 269 275 G4cout << "Window name: " << fName << G4endl; -
trunk/source/visualization/management/include/G4ViewParameters.hh
r850 r893 156 156 G4int GetWindowSizeHintX () const; 157 157 G4int GetWindowSizeHintY () const; 158 G4int GetWindowLocationHintX () const; 159 G4int GetWindowLocationHintY () const; 158 160 const G4String& GetXGeometryString () const; 159 161 // If non-null, can be interpreted with XParseGeometry (see man … … 222 224 void SetMarkerNotHidden (); 223 225 void SetWindowSizeHint (G4int xHint, G4int yHint); 226 void SetWindowLocationHint (G4int xHint, G4int yHint); 224 227 void SetXGeometryString (const G4String&); 225 228 void SetAutoRefresh (G4bool); … … 270 273 G4int fWindowSizeHintX; // Size hints for pixel-based window systems. 271 274 G4int fWindowSizeHintY; 275 G4int fWindowLocationHintX; // Location hints for pixel-based window systems. 276 G4int fWindowLocationHintY; 272 277 G4String fXGeometryString; // If non-null, geometry string for X Windows. 273 278 G4bool fAutoRefresh; // ...after change of view parameters. -
trunk/source/visualization/management/include/G4ViewParameters.icc
r850 r893 170 170 } 171 171 172 inline G4int G4ViewParameters::GetWindowLocationHintX () const { 173 #ifdef G4DEBUG 174 printf("G4ViewParameters::GetWindowLocationHintX () :: %d\n",fWindowLocationHintX); 175 #endif 176 return fWindowLocationHintX; 177 } 178 179 inline G4int G4ViewParameters::GetWindowLocationHintY () const { 180 #ifdef G4DEBUG 181 printf("G4ViewParameters::GetWindowLocationHintY () :: %d\n",fWindowLocationHintY); 182 #endif 183 return fWindowLocationHintY; 184 } 185 172 186 inline const G4String& G4ViewParameters::GetXGeometryString () const { 173 187 return fXGeometryString; … … 328 342 } 329 343 344 inline void G4ViewParameters::SetWindowLocationHint (G4int xHint, G4int yHint) { 345 #ifdef G4DEBUG 346 printf("G4ViewParameters::SetWindowLocationHint () :: %d %d\n",xHint,yHint); 347 #endif 348 fWindowLocationHintX = xHint; 349 fWindowLocationHintY = yHint; 350 } 351 330 352 inline void G4ViewParameters::SetXGeometryString (const G4String& geomString) { 331 353 fXGeometryString = geomString; -
trunk/source/visualization/management/include/G4VisManager.hh
r850 r893 355 355 void GetWindowSizeHint (G4int& xHint, G4int& yHint) const; 356 356 // Note: GetWindowSizeHint information is returned via the G4int& arguments. 357 void GetWindowLocationHint (G4int& xHint, G4int& yHint) const; 357 358 const G4String& GetXGeometryString () const; 358 359 // GetXGeometryString is intended to be parsed by XParseGeometry. … … 381 382 void SetVerboseLevel (Verbosity); 382 383 void SetWindowSizeHint (G4int xHint, G4int yHint); 384 void SetWindowLocationHint (G4int xHint, G4int yHint); 383 385 void SetXGeometryString (const G4String&); 384 386 void SetEventRefreshing (G4bool); … … 457 459 G4VisStateDependent* fpStateDependent; // Friend state dependent class. 458 460 G4int fWindowSizeHintX, fWindowSizeHintY; // For viewer... 461 G4int fWindowLocationHintX, fWindowLocationHintY; // For viewer... 459 462 G4String fXGeometryString; // ...construction. 460 463 G4TrajectoriesModel dummyTrajectoriesModel; // For passing drawing mode. -
trunk/source/visualization/management/include/G4VisManager.icc
r850 r893 78 78 } 79 79 80 inline void G4VisManager::GetWindowLocationHint 81 (G4int& xHint, G4int& yHint) const { 82 xHint = fpViewer->GetViewParameters().GetWindowLocationHintX(); 83 yHint = fpViewer->GetViewParameters().GetWindowLocationHintY(); 84 } 85 80 86 inline const G4String& G4VisManager::GetXGeometryString () const { 81 87 return fXGeometryString; … … 118 124 } 119 125 126 inline void G4VisManager::SetWindowLocationHint (G4int xHint, G4int yHint) { 127 #ifdef G4DEBUG 128 printf("G4VisManager::SetWindowLocationHint () :: %d %d\n",xHint,yHint); 129 #endif 130 G4ViewParameters vp = fpViewer->GetViewParameters(); 131 vp.SetWindowLocationHint(xHint,yHint); 132 fpViewer->SetViewParameters(vp); 133 } 134 120 135 inline void G4VisManager::SetXGeometryString (const G4String& geomString) { 121 136 fXGeometryString = geomString; -
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.