Changeset 754
- Timestamp:
- Sep 7, 2012 2:48:44 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIphsGUI.py
r753 r754 1563 1563 'radiusFactor':0.85,'contourLevel':1.,'bondRadius':0.1,'ballScale':0.33, 1564 1564 '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':[], 1566 1566 'Quaternion':[0.0,0.0,1.0,0.0],'bondList':{},'viewDir':[0,0,1]} 1567 1567 try: -
trunk/GSASIIplot.py
r753 r754 2394 2394 VD /= np.sqrt(np.sum(VD**2)) 2395 2395 drawingData['viewDir'] = VD 2396 drawingData[' Rotation'] = [0.0,0.0,0.0,[]]2396 drawingData['oldxy'] = [] 2397 2397 drawingData['Quaternion'] = [0.0,0.0,1.0,0.0] 2398 2398 SetViewPointText(drawingData['viewPoint'][0]) … … 2486 2486 GetTruePosition(xy,True) 2487 2487 else: 2488 drawingData[' Rotation'][3] = list(xy)2488 drawingData['oldxy'] = list(xy) 2489 2489 Draw() 2490 2490 … … 2618 2618 roll = GetRoll(newxy,rho) 2619 2619 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) 2621 2621 2622 2622 def SetPeakRoll(newxy): … … 2632 2632 def SetTranslation(newxy): 2633 2633 #first get translation vector in screen coords. 2634 oldxy = drawingData[' Rotation'][3]2634 oldxy = drawingData['oldxy'] 2635 2635 if not len(oldxy): oldxy = list(newxy) 2636 2636 dxy = newxy-oldxy 2637 drawingData[' Rotation'][3] = list(newxy)2637 drawingData['oldxy'] = list(newxy) 2638 2638 V = np.array([-dxy[0],dxy[1],0.]) 2639 2639 #then transform to rotated crystal coordinates & apply to view point … … 2644 2644 Ty += V[1]*0.01 2645 2645 Tz += V[2]*0.01 2646 drawingData[' Rotation'][3] = list(newxy)2646 drawingData['oldxy'] = list(newxy) 2647 2647 drawingData['viewPoint'][0] = Tx,Ty,Tz 2648 2648 SetViewPointText([Tx,Ty,Tz]) … … 2650 2650 def SetRotation(newxy): 2651 2651 #first get rotation vector in screen coords. & angle increment 2652 oldxy = drawingData[' Rotation'][3]2652 oldxy = drawingData['oldxy'] 2653 2653 if not len(oldxy): oldxy = list(newxy) 2654 2654 dxy = newxy-oldxy 2655 drawingData[' Rotation'][3] = list(newxy)2655 drawingData['oldxy'] = list(newxy) 2656 2656 V = np.array([dxy[1],dxy[0],0.]) 2657 2657 A = 0.25*np.sqrt(dxy[0]**2+dxy[1]**2) … … 2672 2672 #first get rotation vector (= view vector) in screen coords. & angle increment 2673 2673 View = glGetIntegerv(GL_VIEWPORT) 2674 oldxy = drawingData[' Rotation'][3]2674 oldxy = drawingData['oldxy'] 2675 2675 if not len(oldxy): oldxy = list(newxy) 2676 2676 dxy = newxy-oldxy 2677 drawingData[' Rotation'][3] = list(newxy)2677 drawingData['oldxy'] = list(newxy) 2678 2678 V = drawingData['viewDir'] 2679 2679 X0 = drawingData['viewPoint'][0]
Note: See TracChangeset
for help on using the changeset viewer.