Changeset 727 for trunk/geant4/visualization
- Timestamp:
- Feb 18, 2008, 6:26:55 PM (17 years ago)
- Location:
- trunk/geant4/visualization/OpenGL/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/geant4/visualization/OpenGL/src/G4OpenGLQtViewer.cc
r725 r727 291 291 ,fContextMenu(0) 292 292 ,fMouseAction(STYLE1) 293 ,fDeltaRotation( 1)293 ,fDeltaRotation(0.5) 294 294 ,fDeltaSceneTranslation(0.01) 295 295 ,fDeltaDepth(0.01) … … 1483 1483 { 1484 1484 fAutoMove = mAutoMove; 1485 #ifdef GEANT4_QT_DEBUG1486 printf(" mouse move event %d %d\n",pos_x,pos_y);1487 #endif1488 1485 1489 1486 if (!fAutoMove) { // keep old delta if automove … … 1513 1510 } 1514 1511 fLastPos = QPoint(pos_x, pos_y); 1515 #ifdef GEANT4_QT_DEBUG1516 if (mButtons & Qt::LeftButton) {1517 printf(" end of mouse move event %d %d delta:%f %f\n",pos_x,pos_y,fDeltaPosX,fDeltaPosY);1518 } else {1519 printf(" end of mouse move event %d %d delta:%f %f --------------NO BUTTON\n",pos_x,pos_y,fDeltaPosX,fDeltaPosY);1520 }1521 #endif1522 1512 } 1523 1513 … … 1616 1606 1617 1607 new_vp = std::cos(delta_alpha) * vp + std::sin(delta_alpha) * zprime; 1618 1608 1609 // to avoid z rotation flipping 1610 // to allow more than 360° rotation 1619 1611 if (fVP.GetLightsMoveWithCamera()) { 1620 1612 new_up = (new_vp.cross(yprime)).unit(); 1621 fVP.SetUpVector(new_up); 1613 if (new_vp.z()*vp.z() <0) { 1614 new_up.set(new_up.x(),-new_up.y(),new_up.z()); 1615 } 1622 1616 } else { 1623 1617 new_up = up; 1624 } 1618 if (new_vp.z()*vp.z() <0) { 1619 new_up.set(new_up.x(),-new_up.y(),new_up.z()); 1620 } 1621 } 1622 fVP.SetUpVector(new_up); 1625 1623 //////////////// 1626 1624 // Rotates by fixed azimuthal angle delta_theta. … … 1639 1637 viewPoint = new_vp.unit() + delta; 1640 1638 1639 #ifdef GEANT4_QT_DEBUG 1640 // printf("vp Vector : %f %f %f delta_alpha:%f delta_theta:%f cosalpha:%f sinalpha:%f\n",viewPoint.x(),viewPoint.y(),viewPoint.z(),delta_alpha,delta_theta,cosalpha,sinalpha); 1641 // printf("up : %f %f %f\n",up.x(),up.y(),up.z()); 1642 // printf("new up : %f %f %f\n",new_up.x(),new_up.y(),new_up.z()); 1643 // printf("vp : %f %f %f\n",vp.x(),vp.y(),vp.z()); 1644 // printf("new_vp : %f %f %f\n",new_vp.x(),new_vp.y(),new_vp.z()); 1645 #endif 1641 1646 fVP.SetViewAndLights (viewPoint); 1642 1647 updateQWidget(); … … 1994 1999 #endif 1995 2000 if (event->key() == Qt::Key_Plus) { 1996 fDeltaPosX =fDeltaPosX*(1+fDeltaMove); 1997 fDeltaPosY =fDeltaPosY*(1+fDeltaMove); 2001 fDeltaPosX =fDeltaPosX*(1+fDeltaRotation); 2002 fDeltaPosY =fDeltaPosY*(1+fDeltaRotation); 2003 printf("rotate + %f %f\n",fDeltaPosX,fDeltaPosY); 1998 2004 } 1999 2005 else if (event->key() == Qt::Key_Minus) { 2000 fDeltaPosX =fDeltaPosX*(1-fDeltaMove); 2001 fDeltaPosY =fDeltaPosY*(1-fDeltaMove); 2006 fDeltaPosX =fDeltaPosX*(1-fDeltaRotation); 2007 fDeltaPosY =fDeltaPosY*(1-fDeltaRotation); 2008 printf("rotate - %f %f\n",fDeltaPosX,fDeltaPosY); 2002 2009 } 2003 2010 } else { -
trunk/geant4/visualization/OpenGL/src/G4OpenGLViewer.cc
r712 r727 196 196 } 197 197 198 printf("Set view to : %f %f %f %f %f %f \n",left, right, bottom, top, pnear, pfar);199 198 glMatrixMode (GL_MODELVIEW); // apply further transformations to scene. 200 199 glLoadIdentity();
Note: See TracChangeset
for help on using the changeset viewer.