ObjectAlignment.cpp (pymol-v1.8.6.0.tar.bz2) | : | ObjectAlignment.cpp (pymol-v2.1.0.tar.bz2) | ||
---|---|---|---|---|
skipping to change at line 789 | skipping to change at line 789 | |||
return (ok); | return (ok); | |||
} | } | |||
int ObjectAlignmentNewFromPyList(PyMOLGlobals * G, PyObject * list, | int ObjectAlignmentNewFromPyList(PyMOLGlobals * G, PyObject * list, | |||
ObjectAlignment ** result, int version) | ObjectAlignment ** result, int version) | |||
{ | { | |||
int ok = true; | int ok = true; | |||
ObjectAlignment *I = NULL; | ObjectAlignment *I = NULL; | |||
(*result) = NULL; | (*result) = NULL; | |||
if(ok) | if(ok) | |||
ok = (list != Py_None); | ok = (list != NULL); | |||
if(ok) | if(ok) | |||
ok = PyList_Check(list); | ok = PyList_Check(list); | |||
I = ObjectAlignmentNew(G); | I = ObjectAlignmentNew(G); | |||
if(ok) | if(ok) | |||
ok = (I != NULL); | ok = (I != NULL); | |||
if(ok) | if(ok) | |||
ok = ObjectFromPyList(G, PyList_GetItem(list, 0), &I->Obj); | ok = ObjectFromPyList(G, PyList_GetItem(list, 0), &I->Obj); | |||
if(ok) | if(ok) | |||
skipping to change at line 915 | skipping to change at line 915 | |||
if(oas->alignVLA) { | if(oas->alignVLA) { | |||
int id, b = 0, c; | int id, b = 0, c; | |||
int *vla = oas->alignVLA; | int *vla = oas->alignVLA; | |||
int n_id = VLAGetSize(vla); | int n_id = VLAGetSize(vla); | |||
float mean[3], vert[3], gvert[3]; | float mean[3], vert[3], gvert[3]; | |||
int n_coord = 0; | int n_coord = 0; | |||
int tag = SELECTOR_BASE_TAG + 1; | int tag = SELECTOR_BASE_TAG + 1; | |||
OVOneToAny *id2tag = oas->id2tag; | OVOneToAny *id2tag = oas->id2tag; | |||
CGOBegin(cgo, GL_LINES); | ||||
while(b < n_id) { | while(b < n_id) { | |||
int gvert_valid; | int gvert_valid; | |||
while((b < n_id) && (!vla[b])) | while((b < n_id) && (!vla[b])) | |||
b++; | b++; | |||
if(!(b < n_id)) | if(!(b < n_id)) | |||
break; | break; | |||
c = b; | c = b; | |||
skipping to change at line 949 | skipping to change at line 951 | |||
} | } | |||
} | } | |||
} | } | |||
if(n_coord > 2) { /* >2 points, then draw to mean or guide vertex */ | if(n_coord > 2) { /* >2 points, then draw to mean or guide vertex */ | |||
float scale = 1.0F / n_coord; | float scale = 1.0F / n_coord; | |||
scale3f(mean, scale, mean); | scale3f(mean, scale, mean); | |||
c = b; | c = b; | |||
CGOBegin(cgo, GL_LINES); | ||||
while((id = vla[c++])) { | while((id = vla[c++])) { | |||
auto eoo = ExecutiveUniqueIDAtomDictGet(G, id); | auto eoo = ExecutiveUniqueIDAtomDictGet(G, id); | |||
if (eoo) { | if (eoo) { | |||
if(ObjectMoleculeGetAtomVertex(eoo->obj, a, | if(ObjectMoleculeGetAtomVertex(eoo->obj, a, | |||
eoo->atm, vert)) { | eoo->atm, vert)) { | |||
if(gvert_valid) { | if(gvert_valid) { | |||
if(eoo->obj != guide_obj) { | if(eoo->obj != guide_obj) { | |||
CGOVertexv(cgo, gvert); | CGOVertexv(cgo, gvert); | |||
CGOVertexv(cgo, vert); | CGOVertexv(cgo, vert); | |||
} | } | |||
} else { | } else { | |||
CGOVertexv(cgo, mean); | CGOVertexv(cgo, mean); | |||
CGOVertexv(cgo, vert); | CGOVertexv(cgo, vert); | |||
} | } | |||
} | } | |||
} | } | |||
} | } | |||
CGOEnd(cgo); | ||||
} else if(n_coord) { /* if 2 points, then simply draw a line */ | } else if(n_coord) { /* if 2 points, then simply draw a line */ | |||
float first[3]; | float first[3]; | |||
int first_flag = true; | int first_flag = true; | |||
c = b; | c = b; | |||
CGOBegin(cgo, GL_LINES); | ||||
while((id = vla[c++])) { | while((id = vla[c++])) { | |||
auto eoo = ExecutiveUniqueIDAtomDictGet(G, id); | auto eoo = ExecutiveUniqueIDAtomDictGet(G, id); | |||
if (eoo) { | if (eoo) { | |||
if(ObjectMoleculeGetAtomVertex(eoo->obj, a, | if(ObjectMoleculeGetAtomVertex(eoo->obj, a, | |||
eoo->atm, vert)) { | eoo->atm, vert)) { | |||
if(first_flag) { | if(first_flag) { | |||
copy3f(vert, first); | copy3f(vert, first); | |||
first_flag = false; | first_flag = false; | |||
} else { | } else { | |||
CGOVertexv(cgo, first); | CGOVertexv(cgo, first); | |||
CGOVertexv(cgo, vert); | CGOVertexv(cgo, vert); | |||
} | } | |||
} | } | |||
} | } | |||
} | } | |||
CGOEnd(cgo); | ||||
} | } | |||
/* update the it2tag dictionary */ | /* update the it2tag dictionary */ | |||
tag++; | tag++; | |||
while((b < n_id) && vla[b]) { | while((b < n_id) && vla[b]) { | |||
OVOneToAny_SetKey(id2tag, vla[b], tag); | OVOneToAny_SetKey(id2tag, vla[b], tag); | |||
b++; | b++; | |||
} | } | |||
} | } | |||
CGOEnd(cgo); | ||||
} | } | |||
CGOStop(cgo); | CGOStop(cgo); | |||
/* simplify if necessary */ | /* simplify if necessary */ | |||
{ | { | |||
int est = CGOCheckComplex(cgo); | int est = CGOCheckComplex(cgo); | |||
{ | { | |||
CGO *convertcgo = NULL; | CGO *convertcgo = NULL; | |||
skipping to change at line 1042 | skipping to change at line 1041 | |||
if(I->SelectionState < 0) { | if(I->SelectionState < 0) { | |||
int state = -1; | int state = -1; | |||
if(I->ForceState >= 0) { | if(I->ForceState >= 0) { | |||
state = I->ForceState; | state = I->ForceState; | |||
I->ForceState = 0; | I->ForceState = 0; | |||
} | } | |||
if(state < 0) | if(state < 0) | |||
state = SettingGet_i(I->Obj.G, NULL, I->Obj.Setting, cSetting_state) - 1; | state = SettingGet_i(I->Obj.G, NULL, I->Obj.Setting, cSetting_state) - 1; | |||
if(state < 0) | if(state < 0) | |||
state = SceneGetState(G); | state = SceneGetState(G); | |||
if(state > I->NState) | if(state >= I->NState) | |||
state = I->NState - 1; | state = I->NState - 1; | |||
if(state < 0) | if(state < 0) | |||
state = 0; | state = 0; | |||
if(state < I->NState) { | if(state < I->NState) { | |||
ObjectAlignmentState *oas = I->State + state; | ObjectAlignmentState *oas = I->State + state; | |||
if(oas->id2tag) { | if(oas->id2tag) { | |||
SelectorDelete(G, I->Obj.Name); | SelectorDelete(G, I->Obj.Name); | |||
SelectorCreateFromTagDict(G, I->Obj.Name, oas->id2tag, false); | SelectorCreateFromTagDict(G, I->Obj.Name, oas->id2tag, false); | |||
I->SelectionState = state; | I->SelectionState = state; | |||
} | } | |||
End of changes. 8 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added |