Ignore:
Timestamp:
Nov 27, 2008, 4:56:05 PM (16 years ago)
Author:
garnier
Message:

make 3.80 added because 3.81 is bad

Location:
trunk/source/visualization
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/visualization/OpenGL/src/G4OpenGLXViewer.cc

    r891 r893  
    255255
    256256#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());
    258258#endif
    259259
     
    264264  //  G4int                             WinSize_x;
    265265  //  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
    268274
    269275  G4cout << "Window name: " << fName << G4endl;
  • trunk/source/visualization/management/include/G4ViewParameters.hh

    r850 r893  
    156156        G4int            GetWindowSizeHintX      () const;
    157157        G4int            GetWindowSizeHintY      () const;
     158        G4int            GetWindowLocationHintX  () const;
     159        G4int            GetWindowLocationHintY  () const;
    158160  const G4String&        GetXGeometryString      () const;
    159161  // If non-null, can be interpreted with XParseGeometry (see man
     
    222224  void SetMarkerNotHidden      ();
    223225  void SetWindowSizeHint       (G4int xHint, G4int yHint);
     226  void SetWindowLocationHint   (G4int xHint, G4int yHint);
    224227  void SetXGeometryString      (const G4String&);
    225228  void SetAutoRefresh          (G4bool);
     
    270273  G4int        fWindowSizeHintX; // Size hints for pixel-based window systems.
    271274  G4int        fWindowSizeHintY;
     275  G4int        fWindowLocationHintX; // Location hints for pixel-based window systems.
     276  G4int        fWindowLocationHintY;
    272277  G4String     fXGeometryString; // If non-null, geometry string for X Windows.
    273278  G4bool       fAutoRefresh;     // ...after change of view parameters.
  • trunk/source/visualization/management/include/G4ViewParameters.icc

    r850 r893  
    170170}
    171171
     172inline G4int G4ViewParameters::GetWindowLocationHintX () const {
     173#ifdef G4DEBUG
     174        printf("G4ViewParameters::GetWindowLocationHintX () :: %d\n",fWindowLocationHintX);
     175#endif
     176  return fWindowLocationHintX;
     177}
     178
     179inline G4int G4ViewParameters::GetWindowLocationHintY () const {
     180#ifdef G4DEBUG
     181        printf("G4ViewParameters::GetWindowLocationHintY () :: %d\n",fWindowLocationHintY);
     182#endif
     183  return fWindowLocationHintY;
     184}
     185
    172186inline const G4String& G4ViewParameters::GetXGeometryString () const {
    173187  return fXGeometryString;
     
    328342}
    329343
     344inline 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
    330352inline void G4ViewParameters::SetXGeometryString (const G4String& geomString) {
    331353  fXGeometryString = geomString;
  • trunk/source/visualization/management/include/G4VisManager.hh

    r850 r893  
    355355  void  GetWindowSizeHint (G4int& xHint, G4int& yHint) const;
    356356  // Note: GetWindowSizeHint information is returned via the G4int& arguments.
     357  void  GetWindowLocationHint (G4int& xHint, G4int& yHint) const;
    357358  const G4String&              GetXGeometryString          () const;
    358359  // GetXGeometryString is intended to be parsed by XParseGeometry.
     
    381382  void              SetVerboseLevel             (Verbosity);
    382383  void              SetWindowSizeHint           (G4int xHint, G4int yHint);
     384  void              SetWindowLocationHint           (G4int xHint, G4int yHint);
    383385  void              SetXGeometryString          (const G4String&);
    384386  void              SetEventRefreshing          (G4bool);
     
    457459  G4VisStateDependent*  fpStateDependent;   // Friend state dependent class.
    458460  G4int fWindowSizeHintX, fWindowSizeHintY; // For viewer...
     461  G4int fWindowLocationHintX, fWindowLocationHintY; // For viewer...
    459462  G4String              fXGeometryString;   // ...construction.
    460463  G4TrajectoriesModel   dummyTrajectoriesModel;  // For passing drawing mode.
  • trunk/source/visualization/management/include/G4VisManager.icc

    r850 r893  
    7878}
    7979
     80inline void G4VisManager::GetWindowLocationHint
     81 (G4int& xHint, G4int& yHint) const {
     82  xHint = fpViewer->GetViewParameters().GetWindowLocationHintX();
     83  yHint = fpViewer->GetViewParameters().GetWindowLocationHintY();
     84}
     85
    8086inline const G4String& G4VisManager::GetXGeometryString () const {
    8187  return fXGeometryString;
     
    118124}
    119125
     126inline 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
    120135inline void G4VisManager::SetXGeometryString (const G4String& geomString) {
    121136  fXGeometryString = geomString;
  • trunk/source/visualization/management/src/G4VisCommandsViewer.cc

    r891 r893  
    685685    windowSizeHintString = ossw.str();
    686686  }
    687   fpVisManager->SetWindowSizeHint (windowSizeHint, windowSizeHint);
    688   fpVisManager->SetXGeometryString(windowSizeHintString);
    689687  // WindowSizeHint and XGeometryString are picked up from the vis
    690688  // manager in the G4VViewer constructor.  They have to be held by
     
    694692
    695693  int x,y = 0;
    696   unsigned int w,h = 9999999;
     694  unsigned int w,h = 0;
    697695
    698696  int m = ParseGeometry( windowSizeHintString, &x, &y, &w, &h );
    699697  //  QSize minSize = main_widget->minimumSize();
    700698  //  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  }
    722715
    723716#ifdef G4DEBUG
    724717  printf  ("Lecture X:%d Y:%d W:%d H:%d\n",x,y,w,h);
    725   ////////
    726718#endif
     719
    727720
    728721  // Create viewer.
    729722  fpVisManager -> CreateViewer (newName);
     723
     724  // set parameters AFTER
     725  fpVisManager->SetWindowSizeHint (w,h);
     726  fpVisManager->SetWindowLocationHint (x,y);
     727  fpVisManager->SetXGeometryString(windowSizeHintString);
    730728  G4VViewer* newViewer = fpVisManager -> GetCurrentViewer ();
    731729  if (newViewer && newViewer -> GetName () == newName) {
  • trunk/source/visualization/management/src/G4VisManager.cc

    r850 r893  
    673673        fpViewer = p;                             // Make current.
    674674        fpSceneHandler -> AddViewerToList (fpViewer);
     675#ifdef G4DEBUG
     676  printf("G4VisManager::CreateViewer\n");
     677#endif
    675678        fpSceneHandler -> SetCurrentViewer (fpViewer);
    676679
Note: See TracChangeset for help on using the changeset viewer.