Changeset 756 for trunk/GSASIIplot.py


Ignore:
Timestamp:
Sep 11, 2012 2:28:29 PM (10 years ago)
Author:
vondreele
Message:

change display of density maps - now faster
implement a view direction command (not succcessfuly so far)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r755 r756  
    23912391        if key in ['C']:
    23922392            drawingData['viewPoint'] = [[.5,.5,.5],[0,0]]
    2393             VD = np.inner(Bmat,np.array([0,0,1]))
    2394             VD /= np.sqrt(np.sum(VD**2))
    2395             drawingData['viewDir'] = VD
     2393            drawingData['viewDir'] = [0.,0.,1]
    23962394            drawingData['oldxy'] = []
    23972395            drawingData['Quaternion'] = [0.0,0.0,1.0,0.0]
     
    27372735        glPopMatrix()
    27382736       
     2737    def RenderDots(XYZ,RC):
     2738        glEnable(GL_COLOR_MATERIAL)
     2739        XYZ = np.array(XYZ)
     2740        glPushMatrix()
     2741        for xyz,rc in zip(XYZ,RC):
     2742            x,y,z = xyz
     2743            r,c = rc
     2744            glColor3ubv(c)
     2745            glPointSize(r*50)
     2746            glBegin(GL_POINTS)
     2747            glVertex3fv(xyz)
     2748            glEnd()
     2749        glPopMatrix()
     2750        glColor4ubv([0,0,0,0])
     2751        glDisable(GL_COLOR_MATERIAL)
     2752       
    27392753    def RenderSmallSphere(x,y,z,radius,color):
    27402754        glMaterialfv(GL_FRONT_AND_BACK,GL_DIFFUSE,color)
     
    27452759        gluSphere(q,radius,4,2)
    27462760        glPopMatrix()
    2747        
     2761               
    27482762    def RenderEllipsoid(x,y,z,ellipseProb,E,R4,color):
    27492763        s1,s2,s3 = E
     
    28492863    def RenderMap(rho,rhoXYZ,indx,Rok):
    28502864        cLevel = drawingData['contourLevel']
     2865        XYZ = []
     2866        RC = []
    28512867        for i,xyz in enumerate(rhoXYZ):
    28522868            if not Rok[i]:
     
    28572873                    alpha = (abs(rho[I,J,K])/mapData['rhoMax']-cLevel)/(1.-cLevel)
    28582874                if rho[I,J,K] < 0.:
    2859                     RenderSmallSphere(x,y,z,0.1*alpha,Rd)
     2875                    XYZ.append(xyz)
     2876                    RC.append([0.1*alpha,Rd])
    28602877                else:
    2861                     RenderSmallSphere(x,y,z,0.1*alpha,Gr)
     2878                    XYZ.append(xyz)
     2879                    RC.append([0.1*alpha,Gr])
     2880        RenderDots(XYZ,RC)
    28622881                           
    28632882    def Draw():
     
    30523071    Page.SetFocus()
    30533072    if mapData['Flip']:
     3073        choice = [' save as/key:','jpeg','tiff','bmp','u: roll up','d: roll down','l: roll left','r: roll right']
     3074    else:
    30543075        choice = [' save as/key:','jpeg','tiff','bmp','c: center on 1/2,1/2,1/2','n: next','p: previous']
    3055     else:
    3056         choice = [' save as/key:','jpeg','tiff','bmp','u: roll up','d: roll down','l: roll left','r: roll right']
    30573076    cb = wx.ComboBox(G2frame.G2plotNB.status,style=wx.CB_DROPDOWN|wx.CB_READONLY,choices=choice)
    30583077    cb.Bind(wx.EVT_COMBOBOX, OnKeyBox)
Note: See TracChangeset for help on using the changeset viewer.