ó
ÉÝ{Tc           @   sü   d  Z  d d l m Z m Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l	 Td e j f d „  ƒ  YZ
 d e j f d „  ƒ  YZ d	 e j f d
 „  ƒ  YZ d e j f d „  ƒ  YZ d e j f d „  ƒ  YZ d e j f d „  ƒ  YZ d S(   s˜  
     qtgui/superposeGui.py: CCP4MG Molecular Graphics Program
     Copyright (C) 2001-2008 University of York, CCLRC
     Copyright (C) 2009-2011 University of York
     Copyright (C) 2012 STFC

     This library is free software: you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public License
     version 3, modified in accordance with the provisions of the 
     license to address the requirements of UK law.
 
     You should have received a copy of the modified GNU Lesser General 
     Public License along with this library.  If not, copies may be 
     downloaded from http://www.ccp4.ac.uk/ccp4license.php
 
     This program is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU Lesser General Public License for more details.
iÿÿÿÿ(   t   QtCoret   QtGuiN(   t   *t   superposeWindowc           B   s,   e  Z d  „  Z d „  Z d „  Z d „  Z RS(   c         C   s(  t  j  j |  | ƒ |  j d ƒ d } t j ƒ  } t j d k rg | j | | | | ƒ | j | ƒ n  t j	 |  ƒ |  _
 | j |  j
 ƒ t |  ƒ |  _ |  j
 j |  j ƒ |  j
 j d ƒ |  j
 j t j j ƒ t j |  ƒ } | j t j j ƒ xGd d t j j |  j j g d d t j j |  j j g d	 d
 t j j |  j j g d d t j j |  j j g d d t j j |  j j g d d t j j |  j j g d d t j j |  j g d d t j j  |  j j! g g D]j \ } } } } | j" | | ƒ }	 |	 j# | ƒ |	 j$ d ƒ |  j% |	 t j& d ƒ | ƒ t' |  | |	 ƒ qÏWt j d k ržd }
 t j ƒ  } | j | ƒ | j |
 |
 |
 |
 ƒ | j |
 ƒ | j( | ƒ n | j | ƒ |  j% |  j t j& d ƒ |  j) ƒ |  j* | ƒ |  j+ |  j j, ƒ  |  j
 j- ƒ  j. ƒ  d ƒ |  j/ ƒ  |  j0 ƒ  |  j) ƒ  d  S(   Ns   Superpose modelsi    t   darwini   t	   superposet	   Superposet   undot   Undot   exports   Export matchest   lists   List resultst   showaxiss	   Show axest   saves   Save all data filest   closet   Closet   helpt   Helps	   clicked()i
   t
   enableSavei�  (1   t   MGSimpleDialogt   __init__t   setWindowTitleR   t   QVBoxLayoutt   syst   platformt   setContentsMarginst
   setSpacingt   QScrollAreat
   scrollareat	   addWidgett   superposeGuit   superpose_guit	   setWidgett   setWidgetResizablet   setHorizontalScrollBarPolicyR    t   Qtt   ScrollBarAlwaysOfft   QDialogButtonBoxt   setOrientationt
   Horizontalt
   ActionRolet   applyR   t
   openExportt   listResultst   showAxest	   saveFilest
   RejectRoleR   t   HelpRoleR   t	   addButtont   setObjectNamet   setAutoDefaultt   connectt   SIGNALt   setattrt	   addLayoutR   t	   setLayoutt   setMinimumSizet   widtht   verticalScrollBart   heightt   UnCloset   CreateMenuEntry(   t   selft   parentt   margint   layoutt
   button_boxt   namet   labelt   rolet   slott   buttont   bmargint   blayout(    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyR   %   sT    1",

c         C   s!   |  j  j ƒ  t j j |  ƒ d  S(   N(   R   R   R   (   R=   (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyR   W   s    c         C   s!   |  j  j ƒ  t j j |  ƒ d  S(   N(   R   R;   R   (   R=   (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyR;   [   s    c         C   s©   xr t  d ƒ j j ƒ  D][ } t | ƒ } | r | j j ƒ  r |  j j d ƒ |  j j d ƒ |  j	 j d ƒ d  Sq W|  j j d ƒ |  j j d ƒ |  j	 j d ƒ d  S(   NR   i   i    (
   t   Applt   supModelt   keyst   datat   molHndt   GetIsTransformedR   t
   setEnabledR   R   (   R=   t   modelt   molobj(    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyR   `   s    (   t   __name__t
   __module__R   R   R;   R   (    (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyR       s   	2		R   c           B   sO  e  Z d  g Z d g Z d d d g d d d g d d	 d
 g g Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d „  Z d „  Z d „  Z d „  Z d d „ Z d „  Z d d „ Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d  „  Z d! „  Z d" „  Z d# „  Z d) d$ „ Z d) d% „ Z g  d& „ Z d' „  Z  d( „  Z! RS(*   s   No showt   noshowt   ssms
   Gesamt/SSMsD   Automatic match and superpose fragments/secondary structure elementsR   s   Match close residuessG   Match and superpose residues close to those selected in the fixed modelt   interactives   User defined matchess=   Select matching atom, monomers,residues or ranges of residuesc         C   s"  t  j j |  | ƒ d |  _ d |  _ g  |  _ d  |  _ d } t  j ƒ  } t  j	 d |  ƒ } t  j
 ƒ  } t  j |  ƒ |  _ xf t j D][ } t  j | d |  ƒ } | j | d ƒ | j | d ƒ |  j j | ƒ | j | ƒ qƒ W| j | ƒ | j | d d d d ƒ |  j |  j t j d ƒ t j |  j d ƒ ƒ t  j	 d |  ƒ } t  j ƒ  } t j d	 k r|| j | | | | ƒ n  t j d	 k r›| j | ƒ n  xd
 d d g d d d g g D]è \ } }	 }
 t  j
 ƒ  } t  |  | d t  j! |	 ƒ ƒ | j t" |  | d ƒ ƒ t# j$ d |  d d ƒ } | j | ƒ | j |
 ƒ | j% t" t& d ƒ | d ƒ ƒ | j | ƒ |  j | t j d ƒ t j |  j | ƒ ƒ | j' | ƒ qºW| j( t" t& d ƒ d
 d ƒ g ƒ | j | ƒ | j | d d ƒ t  j	 d |  ƒ } t  j ƒ  } t j d	 k r.| j | | | | ƒ n  t j d	 k rM| j | ƒ n  t  j
 ƒ  } t  j) d |  ƒ } | j d ƒ | j d ƒ |  j | t j d ƒ t j |  j d ƒ ƒ | j | ƒ t  j) d |  ƒ } |  j | t j d ƒ t j |  j d ƒ ƒ | j d ƒ | j d ƒ | j | ƒ t# j* |  ƒ } | j d ƒ |  j | t j d ƒ t j |  j d ƒ ƒ | j | ƒ | j' | ƒ t  j
 ƒ  } t  j) d  |  ƒ } | j d! ƒ | j d" ƒ |  j | t j d ƒ t j |  j d" ƒ ƒ | j | ƒ xh d# d$ g D]Z } t# j* |  ƒ } | j | ƒ | j | ƒ |  j | t j d ƒ t j |  j | ƒ ƒ qÿW| j' | ƒ | j | ƒ | j | d d ƒ t  j	 d% |  ƒ |  _+ t  j ƒ  } t j d	 k rÓ| j | | | | ƒ n  t j d	 k rò| j | ƒ n  t  j
 ƒ  } t  j, ƒ  |  _- | j t  j! d& |  ƒ ƒ |  j- j. d' d( g ƒ |  j |  j- t j d) ƒ t j |  j d* ƒ ƒ | j |  j- ƒ | j/ d+ ƒ | j' | ƒ | j/ d+ ƒ |  j+ j | ƒ |  j+ j0 ƒ  t  j	 d, |  ƒ |  _1 t  j ƒ  } t j d	 k r| j | | | | ƒ n  t j d	 k r&| j | ƒ n  t  j
 ƒ  } | j t  j! d- |  ƒ ƒ t  j |  ƒ |  _2 xX d d. g d d/ g g D]> \ } } t  j | |  ƒ } |  j2 j | | ƒ | j | ƒ qvW|  j |  j2 t j d ƒ t j |  j d0 ƒ ƒ | j/ d+ ƒ | j' | ƒ t  j
 ƒ  } | j t  j! d1 |  ƒ ƒ | j' | ƒ t  j, |  ƒ } | j d2 ƒ |  j | t j d ƒ t j |  j d2 ƒ ƒ d3 d  l3 } x! | j3 j4 D] } | j5 | ƒ q’Wt  j
 ƒ  } | j | ƒ t  j6 |  ƒ } | j d4 ƒ |  j | t j d5 ƒ t j |  j d4 ƒ ƒ | j | ƒ | j t  j! d6 |  ƒ ƒ | j/ d+ ƒ | j' | ƒ | j/ d+ ƒ |  j1 j | ƒ |  j1 j0 ƒ  t  j	 d7 |  ƒ |  _7 t  j ƒ  } t j d	 k r¼	| j | | | | ƒ n  t j d	 k rÛ	| j | ƒ n  t  j
 ƒ  } | j t  j! d8 |  ƒ ƒ | j' | ƒ t  j
 ƒ  } | j t  j! d9 |  ƒ ƒ t  j6 |  ƒ } | j d: ƒ | j8 d; ƒ | j | ƒ |  j | t j d5 ƒ t j |  j d: ƒ ƒ | j t  j! d< |  ƒ ƒ t  j9 |  ƒ } | j d= ƒ | j: d> d? ƒ | j; d> ƒ |  j | t j d@ ƒ t j |  j d= ƒ ƒ | j | ƒ | j t  j! dA |  ƒ ƒ t  j9 |  ƒ } | j dB ƒ |  j | t j d@ ƒ t j |  j dB ƒ ƒ | j: d> d? ƒ | j; d> ƒ | j | ƒ | j/ d+ ƒ | j' | ƒ |  j7 j | ƒ |  j7 j0 ƒ  t  j	 dC |  ƒ |  _< t  j |  j< ƒ } t j d	 k r$| j | ƒ n  t j d	 k rL| j | | | | ƒ n  i  |  _= xQ t> j? j@ ƒ  D]@ \ } }	 t  j! |	 |  ƒ |  j= | <|  j= | j t> jA | ƒ qeW|  j< j | ƒ |  j< j0 ƒ  t  j	 dD |  ƒ |  _B t  j ƒ  } t j d	 k r| j | | | | ƒ n  t j d	 k r.| j | ƒ n  |  jB j | ƒ d  |  _C |  jB j0 ƒ  |  j | ƒ t& d ƒ jD ƒ  |  jE t  j t& d ƒ jF ƒ jG d ƒ |  j tH ƒ  t j dE ƒ |  jI ƒ |  j tH ƒ  t j dF ƒ |  jI ƒ |  j tH ƒ  t j dG ƒ |  jI ƒ |  j tH ƒ  t j dH ƒ |  jI ƒ d  S(I   Ni    i   s   Superpose methodi   i   s   buttonClicked(int)t   methods   Fixed and moving modelsR   t   fixeds   Fixed models>   Fixed model - matches and atom selections shown for this modelt   show_equiv_mols   Highlighted modelsB   The matches and selected atoms are displayed for this moving modelt   _labelR>   t   object_typet   MolDataR   t    s   currentIndexChanged(int)s   Display of matchess   Show matches with t   show_equivalentssM   Dashed lines between matched atoms of the fixed and one selected moving models   stateChanged(int)s   distance labelst   show_distancess,   Show inter-atomic distance for matched atomst   conn_colours   Highlight selected atomss=   If limited set of atoms selected highlight them with pyramidst	   show_maskt   fixed_mask_colourt   moving_mask_colourt   Optionss   Method:t   SSMt   Gesamts#   currentIndexChanged(const QString&)t	   submethodi   s   User defined matches optionss   Apply superpose tos   the moving models   all active modelst   apply_interactive_alls&   For selected residues and ranges matcht   selected_atoms_modeiÿÿÿÿt   selected_atoms_selections   editingFinished()t   atomss   Close residues optionss&   Close atoms must have same name and ..s   Residue max intert   close_atoms_central_atomi   t   distancet   close_atoms_res_cutoffg      à?g      $@s   valueChanged(double)s   Max interatomic distancet   close_atoms_cutoffs   Models to superposes   User defined matchest
   addDataObjt   deleteDataObjt   loadAllDataObjt   update(J   R   t   QWidgetR   t   block_showMatcht   block_updatet
   model_listt   Nonet   multiSaveWidgett   QGridLayoutt	   QGroupBoxt   QHBoxLayoutt   QButtonGroupt   method_groupR   t   methods_menut   QRadioButtonR0   t
   setToolTipR/   R   R6   R2   R    R3   t   guiUtilst   partialRs   R   R   R   R   R   R4   t   QLabelt   getattrt	   mgWidgetst   mgDataObjCombot   setCurrentDataObjRI   R5   t   setExcludeDataObjListt	   QCheckBoxt   mgColourCombot	   ssm_framet	   QComboBoxt   ssm_gesamt_combot   addItemst
   addStretcht   hidet   interactive_frameRh   R   t   selected_atoms_mode_menut   addItemt	   QLineEditt   close_residues_framet   setMaxLengtht   QDoubleSpinBoxt   setRanget   setSingleStept   model_framet   model_frame_labelt   modelForSuperposeRC   t   itemst   tooltipst   interactive_selection_framet   editMatchesFramet   initiallise_statust	   findChildRW   t
   setCheckedt   DISPLAYTABLEt   handleChangedModels(   R=   R>   t   frame_marginR@   t   framet   frame_layoutt   itemt   widgetRB   RC   t   tipt   linet   iiR   t   model_layoutt   inter_layout(    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyR   }   s€   				.  +"  ++++/  .  %.++  +++  	  	%"""c   
      C   sï  |  j  ƒ  xg d d g D]Y } |  j t j | ƒ } | r | j ƒ  t t d ƒ | ƒ } | rp | j | ƒ qp q q Wt d ƒ j ƒ  |  j	 d ƒ |  j	 d ƒ |  j t j | ƒ j
 t t d ƒ d d ƒ g ƒ |  j ƒ  t |  j j ƒ  j ƒ  ƒ } |  j | ƒ t d d ƒ } d  } g  } xŸ | D]— } t | d	 ƒ rk| d  k rkt j | j ƒ } t j | j ƒ } n  t | d	 ƒ r#| d  k r#x1 | D]% }	 |	 | j k rŽ| j |	 ƒ qŽqŽWq#q#W| j d
 d ƒ |  j j ƒ  |  j j | ƒ d  S(   NRX   RY   R   R^   R_   R]   R[   R\   t   chainsi    (   t   loadModelFrameR£   R†   R‡   t	   resetMenuR…   RI   Rˆ   t   set_default_fixedRs   R‰   t   drawEditMatchesFramet   strR~   t   checkedButtont
   objectNamet   handleChangedMethodt   get_dataobjRx   t   hasattrt   copyt   deepcopyR±   t   removet   insertt   selectAllChainCombot   clearR�   (
   R=   Rª   R«   t   molRW   t   dataobjst   firstChainst	   allChainst   ot   ch(    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyR¦   P  s:    

 1
c         C   s¤   d } x— |  j  D]Œ } | d } |  j j t d | ƒ } | r t | d ƒ rœ t | j d ƒ r™ | d k r | j j | ƒ q– | j j | d ƒ q™ qœ q q Wd  S(   Ni    i   R   t	   selectiont   setTextR]   t   /(   Rw   R›   R£   R�   R»   RÈ   RÉ   (   R=   t   chaint   rowRP   R«   (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyt   selectChainInAllModelsv  s    
c         C   s×  | d k r t  j } n	 t  j } d } xt |  j j ƒ  D]c \ } } | j | d ƒ } | d k r� | j d ƒ |  j j ƒ  j	 | | | ƒ q7 | j d ƒ q7 WxS |  j
 D]H } | d } |  j j t  d | ƒ } | r¨ | j d | d | ƒ q¨ q¨ Wt |  d ƒ s³t j ƒ  |  _ t j ƒ  } |  j j | ƒ t j d	 ƒ }	 t j d
 ƒ }
 t j ƒ  |  _ t d d ƒ } d  } g  } xŸ | D]— } t | d ƒ rÅ| d  k rÅt j | j ƒ } t j | j ƒ } n  t | d ƒ r}| d  k r}x1 | D]% } | | j k rè| j | ƒ qèqèWq}q}W| j d d ƒ |  j j ƒ  |  j j | ƒ | j	 |	 ƒ | j	 |  j ƒ | j	 |
 ƒ t j d d ƒ } | j  | ƒ |  j! |  j t" j# d ƒ |  j$ ƒ n  | d k sË| d k rñ|  j j ƒ  j	 |  j | d d ƒ n  | d k r|  j% r|  j& ƒ  n  xÀ d d g |  j g d g |  j' g g D]— \ } } |  j ƒ  j( | ƒ } | j) | ƒ r§| d k  rÓ| j* ƒ  |  j ƒ  j	 | d d d d ƒ qÓq<| d k r<| j+ ƒ  |  j ƒ  j, | ƒ q<q<WxÀ d |  j- g d |  j. g d |  j/ g g D]” \ } } |  j ƒ  j( | ƒ } | | k rj| d k  r–| j* ƒ  |  j ƒ  j	 | d d d d ƒ q–q| d k r| j+ ƒ  |  j ƒ  j, | ƒ qqWi d d 6d d 6d d 6} |  j0 j1 | | ƒ |  j2 ƒ  d  S(   NR   i    iÿÿÿÿi   R   RÌ   t   columnst   selectAllChainWidgets   (or select chain s    in all objects)R[   R\   R±   R]   iÈ   i   s#   currentIndexChanged(const QString&)RU   i   RV   i   s   Highlighted models   Moving model(3   R�   t   close_columnsRÎ   Rœ   Rž   t   gett
   setVisibleR›   R@   R   Rw   R£   t   layoutWidgetsR»   R   Rt   RÏ   R|   R6   R„   R�   RÀ   Rº   Rx   R¼   R½   R±   R¾   R¿   RÁ   R�   t   QSpacerItemR”   R2   R    R3   RÍ   R¡   Rµ   R    t   indexOft   countt   showR‘   t   removeWidgetRŒ   R–   R’   t   show_equiv_mol_labelRÉ   t   redraw(   R=   RW   RÎ   RÌ   Rª   R«   t   colRP   t   selectAllChainLayoutt   selectAllChainLabel1t   selectAllChainLabel2RÃ   RÄ   RÅ   RÆ   RÇ   t   spacert   modeR¨   t   idxt   show_equiv_mol_label_text(    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyR¹   …  s�    	
 %&
%

%


c         C   s~   |  j  t ƒ  t j d ƒ |  j ƒ |  j  t ƒ  t j d ƒ |  j ƒ t d ƒ j ƒ  d d  l	 } | j
 d d ƒ |  j ƒ  d  S(   Nt   DisplayTableChangedt   atomContextMenuR   iÿÿÿÿt	   auto_savei    (   t
   disconnectR¥   R    R3   R²   t
   MAINWINDOWt   handleAtomPickRI   R   t   rebuildt   UpdateDisplayR‘   (   R=   Ré   (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyR   ö  s    ""c         C   s¨   |  j  ƒ  |  j ƒ  |  j t ƒ  t j d ƒ |  j  ƒ |  j t ƒ  t j d ƒ |  j ƒ |  j t	 d ƒ j
 ƒ t	 d ƒ j ƒ  d d  l } | j d d ƒ |  j ƒ  d  S(   NRã   Rä   R   iÿÿÿÿRå   i    (   R²   t   initialiseParamsR2   R¥   R    R3   Rç   Rè   R¹   RI   RW   t   uncloseRé   Rê   R×   (   R=   Ré   (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyR;     s    

""c         C   s   t  ƒ  j d ƒ d  S(   Ns   superpose.html(   t   HELPBROWSERt
   loadMgHelp(   R=   (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyR     s    c      	   C   s™  g  } x' t  d d ƒ D] } | j | j ƒ q Wg  } x0 |  j D]% } | j | ƒ s@ | j | ƒ q@ q@ WxZ | D]R } t d ƒ j | ƒ |  j t d | ƒ } | r² | j	 ƒ  n  |  j j
 | ƒ qp W|  j j ƒ  j ƒ  d } x³ | D]« } |  j j | ƒ sæ t d ƒ j | ƒ } | s‘| d } t |  j d | d |  j j ƒ  d | ƒ} |  j | j t j d	 ƒ t j |  j | ƒ ƒ |  j j | ƒ q‘qæ qæ Wd
 S(   sA   
    Load models from Appl('Superpose') into the model frame
    R[   R\   R   R   i   RB   R@   RÌ   s   currentIndexChanged(int)N(   Rº   t   appendRB   Rw   RÖ   RI   t   handle_delete_MolDataR£   R�   t   deleteR¾   R›   R@   t   rowCountt   add_MolDataR2   t   matchR    R3   R‚   Rƒ   t	   showMatch(   R=   t   new_model_listRª   t   del_listRP   R«   RÌ   t   rv(    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyR²     s.     
.c         C   sJ  d |  _  |  j t j t d ƒ j ƒ } | r= | j d ƒ n  xQ d d d g D]@ } |  j t j | ƒ } | rM | j t t d ƒ | ƒ ƒ qM qM Wx` d d d g D]O } |  j t	 j
 | ƒ } | r¡ t t d ƒ | ƒ } | rð | j | ƒ qð q¡ q¡ Wx] d	 d
 g D]O } |  j t	 j | ƒ } | rt t d ƒ | ƒ } | rP| j | ƒ qPqqWxN d d g D]@ } |  j t j | ƒ } | ra| j t t d ƒ | ƒ ƒ qaqaWxK d g D]@ } |  j t j | ƒ } | r¯| j t t d ƒ | ƒ ƒ q¯q¯W|  j t j d ƒ } | r9| j t d ƒ j j t d ƒ j ƒ ƒ n  |  j t j d ƒ } | rœ| j t d ƒ j ƒ  ƒ t d ƒ j d k r�| j ƒ  qœ| j ƒ  n  |  j j d ƒ j d t d ƒ j ƒ |  j j d ƒ j t d ƒ j ƒ xV |  j D]K } |  j t d | ƒ } | rît d ƒ j | j ƒ  } | j  | ƒ qîqîWd |  _  d  S(   Ni   R   R^   R_   Ra   R`   Rb   Rc   RX   RY   Rn   Ro   Rl   Ri   Rj   t   useri    R   (!   Rv   R£   R   R€   RI   RW   R¤   RŠ   R…   R†   R‹   t
   set_colourR‡   Rˆ   R˜   t   setValueR•   RÉ   R�   t   setCurrentIndext   selected_atoms_mode_aliast   indexRi   t   get_user_selected_atomsR×   R‘   Rh   RF   Rw   R�   RJ   t	   getparamst	   setParams(   R=   R«   Rª   t   colourRÂ   t
   model_namet   params(    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyRë   >  sZ    	 #   # # +&"c         C   s.   |  j  j | ƒ r& |  j  j | ƒ d Sd Sd  S(   Ni   iÿÿÿÿ(   Rw   RÖ   Rþ   (   R=   RP   (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyt   getModelRoww  s    R]   c         C   s  |  j  r d  Sd } i  } | d k ru t |  j j ƒ  j ƒ  ƒ } t d ƒ j } t d ƒ j d | ƒ |  j | ƒ nYd d d g j	 | ƒ rÝ |  j
 t j | ƒ } | s¬ d  S| j ƒ  } t d ƒ j d | d | ƒ d	 } nñd
 d g j	 | ƒ rÓ|  j
 t j | ƒ } | sd  S| j ƒ  j } | d
 k r­t d ƒ j | ƒ |  j
 t j d ƒ } | rÀ| j t t d ƒ d
 d ƒ g ƒ t t d ƒ d ƒ }	 |	 rª| j |	 ƒ qªqÀn t d ƒ j | ƒ |  j ƒ  d	 } nû| d k r&|  j
 t j | ƒ } | sþd  St d ƒ j t | j ƒ  ƒ ƒ d	 } n¨| d k ry|  j
 t j | ƒ } | sQd  St d ƒ j t | j ƒ  ƒ ƒ d	 } nUd d g j	 | ƒ rÆ|  j
 t j | ƒ } | s­d  St | j  ƒ  ƒ | | <nd g j	 | ƒ r|  j
 t j! | ƒ } | s÷d  St | j" ƒ  ƒ | | <n¾| d k r¦|  j
 t j# | ƒ } | s;d  St d ƒ j$ t | j% ƒ  ƒ | | <|  j
 t j! d ƒ }
 |
 rÎ| | d k r–|
 j& ƒ  q£|
 j' ƒ  qÎn(| d k rà|  j
 t j! d ƒ } t | j" ƒ  ƒ | | <nî | d k rt |  j( j) ƒ  ƒ | d <nÆ | d k rÎt d ƒ j d t |  j* j+ ƒ  j, ƒ  ƒ j- ƒ  ƒ x† |  j. D]x } |  j
 t/ d | ƒ } t0 | d ƒ rOt |  j* j+ ƒ  j, ƒ  ƒ j- ƒ  d k r´| j1 j2 t3 ƒ qÇ| j1 j2 t4 ƒ qOqOWn  | rêt d ƒ j | ƒ n  | rý|  j5 ƒ  n  d  S(   Ni    RW   R   R`   Rb   Rc   Rà   R  i   RX   RY   R]   R^   Ra   Rn   Ro   Rl   Ri   Rj   Rù   Rh   Rg   R   Rô   t   gesamt(6   Rv   R¶   R~   R·   R¸   RI   RW   t	   setparamsR¹   RÖ   R£   R†   R‹   t
   get_colourRú   R‡   t   getCurrentDataObjRB   t	   set_fixedR‰   R…   Rˆ   t   set_show_equiv_molRµ   R   RŠ   t   set_show_equivalentst   intt	   isCheckedt   set_show_maskR˜   t   floatt   valueR•   t   textR�   Rý   t   currentIndexR×   R‘   Rh   t	   checkedIdRŽ   t   currentTextt   toUtf8t   lowerRw   R�   R»   Rô   RO   t   Falset   TrueRÚ   (   R=   Rà   RÚ   R  t
   new_methodt
   old_methodR«   R  R  RÂ   t   select_widgetRP   (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyRs   €  s¢    	  	 " 
	 	 	   #1'  c         C   s    d d  l  } | j d d ƒ d  S(   NiÿÿÿÿRå   i    (   Ré   Rê   (   R=   Ré   (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyRÚ   Ü  s    iÿÿÿÿc         C   s    |  j  r; |  j  j ƒ  |  j j ƒ  j |  j  ƒ d  |  _  n  t d ƒ j rœ t d ƒ j rœ t  |  t d ƒ j t d ƒ j ƒ |  _  |  j j ƒ  j	 |  j  ƒ n  d  S(   NR   (
   R¡   t   deleteLaterR    R@   RØ   Rx   RI   RX   RY   R   (   R=   t   matchID(    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyRµ   â  s    	'c         C   s­  |  j  ƒ  x! |  j t ƒ D] } | j ƒ  q Wt |  j j ƒ  j ƒ  ƒ } | d k rì t d ƒ j	 ƒ  } | rì d } x | D] } | | d } qz W| d } t
 j j |  d | t
 j j t
 j j Bt
 j j ƒ } | t
 j j k ré d  Sqì n  t d ƒ j ƒ  } | d sx| d k r!|  j ƒ  n
 |  j ƒ  |  j ƒ  |  j ƒ  |  j t j d ƒ ƒ |  j  ƒ  |  j t d ƒ j ƒ n1 | d	 r©t
 j j d  |  j ƒ  d
 | d	 ƒ n  d  S(   NRU   R   sR   The following structures have atoms in more than one NMR/symmetry model selected.
s   
s   Do you want to continues%   Multiple NMR/symmetry models selectedi    R   i   s   Superpose failed.
(   Rs   t   findChildrenR�   t   handleSelectionR¶   R~   R·   R¸   RI   t   checkForMultiModelsR   t   QMessageBoxt   questiont   Yest   NoR(   t   updateMatchest   clearMatchest	   updateRMSRÚ   t   emitR    R3   R¹   RW   t   warningRx   t   windowTitle(   R=   R«   Rà   t   multi_modelsR  Rª   t   retvalRø   (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyR(   ñ  s6    

" 






c         C   s[   |  j  ƒ  t d ƒ j ƒ  } |  j t j d ƒ ƒ | sW d d  l } | j d d ƒ n  d  S(   NR   R   iÿÿÿÿRå   i    (   Rs   RI   R   R)  R    R3   Ré   Rê   (   R=   Rø   Ré   (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyR     s    
c   &      C   sŸ  d d  l  } d d  l } t d ƒ j ƒ  } t d ƒ j ƒ  d } xX| D]P} t | d ƒ rG | j d ƒ rG | j d ƒ rG | j d ƒ rG | d d | d } | d j ƒ  } g  } x6 | D]. }	 | j t	 |	 ƒ ƒ | j
 d	 d	 | ƒ }
 q¼ W| j |
 ƒ } | j ƒ  } | j ƒ  | j ƒ  } | j | d ƒ r6| j | d ƒ r6| | d j d
 ƒ r6| | d j d
 ƒ r6t d | | d d ƒ d j d d  | | d d
 g ƒ } t d | | d d ƒ d j d d  | | d d
 g ƒ } | d d k r
