"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "layer2/ObjectMap.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.

ObjectMap.cpp  (pymol-v1.8.6.0.tar.bz2):ObjectMap.cpp  (pymol-v2.1.0.tar.bz2)
skipping to change at line 1128 skipping to change at line 1128
inp += 3; inp += 3;
/* compute the effective lattice offset as a function of cell spacing */ /* compute the effective lattice offset as a function of cell spacing */
x = (ms->Div[0] * frac[0]); x = (ms->Div[0] * frac[0]);
y = (ms->Div[1] * frac[1]); y = (ms->Div[1] * frac[1]);
z = (ms->Div[2] * frac[2]); z = (ms->Div[2] * frac[2]);
/* now separate the integral and fractional parts for interpolation */ /* now separate the integral and fractional parts for interpolation */
a = (int) floor(x); a = (int) floor(x + R_SMALL8);
b = (int) floor(y); b = (int) floor(y + R_SMALL8);
c = (int) floor(z); c = (int) floor(z + R_SMALL8);
x -= a; x -= a;
y -= b; y -= b;
z -= c; z -= c;
if(flag) if(flag)
*flag = 1; *flag = 1;
/* wrap into the map */ /* wrap into the map */
if(a < ms->Min[0]) { if(a < ms->Min[0]) {
if(x < 0.99F) { if(x < 0.99F) {
skipping to change at line 1209 skipping to change at line 1209
} }
} else { } else {
while(n--) { while(n--) {
x = (inp[0] - ms->Origin[0]) / ms->Grid[0]; x = (inp[0] - ms->Origin[0]) / ms->Grid[0];
y = (inp[1] - ms->Origin[1]) / ms->Grid[1]; y = (inp[1] - ms->Origin[1]) / ms->Grid[1];
z = (inp[2] - ms->Origin[2]) / ms->Grid[2]; z = (inp[2] - ms->Origin[2]) / ms->Grid[2];
inp += 3; inp += 3;
a = (int) floor(x); a = (int) floor(x + R_SMALL8);
b = (int) floor(y); b = (int) floor(y + R_SMALL8);
c = (int) floor(z); c = (int) floor(z + R_SMALL8);
x -= a; x -= a;
y -= b; y -= b;
z -= c; z -= c;
if(flag) if(flag)
*flag = 1; *flag = 1;
if(a < ms->Min[0]) { if(a < ms->Min[0]) {
x = 0.0F; x = 0.0F;
a = ms->Min[0]; a = ms->Min[0];
ok = false; ok = false;
skipping to change at line 2463 skipping to change at line 2463
// Xo(map) = S * (Xo(atoms) - t) // Xo(map) = S * (Xo(atoms) - t)
ObjectStateSetMatrix(&ms->State, matrix); ObjectStateSetMatrix(&ms->State, matrix);
PRINTFB(I->Obj.G, FB_ObjectMap, FB_Details) PRINTFB(I->Obj.G, FB_ObjectMap, FB_Details)
" ObjectMapCCP4: Applied skew transformation\n" " ObjectMapCCP4: Applied skew transformation\n"
ENDFB(I->Obj.G); ENDFB(I->Obj.G);
} }
} }
// XORIGIN, YORIGIN, ZORIGIN (50 - 52)
// TODO See "Origin Conventions" in http://situs.biomachina.org/fmap.pdf
float * mrc2000origin = (float *)(i + 49 - 25);
if (lengthsq3f(mrc2000origin) > R_SMALL4) {
if (!quiet) {
PRINTFB(I->Obj.G, FB_ObjectMap, FB_Warnings)
" ObjectMapCCP4: MRC 2000 ORIGIN %.2f %.2f %.2f (unused)\n",
mrc2000origin[0], mrc2000origin[1], mrc2000origin[2]
ENDFB(I->Obj.G);
}
}
i += 54 - 25; i += 54 - 25;
stdev = *(float *) (i++); stdev = *(float *) (i++);
if(!quiet) { if(!quiet) {
PRINTFB(I->Obj.G, FB_ObjectMap, FB_Blather) PRINTFB(I->Obj.G, FB_ObjectMap, FB_Blather)
" ObjectMapCCP4: AMIN %f AMAX %f AMEAN %f ARMS %f\n", mind, maxd, mean, st dev ENDFB(I->Obj.G); " ObjectMapCCP4: AMIN %f AMAX %f AMEAN %f ARMS %f\n", mind, maxd, mean, st dev ENDFB(I->Obj.G);
} }
n_pts = nc * ns * nr; n_pts = nc * ns * nr;
skipping to change at line 4849 skipping to change at line 4861
p = ParseNextLine(p); p = ParseNextLine(p);
} }
if(ok && (stage == 2)) { if(ok && (stage == 2)) {
PRINTFB(I->Obj.G, FB_ObjectMap, FB_Details) PRINTFB(I->Obj.G, FB_ObjectMap, FB_Details)
" DXStrToMap: Origin %8.3f %8.3f %8.3f\n", ms->Origin[0], ms->Origin[1], " DXStrToMap: Origin %8.3f %8.3f %8.3f\n", ms->Origin[0], ms->Origin[1],
ms->Origin[2] ms->Origin[2]
ENDFB(I->Obj.G); ENDFB(I->Obj.G);
} }
float delta[9];
int delta_i = 0;
while(ok && (*p) && (stage == 2)) { while(ok && (*p) && (stage == 2)) {
pp = p; pp = p;
p = ParseNCopy(cc, p, 5); p = ParseNCopy(cc, p, 5);
if(strcmp(cc, "delta") == 0) {
p = ParseWordCopy(cc, p, 20); if(strcmp(cc, "delta") != 0) {
if(sscanf(cc, "%f", &ms->Grid[0]) == 1) { if(is_number(cc)) {
p = pp;
} else {
p = ParseNextLine(p); p = ParseNextLine(p);
p = ParseWordCopy(cc, p, 20); continue;
p = ParseWordCopy(cc, p, 20);
p = ParseWordCopy(cc, p, 20);
if(sscanf(cc, "%f", &ms->Grid[1]) == 1) {
p = ParseNextLine(p);
p = ParseWordCopy(cc, p, 20);
p = ParseWordCopy(cc, p, 20);
p = ParseWordCopy(cc, p, 20);
p = ParseWordCopy(cc, p, 20);
if(sscanf(cc, "%f", &ms->Grid[2]) == 1) {
stage = 3;
}
}
} }
} else if(is_number(cc)) { }
p = pp;
p = ParseWordCopy(cc, p, 20); if(3 != sscanf(p, " %f %f %f",
if(sscanf(cc, "%f", &ms->Grid[0]) == 1) { delta + delta_i,
p = ParseNextLine(p); delta + delta_i + 1,
p = ParseWordCopy(cc, p, 20); delta + delta_i + 2)) {
p = ParseWordCopy(cc, p, 20); // error
if(sscanf(cc, "%f", &ms->Grid[1]) == 1) { break;
p = ParseNextLine(p); }
p = ParseWordCopy(cc, p, 20);
p = ParseWordCopy(cc, p, 20); p = ParseNextLine(p);
p = ParseWordCopy(cc, p, 20); delta_i += 3;
if(sscanf(cc, "%f", &ms->Grid[2]) == 1) {
stage = 3; if (delta_i == 9) {
} stage = 3;
}
if (is_diagonalf(3, delta)) {
ms->Grid[0] = delta[0];
ms->Grid[1] = delta[4];
ms->Grid[2] = delta[8];
} else {
if(!ms->State.Matrix)
ms->State.Matrix = Alloc(double, 16);
copy33f44d(delta, ms->State.Matrix);
ms->State.Matrix[3] = ms->Origin[0];
ms->State.Matrix[7] = ms->Origin[1];
ms->State.Matrix[11] = ms->Origin[2];
ones3f(ms->Grid);
zero3f(ms->Origin);
} }
} }
} }
if(ok && (stage == 3)) { if(ok && (stage == 3)) {
PRINTFB(I->Obj.G, FB_ObjectMap, FB_Details) PRINTFB(I->Obj.G, FB_ObjectMap, FB_Details)
" DXStrToMap: Grid %8.3f %8.3f %8.3f\n", ms->Grid[0], ms->Grid[1], ms->Gri d[2] " DXStrToMap: Grid %8.3f %8.3f %8.3f\n", ms->Grid[0], ms->Grid[1], ms->Gri d[2]
ENDFB(I->Obj.G); ENDFB(I->Obj.G);
} }
while(ok && (*p) && (stage == 3)) { while(ok && (*p) && (stage == 3)) {
p = ParseNCopy(cc, p, 6); p = ParseNCopy(cc, p, 6);
if(strcmp(cc, "object") == 0) { if(strcmp(cc, "object") == 0) {
p = ParseWordCopy(cc, p, 20); p = ParseWordCopy(cc, p, 20);
p = ParseNTrim(cc, p, 29); if (1 == sscanf(p, " class array type %*s rank %*s items %s", cc)) {
if(strcmp(cc, "class array type double rank") == 0) {
p = ParseWordCopy(cc, p, 20);
p = ParseWordCopy(cc, p, 20);
p = ParseWordCopy(cc, p, 20);
if(sscanf(cc, "%d", &n_items) == 1) { if(sscanf(cc, "%d", &n_items) == 1) {
if(n_items == ms->FDim[0] * ms->FDim[1] * ms->FDim[2]) if(n_items == ms->FDim[0] * ms->FDim[1] * ms->FDim[2])
stage = 4; stage = 4;
} }
} }
} else if(is_number(cc)) { } else if(is_number(cc)) {
n_items = ms->FDim[0] * ms->FDim[1] * ms->FDim[2]; n_items = ms->FDim[0] * ms->FDim[1] * ms->FDim[2];
stage = 4; stage = 4;
break; break;
} }
 End of changes. 8 change blocks. 
43 lines changed or deleted 59 lines changed or added

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