Changeset 2476 for trunk/GSASIIplot.py
- Timestamp:
- Sep 22, 2016 11:42:28 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIplot.py
r2475 r2476 4749 4749 def PlotStructure(G2frame,data,firstCall=False): 4750 4750 '''Crystal structure plotting package. Can show structures as balls, sticks, lines, 4751 thermal motion ellipsoids and polyhedra 4751 thermal motion ellipsoids and polyhedra. Magnetic moments shown as black/red 4752 arrows according to spin state 4752 4753 ''' 4753 4754 … … 5211 5212 glEnable(GL_LIGHT0) 5212 5213 glLightModeli(GL_LIGHT_MODEL_TWO_SIDE,0) 5213 glLightfv(GL_LIGHT0,GL_AMBIENT,[. 5,.5,.5,1])5214 glLightfv(GL_LIGHT0,GL_AMBIENT,[.8,.8,.8,1]) 5214 5215 glLightfv(GL_LIGHT0,GL_DIFFUSE,[.8,.8,.8,1]) 5215 glLightfv(GL_LIGHT0,GL_SPECULAR,[1,1,1,1]) 5216 # glLightfv(GL_LIGHT0,GL_SPECULAR,[1,1,1,1]) 5217 # glLightfv(GL_LIGHT0,GL_POSITION,[0,0,1,1]) 5216 5218 5217 5219 def GetRoll(newxy,rhoshape): … … 5404 5406 glColor4ubv([0,0,0,0]) 5405 5407 glDisable(GL_COLOR_MATERIAL) 5408 5409 def RenderPlane(plane,color): 5410 fade = list(color) + [.25,] 5411 glMaterialfv(GL_FRONT_AND_BACK,GL_AMBIENT_AND_DIFFUSE,fade) 5412 glShadeModel(GL_FLAT) 5413 glEnable(GL_BLEND) 5414 glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA) 5415 glPushMatrix() 5416 glShadeModel(GL_SMOOTH) 5417 glPolygonMode(GL_FRONT_AND_BACK,GL_FILL) 5418 glFrontFace(GL_CW) 5419 glBegin(GL_TRIANGLE_FAN) 5420 for vertex in plane: 5421 glVertex3fv(vertex) 5422 glEnd() 5423 glPopMatrix() 5424 glDisable(GL_BLEND) 5425 glShadeModel(GL_SMOOTH) 5406 5426 5407 5427 def RenderSphere(x,y,z,radius,color): … … 5518 5538 glPushMatrix() 5519 5539 glTranslate(x,y,z) 5520 glMaterialfv(GL_FRONT_AND_BACK,GL_ DIFFUSE,color)5540 glMaterialfv(GL_FRONT_AND_BACK,GL_AMBIENT_AND_DIFFUSE,color) 5521 5541 glShadeModel(GL_SMOOTH) 5522 5542 glMultMatrixf(B4mat.T) … … 5599 5619 #useful debug? 5600 5620 # if caller: 5601 # print caller 5621 # print caller,generalData['Name'] 5602 5622 # end of useful debug 5603 5623 mapData = generalData['Map'] … … 5666 5686 glMultMatrixf(A4mat.T) 5667 5687 glTranslate(-Tx,-Ty,-Tz) 5668 if drawingData['unitCellBox']:5669 RenderBox()5670 5688 if drawingData['showABC']: 5671 5689 x,y,z = drawingData['viewPoint'][0] … … 5820 5838 Backbone = Backbones[chain] 5821 5839 RenderBackbone(Backbone,BackboneColor,bondR) 5840 if drawingData['unitCellBox']: 5841 RenderBox() 5842 if drawingData['Plane'][1]: 5843 H,phase,stack,phase,color = drawingData['Plane'] 5844 Planes = G2lat.PlaneIntercepts(Amat,Bmat,H,phase,stack) 5845 for plane in Planes: 5846 RenderPlane(plane,color) 5822 5847 # print time.time()-time0 5823 5848 try:
Note: See TracChangeset
for help on using the changeset viewer.