Changeset 460 for trunk/GSASIIplot.py


Ignore:
Timestamp:
Jan 31, 2012 3:40:48 PM (11 years ago)
Author:
vondreele
Message:

add more text to help/gsasII.html
finish best plane calcs
allow multiple atom selection from plot
begin torsion calc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r456 r460  
    21842184        self.G2plotNB.status.SetStatusText('Drawing saved to: '+Fname,1)
    21852185   
    2186     def GetTruePosition(xy):
     2186    def GetTruePosition(xy,Add=False):
    21872187        View = glGetIntegerv(GL_VIEWPORT)
    21882188        Proj = glGetDoublev(GL_PROJECTION_MATRIX)
    21892189        Model = glGetDoublev(GL_MODELVIEW_MATRIX)
    21902190        Zmax = 1.
     2191        if Add:
     2192            Indx = GetSelectedAtoms()
    21912193        for i,atom in enumerate(drawAtoms):
    21922194            x,y,z = atom[cx:cx+3]
     
    21952197            if np.allclose(xy,XY,atol=10) and Z < Zmax:
    21962198                Zmax = Z
    2197                 SetSelectedAtoms(i)
     2199                try:
     2200                    Indx.remove(i)
     2201                    ClearSelectedAtoms()
     2202                    for id in Indx:
     2203                        SetSelectedAtoms(id,Add)
     2204                except:
     2205                    SetSelectedAtoms(i,Add)
    21982206                   
    21992207    def OnMouseDown(event):
    22002208        xy = event.GetPosition()
    22012209        if event.ShiftDown():
    2202             GetTruePosition(xy)
     2210            if event.LeftIsDown():
     2211                GetTruePosition(xy)
     2212            elif event.RightIsDown():
     2213                GetTruePosition(xy,True)
    22032214        else:
    22042215            drawingData['Rotation'][3] = xy
     
    22062217       
    22072218    def OnMouseMove(event):
     2219        if event.ShiftDown():
     2220            return       
    22082221        newxy = event.GetPosition()
    22092222        page = getSelection()
     
    22172230            x,y,z = drawingData['testPos'][0]
    22182231            self.G2plotNB.status.SetStatusText('moving test point %.4f,%.4f,%.4f'%(x,y,z),1)
    2219                
    2220                
     2232                               
    22212233        if event.Dragging() and not event.ControlDown():
    22222234            if event.LeftIsDown():
     
    22352247       
    22362248    def OnMouseWheel(event):
     2249        if event.ShiftDown():
     2250            return
    22372251        drawingData['cameraPos'] += event.GetWheelRotation()/24
    22382252        drawingData['cameraPos'] = max(10,min(500,drawingData['cameraPos']))
     
    22712285                self.dataDisplay.GetPage(page).ClearSelection()      #this is the Atoms grid in Atoms
    22722286                   
    2273     def SetSelectedAtoms(ind):
     2287    def SetSelectedAtoms(ind,Add=False):
    22742288        page = getSelection()
    22752289        if page:
    22762290            if self.dataDisplay.GetPageText(page) == 'Draw Atoms':
    2277                 self.dataDisplay.GetPage(page).SelectRow(ind)      #this is the Atoms grid in Draw Atoms
     2291                self.dataDisplay.GetPage(page).SelectRow(ind,Add)      #this is the Atoms grid in Draw Atoms
    22782292            elif self.dataDisplay.GetPageText(page) == 'Atoms':
    22792293                Id = drawAtoms[ind][-2]
Note: See TracChangeset for help on using the changeset viewer.