Changeset 1383


Ignore:
Timestamp:
Jun 13, 2014 5:40:58 PM (7 years ago)
Author:
toby
Message:

fix bug where 'zero' rotations flips structure plot

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r1382 r1383  
    32273227        return Bonds
    32283228
     3229    # PlotStructure initialization here
    32293230    ForthirdPI = 4.0*math.pi/3.0
    32303231    generalData = data['General']
     
    36413642       
    36423643    def SetRotation(newxy):
    3643 #first get rotation vector in screen coords. & angle increment       
     3644        'Perform a rotation in x-y space due to a left-mouse drag'
     3645    #first get rotation vector in screen coords. & angle increment       
    36443646        oldxy = drawingData['oldxy']
    36453647        if not len(oldxy): oldxy = list(newxy)
     
    36483650        V = np.array([dxy[1],dxy[0],0.])
    36493651        A = 0.25*np.sqrt(dxy[0]**2+dxy[1]**2)
    3650 # next transform vector back to xtal coordinates via inverse quaternion
    3651 # & make new quaternion
     3652        if not A: return # nothing changed, nothing to do
     3653    # next transform vector back to xtal coordinates via inverse quaternion
     3654    # & make new quaternion
    36523655        Q = drawingData['Quaternion']
    36533656        V = G2mth.prodQVQ(G2mth.invQ(Q),np.inner(Bmat,V))
     
    36553658        Q = G2mth.prodQQ(Q,DQ)
    36563659        drawingData['Quaternion'] = Q
    3657 # finally get new view vector - last row of rotation matrix
     3660    # finally get new view vector - last row of rotation matrix
    36583661        VD = np.inner(Bmat,G2mth.Q2Mat(Q)[2])
    36593662        VD /= np.sqrt(np.sum(VD**2))
     
    41424145        Draw('focus')
    41434146       
    4144     # PlotStructure execution starts here
     4147    # PlotStructure execution starts here (N.B. initialization above)
    41454148    try:
    41464149        plotNum = G2frame.G2plotNB.plotList.index(generalData['Name'])
Note: See TracChangeset for help on using the changeset viewer.