Changeset 1969 for trunk/GSASIIplot.py
- Timestamp:
- Aug 31, 2015 1:53:11 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIplot.py
r1968 r1969 572 572 global ifBox 573 573 Choice = {'F':'Fo','S':'Fosq','U':'Unit','D':'dFsq','W':'dFsq/sig'} 574 viewChoice = {'L':[[ 1,0,0],[0,0,1]],'K':[[0,1,0],[1,0,0]],'H':[[0,0,1],[0,1,0]]}574 viewChoice = {'L':[[0,0,1],[1,0,0],[0,1,0]],'K':[[0,1,0],[0,0,1],[1,0,0]],'H':[[1,0,0],[0,0,1],[0,1,0]]} 575 575 try: 576 576 keyCode = event.GetKeyCode() … … 584 584 Data['Zone'] = False 585 585 key = 'L' 586 Data['viewKey'] = key 586 587 drawingData['viewPoint'][0] = drawingData['default'] 587 drawingData['viewDir'] = viewChoice[key][0]588 drawingData['viewUp'] = viewChoice[key][1]588 drawingData['viewDir'] = np.array(viewChoice[key][0]) 589 drawingData['viewUp'] = np.array(viewChoice[key][1]) 589 590 drawingData['oldxy'] = [] 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(np.pi/2.,viewChoice[key][1]) 591 if Data['Zone']: 592 if key == 'L': 593 Q = [-1,0,0,0] 594 else: 595 V0 = np.array(viewChoice[key][0]) 596 V1 = np.array(viewChoice[key][1]) 597 V0 = np.inner(Amat,V0) 598 V1 = np.inner(Amat,V1) 599 V0 /= nl.norm(V0) 600 V1 /= nl.norm(V1) 601 A = np.arccos(np.sum(V1*V0)) 602 Q = G2mth.AV2Q(-A,viewChoice[key][2]) 603 else: 604 V0 = np.array(viewChoice[key][0]) 605 V = np.inner(Bmat,V0) 606 V /= np.sqrt(np.sum(V**2)) 607 V *= np.array([0,0,1]) 608 A = np.arccos(np.sum(V*V0)) 609 Q = G2mth.AV2Q(-A,viewChoice[key][2]) 595 610 drawingData['Quaternion'] = Q 596 611 elif key in 'Z': … … 602 617 elif key == '-': 603 618 Data['Scale'] /= 1.25 619 elif key == 'P': 620 vec = viewChoice[Data['viewKey']][0] 621 drawingData['viewPoint'][0] -= vec 622 elif key == 'N': 623 vec = viewChoice[Data['viewKey']][0] 624 drawingData['viewPoint'][0] += vec 604 625 elif key == '0': 605 626 drawingData['viewPoint'][0] = [0,0,0] … … 806 827 if hkl: 807 828 h,k,l = hkl 808 Page.canvas.SetToolTipString('%d %d%d'%(h,k,l))809 G2frame.G2plotNB.status.SetStatusText('hkl = %d %d%d'%(h,k,l),1)829 Page.canvas.SetToolTipString('%d,%d,%d'%(h,k,l)) 830 G2frame.G2plotNB.status.SetStatusText('hkl = %d,%d,%d'%(h,k,l),1) 810 831 811 832 def OnMouseWheel(event): … … 856 877 for line,color in zip(uEdges,uColors)[:3]: 857 878 glColor3ubv(color) 858 glVertex3fv(-line[1]) 879 glVertex3fv([0,0,0]) 880 # glVertex3fv(-line[1]) 859 881 glVertex3fv(line[1]) 860 882 glEnd() … … 870 892 x,y,z = xyz 871 893 r,c = rc 872 gl Materialfv(GL_FRONT_AND_BACK,GL_EMISSION,c)894 glColor3ubv(c) 873 895 glPointSize(r*50) 874 896 glBegin(GL_POINTS)
Note: See TracChangeset
for help on using the changeset viewer.