Changeset 754


Ignore:
Timestamp:
Sep 7, 2012 2:48:44 PM (10 years ago)
Author:
vondreele
Message:

final cleanup of quaternion stuff

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIphsGUI.py

    r753 r754  
    15631563            'radiusFactor':0.85,'contourLevel':1.,'bondRadius':0.1,'ballScale':0.33,
    15641564            'vdwScale':0.67,'ellipseProb':50,'sizeH':0.50,'unitCellBox':False,
    1565             'showABC':True,'selectedAtoms':[],'Atoms':[],'Rotation':[0.0,0.0,0.0,[]],
     1565            'showABC':True,'selectedAtoms':[],'Atoms':[],'oldxy':[],
    15661566            'Quaternion':[0.0,0.0,1.0,0.0],'bondList':{},'viewDir':[0,0,1]}
    15671567        try:
  • trunk/GSASIIplot.py

    r753 r754  
    23942394            VD /= np.sqrt(np.sum(VD**2))
    23952395            drawingData['viewDir'] = VD
    2396             drawingData['Rotation'] = [0.0,0.0,0.0,[]]
     2396            drawingData['oldxy'] = []
    23972397            drawingData['Quaternion'] = [0.0,0.0,1.0,0.0]
    23982398            SetViewPointText(drawingData['viewPoint'][0])
     
    24862486                GetTruePosition(xy,True)
    24872487        else:
    2488             drawingData['Rotation'][3] = list(xy)
     2488            drawingData['oldxy'] = list(xy)
    24892489        Draw()
    24902490       
     
    26182618        roll = GetRoll(newxy,rho)
    26192619        mapData['rho'] = np.roll(np.roll(np.roll(rho,roll[0],axis=0),roll[1],axis=1),roll[2],axis=2)
    2620         drawingData['Rotation'][3] = list(newxy)
     2620        drawingData['oldxy'] = list(newxy)
    26212621       
    26222622    def SetPeakRoll(newxy):
     
    26322632    def SetTranslation(newxy):
    26332633#first get translation vector in screen coords.       
    2634         oldxy = drawingData['Rotation'][3]
     2634        oldxy = drawingData['oldxy']
    26352635        if not len(oldxy): oldxy = list(newxy)
    26362636        dxy = newxy-oldxy
    2637         drawingData['Rotation'][3] = list(newxy)
     2637        drawingData['oldxy'] = list(newxy)
    26382638        V = np.array([-dxy[0],dxy[1],0.])
    26392639#then transform to rotated crystal coordinates & apply to view point       
     
    26442644        Ty += V[1]*0.01
    26452645        Tz += V[2]*0.01
    2646         drawingData['Rotation'][3] = list(newxy)
     2646        drawingData['oldxy'] = list(newxy)
    26472647        drawingData['viewPoint'][0] =  Tx,Ty,Tz
    26482648        SetViewPointText([Tx,Ty,Tz])
     
    26502650    def SetRotation(newxy):
    26512651#first get rotation vector in screen coords. & angle increment       
    2652         oldxy = drawingData['Rotation'][3]
     2652        oldxy = drawingData['oldxy']
    26532653        if not len(oldxy): oldxy = list(newxy)
    26542654        dxy = newxy-oldxy
    2655         drawingData['Rotation'][3] = list(newxy)
     2655        drawingData['oldxy'] = list(newxy)
    26562656        V = np.array([dxy[1],dxy[0],0.])
    26572657        A = 0.25*np.sqrt(dxy[0]**2+dxy[1]**2)
     
    26722672#first get rotation vector (= view vector) in screen coords. & angle increment       
    26732673        View = glGetIntegerv(GL_VIEWPORT)
    2674         oldxy = drawingData['Rotation'][3]
     2674        oldxy = drawingData['oldxy']
    26752675        if not len(oldxy): oldxy = list(newxy)
    26762676        dxy = newxy-oldxy
    2677         drawingData['Rotation'][3] = list(newxy)
     2677        drawingData['oldxy'] = list(newxy)
    26782678        V = drawingData['viewDir']
    26792679        X0 = drawingData['viewPoint'][0]
Note: See TracChangeset for help on using the changeset viewer.