Changeset 748 for trunk/GSASIIplot.py


Ignore:
Timestamp:
Sep 1, 2012 11:23:07 AM (10 years ago)
Author:
vondreele
Message:

change view point operation & use view point as atom insertion
remove testpoint

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r740 r748  
    24262426        newxy = event.GetPosition()
    24272427        page = getSelection()
    2428         if event.ControlDown() and drawingData['showABC']:
    2429             if event.LeftIsDown():
    2430                 SetTestRot(newxy)
    2431             elif event.RightIsDown():
    2432                 SetTestPos(newxy)
    2433             elif event.MiddleIsDown():
    2434                 SetTestRotZ(newxy)
    2435             x,y,z = drawingData['testPos'][0]
    2436             G2frame.G2plotNB.status.SetStatusText('moving test point %.4f,%.4f,%.4f'%(x,y,z),1)
    2437             Draw()
    24382428                               
    24392429        if event.Dragging() and not event.ControlDown():
     
    25262516        if key in ['C']:
    25272517            drawingData['viewPoint'] = [[.5,.5,.5],[0,0]]
    2528             drawingData['testPos'] = [[-.1,-.1,-.1],[0.0,0.0,0.0],[0,0]]
    25292518            drawingData['Rotation'] = [0.0,0.0,0.0,[]]
    25302519            SetViewPointText(drawingData['viewPoint'][0])
     
    26152604        SetViewPointText([Tx,Ty,Tz])
    26162605       
    2617     def SetTestPos(newxy):
    2618         Tx,Ty,Tz = drawingData['testPos'][0]
    2619         anglex,angley,anglez,oldxy = drawingData['Rotation']
    2620         if not len(oldxy): oldxy = list(newxy)
    2621         Rx = G2lat.rotdMat(anglex,0)
    2622         Ry = G2lat.rotdMat(angley,1)
    2623         Rz = G2lat.rotdMat(anglez,2)
    2624         dxy = list(newxy-oldxy)+[0,]
    2625         dxy = np.inner(Rz,np.inner(Ry,np.inner(Rx,dxy)))
    2626         Tx += dxy[0]*0.001
    2627         Ty -= dxy[1]*0.001
    2628         Tz += dxy[2]*0.001
    2629         drawingData['Rotation'][3] = list(newxy)
    2630         drawingData['testPos'][0] =  Tx,Ty,Tz
    2631        
    2632     def SetTestRot(newxy):
    2633         Txyz = np.array(drawingData['testPos'][0])
    2634         oldxy = drawingData['testPos'][2]
    2635         Ax,Ay,Az = drawingData['testPos'][1]
    2636         Vxyz = np.array(drawingData['viewPoint'][0])
    2637         Dxyz = np.inner(Amat,Txyz-Vxyz)
    2638         dxy = list(newxy-oldxy)+[0,]
    2639         Ax += dxy[1]*0.01
    2640         Ay += dxy[0]*0.01
    2641         Rx = G2lat.rotdMat(Ax,0)
    2642         Ry = G2lat.rotdMat(Ay,1)
    2643         Dxyz = np.inner(Ry,np.inner(Rx,Dxyz))       
    2644         Dxyz = np.inner(Bmat,Dxyz)+Vxyz
    2645         drawingData['testPos'][1] = [Ax,Ay,Az]
    2646         drawingData['testPos'][2] = newxy
    2647         drawingData['testPos'][0] = Dxyz
    2648        
    2649     def SetTestRotZ(newxy):
    2650         Txyz = np.array(drawingData['testPos'][0])
    2651         oldxy = drawingData['testPos'][2]
    2652         Ax,Ay,Az = drawingData['testPos'][1]
    2653         Vxyz = np.array(drawingData['viewPoint'][0])
    2654         Dxyz = np.inner(Amat,Txyz-Vxyz)       
    2655         dxy = list(newxy-oldxy)+[0,]
    2656         Az += (dxy[0]+dxy[1])*.01
    2657         Rz = G2lat.rotdMat(Az,2)
    2658         Dxyz = np.inner(Rz,Dxyz)       
    2659         Dxyz = np.inner(Bmat,Dxyz)+Vxyz
    2660         drawingData['testPos'][1] = [Ax,Ay,Az]
    2661         drawingData['testPos'][2] = newxy
    2662         drawingData['testPos'][0] = Dxyz
    2663                              
    26642606    def SetRotation(newxy):       
    26652607        anglex,angley,anglez,oldxy = drawingData['Rotation']
     
    29122854            RenderBox()
    29132855        if drawingData['showABC']:
    2914             x,y,z = drawingData['testPos'][0]
    2915 #            if altDown:
    2916 #                G2frame.G2plotNB.status.SetStatusText('moving test point %.4f,%.4f,%.4f'%(x,y,z),1)
    2917 #            else:
    2918 #                G2frame.G2plotNB.status.SetStatusText('test point %.4f,%.4f,%.4f'%(x,y,z),1)           
     2856            x,y,z = drawingData['viewPoint'][0]
    29192857            RenderUnitVectors(x,y,z)
    29202858        Backbones = {}
Note: See TracChangeset for help on using the changeset viewer.