Changeset 2135 for trunk/GSASIIplot.py
- Timestamp:
- Jan 22, 2016 2:38:54 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIplot.py
r2132 r2135 771 771 for i,ref in enumerate(hklRef): 772 772 h,k,l = ref[:3] 773 X,Y,Z = gluProject(h,k,l,Model,Proj,View) 774 XY = [int(X),int(Y)] 775 if np.allclose(xy,XY,atol=10) and Z < Zmax: 776 Zmax = Z 773 try: 774 X,Y,Z = gluProject(h,k,l,Model,Proj,View) 775 XY = [int(X),int(Y)] 776 if np.allclose(xy,XY,atol=10) and Z < Zmax: 777 Zmax = Z 778 return [int(h),int(k),int(l)] 779 except ValueError: 777 780 return [int(h),int(k),int(l)] 781 778 782 779 783 def SetTranslation(newxy): … … 905 909 glDisable(GL_COLOR_MATERIAL) 906 910 907 def RenderUnitVectors(x,y,z ):911 def RenderUnitVectors(x,y,z,labxyz=['','','']): 908 912 xyz = np.array([x,y,z]) 909 913 glEnable(GL_COLOR_MATERIAL) … … 918 922 glVertex3fv(line[1]) 919 923 glEnd() 924 glRotate(180,1,0,0) #fix to flip about x-axis 925 for ix,txt in enumerate(labxyz): 926 if txt: 927 pos = uEdges[ix][1] 928 glTranslate(pos[0],-1.5*pos[1],-pos[2]) 929 text = gltext.TextElement(text=txt,font=Font) 930 text.draw_text(scale=0.05) 931 glTranslate(-pos[0],1.5*pos[1],pos[2]) 920 932 glPopMatrix() 921 933 glColor4ubv([0,0,0,0]) … … 984 996 else: 985 997 RenderUnitVectors(x,y,z) 986 RenderUnitVectors(0,0,0 )998 RenderUnitVectors(0,0,0,labxyz=['h','k','l']) 987 999 RenderDots(HKL,RC) 988 1000 time0 = time.time()
Note: See TracChangeset
for help on using the changeset viewer.