Changeset 906 for trunk/source/visualization/OpenGL/src/G4OpenGLQtViewer.cc
- Timestamp:
- Jan 15, 2009, 5:41:07 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/visualization/OpenGL/src/G4OpenGLQtViewer.cc
r898 r906 25 25 // 26 26 // 27 // $Id: G4OpenGLQtViewer.cc,v 1.3 0 2008/11/06 13:43:44lgarnier Exp $27 // $Id: G4OpenGLQtViewer.cc,v 1.31 2009/01/13 09:47:05 lgarnier Exp $ 28 28 // GEANT4 tag $Name: $ 29 29 // … … 89 89 G4OpenGLViewer::SetView (); 90 90 } 91 92 /**93 * Set the viewport of the scene94 */95 void G4OpenGLQtViewer::setupViewport(int aWidth, int aHeight)96 {97 int side = aWidth;98 if (aHeight < aWidth) side = aHeight;99 glViewport((aWidth - side) / 2, (aHeight - side) / 2, side, side);100 101 glMatrixMode(GL_PROJECTION);102 glLoadIdentity();103 glOrtho(-0.5, +0.5, +0.5, -0.5, 4.0, 15.0);104 glMatrixMode(GL_MODELVIEW);105 }106 107 108 91 109 92 … … 788 771 789 772 790 void G4OpenGLQtViewer::G4resizeGL(791 int aWidth792 ,int aHeight)793 {794 setupViewport(aWidth,aHeight);795 796 if (((fWinSize_x != (unsigned int)aWidth)) || (fWinSize_y != (unsigned int) aHeight)) {797 hasToRepaint =true;798 }799 fWinSize_x = (unsigned int) aWidth;800 fWinSize_y = (unsigned int) aHeight;801 }802 803 804 773 void G4OpenGLQtViewer::G4manageContextMenuEvent(QContextMenuEvent *e) 805 774 {
Note: See TracChangeset
for help on using the changeset viewer.