| d } n d  } | d d k r-| d } qBd  } n d  } d  } t | d ƒ } t | d ƒ } d  } t | d ƒ r| r’| j j | ƒ } na | j j ƒ  } | j j | | j d d | j d | j d d d d d | j ƒ | j j | ƒ } | j | ƒ } | j | ƒ } n d  St | d ƒ rÄ| rB| j j | ƒ } na | j j ƒ  } | j j | | j d d | j d | j d d d d d | j ƒ | j j | ƒ } | j | ƒ } | j | ƒ } n d  S| rÿd d  l } | j |
 j ƒ  | ƒ } | j ƒ  n  | j | | | | ƒ } | j ƒ  | j ƒ  | d d } | j ƒ  | j ƒ  | d d } d d  l  } d }  |  d | j! ƒ  7}  |  d 7}  |  d | d 7}  |  d 7}  |  d 7}  |  d | d t" | j# ƒ  ƒ d t" | j$ ƒ  ƒ d t" | j% ƒ  ƒ d t" | j# ƒ  ƒ d t" | j$ ƒ  ƒ d t" | j% ƒ  ƒ d 7}  | d }! d d  l& }" |" j' j( }# d d  l) }$ |# s|$ j* d  }# n  |$ j+ j, |# |! ƒ }% qG qG Wd  S(!   NiÿÿÿÿR   t   superposeModelst   has_keyt   movingRX   t   matrixt   _to_i   RÈ   RB   t   MolData_namei    t   defni   RM   R   t   CAt   Ci   s0   
