Changeset 4763 for trunk/GSASIIphsGUI.py
- Timestamp:
- Jan 13, 2021 4:34:34 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIphsGUI.py
r4759 r4763 1198 1198 dlg.Destroy() 1199 1199 return indx 1200 1201 def getAtomPtrs(data,draw=False):1202 ''' get atom data pointers cx,ct,cs,cia in Atoms or Draw Atoms lists1203 NB:may not match column numbers in displayed table1204 1205 param: dict: data phase data structure1206 draw: boolean True if Draw Atoms list pointers are required1207 return: cx,ct,cs,cia pointers to atom xyz, type, site sym, uiso/aniso flag1208 '''1209 if draw:1210 return data['Drawing']['atomPtrs']1211 else:1212 return data['General']['AtomPtrs']1213 1200 1214 1201 def SetPhaseWindow(phasePage,mainSizer=None,Scroll=0): … … 3650 3637 '''Inserts a new atom into list immediately before every selected atom 3651 3638 ''' 3652 cx,ct,cs,ci = getAtomPtrs(data)3639 cx,ct,cs,ci = G2mth.getAtomPtrs(data) 3653 3640 indx = getAtomSelections(Atoms,ct-1) 3654 3641 for a in reversed(sorted(indx)): … … 3671 3658 '''Adds H atoms to fill out coordination sphere for selected atoms 3672 3659 ''' 3673 cx,ct,cs,cia = getAtomPtrs(data)3660 cx,ct,cs,cia = G2mth.getAtomPtrs(data) 3674 3661 indx = getAtomSelections(Atoms,ct-1) 3675 3662 if not indx: return … … 3794 3781 3795 3782 def OnAtomMove(event): 3796 cx,ct,cs,ci = getAtomPtrs(data)3783 cx,ct,cs,ci = G2mth.getAtomPtrs(data) 3797 3784 indx = getAtomSelections(Atoms,ct-1) 3798 3785 drawData = data['Drawing'] … … 3841 3828 3842 3829 def AtomDelete(event): 3843 cx,ct,cs,ci = getAtomPtrs(data)3830 cx,ct,cs,ci = G2mth.getAtomPtrs(data) 3844 3831 indx = getAtomSelections(Atoms) 3845 3832 colLabels = [Atoms.GetColLabelValue(c) for c in range(Atoms.GetNumberCols())] … … 3877 3864 3878 3865 def AtomRefine(event): 3879 cx,ct,cs,ci = getAtomPtrs(data)3866 cx,ct,cs,ci = G2mth.getAtomPtrs(data) 3880 3867 indx = getAtomSelections(Atoms,ct-1) 3881 3868 if not indx: return … … 3902 3889 3903 3890 def AtomModify(event): 3904 cx,ct,cs,ci = getAtomPtrs(data)3891 cx,ct,cs,ci = G2mth.getAtomPtrs(data) 3905 3892 indx = getAtomSelections(Atoms,ct-1) 3906 3893 if not indx: return … … 4013 4000 4014 4001 def AtomTransform(event): 4015 cx,ct,cs,ci = getAtomPtrs(data)4002 cx,ct,cs,ci = G2mth.getAtomPtrs(data) 4016 4003 indx = getAtomSelections(Atoms,ct-1) 4017 4004 if not indx: return … … 4083 4070 # 'yz':np.array([[0,i,j] for i in range(3) for j in range(3)])-np.array([1,1,0]), 4084 4071 # 'xyz':np.array([[i,j,k] for i in range(3) for j in range(3) for k in range(3)])-np.array([1,1,1])} 4085 # cx,ct,cs,ci = getAtomPtrs(data)4072 # cx,ct,cs,ci = G2mth.getAtomPtrs(data) 4086 4073 # indx = getAtomSelections(Atoms,ct-1) 4087 4074 # if indx: … … 4126 4113 # print "select one or more rows of atoms" 4127 4114 # G2frame.ErrorDialog('Select atom',"select one or more atoms then redo") 4115 4116 def CollectAtoms(event): 4117 cx,ct,cs,ci = G2mth.getAtomPtrs(data) 4118 Ind = getAtomSelections(Atoms,ct-1) 4119 if Ind: 4120 choice = ['x=0','y=0','z=0','origin','center'] 4121 dlg = wx.SingleChoiceDialog(G2frame,'Atoms closest to:','Select',choice) 4122 if dlg.ShowModal() == wx.ID_OK: 4123 sel = dlg.GetSelection()+1 4124 dlg.Destroy() 4125 else: 4126 dlg.Destroy() 4127 return 4128 wx.BeginBusyCursor() 4129 data['Atoms'] = G2mth.AtomsCollect(data,Ind,sel) 4130 wx.EndBusyCursor() 4131 Atoms.ClearSelection() 4132 data['Drawing']['Atoms'] = [] 4133 OnReloadDrawAtoms(event) 4134 FillAtomsGrid(Atoms) 4128 4135 4129 4136 def MakeMolecule(event): 4130 cx,ct,cs,ci = getAtomPtrs(data)4137 cx,ct,cs,ci = G2mth.getAtomPtrs(data) 4131 4138 indx = getAtomSelections(Atoms,ct-1) 4132 4139 DisAglCtls = {} … … 4181 4188 def OnDistAngle(event,fp=None,hist=False): 4182 4189 'Compute distances and angles' 4183 cx,ct,cs,ci = getAtomPtrs(data)4190 cx,ct,cs,ci = G2mth.getAtomPtrs(data) 4184 4191 indx = getAtomSelections(Atoms,ct-1) 4185 4192 Oxyz = [] … … 4252 4259 def OnFracSplit(event): 4253 4260 'Split atom frac accordintg to atom type & refined site fraction' 4254 cx,ct,cs,ci = getAtomPtrs(data)4261 cx,ct,cs,ci = G2mth.getAtomPtrs(data) 4255 4262 indx = getAtomSelections(Atoms,ct-1) 4256 4263 if indx: … … 7444 7451 7445 7452 def OnRestraint(event): 7446 cx,ct,cs,ci = getAtomPtrs(data,draw=True)7453 cx,ct,cs,ci = G2mth.getAtomPtrs(data,draw=True) 7447 7454 indx = getAtomSelections(drawAtoms,ct-1) 7448 7455 if not indx: return … … 7500 7507 7501 7508 def OnDefineRB(event): 7502 cx,ct,cs,ci = getAtomPtrs(data,draw=True)7509 cx,ct,cs,ci = G2mth.getAtomPtrs(data,draw=True) 7503 7510 indx = getAtomSelections(drawAtoms,ct-1) 7504 7511 if not indx: return … … 7763 7770 7764 7771 def DrawAtomStyle(event): 7765 cx,ct,cs,ci = getAtomPtrs(data,draw=True)7772 cx,ct,cs,ci = G2mth.getAtomPtrs(data,draw=True) 7766 7773 indx = getAtomSelections(drawAtoms,ct-1) 7767 7774 if not indx: return … … 7785 7792 7786 7793 def DrawAtomLabel(event): 7787 cx,ct,cs,ci = getAtomPtrs(data,draw=True)7794 cx,ct,cs,ci = G2mth.getAtomPtrs(data,draw=True) 7788 7795 indx = getAtomSelections(drawAtoms,ct-1) 7789 7796 if not indx: return … … 7805 7812 7806 7813 def DrawAtomColor(event): 7807 cx,ct,cs,ci = getAtomPtrs(data,draw=True)7814 cx,ct,cs,ci = G2mth.getAtomPtrs(data,draw=True) 7808 7815 indx = getAtomSelections(drawAtoms,ct-1) 7809 7816 if not indx: return … … 7865 7872 7866 7873 def SetViewPoint(event): 7867 cx,ct,cs,ci = getAtomPtrs(data,draw=True)7874 cx,ct,cs,ci = G2mth.getAtomPtrs(data,draw=True) 7868 7875 indx = getAtomSelections(drawAtoms,ct-1) 7869 7876 if not indx: return … … 7881 7888 7882 7889 def AddSymEquiv(event): 7883 cx,ct,cs,ci = getAtomPtrs(data,draw=True)7890 cx,ct,cs,ci = G2mth.getAtomPtrs(data,draw=True) 7884 7891 indx = getAtomSelections(drawAtoms,ct-1) 7885 7892 if not indx: return … … 7936 7943 7937 7944 def AddSphere(event): 7938 cx,ct,cs,ci = getAtomPtrs(data,draw=True)7945 cx,ct,cs,ci = G2mth.getAtomPtrs(data,draw=True) 7939 7946 indx = getAtomSelections(drawAtoms,ct-1,'as center of sphere addition', 7940 7947 includeView=True) … … 8135 8142 added = 0 8136 8143 targets = [item for item in atomTypes if params[item]] 8137 cx,ct,cs,ci = getAtomPtrs(data,draw=True)8144 cx,ct,cs,ci = G2mth.getAtomPtrs(data,draw=True) 8138 8145 rep = 0 8139 8146 allrep = 0 … … 12682 12689 G2frame.Bind(wx.EVT_MENU, OnAtomMove, id=G2G.wxID_ATOMMOVE) 12683 12690 G2frame.Bind(wx.EVT_MENU, MakeMolecule, id=G2G.wxID_MAKEMOLECULE) 12691 G2frame.Bind(wx.EVT_MENU, CollectAtoms, id=G2G.wxID_COLLECTATOMS) 12684 12692 G2frame.Bind(wx.EVT_MENU, OnReloadDrawAtoms, id=G2G.wxID_RELOADDRAWATOMS) 12685 12693 G2frame.Bind(wx.EVT_MENU, OnDistAngle, id=G2G.wxID_ATOMSDISAGL)
Note: See TracChangeset
for help on using the changeset viewer.