(iRen,ren)
| 55 | # This general method computes some common information from mouse |
| 56 | # motion and button presses. |
| 57 | def getMotion(iRen,ren): |
| 58 | global oldPickD, newPickD, oldPickW, newPickW, fpD, fpW, posW |
| 59 | global motionD, motionW, cam |
| 60 | style = iRen.GetInteractorStyle() |
| 61 | oldPickD = iRen.GetLastEventPosition() |
| 62 | newPickD = iRen.GetEventPosition() |
| 63 | motionD[0] = newPickD[0] - oldPickD[0]; |
| 64 | motionD[1] = newPickD[1] - oldPickD[1]; |
| 65 | cam = ren.GetActiveCamera() |
| 66 | fpW = cam.GetFocalPoint() |
| 67 | posW = cam.GetPosition() |
| 68 | style.ComputeWorldToDisplay(ren, fpW[0], fpW[1], fpW[2], fpD) |
| 69 | focalDepth = fpD[2] |
| 70 | style.ComputeDisplayToWorld(ren,oldPickD[0],oldPickD[1],focalDepth,oldPickW) |
| 71 | style.ComputeDisplayToWorld(ren,newPickD[0],newPickD[1],focalDepth,newPickW) |
| 72 | motionW[0] = oldPickW[0] - newPickW[0] |
| 73 | motionW[1] = oldPickW[1] - newPickW[1] |
| 74 | motionW[2] = oldPickW[2] - newPickW[2] |
| 75 | |
| 76 | # Left mouse button is pan |
| 77 | def mouseLeftMove(iRen,ren): |
no test coverage detected