#Definition of vectors for display with CCP4mg
s   #Created on s3   

data_VECTORS


loop_
_tags.name
_tags.annotation
t   "s   "  " "s   


s{   
loop_
_vector.tag
_vector.start_x
_vector.start_y
_vector.start_z
_vector.end_x
_vector.end_y
_vector.end_z
_vector.label
s   " t    s    ""
s   _Superpose.vectort   HOME(-   t
   pygl_coordt   mmdb2RI   t   get_dataR   R»   R/  t   splitRï   R  R1  t   GetAxisAndPointFromMatrixt   pointt   axisRº   t   parse_selectionRx   RL   RM   t   CentreOfMasst   NewSelectiont   Selectt
   STYPE_ATOMt   ANY_RESt   SKEY_NEWt   realtype_to_doublet	   Cartesiant   VisRotTranst#   RotTransMatrixVisFromPointAndMatrixt   Inverset   drawt   DistanceBetweenTwoLinest   timet   asctimeR¶   t   get_xt   get_yt   get_zR†   t   MGFileDialogt   last_directoryt   ost   environt   patht   join(&   R=   R:  t   mmdbt   supDatat   modelst   dRB   t   matt   matvalst   valt   mt	   axisPointt   p1t   p2t   rv_fixedt	   rv_movingt
   selH_fixedt   selH_movingt   fixed_molHndt   moving_molHndt   p3t   rtt   fixed_selHndt   rtdt   moving_selHndt   p4RJ  t   vist	   intersectt   begint   endRO  t
   vectorTextt   fnameR†   t	   directoryRV  t	   fnameFull(    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyR+     s’    <T==	@@""
Š
c         C   sM   t  d ƒ j ƒ  } | rI t ƒ  j | d ƒ } | rI | j d d ƒ qI n  d  S(   NR   t   stylet   fixed_width(   RI   t	   list_datat
   FILEVIEWERt   loadTextt   setFont(   R=   Rø   R«   (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyR*   Ÿ  s
    c         C   sZ   d |  _  xA |  j D]6 } |  j t d | ƒ } | j j ƒ  | j j ƒ  q Wd |  _  d  S(   Ni   R   i    (   Ru   Rw   R£   R�   Rô   RÁ   R‘   (   R=   RP   R«   (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyR'  ª  s    	c         C   s(  d |  _  x|  j D]} |  j t d | ƒ } | j j ƒ  t d ƒ j | j ƒ  } | j	 d d ƒ r
x2 t
 | d ƒ D]  } | j j t | d ƒ ƒ qx W| d d k r¿ | j j d ƒ n  | j j d ƒ | j j | j j t | j	 d ƒ ƒ ƒ ƒ | j j ƒ  q | j j ƒ  q Wd |  _  d  S(	   Ni   R   R   t   nof_matchesi    t   bestR   t   displayed_match(   Ru   Rw   R£   R�   Rô   RÁ   RI   RJ   t   getmatchesinfoRÑ   t   rangeR”   R¶   Rü   t   findTextR×   R‘   (   R=   RP   R«   R  Rª   (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyR&  µ  s    	 +c         C   sŽ   t  d ƒ j d k r% |  j j ƒ  ne xb |  j D]W } t  d ƒ j | j ƒ  } |  j t d | ƒ } | j	 j
 t | j d d ƒ ƒ ƒ q/ Wd  S(   NR   RV   R   t   rmsR]   (   RI   RW   R¡   R(  Rw   RJ   R‚  R£   R�   R…  RÉ   R¶   RÑ   (   R=   RP   R  R«   (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyR(  Ê  s    c         C   sˆ   |  j  r d  S|  j t d | ƒ } | s- d  S| j j ƒ  } t d ƒ j | | ƒ } |  j ƒ  |  j ƒ  d d  l	 } | j
 d d ƒ d  S(   NR   R   iÿÿÿÿRå   i    (   Ru   R£   R�   Rô   R  RI   t   handle_change_matchR&  R(  Ré   Rê   (   R=   RP   R«   t   gui_idxt   app_idxRé   (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyRõ   Õ  s    	  

c         C   si   t  |  d ƒ sX d d  l } | j |  d d ƒ|  _ |  j |  j t j d ƒ |  j ƒ n  |  j j ƒ  d  S(   Nt
   export_guiiÿÿÿÿt	   data_types   Superpose matchesR   (	   R»   t   displayTableObjectst	   exportGuiR‰  R2   R    R3   R	   R×   (   R=   R‹  (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyR)   å  s
    %c      
   C   sV  |  j  j ƒ  } d d  l } | j |  j  j ƒ  d ƒ } | rt d ƒ j j t d ƒ j d  ƒ } | rü | j
 d | d | ƒ } | d r|  j  j ƒ  rd d  l } | j d | ƒ } | rù t ƒ  j d | j d | j d	 t | d
 d ƒ d d ƒ qù qqd d t d ƒ j g } n  | d rEt j j d  |  j ƒ  | d ƒ n  |  j  j ƒ  d  S(   Niÿÿÿÿs   /nR   t   filenamet   commentsi    R[   RB   RC   t
   name_labelR]   t
   getDispObji   s   Error finding data for model (   R‰  t   getFilet   stringR=  t   getCommentsRI   RJ   RÑ   RY   Rx   t   export_matchest	   getReloadt   VectorsDispobjt   openvectorfileR¥   Rp   R[   RB   R…   R   R"  R*  R+  R   (   R=   t   exfileR’  RŽ  RJ   Rø   R–  t   new_data(    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyR	   î  s"    $"
#c      	   C   sv  | s
 d  S| j  ƒ  } | s  d  St d ƒ } | j d k s[ | j | j g j | j ƒ r_ d  S| j ƒ  } | su d  Sd d  l } d g } | j	 | ƒ } x) | D]! } | j
 d t | d ƒ ƒ q  W| j d d d	 d
 d d g ƒ | j | ƒ }	 |	 r=d g }
 x> |	 D]- } |
 j
 d | d d t | d ƒ ƒ q	Wn g  }
 | j |  | | |
 d g |  j d i | d 6ƒd  S(   NR   RV   iÿÿÿÿs   Superpose: select thist   superpose_select_range_i    t   superpose_select_atomt   superpose_select_monomert   superpose_select_maint   superpose_select_sidet   superpose_select_residuet   superpose_select_starts   Superpose: match this tot   superpose_match_i   t   _t   superpose_undo_lastt   infot	   pickevent(   t
   getDataObjRI   RW   RX   RY   RÖ   RB   t   getContextMenuR‚   t   get_unfinished_rangeRï   R¶   t   extendt   get_unmatched_menut   populateMenut   getActionDef(   R=   R¥  RQ   t   SUPt   menuR‚   t   select_menut   end_range_menuRª   t   match_menu_itemst
   match_menu(    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyRè     s0      / 		.c         K   su  | j  ƒ  } | s d  S| j d d ƒ } d } | j ƒ  } | r\ | d j j ƒ  r\ d } n  | | j | f } | d k r¢ t d d d d	 d
 d d |  j | g ƒ S| d k rÖ t d d d d d
 d d |  j | g ƒ S| d k r| rt d d d d d
 d d |  j | g ƒ S| d k rJ| rJt d d d d d
 d d |  j | g ƒ S| d k r~t d d d d d
 d d |  j | g ƒ S| d k r²t d d d d d
 d d |  j | g ƒ S| d d !d k r:t | d ƒ }	 t	 d ƒ j
 | ƒ }
 xM |
 D]B } | d |	 k rñt d | d d d d
 d d |  j | g ƒ SqñWn  | d d  !d! k rç| d" j d# ƒ \ } }	 t |	 ƒ }	 t	 d ƒ j | ƒ }
 x] |
 D]R } | d |	 k rŽ| d | k rŽt d | d$ d d% d
 d d |  j | g ƒ SqŽWn  | d& k rt d d' d d( d |  j | g ƒ S| d) k rCt d d* d d( d |  j | g ƒ S| d+ k rqt d d, d d- d |  j | g ƒ Si  S(.   Nt   formatt   fulli    i   R›  R  t   AtomR¬   s   Select this atomR  RE   Rœ  t   Monomers   Select this monomerR�  s
   Main chains+   Select the main chain atoms of this residueRž  s
   Side chains+   Select the side chain atoms of this residueRŸ  t   Residues    Select all atoms of this residueR   s   Start residue ranges&   Select range of residues starting herei   t   superpose_select_rangei   R   s   End range of residues herei   t   superpose_matchi   R¢  i   s$   Match to these atom(s) or residue(s)t   superpose_clear_unmatcheds   Clear unmatched selectionss%   Remove any selections in either modelt   superpose_clear_alls   Clear all selections/matchesR£  s   Undo last selection/matchs$   Undo the previous selection or match(   R¦  t   getLabelt   getPickedAtomst   residuet   isAminoacidRB   t   dictt
   pickSelectR  RI   R¨  R=  Rª  (   R=   RB   R¥  t   kwRQ   RC   t	   isPeptidet   pAtomsR¤  R®   R®  Rª   Rà   (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyR¬  '  sŽ      	 c   
   	   K   s±  | \ } } } d } | d d !d k rY t  d ƒ j d t | d ƒ d | d	 | ƒ } n| d d
 !d k r— t  d ƒ j d | d d | d	 | ƒ } nÎ | d d !d k rö | d
 j d ƒ \ } } t  d ƒ j d t | ƒ d | d	 | d | ƒ } no | d k rt  d ƒ j d d ƒ nJ | d k r@t  d ƒ j d d ƒ n% | d k ret  d ƒ j d d ƒ n  d d  l }	 |	 j ƒ  t |  d d  ƒ r­|  j j	 ƒ  |  j j
 | ƒ n  d  S(   Niÿÿÿÿi    i   R¸  R   t	   end_rangei   R3  t   atomIDi   t   superpose_selectt   selecti   i   R¹  R¢  Rô   Rà   Rº  t   clear_unmatchedi   R»  t	   clear_allR£  t	   undo_lastR¡   (   RI   t   handle_atom_popupR  R=  Ré   Rê   R…   Rx   R¡   t   loadSelectMatcht
   setMatchId(
   R=   R¤  RÂ  RB   t   molobj_nameRC   R  Rà   Rô   Ré   (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyRÁ  v  s.    %!
c         C   s,  g  } g  } xd t  d ƒ j j ƒ  D]M \ } } t | ƒ } | r" | j j ƒ  r_ | j | ƒ qo | j | ƒ q" q" W|  j s© d d  l } | j |  d d d d ƒ|  _ n  |  j j	 d | d | ƒ |  j j
 ƒ  |  j |  j t j d	 ƒ t j |  j t j d
 ƒ ƒ ƒ |  j |  j t j d	 ƒ |  j ƒ d  S(   NR   iÿÿÿÿt   application_tagR   t   titles    Save coordinates after superposet   DataObj_changedt   DataObj_unchangedt   saved_filesR   (   RI   RJ   Rž   RL   RM   RN   Rï   Ry   t   saveDataFilest
   setDataObjR×   R2   R    R3   R‚   Rƒ   R)  t   updateDataObjLabels(   R=   RÒ  RÓ  RP   RJ   RQ   RÕ  (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyR,   ™  s     "	7c         C   s(   x! |  j  t ƒ D] } | j ƒ  q Wd  S(   N(   R  R�   t   setNameLabel(   R=   R«   (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyR×  ¯  s    N("   RR   RS   t	   show_menut
   show_aliasR   R   R¦   RÍ   R¹   R   R;   R   R²   Rë   R  Rs   RÚ   Rµ   R(   R   R+   R*   R'  R&  R(  Rõ   R)   R	   Rx   Rè   R¬  RÁ  R,   R×  (    (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyR   q   sB   			Ó	&		q				'	9		\		 		ƒ								 O#	R�   c           B   s�  e  Z i d  d 6d d 6d d 6d d 6d d	 6d
 d 6d d 6d d 6Z i d d 6d d 6d d 6d d 6d d	 6d d 6d d 6d d 6Z i d d 6d d 6d d 6d d 6d d	 6d d 6d d 6d d 6Z i d  d 6d d 6d d 6d d 6d d	 6d d 6d d 6d d 6Z d* d  d* d d „ Z d „  Z d* d i  d „ Z	 i  d  „ Z
 d! „  Z d" „  Z d# „  Z d$ „  Z d% „  Z d& „  Z d' „  Z d( „  Z d) „  Z RS(+   R]   R�  t   Activet   ont   FixedRX   t   Matchest   visiblet	   SelectionRÈ   t   MaskRa   s
   Show matchRô   t   RMSR…  i    i   iÿÿÿÿi   i   i   s   Superpose this model?s   Select one fixed models   Show matches to fixed models$   Select set of atoms to be superposeds   Highlight the selected atomss   Show alternative superpositions=   RMS distance between overlapped atoms in fixed and this modelc         C   sÔ  t  j j |  | ƒ |  j d | ƒ t  j |  ƒ |  _ |  j j t j d ƒ |  j	 |  j t
 j d ƒ |  j ƒ t  j d |  ƒ |  _ |  j ƒ  t j |  t | ƒ j d d d d g d	 d
 ƒ|  _ |  j j t j d ƒ |  j	 |  j t
 j d ƒ |  j ƒ t  j |  ƒ |  _ |  j j t j d ƒ |  j	 |  j t
 j d ƒ |  j ƒ t  j |  ƒ |  _ |  j j t j d ƒ |  j j d ƒ t  j |  ƒ |  _ |  j j t j d ƒ |  j j d ƒ |  j d | d t j ƒ d  S(   NR   RÜ  s   clicked(bool)R]   t   selectionWidgetsR±   t   neighbt   namedSelectiont   highlightPendingi   RÈ   t   changedRa   Rô   i    R…  RÌ   RÎ   (   R   Rt   R   R0   RŠ   RÜ  R�   R�   RŸ   R2   R    R3   t   handleOnR„   R�  RØ  R†   t   mgSelectionComboRL   t	   treeModelRÈ   R   Ra   t   handleShowMaskR�   Rô   RÒ   R…  RÓ   RÎ   (   R=   R>   RB   R@   RÌ   (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyR   à  s(    "
3""c         C   s\   |  j  ƒ  j ƒ  } x9 d d d d d d g D] } t |  | ƒ } | j ƒ  q+ W|  j ƒ  d  S(   NRÜ  R�  RÈ   Ra   Rô   R…  (   R>   R@   R…   R   R  (   R=   R@   Rª   R«   (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyRñ     s
    c         C   s™   | d  k r! |  j ƒ  j ƒ  } n  xq | j ƒ  D]c \ } } t |  | d  ƒ } | r. | d k r� | j d ƒ | j | | | ƒ q‘ | j d ƒ q. q. Wd  S(   Ni    i   (   Rx   R>   R@   Rž   R…   RÒ   R   (   R=   R@   RÌ   RÎ   t   keyRÛ   R«   (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyRÓ     s     c         K   sr   | j  d ƒ r& |  j j | d ƒ n  | j  d ƒ rn t |  d d  ƒ } | rn | j | d ƒ | j ƒ  qn n  d  S(   NRÜ  RÈ   (   R/  RÜ  R¤   R…   Rx   RÉ   t   updateTreeView(   R=   R  RÂ  R«   (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyR  $  s     c         C   sh   i  } xB d d g D]4 } t  |  | d  ƒ r t  |  | ƒ j ƒ  | | <q q Wt  |  d ƒ j ƒ  | d <| S(   NRX   RÜ  RÈ   (   R…   Rx   R  R  (   R=   R  Rª   (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyt	   getParams4  s     c         C   sC   t  d ƒ j t |  j ƒ  ƒ d ƒ d d  l } | j d d ƒ d  S(   NR   i	   iÿÿÿÿRå   i    (   RI   R
  R¶   R¸   Ré   Rê   (   R=   t   stateRé   (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyt   handleFixed@  s    #c         C   sa   t  d ƒ j t |  j ƒ  ƒ d ƒ } | rA | j t | ƒ ƒ n  d d  l } | j d d ƒ d  S(   NR   i	   iÿÿÿÿRå   i    (   RI   t   GetSuperposeModelR¶   R¸   t   set_visibilityR  Ré   Rê   (   R=   Rï  t   targetRé   (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyt   handleVisibleF  s
    % c         C   s*   t  d ƒ j d t |  j ƒ  ƒ d ƒ d  S(   NR   RY   i	   (   RI   R  R¶   R¸   (   R=   Rï  (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyt   handleMovingM  s    c         C   s)   |  j  ƒ  j  ƒ  j t |  j ƒ  ƒ d ƒ S(   Ni	   (   R>   R  R¶   R¸   (   R=   (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyRÌ   Q  s    c         C   sa   t  d ƒ j t |  j ƒ  ƒ d ƒ } | rA | j t | ƒ ƒ n  d d  l } | j d d ƒ d  S(   NR   i	   iÿÿÿÿRå   i    (   RI   Rñ  R¶   R¸   R  R  Ré   Rê   (   R=   Rï  Ró  Ré   (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyRë  U  s
    % c         C   sˆ   t  d ƒ j t |  j ƒ  ƒ d ƒ } | rh | j d t |  j j ƒ  ƒ d t t |  d ƒ j	 ƒ  ƒ ƒ n  d d  l
 } | j d d ƒ d  S(   NR   i	   RÜ  RÈ   iÿÿÿÿRå   i    (   RI   Rñ  R¶   R¸   R  R  RÜ  R  R…   R  Ré   Rê   (   R=   Ró  Ré   (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyR   ]  s
    % =c         C   sQ   t  d ƒ j t |  j ƒ  ƒ d ƒ } | rM | j d t |  j j ƒ  ƒ ƒ n  d  S(   NR   i	   RÜ  (   RI   Rñ  R¶   R¸   R  R  RÜ  R  (   R=   Rï  Ró  (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyRè  d  s    % c         C   s9   t  |  j ƒ  d ƒ } | r5 |  j j | j ƒ  ƒ n  d  S(   Ni	   (   RL   R¸   R�  RÉ   t	   get_label(   R=   t   dobj(    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyRØ  i  s    N(   RR   RS   RC   RÎ   RÐ   RŸ   Rx   R   Rñ   RÓ   R  Rî  Rð  Rô  Rõ  RÌ   Rë  R   Rè  RØ  (    (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyR�   ¸  sZ   







,									t   interactiveSuperposeMatchc           B   sY   e  Z d  d d d g Z d d d d g Z d d d d g Z d „  Z d	 „  Z d
 „  Z RS(   R·  s   Residue rangeRµ  R¶  R¾  Rƒ  t   atomt   monomerc         C   sS  t  j j |  | ƒ t  j ƒ  } | j d d d d ƒ | j d ƒ t  j |  ƒ } | j d ƒ x t j	 D] } | j
 | ƒ qh W| j d ƒ |  j | t j d ƒ |  j ƒ | j | ƒ t j |  |  j ƒ  j d ƒ } | j d ƒ | j d ƒ | j | ƒ t j |  |  j ƒ  j d ƒ } | j d	 ƒ | j d
 ƒ | j | ƒ |  j | ƒ d  S(   Ni    Rà   s   Limit superposition to atomss   currentIndexChanged(int)R¾  t   fixed_selection_commands)   Select residue(s) or atoms in fixed modelRƒ  t   moving_selection_commands*   Select residue(s) or atoms in moving model(   R   Rt   R   R|   R   R   R�   R0   Rø  t	   mode_menuR”   R�   R2   R    R3   t   handleChangeModeR   R†   t   mgAtomPickerR>   t   fixed_MolData_nameR3  R6   (   R=   R>   R@   R«   Rª   (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyR   {  s(    c         C   sR   |  j  t j d ƒ j d ƒ |  j  t j d ƒ j ƒ  |  j  t j d ƒ j ƒ  d  S(   NRà   i    Rû  Rü  (   R£   R   R�   Rü   R†   Rÿ  RÁ   (   R=   (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyt
   setDefault›  s    c         C   sI   t  j | } |  j t j d ƒ j | ƒ |  j t j d ƒ j | ƒ d  S(   NRû  Rü  (   Rø  t   picker_modeR£   R†   Rÿ  t   setMode(   R=   t   imodeRà   (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyRþ  ¢  s    (   RR   RS   Rý  t
   mode_aliasR  R   R  Rþ  (    (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyRø  r  s   	 	t   interactiveSuperposeGuic           B   s   e  Z d  „  Z RS(   c         C   s…   t  j j |  | ƒ | |  _ | |  _ t  j ƒ  } t j |  t d d d d d d d d d d ƒ|  _	 | j
 |  j	 ƒ |  j | ƒ d  S(   Nt   nLinesi   t   ifApplyt
   ifEditablet   ifClearR8   i    (   R   t   QFrameR   R3  R   R   R†   t   extendingFrameRø  t   exframeR   R6   (   R=   R>   R3  R   R@   (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyR   °  s    		$(   RR   RS   R   (    (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyR  «  s   R¡   c        	   B   sj  e  Z d  d d d d d d d d g	 Z d  d	 d
 d d d d d d g	 Z d  d d d d d d d d g	 Z d* d d d d „ Z d „  Z d d „ Z d „  Z	 d „  Z
 d „  Z d „  Z d „  Z d „  Z d „  Z d d „ Z d „  Z d d „ Z d „  Z d d „ Z d  „  Z d! „  Z i  d" „ Z d# „  Z d$ „  Z d d% „ Z d& „  Z d' „  Z d( „  Z d) „  Z RS(+   Rù  t   sidet   mainR¾  Rƒ  t   range_same_seqidRú  RÈ   t   selection_closes
   side chains
   main chains   residue ranges   range with same seq ids   close atoms in selectionR]   iÿÿÿÿc         C   s�  t  j j |  | ƒ | |  _ | |  _ d |  _ d  |  _ d |  _ t  j	 |  ƒ } | j
 d ƒ | j d d d d ƒ t  j |  ƒ |  _ |  j j t  j d d ƒ ƒ |  j j d ƒ |  j j t  j j ƒ t  j d |  ƒ } |  j | t j d ƒ |  j ƒ t  j d	 |  ƒ } |  j | t j d ƒ |  j ƒ t  j d
 |  ƒ } |  j | t j d ƒ |  j ƒ t  j d |  ƒ }	 |  j |	 t j d ƒ |  j ƒ t  j d |  ƒ }
 |  j |
 t j d ƒ t j |  j d ƒ ƒ t  j	 ƒ  } | j |  j d d d d ƒ | j | d d ƒ | j | d d ƒ | j | d d ƒ | j |	 d d ƒ | j |
 d d ƒ | j | d d ƒ t  j  ƒ  } t  j! ƒ  } t  j" d |  ƒ |  _# | j |  j# ƒ t  j$ |  ƒ |  _% x! t& j' D] } |  j% j( | ƒ qºW|  j% j d ƒ | j |  j% ƒ | j) d ƒ t  j* d ƒ |  _+ | j |  j+ ƒ | j | ƒ t  j* |  j, d ƒ ƒ } t  j* |  j, d ƒ ƒ } t  j! ƒ  } | j | ƒ | j | ƒ t  j! ƒ  |  _- t. j/ d |  j d d ƒ |  _0 t1 |  j ƒ j2 } t. j3 |  | d d d d g ƒ|  _4 |  j4 j5 ƒ  |  j- j |  j0 ƒ | j |  j- ƒ t  j! ƒ  } | j | ƒ | j | ƒ t  j! ƒ  |  _6 t. j/ d |  j d d ƒ |  _7 |  j6 j |  j7 ƒ t1 |  j ƒ j2 } t. j3 |  | d d d d g ƒ|  _8 |  j8 j5 ƒ  | j |  j6 ƒ | j | d d ƒ |  j9 t& j: j; d ƒ ƒ |  j |  j% t j d ƒ |  j9 ƒ |  j< ƒ  |  j j= ƒ  d k rO|  j> d ƒ n
 |  j ƒ  |  j |  j t j d ƒ |  j? ƒ |  j |  j t j d ƒ |  j@ ƒ |  j |  j t j d  ƒ |  jA ƒ |  j |  j% t j d ƒ |  jB ƒ |  j |  j0 t j d! ƒ |  jB ƒ |  j |  j4 t j d" ƒ |  jB ƒ |  j |  j# t j d# ƒ |  jC ƒ |  j |  j7 t j d! ƒ |  jB ƒ |  j |  j8 t j d" ƒ |  jB ƒ d  S($   Niÿÿÿÿi    i   t   Courieri   sL   List of matching atoms/residues/monomers
double click line to toggle onn/offs   Create new matchs	   clicked()s   Copy matches from..s   Delete selected matchs   Delete all matchess   Delete incomplete matchesi   i   i   i   s   Use match of mode s   Choose a match modeR8  s   Fixed models   Moving modelR3  t   blankRã  Rå  Rä  R±   Rƒ  s   currentIndexChanged(int)s#   itemDoubleClicked(QListWidgetItem*)s   itemClicked(QListWidgetItem*)s)   customContextMenuRequested(const QPoint&)t   AtomChangedRç  s   clicked(bool)(D   R   R  R   R   R3  t   matchIdRx   t   copyMatchGuit   signalsBlockedRz   R   R   t   QListWidgett   selectMatchR~  t   QFontR�   t   setSelectionModet   QAbstractItemViewt   SingleSelectiont   QPushButtonR2   R    R3   t	   handleNewt   copyMatchest   deleteMatcht	   deleteAllR‚   Rƒ   R   R5   R   R|   RŠ   t
   onCheckBoxR�   t	   modeComboR¡   Rý  R”   R�   R„   t   rmsLabelt   trt   fixedLayoutR†   Rÿ  t   fixedAtomPickerRL   Rê  Ré  t   fixedSelectionComboR‘   t   movingLayoutt   movingAtomPickert   movingSelectionComboRþ  R  Rþ   RÍ  RÖ   RÎ  t   changeMatchOnt   changeMatchIdt   selectMatchMenut   Applyt   clickedMatchOn(   R=   R>   R   R3  R  R@   t
   new_buttont   copy_buttont   delete_buttont   delete_all_buttont   delete_unmatched_buttont
   editLayoutt   pickerLayoutt   line_layoutRª   t
   fixedLabelt   movingLabelt   abstractModel(    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyR   Æ  s¦    					+$$"


"""""""c         C   s   d  S(   N(    (   R=   R?  (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyR/  H  s    c         C   s  |  j  d ƒ | d k  r2 t j |  j j ƒ  } n t j | } |  j j | ƒ d d g j | ƒ rŸ |  j |  j |  j	 |  j
 ƒ |  j |  j |  j |  j ƒ nm |  j |  j |  j
 |  j	 ƒ |  j |  j |  j |  j ƒ | d k rì d } n  |  j
 j | ƒ |  j j | ƒ |  j  d ƒ d  S(   Ni   i    RÈ   R  R  Rƒ  (   t   blockWidgetSignalsR¡   R  R$  R  Rü   RÖ   t   toggleSeleWidgetR'  R)  R(  R*  R,  R+  R  (   R=   R  Rà   (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyRþ  L  s     	c         C   s2   | j  ƒ  | j ƒ  | j | ƒ | j | ƒ d  S(   N(   R×   R‘   RØ   R   (   R=   R@   t	   on_widgett
   off_widget(    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyR>  _  s    

c         C   s#   |  j  j | ƒ } |  j | ƒ d  S(   N(   R  RÌ   RÎ  (   R=   t   listItemRÌ   (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyR.  e  s    c         C   s˜   |  j  j | ƒ } t d ƒ j |  j | ƒ } | s7 d  S| j ƒ  j d d ƒ } | d k r” | j i d | d 6ƒ |  j | d | ƒ |  j	 ƒ  n  d  S(   NR   RÜ  iÿÿÿÿi    i   (
   R  RÌ   RI   t   GetSuperposeModelMatchR3  R   RÑ   R  t   recolourRowt   updateDisplay(   R=   RA  RÌ   t   matchObjectRÜ  (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyR-  i  s     c         C   sx   |  j  ƒ  } t d ƒ j |  j | ƒ } | s1 d  St |  j j ƒ  ƒ } | j i | d 6ƒ |  j | | ƒ |  j	 ƒ  d  S(   NR   RÜ  (
   t
   getMatchIdRI   RB  R3  R  R#  R  R  RC  RD  (   R=   t   statusRÌ   RE  RÜ  (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyR1  u  s     c         C   sd   |  j  j | ƒ j ƒ  } | r4 | j t j j ƒ n | j t j j ƒ |  j  j | ƒ j | ƒ d  S(   N(	   R  Rª   t
   foregroundt   setColorR    R"   t   blackt	   lightGrayt   setForeground(   R=   RÌ   RÜ  t   brush(    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyRC  €  s
    c         C   sL   t  d ƒ j |  j ƒ } | j ƒ  } |  j | ƒ |  j ƒ  |  j | ƒ d  S(   NR   (   RI   Rñ  R3  t	   new_matchRÎ  RÍ  t   setRow(   R=   RJ   t   newId(    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyR  Š  s
    
c         C   s�   t  d ƒ j |  j ƒ } |  j ƒ  } t  d ƒ j |  j | ƒ } | r‹ | j |  j ƒ  ƒ |  j | ƒ |  j t	 j
 d ƒ ƒ |  j | ƒ n  d  S(   NR   t   matchesChanged(   RI   Rñ  R3  RF  RB  R  Rî  RÍ  R)  R    R3   RD  (   R=   RJ   t   saveIdRE  (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyR0  ›  s    c         C   sB   t  d ƒ j |  j ƒ } | r> | j | ƒ d | _ t ƒ  n  d  S(   NR   i   (   RI   Rñ  R3  t   update_Connectivity2t	   do_redrawt   UPDATEDISPLAY(   R=   RR  RJ   (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyRD  ®  s
    	c         C   s   t  ƒ  j d ƒ d  S(   Ns   superpose.html(   Rí   Rî   (   R=   (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyR   ¶  s    c         C   s,  t  d ƒ j |  j ƒ } | r| j | ƒ } | d k  rÍ |  j j ƒ  d } xÉ | D]s \ } } |  j j | ƒ | d } | sS |  j j | ƒ j ƒ  } | j	 t
 j j ƒ |  j j | ƒ j | ƒ qS qS Wqt | ƒ d k r| |  j j ƒ  k  r|  j j | ƒ j | d d ƒ qn  |  j j ƒ  d  S(   NR   i    iÿÿÿÿi   (   RI   Rñ  R3  t   get_match_menuR  RÁ   R”   Rª   RH  RI  R    R"   RK  RL  t   lenRÖ   RÉ   Rs   (   R=   t   iMatchRJ   t
   match_listRÌ   t   activeRC   RM  (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyRÍ  »  s     
#''c         C   sœ   |  j  j ƒ  } | d k r˜ | |  j  j ƒ  k  r˜ t d ƒ j |  j ƒ } | r^ | j | ƒ n  |  j ƒ  |  j | ƒ |  j	 ƒ  |  j
 t j d ƒ ƒ n  d  S(   Ni    R   RQ  (   R  t
   currentRowRÖ   RI   Rñ  R3  t   delete_matchRÍ  RÎ  RD  R)  R    R3   (   R=   t   iVRJ   (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyR!  Ô  s    !

i    c         C   s¦   t  d ƒ j |  j ƒ } | r+ | j ƒ  n
 | j ƒ  | j ƒ  |  j ƒ  |  j j ƒ  d k rk |  j	 ƒ  n |  j
 d ƒ |  j ƒ  |  j ƒ  |  j t j d ƒ ƒ d  S(   NR   i    iÿÿÿÿRQ  (   RI   Rñ  R3  RÉ  RÊ  RS  RÍ  R  RÖ   R  RÎ  RD  RÁ   R)  R    R3   (   R=   t	   unmatchedRJ   (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyR"  à  s    




c         C   sb   |  j  d ƒ |  j j ƒ  |  j j ƒ  |  j j ƒ  |  j j ƒ  |  j j d ƒ |  j  d ƒ d  S(   Ni   i    (	   R=  R)  RÁ   R,  R(  t   resetR+  R#  R¤   (   R=   (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyRÁ   ò  s    c         C   s¥   | r |  j  d |  _  n |  j  d |  _  |  j  r; t } n t } |  j j | ƒ |  j j | ƒ |  j j | ƒ |  j j | ƒ |  j j | ƒ |  j	 j | ƒ d  S(   Ni   (
   R  R  R  R)  t   blockSignalsR,  R(  R+  R$  R#  (   R=   Rà   R  (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyR=  û  s    		c         K   sQ  i  } d d  l  } | j | j j ƒ | j | ƒ | j | ƒ t j j | j d d ƒ ƒ } |  j d ƒ |  j	 j
 | ƒ |  j j | j d d ƒ ƒ |  j ƒ  d d g j | j d d ƒ ƒ r|  j j d | j d d	 ƒ ƒ |  j j d | j d
 d	 ƒ ƒ n> |  j j d | j d d	 ƒ ƒ |  j j d | j d
 d	 ƒ ƒ |  j d ƒ d  S(   NiÿÿÿÿRà   Rƒ  i   RÜ  RÈ   R  t   sele1R]   t   sele2t   atomNamei    (   R   Rs   t   SuperposeMatcht
   initialiseR¡   R  Rþ   RÑ   R=  R$  Rü   R#  R¤   Rþ  RÖ   R)  R  R,  R(  t   setSelectionR+  (   R=   R  RÂ  t   parsR   R  (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyR    s     
!"c         C   s±   d d  l  } t j |  j j ƒ  } t |  j j ƒ  ƒ } d d g j | ƒ rm |  j	 j
 ƒ  } |  j j
 ƒ  } n |  j j ƒ  } |  j j ƒ  } i | d 6| d 6| d 6| d 6} | S(   NiÿÿÿÿRÈ   R  Rà   RÜ  Ra  Rb  (   R   R¡   R  R$  R  R  R#  R  RÖ   R)  R  R,  R(  RÈ   R+  (   R=   R   Rà   RÜ  Ra  Rb  Rg  (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyRî  #  s    

c         C   s   |  j  S(   N(   R  (   R=   (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyRF  6  s    c         C   sˆ   | d k  s! | |  j  j ƒ  k r7 |  j  j ƒ  d } n  |  j | ƒ t d ƒ j |  j | ƒ } | |  _ | r„ |  j | j ƒ  ƒ n  d  S(   Ni    i   R   (	   R  RÖ   RO  RI   RB  R3  R  R  R   (   R=   t   vidt   supModelMatch(    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyRÎ  9  s    !	 c         C   sM   | |  j  j ƒ  k r d  S|  j  j t ƒ |  j  j | ƒ |  j  j t ƒ d  S(   N(   R  R[  R`  R  t   setCurrentRowR  (   R=   t   irow(    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyRO  B  s
     c         C   sÊ  |  j  s¹t j |  ƒ |  _  |  j  j d ƒ t j ƒ  } | j t j d |  ƒ d d d d ƒ | j t j d |  ƒ d d ƒ t j d |  d d	 ƒ |  _	 | j |  j	 d d ƒ |  j	 j
 |  j ƒ | j t j d
 |  ƒ d d ƒ t j d |  d d	 ƒ |  _ | j |  j d d ƒ |  j j
 |  j ƒ t j ƒ  } | j t j j ƒ } | j t j j ƒ } |  j | t j d ƒ |  j  j ƒ |  j | t j d ƒ |  j ƒ | j | ƒ |  j  j | ƒ n  |  j  j ƒ  d  S(   Ns   Superpose: Copy Matchess   Copy matches fromi    i   i   s   Fixed modelR>   R[   R\   s   Moving models	   clicked()(   R  R   t   QDialogR   Rz   R   R„   R†   R‡   t   copyMatchFixedRˆ   R   t   copyMatchMovingR3  R$   R/   R0  t   CancelR2   R    R3   R   t   handleCopyMatchesR6   R×   (   R=   R@   t   dialog_buttonst   apply_buttont   cancel_button(    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyR   I  s*    	%"c         C   s%  |  j  j ƒ  j } |  j j ƒ  j } | | k sN | |  j k rp | |  j k rp t j j d  |  j
 j ƒ  d ƒ n± t ƒ  j d | d d d | ƒ \ } } | sÃ | j | ƒ sÃ t | | ƒ d k rå t j j d  |  j
 j ƒ  d ƒ n< t d ƒ j |  j ƒ } | r!| j | | ƒ |  j ƒ  n  d  S(	   Ns,   Invalid choice of models for copying matchest   setR¤  t   superpose_matchesRì  i    s+   There are no saved matches for these modelsR   (   Rm  R	  RB   Rn  R   R3  R   R"  R*  Rx   R  R+  t	   MODELINFOt   get_infoR/  RW  RI   Rñ  t   set_matchesRÍ  (   R=   RX   R0  RG  R¤  RJ   (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyRp  a  s    *"',"c         C   s6   t  d ƒ j j |  j ƒ } |  j j d | j ƒ d  S(   NR   s   Last superposition RMS (   RI   RJ   RÑ   R3  R%  RÉ   t   last_rms(   R=   RJ   (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyR(  t  s    N(   RR   RS   R  Rý  R  Rx   R   R/  Rþ  R>  R.  R-  R1  RC  R  R0  RD  R   RÍ  R!  R"  RÁ   R=  R  Rî  RF  RÎ  RO  R   Rp  R(  (    (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyR¡   ¾  s8   !!!‚						
													(   t   __doc__t   PyQt4R    R   R   R¼   R   R†   R‚   t   global_definitionsR   Rt   R   R�   Rø  R  R  R¡   (    (    (    s?   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/superposeGui.pyt   <module>   s   $
Qÿ ÿ ÿ ÿ Kº9