@@ -7204,13 +7204,6 @@ def Draw(caller='',Fade=[],NPkey=False):
72047204 radius = ballScale * drawingData ['sizeH' ]
72057205 else :
72067206 radius = 0.0
7207- # elif 'Q' in atom[ct]: #spinning rigid body - set shell color
7208- # for Srb in RBdata.get('Spin',[]):
7209- # if Srb == generalData['SpnIds'][atom[ci]]:
7210- # fade = True
7211- # Info = G2elem.GetAtomInfo(RBdata['Spin'][Srb]['atType'])
7212- # atColor = [Info['Color'],]
7213- # break
72147207 else :
72157208 if 'vdW' in atom [cs ]:
72167209 radius = vdwScale * vdWRadii [atNum ]
@@ -7254,7 +7247,33 @@ def Draw(caller='',Fade=[],NPkey=False):
72547247 else :
72557248 RenderSphere (x ,y ,z ,radius [ish ][0 ],atColor [ish ],True ,shape = [60 ,30 ])
72567249 else :
7257- RenderSphere (x ,y ,z ,radius ,atColor )
7250+ #### put deformation texture on sphere here
7251+ if atom [ci ] in deformationData :
7252+ defCtrls = deformationData [- atom [ci ]]
7253+ defParms = deformationData [atom [ci ]]
7254+ SytSym = G2spc .SytSym (atom [cx :cx + 3 ],SGData )[0 ]
7255+ if defCtrls .get ('showDef' ,False ):
7256+ useAtColor = defCtrls .get ('atColor' ,True )
7257+ atcolor = None
7258+ if useAtColor :
7259+ atcolor = atColor * 255
7260+ if defCtrls ['Radial' ] == 'Slater' :
7261+ SHC = defParms [0 ][1 ]
7262+ SHC = {item .replace ('D' ,'C' ):SHC [item ] for item in SHC if item not in ['Ne' ,'kappa' ]}
7263+ UVMat = defCtrls ['UVmat' ]
7264+ Npsi ,Ngam = 90 ,45
7265+ PSI ,GAM = np .mgrid [0 :Npsi ,0 :Ngam ] #[azm,pol]
7266+ PSI = PSI .flatten ()* 360. / Npsi #azimuth 0-360 ncl
7267+ GAM = GAM .flatten ()* 180. / Ngam #polar 0-180 incl
7268+ Rp ,PSIp ,GAMp = G2mth .RotPolbyM (np .ones_like (PSI ),PSI ,GAM ,UVMat )
7269+ P = G2lat .SHarmcal (SytSym ,SHC ,PSIp ,GAMp ).reshape ((Npsi ,Ngam ))
7270+ if np .min (P ) < np .max (P ):
7271+ P = (P - np .min (P ))/ (np .max (P )- np .min (P ))
7272+ RenderTextureSphere (x ,y ,z ,radius ,atcolor ,shape = [Npsi ,Ngam ],Texture = P .T ,ifFade = False )
7273+ else :
7274+ RenderSphere (x ,y ,z ,radius ,atColor )
7275+ else :
7276+ RenderSphere (x ,y ,z ,radius ,atColor )
72587277 if 'sticks' in atom [cs ]:
72597278 RenderBonds (x ,y ,z ,Bonds ,bondR ,bndColor )
72607279 elif 'ellipsoids' in atom [cs ]:
@@ -7540,7 +7559,7 @@ def OnFocus(event):
75407559 mcsaTypes = np .reshape (mcsaTypes ,(nuniq * neqv ))
75417560 mcsaBonds = FindPeaksBonds (mcsaXYZ )
75427561 drawAtoms = drawingData .get ('Atoms' ,[])
7543-
7562+ deformationData = data . get ( 'Deformations' ,{})
75447563 mapData = {'MapType' :False , 'rho' :[]}
75457564 showBonds = False
75467565 if 'Map' in generalData :
0 commit comments