"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "layer2/GadgetSet.cpp" between
pymol-v1.8.6.0.tar.bz2 and pymol-v2.1.0.tar.bz2

About: PyMOL is a Python-enhanced molecular graphics tool. It excels at 3D visualization of proteins, small molecules, density, surfaces, and trajectories. It also includes molecular editing, ray tracing, and movies. Open Source version.

GadgetSet.cpp  (pymol-v1.8.6.0.tar.bz2):GadgetSet.cpp  (pymol-v2.1.0.tar.bz2)
skipping to change at line 45 skipping to change at line 45
void GadgetSetStrip(GadgetSet * I); void GadgetSetStrip(GadgetSet * I);
int GadgetSetGetVertex(GadgetSet * I, int index, int base, float *v) int GadgetSetGetVertex(GadgetSet * I, int index, int base, float *v)
{ {
int ok = true; int ok = true;
float *v0, *v1; float *v0, *v1;
if(index < I->NCoord) { if(index < I->NCoord) {
v0 = I->Coord + 3 * index; v0 = I->Coord + 3 * index;
if(base < 0) { if(base < 0) {
copy3f(v0, v); copy3f(v0, v);
if(index) if(index){
add3f(I->Coord, v, v); add3f(I->Coord, v, v);
}
} else if(base < I->NCoord) { } else if(base < I->NCoord) {
v1 = I->Coord + 3 * base; v1 = I->Coord + 3 * base;
add3f(v1, v0, v); add3f(v1, v0, v);
if(index) if(index)
add3f(I->Coord, v, v); add3f(I->Coord, v, v);
} else { } else {
ok = false; ok = false;
} }
} else } else
ok = false; ok = false;
skipping to change at line 68 skipping to change at line 69
} }
int GadgetSetSetVertex(GadgetSet * I, int index, int base, float *v) int GadgetSetSetVertex(GadgetSet * I, int index, int base, float *v)
{ {
int ok = true; int ok = true;
float *v0, *v1; float *v0, *v1;
if(index < I->NCoord) { if(index < I->NCoord) {
v0 = I->Coord + 3 * index; v0 = I->Coord + 3 * index;
if(base < 0) { if(base < 0) {
copy3f(v, v0); copy3f(v, v0);
if(index) if(index){
subtract3f(v0, I->Coord, v0); subtract3f(v0, I->Coord, v0);
}
} else if(base < I->NCoord) { } else if(base < I->NCoord) {
v1 = I->Coord + 3 * base; v1 = I->Coord + 3 * base;
subtract3f(v, v1, v0); subtract3f(v, v1, v0);
if(index) if(index)
subtract3f(v0, I->Coord, v0); subtract3f(v0, I->Coord, v0);
} else { } else {
ok = false; ok = false;
} }
} else } else
ok = false; ok = false;
return (ok); return (ok);
} }
int GadgetSetFromPyList(PyMOLGlobals * G, PyObject * list, GadgetSet ** gs, int version) int GadgetSetFromPyList(PyMOLGlobals * G, PyObject * list, GadgetSet ** gs, int version)
{ {
#ifdef _PYMOL_NOPY
return 0;
#else
int ok = true; int ok = true;
int ll; int ll;
GadgetSet *I = NULL; GadgetSet *I = NULL;
PyObject *tmp = NULL; PyObject *tmp = NULL;
if(*gs) { if(*gs) {
(*gs)->fFree(); (*gs)->fFree();
*gs = NULL; *gs = NULL;
} }
skipping to change at line 155 skipping to change at line 153
if(!ok) { if(!ok) {
if(I) if(I)
I->fFree(); I->fFree();
} else { } else {
*gs = I; *gs = I;
} }
} }
return (ok); return (ok);
#endif
} }
PyObject *GadgetSetAsPyList(GadgetSet * I, bool incl_cgos) PyObject *GadgetSetAsPyList(GadgetSet * I, bool incl_cgos)
{ {
#ifdef _PYMOL_NOPY
return NULL;
#else
PyObject *result = NULL; PyObject *result = NULL;
if(I) { if(I) {
result = PyList_New(8); result = PyList_New(8);
PyList_SetItem(result, 0, PyInt_FromLong(I->NCoord)); PyList_SetItem(result, 0, PyInt_FromLong(I->NCoord));
if(I->NCoord) { if(I->NCoord) {
PyList_SetItem(result, 1, PConvFloatArrayToPyList(I->Coord, I->NCoord * 3) ); PyList_SetItem(result, 1, PConvFloatArrayToPyList(I->Coord, I->NCoord * 3) );
} else { } else {
skipping to change at line 206 skipping to change at line 200
} }
if(incl_cgos && I->PickShapeCGO) { if(incl_cgos && I->PickShapeCGO) {
PyList_SetItem(result, 7, CGOAsPyList(I->PickShapeCGO)); PyList_SetItem(result, 7, CGOAsPyList(I->PickShapeCGO));
} else { } else {
PyList_SetItem(result, 7, PConvAutoNone(NULL)); PyList_SetItem(result, 7, PConvAutoNone(NULL));
} }
} }
return (PConvAutoNone(result)); return (PConvAutoNone(result));
#endif
} }
/*========================================================================*/ /*========================================================================*/
int GadgetSetGetExtent(GadgetSet * I, float *mn, float *mx) int GadgetSetGetExtent(GadgetSet * I, float *mn, float *mx)
{ {
float *v; float *v;
int a; int a;
v = I->Coord; v = I->Coord;
for(a = 0; a < I->NCoord; a++) { for(a = 0; a < I->NCoord; a++) {
min3f(v, mn, mn); min3f(v, mn, mn);
 End of changes. 8 change blocks. 
11 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)