Changeset 3079 for trunk/GSASIIconstrGUI.py
 Timestamp:
 Sep 18, 2017 8:52:24 AM (4 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/GSASIIconstrGUI.py
r3065 r3079 1514 1514 else: 1515 1515 rbXYZ = np.array(rbXYZ)np.array(rbXYZ[0]) 1516 Xxyz = rbXYZ[1] 1517 X = Xxyz/np.sqrt(np.sum(Xxyz**2)) 1518 Yxyz = rbXYZ[2] 1519 Y = Yxyz/np.sqrt(np.sum(Yxyz**2)) 1520 Mat = G2mth.getRBTransMat(X,Y) 1521 rbXYZ = np.inner(Mat,rbXYZ).T 1516 1522 data['Residue'][rbId] = {'RBname':'UNKRB','rbXYZ':rbXYZ,'rbTypes':rbTypes, 1517 1523 'atNames':atNames,'rbRef':[0,1,2,False],'rbSeq':[],'SelSeq':[0,0],'useCount':0} … … 1850 1856 rbData['rbTypes'] = newTypes 1851 1857 rbData['rbXYZ'] = newXYZ 1858 G2plt.PlotRigidBody(G2frame,'Residue',AtInfo,rbData,plotDefaults) 1852 1859 wx.CallAfter(UpdateResidueRB) 1853 1860 … … 1917 1924 1918 1925 def OnRefSel(event): 1926 1919 1927 Obj = event.GetEventObject() 1920 1928 iref,res,jref = Indx[Obj.GetId()] … … 1927 1935 for i,ref in enumerate(RefObjs[jref]): 1928 1936 ref.SetItems([atNames[j] for j in refChoice[rbId][i]]) 1929 ref.SetValue(atNames[rbData['rbRef'][i]]) 1937 ref.SetValue(atNames[rbData['rbRef'][i]]) 1938 rbXYZ = rbData['rbXYZ'] 1930 1939 if not iref: #origin change 1931 rbXYZ = rbData['rbXYZ']1932 1940 rbXYZ = rbXYZ[ind] 1933 res.ClearSelection() 1934 resTable = res.GetTable() 1935 for r in range(res.GetNumberRows()): 1936 row = resTable.GetRowValues(r) 1937 row[2:4] = rbXYZ[r] 1938 resTable.SetRowValues(r,row) 1939 res.ForceRefresh() 1940 G2plt.PlotRigidBody(G2frame,'Residue',AtInfo,rbData,plotDefaults) 1941 #TODO  transform all atom XYZ by axis choices 1942 Xxyz = rbXYZ[rbData['rbRef'][1]] 1943 X = Xxyz/np.sqrt(np.sum(Xxyz**2)) 1944 Yxyz = rbXYZ[rbData['rbRef'][2]] 1945 Y = Yxyz/np.sqrt(np.sum(Yxyz**2)) 1946 Mat = G2mth.getRBTransMat(X,Y) 1947 rbXYZ = np.inner(Mat,rbXYZ).T 1948 rbData['rbXYZ'] = rbXYZ 1949 res.ClearSelection() 1950 resTable = res.GetTable() 1951 for r in range(res.GetNumberRows()): 1952 row = resTable.GetRowValues(r) 1953 row[2:4] = rbXYZ[r] 1954 resTable.SetRowValues(r,row) 1955 res.ForceRefresh() 1956 G2plt.PlotRigidBody(G2frame,'Residue',AtInfo,rbData,plotDefaults) 1941 1957 1942 1958 Types = 2*[wg.GRID_VALUE_STRING,]+3*[wg.GRID_VALUE_FLOAT+':10,5',]
Note: See TracChangeset
for help on using the changeset viewer.