Changeset 1969 for trunk/GSASIIplot.py


Ignore:
Timestamp:
Aug 31, 2015 1:53:11 PM (8 years ago)
Author:
vondreele
Message:

3Dhkl plots fixed - zone plots & full allow 'P' & 'N' steps on origin

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r1968 r1969  
    572572        global ifBox
    573573        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]]}
    575575        try:
    576576            keyCode = event.GetKeyCode()
     
    584584                Data['Zone'] = False
    585585                key = 'L'
     586            Data['viewKey'] = key
    586587            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])
    589590            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])
    595610            drawingData['Quaternion'] = Q
    596611        elif key in 'Z':
     
    602617        elif key == '-':
    603618            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
    604625        elif key == '0':
    605626            drawingData['viewPoint'][0] = [0,0,0]
     
    806827            if hkl:
    807828                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)
    810831       
    811832    def OnMouseWheel(event):
     
    856877        for line,color in zip(uEdges,uColors)[:3]:
    857878            glColor3ubv(color)
    858             glVertex3fv(-line[1])
     879            glVertex3fv([0,0,0])
     880#            glVertex3fv(-line[1])
    859881            glVertex3fv(line[1])
    860882        glEnd()
     
    870892            x,y,z = xyz
    871893            r,c = rc
    872             glMaterialfv(GL_FRONT_AND_BACK,GL_EMISSION,c)
     894            glColor3ubv(c)
    873895            glPointSize(r*50)
    874896            glBegin(GL_POINTS)
Note: See TracChangeset for help on using the changeset viewer.