Changeset 1966 for trunk/GSASIIplot.py
- Timestamp:
- Aug 28, 2015 3:02:12 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIplot.py
r1958 r1966 572 572 global ifBox 573 573 Choice = {'F':'Fo','S':'Fosq','U':'Unit','D':'dFsq','W':'dFsq/sig'} 574 viewChoice = {'H':[[1,0,0],[0,0,1]],'K':[[0,1,0],[1,0,0]],'L':[[0,0,1],[0,1,0]]} 574 575 try: 575 576 keyCode = event.GetKeyCode() … … 579 580 except AttributeError: #if from OnKeyBox above 580 581 key = str(event.key).upper() 581 if key in ['C']: 582 if key in ['C','H','K','L']: 583 if key == 'C': 584 Data['Zone'] = False 585 key = 'L' 582 586 drawingData['viewPoint'][0] = drawingData['default'] 583 drawingData['viewDir'] = [0,0,1] 587 drawingData['viewDir'] = viewChoice[key][0] 588 drawingData['viewUp'] = viewChoice[key][1] 584 589 drawingData['oldxy'] = [] 585 V0 = np.array([0,0,1]) 586 V = np.inner(Amat,V0) 587 V /= np.sqrt(np.sum(V**2)) 588 A = np.arccos(np.sum(V*V0)) 589 Q = G2mth.AV2Q(A,[0,1,0]) 590 drawingData['Quaternion'] = Q 591 Q = drawingData['Quaternion'] 590 # V0 = np.array(viewChoice[key][0]) 591 # V = np.inner(Amat,V0) 592 # V /= np.sqrt(np.sum(V**2)) 593 # A = np.arccos(np.sum(V*V0)) 594 # Q = G2mth.AV2Q(A,viewChoice[key][1]) 595 drawingData['Quaternion'] = [-1,0,0,0] #the old stuff always gave this... 596 elif key in 'Z': 597 Data['Zone'] = not Data['Zone'] 592 598 elif key in 'B': 593 599 ifBox = not ifBox … … 883 889 cPos = drawingData['cameraPos'] 884 890 Zclip = drawingData['Zclip']*cPos/20. 891 if Data['Zone']: 892 Zclip = 0.1 885 893 Q = drawingData['Quaternion'] 886 894 Tx,Ty,Tz = drawingData['viewPoint'][0] … … 901 909 glViewport(0,0,VS[0],VS[1]) 902 910 gluPerspective(20.,aspect,cPos-Zclip,cPos+Zclip) 903 gluLookAt(0,0,cPos,0,0,0,0,1,0) 911 vDir = drawingData['viewDir'] 912 vUp = drawingData['viewUp'] 913 # gluLookAt(0,0,cPos,0,0,0,0,1,0) 914 gluLookAt(vDir[0]*cPos,vDir[1]*cPos,vDir[2]*cPos, 0,0,0, vUp[0],vUp[1],vUp[2]) 904 915 SetLights() 905 916 … … 936 947 Page.SetFocus() 937 948 Page.Choice = None 938 choice = [' save as/key:','jpeg','tiff','bmp','c: recenter to default','b: toggle box ','+: increase scale', 939 '-: decrease scale','f: Fobs','s: Fobs**2','u: unit','d: Fo-Fc','w: DF/sig','i: toggle intensity scaling'] 949 choice = [' save as/key:','jpeg','tiff','bmp','h: view down h','k: view down k','l: view down l', 950 'z: zero zone toggle','c: reset to default','b: toggle box ','+: increase scale','-: decrease scale', 951 'f: Fobs','s: Fobs**2','u: unit','d: Fo-Fc','w: DF/sig','i: toggle intensity scaling'] 940 952 cb = wx.ComboBox(G2frame.G2plotNB.status,style=wx.CB_DROPDOWN|wx.CB_READONLY,choices=choice) 941 953 cb.Bind(wx.EVT_COMBOBOX, OnKeyBox)
Note: See TracChangeset
for help on using the changeset viewer.