Seeker.cpp (pymol-v1.8.6.0.tar.bz2) | : | Seeker.cpp (pymol-v2.1.0.tar.bz2) | ||
---|---|---|---|---|
skipping to change at line 350 | skipping to change at line 350 | |||
int logging = SettingGetGlobal_i(G, cSetting_logging); | int logging = SettingGetGlobal_i(G, cSetting_logging); | |||
int continuation = false; | int continuation = false; | |||
if((row_num < 0) || (col_num < 0)) { | if((row_num < 0) || (col_num < 0)) { | |||
switch (button) { | switch (button) { | |||
case P_GLUT_LEFT_BUTTON: | case P_GLUT_LEFT_BUTTON: | |||
if((UtilGetSeconds(G) - I->LastClickTime) < cDoubleTime) { | if((UtilGetSeconds(G) - I->LastClickTime) < cDoubleTime) { | |||
OrthoLineType buf2; | OrthoLineType buf2; | |||
char name[WordLength]; | char name[WordLength]; | |||
if(ExecutiveGetActiveSeleName(G, name, false, false)) { | if(ExecutiveGetActiveSeleName(G, name, false, false)) { | |||
SelectorCreate(G, name, "none", NULL, true, NULL); | SelectorCreate(G, name, "none", NULL, true, NULL); | |||
if(SettingGetGlobal_i(G, cSetting_logging)) { | if(logging) { | |||
sprintf(buf2, "cmd.select('%s','none', enable=1)", name); | sprintf(buf2, "cmd.select('%s','none', enable=1)", name); | |||
PLog(G, buf2, cPLog_no_flush); | PLog(G, buf2, cPLog_no_flush); | |||
} | } | |||
SeqDirty(G); | SeqDirty(G); | |||
} | } | |||
} | } | |||
I->LastClickTime = UtilGetSeconds(G); | I->LastClickTime = UtilGetSeconds(G); | |||
break; | break; | |||
} | } | |||
} else { | } else { | |||
skipping to change at line 442 | skipping to change at line 442 | |||
} | } | |||
break; | break; | |||
case P_GLUT_LEFT_BUTTON: | case P_GLUT_LEFT_BUTTON: | |||
if(!col->spacer) { | if(!col->spacer) { | |||
int start_over = false; | int start_over = false; | |||
int center = 0; | int center = 0; | |||
ObjectMolecule *obj; | ObjectMolecule *obj; | |||
if(mod & cOrthoCTRL) { | if(mod & cOrthoCTRL) { | |||
center = 2; | center = 2; | |||
} | } | |||
if(!continuation) { | int codes = SettingGet_i(G, row->obj->Obj.Setting, NULL, cSetting_seq_vi | |||
I->drag_start_col = col_num; | ew_format); | |||
I->drag_last_col = col_num; | if(row->obj->DiscreteFlag && SettingGet_b(G, | |||
I->drag_row = row_num; | row->obj->Obj.Setting, | |||
I->drag_dir = 0; | NULL, cSetting_seq_view_discrete_by_s | |||
I->drag_start_toggle = true; | tate)) | |||
} else { | codes = 4; | |||
int tmp; | if (codes != 4 || row->obj->DiscreteFlag) { // keep only non-discrete st | |||
if(((col_num < I->drag_start_col) && (I->drag_last_col > I->drag_start | ates selectable | |||
_col)) || | if(!continuation) { | |||
((col_num > I->drag_start_col) && (I->drag_last_col < I->drag_start | I->drag_start_col = col_num; | |||
_col))) { | I->drag_last_col = col_num; | |||
tmp = I->drag_last_col; | I->drag_row = row_num; | |||
I->drag_last_col = I->drag_start_col; | I->drag_dir = 0; | |||
I->drag_start_col = tmp; | I->drag_start_toggle = true; | |||
I->drag_dir = -I->drag_dir; | } else { | |||
int tmp; | ||||
if(((col_num < I->drag_start_col) && (I->drag_last_col > I->drag_sta | ||||
rt_col)) || | ||||
((col_num > I->drag_start_col) && (I->drag_last_col < I->drag_sta | ||||
rt_col))) { | ||||
tmp = I->drag_last_col; | ||||
I->drag_last_col = I->drag_start_col; | ||||
I->drag_start_col = tmp; | ||||
I->drag_dir = -I->drag_dir; | ||||
} | ||||
} | } | |||
} | I->dragging = true; | |||
I->dragging = true; | ||||
I->handler.box_active = true; | I->handler.box_active = true; | |||
if(continuation) { | if(continuation) { | |||
SeekerDrag(G, rowVLA, row_num, col_num, mod); | SeekerDrag(G, rowVLA, row_num, col_num, mod); | |||
} else { | ||||
if(col->inverse && !start_over) { | ||||
SeekerSelectionToggle(G, rowVLA, row_num, col_num, false, false); | ||||
I->drag_setting = false; | ||||
} else { | } else { | |||
SeekerSelectionToggle(G, rowVLA, row_num, col_num, true, start_over) | if(col->inverse && !start_over) { | |||
; | SeekerSelectionToggle(G, rowVLA, row_num, col_num, false, false); | |||
I->drag_setting = true; | I->drag_setting = false; | |||
} else { | ||||
SeekerSelectionToggle(G, rowVLA, row_num, col_num, true, start_ove | ||||
r); | ||||
I->drag_setting = true; | ||||
} | ||||
} | } | |||
} | } | |||
if(center) | if(center) | |||
SeekerSelectionCenter(G, 2); | SeekerSelectionCenter(G, 2); | |||
if(col->state && (obj = ExecutiveFindObjectMoleculeByName(G, row->name)) ) { | if(col->state && (obj = ExecutiveFindObjectMoleculeByName(G, row->name)) ) { | |||
SettingSetSmart_i(G, obj->Obj.Setting, NULL, cSetting_state, col->stat e); | SettingSetSmart_i(G, obj->Obj.Setting, NULL, cSetting_state, col->stat e); | |||
SceneChanged(G); | SceneChanged(G); | |||
} | } | |||
} | } | |||
break; | break; | |||
} | } | |||
skipping to change at line 509 | skipping to change at line 517 | |||
sele = SelectorIndexByName(G, "_seeker_hilight"); | sele = SelectorIndexByName(G, "_seeker_hilight"); | |||
for(b = 0; b < nRow; b++) { | for(b = 0; b < nRow; b++) { | |||
row = rowVLA + b; | row = rowVLA + b; | |||
if((obj = ExecutiveFindObjectMoleculeByName(G, row->name))) { | if((obj = ExecutiveFindObjectMoleculeByName(G, row->name))) { | |||
int a; | int a; | |||
AtomInfoType *atInfo = obj->AtomInfo; | AtomInfoType *atInfo = obj->AtomInfo; | |||
int at; | int at; | |||
int selected; | int selected; | |||
int not_selected; | ||||
if(sele < 0) { | if(sele < 0) { | |||
for(a = 0; a < row->nCol; a++) { | for(a = 0; a < row->nCol; a++) { | |||
col = row->col + a; | col = row->col + a; | |||
col->inverse = false; | col->inverse = false; | |||
} | } | |||
} else { | } else { | |||
for(a = 0; a < row->nCol; a++) { | for(a = 0; a < row->nCol; a++) { | |||
col = row->col + a; | col = row->col + a; | |||
if(!col->spacer) { | if(!col->spacer) { | |||
selected = false; | selected = false; | |||
atom_list = row->atom_lists + col->atom_at; | atom_list = row->atom_lists + col->atom_at; | |||
not_selected = true; | ||||
while((at = (*atom_list)) >= 0) { | while((at = (*atom_list)) >= 0) { | |||
atom_list++; | atom_list++; | |||
if(SelectorIsMember(G, atInfo[at].selEntry, sele)) { | if(SelectorIsMember(G, atInfo[at].selEntry, sele)) { | |||
selected = true; | selected = true; | |||
} else { | ||||
not_selected = true; | ||||
} | } | |||
} | } | |||
if(selected) | if(selected) | |||
col->inverse = true; | col->inverse = true; | |||
else | else | |||
col->inverse = false; | col->inverse = false; | |||
} else | } else | |||
col->inverse = false; | col->inverse = false; | |||
} | } | |||
skipping to change at line 853 | skipping to change at line 857 | |||
} | } | |||
break; | break; | |||
case 'M': | case 'M': | |||
switch (abbr[1]) { | switch (abbr[1]) { | |||
case 'E': | case 'E': | |||
switch (abbr[2]) { | switch (abbr[2]) { | |||
case 'T': | case 'T': | |||
return 'M'; | return 'M'; | |||
break; | break; | |||
} | } | |||
break; | ||||
case 'S': | ||||
switch (abbr[2]) { | ||||
case 'E': // MSE (SELENOMETHIONINE) | ||||
return 'M'; | ||||
} | ||||
} | } | |||
break; | break; | |||
case 'P': | case 'P': | |||
switch (abbr[1]) { | switch (abbr[1]) { | |||
case 'H': | case 'H': | |||
switch (abbr[2]) { | switch (abbr[2]) { | |||
case 'E': | case 'E': | |||
return 'F'; | return 'F'; | |||
break; | break; | |||
} | } | |||
skipping to change at line 880 | skipping to change at line 890 | |||
break; | break; | |||
} | } | |||
break; | break; | |||
case 'S': | case 'S': | |||
switch (abbr[1]) { | switch (abbr[1]) { | |||
case 'E': | case 'E': | |||
switch (abbr[2]) { | switch (abbr[2]) { | |||
case 'R': | case 'R': | |||
return 'S'; | return 'S'; | |||
break; | break; | |||
case 'C': // SEC (SELENOCYSTEINE) | ||||
return 'U'; | ||||
break; | ||||
} | } | |||
break; | break; | |||
case 'O': /* SOL -- gromacs solvent residue */ | case 'O': /* SOL -- gromacs solvent residue */ | |||
switch (abbr[2]) { | switch (abbr[2]) { | |||
case 'L': | case 'L': | |||
return water; | return water; | |||
break; | break; | |||
} | } | |||
break; | break; | |||
} | } | |||
skipping to change at line 1446 | skipping to change at line 1459 | |||
last = ai; | last = ai; | |||
VLACheck(row->col, CSeqCol, nCol); | VLACheck(row->col, CSeqCol, nCol); | |||
r1 = row->col + nCol; | r1 = row->col + nCol; | |||
r1->start = row->len; | r1->start = row->len; | |||
if(obj->DiscreteFlag) | if(obj->DiscreteFlag) | |||
r1->state = ai->discrete_state; | r1->state = ai->discrete_state; | |||
first_atom_in_label = true; | first_atom_in_label = true; | |||
abbr[0] = SeekerGetAbbr(G, LexStr(G, ai->resn), 'O', 0); | // single letter codes for polymer/solvent | |||
if (!(ai->flags & (cAtomFlag_organic | cAtomFlag_inorganic))) { | ||||
abbr[0] = SeekerGetAbbr(G, LexStr(G, ai->resn), 'O', 0); | ||||
} else { | ||||
abbr[0] = 0; | ||||
} | ||||
r1->hint_no_space = last_abbr || last_spacer; | r1->hint_no_space = last_abbr || last_spacer; | |||
if(!abbr[0]) { | if(!abbr[0]) { | |||
if(last_abbr) { | if(last_abbr) { | |||
UtilConcatVLA(&row->txt, &row->len, " "); | UtilConcatVLA(&row->txt, &row->len, " "); | |||
r1->start = row->len; | r1->start = row->len; | |||
} | } | |||
if(ai->resn) | if(ai->resn) | |||
skipping to change at line 1573 | skipping to change at line 1591 | |||
} else { | } else { | |||
r1->tag = 0; | r1->tag = 0; | |||
} | } | |||
UtilConcatVLA(&row->txt, &row->len, " "); | UtilConcatVLA(&row->txt, &row->len, " "); | |||
nCol++; | nCol++; | |||
} | } | |||
break; | break; | |||
case 4: /* state names */ | case 4: /* state names */ | |||
if(obj->DiscreteFlag) { | if(obj->DiscreteFlag) { | |||
CoordSet *cs; | CoordSet *cs; | |||
WordType buf1; | ||||
if((cs = obj->DiscreteCSet[a]) != last_disc) { | if((cs = obj->DiscreteCSet[a]) != last_disc) { | |||
last_disc = cs; | last_disc = cs; | |||
if(cs) { | if(cs) { | |||
default_color = SettingGet_i(G, cs->Setting, obj->Obj.Setting, | default_color = SettingGet_i(G, cs->Setting, obj->Obj.Setting, | |||
cSetting_seq_view_color); | cSetting_seq_view_color); | |||
VLACheck(row->col, CSeqCol, nCol); | VLACheck(row->col, CSeqCol, nCol); | |||
r1 = row->col + nCol; | r1 = row->col + nCol; | |||
r1->start = row->len; | r1->start = row->len; | |||
r1->color = default_color; | r1->color = default_color; | |||
first_atom_in_label = true; | first_atom_in_label = true; | |||
if(cs->Name[0]) | if(cs->Name[0]) | |||
UtilConcatVLA(&row->txt, &row->len, cs->Name); | UtilConcatVLA(&row->txt, &row->len, cs->Name); | |||
else | else { | |||
UtilConcatVLA(&row->txt, &row->len, "''"); | sprintf(buf1, "%d", ai->discrete_state); | |||
UtilConcatVLA(&row->txt, &row->len, buf1); | ||||
} | ||||
r1->stop = row->len; | r1->stop = row->len; | |||
r1->state = ai->discrete_state; | r1->state = ai->discrete_state; | |||
UtilConcatVLA(&row->txt, &row->len, " "); | UtilConcatVLA(&row->txt, &row->len, " "); | |||
nCol++; | nCol++; | |||
} | } | |||
} | } | |||
} else { | } else { | |||
/* non-discrete objects simply get their states enumerated | /* non-discrete objects simply get their states enumerated | |||
without selections */ | without selections */ | |||
End of changes. 15 change blocks. | ||||
37 lines changed or deleted | 60 lines changed or added |