- Timestamp:
- Jan 7, 2021 11:21:15 AM (2 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIplot.py
r4720 r4735 8167 8167 return Bonds 8168 8168 8169 def SetCursorStatus(newxy,contours=False): 8170 View = GL.glGetIntegerv(GL.GL_VIEWPORT) 8171 Tx,Ty,Tz = drawingData['viewPoint'][0] 8172 tx,ty,tz = GLU.gluProject(Tx,Ty,Tz) 8173 Cx,Cy,Cz = GLU.gluUnProject(newxy[0],View[3]-newxy[1],tz) 8174 rho = G2mth.getRho([Cx,Cy,Cz],mapData) 8175 if contours: 8176 contlevels = contourSet.get_array() 8177 contstr = str(contlevels).strip('[]') 8178 G2frame.G2plotNB.status.SetStatusText('Cursor position: %.4f, %.4f, %.4f; density: %.4f, contours at: %s'%(Cx,Cy,Cz,rho,contstr),1) 8179 else: 8180 G2frame.G2plotNB.status.SetStatusText('Cursor position: %.4f, %.4f, %.4f; density: %.4f'%(Cx,Cy,Cz,rho),1) 8181 8169 8182 def OnKeyBox(event): 8170 8183 mode = cb.GetValue() … … 8265 8278 drawingData['viewPoint'] = [np.array([Tx,Ty,Tz]),pI] 8266 8279 SetViewPointText(drawingData['viewPoint'][0]) 8267 if ct: G2frame.G2plotNB.status.SetStatusText('View point at atom '+atoms[pI[ 0]][ct-1]+txt,1)8280 if ct: G2frame.G2plotNB.status.SetStatusText('View point at atom '+atoms[pI[1]][ct-1]+txt,1) 8268 8281 NPkey = True 8269 8282 … … 8390 8403 Draw('key down') 8391 8404 else: 8392 pass 8405 if key in ['=','-']: #meaning '+','-' 8406 if key == '=': #'+' 8407 Zstep = drawingData['Zstep'] 8408 else: 8409 Zstep = -drawingData['Zstep'] 8410 VP = np.inner(Amat,np.array(drawingData['viewPoint'][0])) 8411 VD = np.inner(Amat,np.array(drawingData['viewDir'])) 8412 VD /= np.sqrt(np.sum(VD**2)) 8413 VP += Zstep*VD 8414 VP = np.inner(Bmat,VP) 8415 drawingData['viewPoint'][0] = VP 8416 SetViewPointText(VP) 8417 Draw('key down') 8418 newxy = event.GetPosition() 8419 SetCursorStatus(newxy,drawingData.get('showSlice',False) in [1,3]) 8393 8420 8394 8421 def GetTruePosition(xy,Add=False): … … 8494 8521 Draw('move') 8495 8522 elif drawingData.get('showSlice',False): 8496 View = GL.glGetIntegerv(GL.GL_VIEWPORT) 8497 Tx,Ty,Tz = drawingData['viewPoint'][0] 8498 tx,ty,tz = GLU.gluProject(Tx,Ty,Tz) 8499 Cx,Cy,Cz = GLU.gluUnProject(newxy[0],View[3]-newxy[1],tz) 8500 rho = G2mth.getRho([Cx,Cy,Cz],mapData) 8501 if drawingData.get('showSlice',False) in [1,3]: 8502 contlevels = contourSet.get_array() 8503 contstr = str(contlevels).strip('[]') 8504 G2frame.G2plotNB.status.SetStatusText('Cursor position: %.4f, %.4f, %.4f; density: %.4f, contours at: %s'%(Cx,Cy,Cz,rho,contstr),1) 8505 else: 8506 G2frame.G2plotNB.status.SetStatusText('Cursor position: %.4f, %.4f, %.4f; density: %.4f'%(Cx,Cy,Cz,rho),1) 8523 SetCursorStatus(newxy,drawingData.get('showSlice',False) in [1,3]) 8507 8524 8508 8525 def OnMouseWheel(event): … … 9189 9206 def distances2Atoms(x,y,z,atomsExpandRadius,atomsdistRadius,Amat,matRot): 9190 9207 # find and display atoms within atomsExpandRadius A 9208 vdWRadii = generalData['vdWRadii'] 9191 9209 vdwScale = drawingData['vdwScale'] 9192 9210 ballScale = drawingData['ballScale'] … … 9690 9708 choice = [' save as/key:','jpeg','tiff','bmp','c: center on 1/2,1/2,1/2'] 9691 9709 if mapData['MapType']: 9692 choice += ['k: contour plot switch',] 9693 choice += ['s: map slice colors',] 9710 choice += ['k: contour plot switch','s: map slice colors',] 9694 9711 if mapData.get('Flip',False): 9695 9712 choice += ['u: roll up','d: roll down','l: roll left','r: roll right'] … … 9698 9715 if generalData['Modulated'] and len(drawAtoms): 9699 9716 choice += ['+: increase tau','-: decrease tau','0: set tau = 0'] 9717 else: 9718 choice += ['+: pos z-step','-: neg z-step',] 9700 9719 9701 9720 Tx,Ty,Tz = drawingData['viewPoint'][0] -
trunk/GSASIIstrMain.py
r4723 r4735 1055 1055 MyPrint(80*'*') 1056 1056 for BV in BVox: 1057 pvline += ' %s: %. 3f '%(BV,BVS[BV])1057 pvline += ' %s: %.2f '%(BV,BVS[BV]) 1058 1058 MyPrint(pvline) 1059 1059
Note: See TracChangeset
for help on using the changeset viewer.