Changeset 897 for trunk/source/visualization/management
- Timestamp:
- Dec 3, 2008, 7:03:25 PM (16 years ago)
- Location:
- trunk/source/visualization/management
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/visualization/management/include/G4ViewParameters.hh
r896 r897 156 156 G4int GetWindowAbsoluteLocationHintX (G4int) const; 157 157 G4int GetWindowAbsoluteLocationHintY (G4int) const; 158 G4intGetWindowSizeHintX () const;159 G4intGetWindowSizeHintY () const;158 unsigned int GetWindowSizeHintX () const; 159 unsigned int GetWindowSizeHintY () const; 160 160 G4int GetWindowLocationHintX () const; 161 161 G4int GetWindowLocationHintY () const; 162 162 const G4String& GetXGeometryString () const; 163 // If non-null, can be interpreted with XParseGeometry (see man 164 // pages). Supercedes GetWindowSizeHintX/Y. 163 // GetXGeometryString is intended to be parsed by XParseGeometry. 164 // It contains the size information, as in GetWindowSizeHint, but 165 // may also contain the window position, e.g., "600x600-0+200. The 166 // viewer should use this in preference to GetWindowSizeHint, since 167 // it contains more information. (The size information in 168 // GetXGeometryString and GetWindowSizeHint is guaranteed to be 169 // identical.) 165 170 G4bool IsAutoRefresh () const; 166 171 const G4Colour& GetBackgroundColour () const; -
trunk/source/visualization/management/include/G4ViewParameters.icc
r896 r897 162 162 } 163 163 164 inline G4int G4ViewParameters::GetWindowSizeHintX () const {164 inline unsigned int G4ViewParameters::GetWindowSizeHintX () const { 165 165 return fWindowSizeHintX; 166 166 } 167 167 168 inline G4int G4ViewParameters::GetWindowSizeHintY () const {168 inline unsigned int G4ViewParameters::GetWindowSizeHintY () const { 169 169 return fWindowSizeHintY; 170 170 } 171 171 172 172 inline G4int G4ViewParameters::GetWindowLocationHintX () const { 173 #ifdef G4DEBUG174 printf("G4ViewParameters::GetWindowLocationHintX () :: %d\n",fWindowLocationHintX);175 #endif176 173 return fWindowLocationHintX; 177 174 } 178 175 179 176 inline G4int G4ViewParameters::GetWindowLocationHintY () const { 180 #ifdef G4DEBUG181 printf("G4ViewParameters::GetWindowLocationHintY () :: %d\n",fWindowLocationHintY);182 #endif183 177 return fWindowLocationHintY; 184 178 } … … 343 337 344 338 inline void G4ViewParameters::SetWindowLocationHint (G4int xHint, G4int yHint) { 345 #ifdef G4DEBUG346 printf("G4ViewParameters::SetWindowLocationHint () :: %d %d\n",xHint,yHint);347 #endif348 339 fWindowLocationHintX = xHint; 349 340 fWindowLocationHintY = yHint; -
trunk/source/visualization/management/include/G4VisManager.hh
r896 r897 353 353 const G4SceneList& GetSceneList () const; 354 354 Verbosity GetVerbosity () const; 355 void GetWindowSizeHint (G4int& xHint, G4int& yHint) const;356 // Note: GetWindowSizeHint information is returned via the G4int& arguments.357 void GetWindowLocationHint (G4int& xHint, G4int& yHint) const;358 const G4String& GetXGeometryString () const;359 // GetXGeometryString is intended to be parsed by XParseGeometry.360 // It contains the size information, as in GetWindowSizeHint, but361 // may also contain the window position, e.g., "600x600-0+200. The362 // viewer should use this in preference to GetWindowSizeHint, since363 // it contains more information. (The size information in364 // GetXGeometryString and GetWindowSizeHint is guaranteed to be365 // identical.)366 355 G4bool GetTransientsDrawnThisRun () const; 367 356 G4bool GetTransientsDrawnThisEvent () const; … … 381 370 void SetVerboseLevel (const G4String&); 382 371 void SetVerboseLevel (Verbosity); 383 void SetWindowSizeHint (G4int xHint, G4int yHint);384 void SetWindowLocationHint (G4int xHint, G4int yHint);385 void SetXGeometryString (const G4String&);386 372 void SetEventRefreshing (G4bool); 387 373 void ResetTransientsDrawnFlags (); … … 458 444 std::vector<G4UIcommand*> fDirectoryList; 459 445 G4VisStateDependent* fpStateDependent; // Friend state dependent class. 460 G4int fWindowSizeHintX, fWindowSizeHintY; // For viewer...461 G4int fWindowLocationHintX, fWindowLocationHintY; // For viewer...462 G4String fXGeometryString; // ...construction.463 446 G4TrajectoriesModel dummyTrajectoriesModel; // For passing drawing mode. 464 447 G4bool fEventRefreshing; -
trunk/source/visualization/management/src/G4ViewParameters.cc
r896 r897 87 87 fPicking (false) 88 88 { 89 #ifdef G4DEBUG90 printf("G4ViewParameters::Create \n");91 #endif92 89 fDefaultMarker.SetScreenSize (5.); 93 90 // Markers are 5 pixels "overall" size, i.e., diameter. -
trunk/source/visualization/management/src/G4VisCommandsViewer.cc
r896 r897 488 488 ////////////// /vis/viewer/create /////////////////////////////////////// 489 489 490 G4VisCommandViewerCreate::G4VisCommandViewerCreate (): 491 fId (0) 492 { 490 G4VisCommandViewerCreate::G4VisCommandViewerCreate (): fId (0) { 493 491 G4bool omitable; 494 492 fpCommand = new G4UIcommand ("/vis/viewer/create", this); … … 638 636 } 639 637 640 641 // Parse windowSizeHintString to extract first field for backwards642 // compatibility...643 std::istringstream issw;644 G4int windowSizeHint;645 size_t i;646 #ifdef G4DEBUG647 printf("G4VisCommandViewerCreate::SetNewValue string\n");648 #endif649 for (i = 0; i < windowSizeHintString.size(); ++i) {650 char c = windowSizeHintString[i];651 #ifdef G4DEBUG652 printf("%c",c);653 #endif654 if (c == 'x' || c == 'X' || c == '+' || c == '-') break;655 }656 #ifdef G4DEBUG657 printf("\n");658 #endif659 if (i != windowSizeHintString.size()) {660 // x or X or + or - found - must be a X-Window-type geometry string...661 // Pick out the first field for backwards compatibility...662 issw.str(windowSizeHintString.substr(0,i));663 issw >> windowSizeHint;664 } else { // ...old-style integer...665 issw.str(windowSizeHintString);666 if (!(issw >> windowSizeHint)) {667 if (verbosity >= G4VisManager::errors) {668 G4cout << "ERROR: Unrecognised geometry string \""669 << windowSizeHintString670 << "\". Using 600."671 << G4endl;672 }673 windowSizeHint = 600;674 }675 // Reconstitute windowSizeHintString...676 std::ostringstream ossw;677 ossw << windowSizeHint << 'x' << windowSizeHint;678 windowSizeHintString = ossw.str();679 }680 638 // WindowSizeHint and XGeometryString are picked up from the vis 681 // manager in the G4VViewer constructor. They have to be held by682 // the vis manager until the viewer is contructed - next line...639 // manager in the G4VViewer constructor. In G4VisManager, after Viewer 640 // creation, we will store theses parameters in G4ViewParameters. 683 641 684 642 fpVisManager -> CreateViewer (newName,windowSizeHintString); … … 1528 1486 SetViewParameters(currentViewer, vp); 1529 1487 } 1530 1531 -
trunk/source/visualization/management/src/G4VisManager.cc
r896 r897 199 199 200 200 void G4VisManager::Initialise () { 201 #ifdef G4DEBUG202 printf("G4VisManager::Initialise\n");203 #endif204 201 205 202 if (fVerbosity >= startup) { … … 652 649 653 650 void G4VisManager::CreateViewer (G4String name,G4String XGeometry) { 654 #ifdef G4DEBUG655 printf("G4VisManager::CreateViewer TOP\n");656 #endif657 651 658 652 if (!fInitialised) Initialise (); 659 #ifdef G4DEBUG660 printf("G4VisManager::CreateViewer 2\n");661 #endif662 653 663 654 if (fpSceneHandler) { 664 #ifdef G4DEBUG665 printf("G4VisManager::CreateViewer 3\n");666 #endif667 655 G4VViewer* p = fpGraphicsSystem -> CreateViewer (*fpSceneHandler, name); 668 #ifdef G4DEBUG669 656 670 657 // Viewer is created, now we can set geometry parameters 671 658 // Before 12/2008, it was done in G4VViewer.cc but it did not have to be there! 672 659 673 660 G4ViewParameters vp = p->GetViewParameters(); 674 661 vp.SetXGeometryString(XGeometry); 675 p->SetViewParameters(vp); 676 677 printf("G4VisManager::CreateViewer 4\n"); 678 #endif 662 p->SetViewParameters(vp); //parse string and store parameters 663 679 664 if (!p) { 680 #ifdef G4DEBUG681 printf("G4VisManager::CreateViewer !p\n");682 #endif683 665 if (fVerbosity >= errors) { 684 666 G4cout << "ERROR in G4VisManager::CreateViewer during " … … 688 670 } 689 671 } else { 690 #ifdef G4DEBUG691 printf("G4VisManager::CreateViewer 5\n");692 #endif693 672 p -> Initialise (); 694 #ifdef G4DEBUG695 printf("G4VisManager::CreateViewer 6\n");696 #endif697 673 if (p -> GetViewId() < 0) { 698 #ifdef G4DEBUG699 printf("G4VisManager::CreateViewer Id <0\n");700 #endif701 674 if (fVerbosity >= errors) { 702 675 G4cout << "ERROR in G4VisManager::CreateViewer during " … … 706 679 } 707 680 } else { 708 #ifdef G4DEBUG709 printf("G4VisManager::CreateViewer 7\n");710 #endif711 681 fpViewer = p; // Make current. 712 #ifdef G4DEBUG713 printf("G4VisManager::CreateViewer 8\n");714 #endif715 682 fpSceneHandler -> AddViewerToList (fpViewer); 716 #ifdef G4DEBUG717 printf("G4VisManager::CreateViewer 9\n");718 #endif719 683 fpSceneHandler -> SetCurrentViewer (fpViewer); 720 684 … … 724 688 } 725 689 726 #ifdef G4DEBUG727 printf("G4VisManager::CreateViewer 10 Read parameters\n");728 #endif729 690 const G4ViewParameters& vp = fpViewer->GetViewParameters(); 730 #ifdef G4DEBUG731 printf("G4VisManager::CreateViewer 11 END of read Parameters\n");732 #endif733 691 if (fVerbosity >= parameters) { 734 692 G4cout << " view parameters are:\n " << vp << G4endl; … … 766 724 } 767 725 else PrintInvalidPointers (); 768 #ifdef G4DEBUG769 printf("G4VisManager::END OF CreateViewer\n");770 #endif771 726 } 772 727
Note: See TracChangeset
for help on using the changeset viewer.