"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "layer2/CoordSet.cpp" between
pymol-open-source-2.2.0.tar.gz and pymol-open-source-2.3.0.tar.gz

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.

CoordSet.cpp  (pymol-open-source-2.2.0):CoordSet.cpp  (pymol-open-source-2.3.0)
skipping to change at line 219 skipping to change at line 219
if(length3f(I->LabPos[a].offset) > R_SMALL4) { if(length3f(I->LabPos[a].offset) > R_SMALL4) {
SettingSet(cSetting_label_placement_offset, I->LabPos[a].offset, I, a); SettingSet(cSetting_label_placement_offset, I->LabPos[a].offset, I, a);
} }
} }
} }
} }
} }
if(!ok) { if(!ok) {
if(I) if(I)
I->fFree(); I->fFree();
*cs = NULL; *cs = NULL;
} else { } else {
*cs = I; *cs = I;
} }
} }
return (ok); return (ok);
} }
/* /*
* Coord set as numpy array * Coord set as numpy array
*/ */
skipping to change at line 897 skipping to change at line 897
const double *matrix) const double *matrix)
/* /*
* v: 3x1 vertex in final output space * v: 3x1 vertex in final output space
* matrix: 4x4 homogenous transformation matrix from model space to output * matrix: 4x4 homogenous transformation matrix from model space to output
* space (view matrix * state matrix). Used for ANISOU. * space (view matrix * state matrix). Used for ANISOU.
*/ */
{ {
char *aType; char *aType;
AtomName name; AtomName name;
ResName resn; ResName resn;
ov_word chain; lexidx_t chain;
char formalCharge[4]; char formalCharge[4];
int ignore_pdb_segi = SettingGetGlobal_b(G, cSetting_ignore_pdb_segi); int ignore_pdb_segi = SettingGetGlobal_b(G, cSetting_ignore_pdb_segi);
WordType x, y, z; WordType x, y, z;
AtomInfoGetAlignedPDBResidueName(G, ai, resn); AtomInfoGetAlignedPDBResidueName(G, ai, resn);
AtomInfoGetAlignedPDBAtomName(G, ai, resn, name); AtomInfoGetAlignedPDBAtomName(G, ai, resn, name);
formalCharge[0] = 0; formalCharge[0] = 0;
if(SettingGetGlobal_b(G, cSetting_pdb_formal_charges)) { if(SettingGetGlobal_b(G, cSetting_pdb_formal_charges)) {
skipping to change at line 1016 skipping to change at line 1016
ErrMessage(G, "CoordSetAtomToChemPyAtom", "can't create atom"); ErrMessage(G, "CoordSetAtomToChemPyAtom", "can't create atom");
else { else {
float tmp_array[6] = { 0.f, 0.f, 0.f, 0.f, 0.f, 0.f }; float tmp_array[6] = { 0.f, 0.f, 0.f, 0.f, 0.f, 0.f };
if (ai->anisou) { if (ai->anisou) {
memcpy(tmp_array, ai->anisou, 6 * sizeof(float)); memcpy(tmp_array, ai->anisou, 6 * sizeof(float));
if (matrix) if (matrix)
RotateU(matrix, tmp_array); RotateU(matrix, tmp_array);
} }
char resi[8];
AtomResiFromResv(resi, sizeof(resi), ai);
PConvFloat3ToPyObjAttr(atom, "coord", v); PConvFloat3ToPyObjAttr(atom, "coord", v);
if(ref) if(ref)
PConvFloat3ToPyObjAttr(atom, "ref_coord", ref); PConvFloat3ToPyObjAttr(atom, "ref_coord", ref);
if (ai->name)
PConvStringToPyObjAttr(atom, "name", LexStr(G, ai->name)); PConvStringToPyObjAttr(atom, "name", LexStr(G, ai->name));
PConvStringToPyObjAttr(atom, "symbol", ai->elem); PConvStringToPyObjAttr(atom, "symbol", ai->elem);
// TODO defaults to UNK if (ai->resn)
PConvStringToPyObjAttr(atom, "resn", LexStr(G, ai->resn)); PConvStringToPyObjAttr(atom, "resn", LexStr(G, ai->resn));
PConvStringToPyObjAttr(atom, "resi", resi); if (ai->inscode) {
char ins_code[2] = {ai->inscode, 0};
PConvStringToPyObjAttr(atom, "ins_code", ins_code);
}
if (ai->ssType[0])
PConvStringToPyObjAttr(atom, "ss", ai->ssType); PConvStringToPyObjAttr(atom, "ss", ai->ssType);
// TODO defaults to 1 if (ai->resv)
PConvIntToPyObjAttr(atom, "resi_number", ai->resv); PConvIntToPyObjAttr(atom, "resi_number", ai->resv);
if (ai->stereo)
PConvIntToPyObjAttr(atom, "stereo", ai->stereo); PConvIntToPyObjAttr(atom, "stereo", ai->stereo);
if (ai->chain)
PConvStringToPyObjAttr(atom, "chain", LexStr(G, ai->chain)); PConvStringToPyObjAttr(atom, "chain", LexStr(G, ai->chain));
if(ai->alt[0]) if(ai->alt[0])
PConvStringToPyObjAttr(atom, "alt", ai->alt); PConvStringToPyObjAttr(atom, "alt", ai->alt);
if (ai->segi)
PConvStringToPyObjAttr(atom, "segi", LexStr(G, ai->segi)); PConvStringToPyObjAttr(atom, "segi", LexStr(G, ai->segi));
if (ai->q != 1.)
PConvFloatToPyObjAttr(atom, "q", ai->q); PConvFloatToPyObjAttr(atom, "q", ai->q);
if (ai->b)
PConvFloatToPyObjAttr(atom, "b", ai->b); PConvFloatToPyObjAttr(atom, "b", ai->b);
if (ai->anisou)
{ {
{ {
PyObject *tmp_obj = PConvFloatArrayToPyList(tmp_array, 6); PyObject *tmp_obj = PConvFloatArrayToPyList(tmp_array, 6);
if(tmp_obj) { if(tmp_obj) {
PyObject_SetAttrString(atom, "u_aniso", tmp_obj); PyObject_SetAttrString(atom, "u_aniso", tmp_obj);
Py_XDECREF(tmp_obj); Py_XDECREF(tmp_obj);
} }
} }
} }
PConvFloatToPyObjAttr(atom, "vdw", ai->vdw); PConvFloatToPyObjAttr(atom, "vdw", ai->vdw);
if (ai->elec_radius)
PConvFloatToPyObjAttr(atom, "elec_radius", ai->elec_radius); PConvFloatToPyObjAttr(atom, "elec_radius", ai->elec_radius);
if (ai->partialCharge)
PConvFloatToPyObjAttr(atom, "partial_charge", ai->partialCharge); PConvFloatToPyObjAttr(atom, "partial_charge", ai->partialCharge);
if (ai->formalCharge)
PConvIntToPyObjAttr(atom, "formal_charge", ai->formalCharge); PConvIntToPyObjAttr(atom, "formal_charge", ai->formalCharge);
// TODO customType=0 from most files
if(ai->customType != -9999) if(ai->customType != -9999)
PConvIntToPyObjAttr(atom, "numeric_type", ai->customType); PConvIntToPyObjAttr(atom, "numeric_type", ai->customType);
if (ai->textType)
PConvStringToPyObjAttr(atom, "text_type", LexStr(G, ai->textType)); PConvStringToPyObjAttr(atom, "text_type", LexStr(G, ai->textType));
if (ai->custom)
PConvStringToPyObjAttr(atom, "custom", LexStr(G, ai->custom)); PConvStringToPyObjAttr(atom, "custom", LexStr(G, ai->custom));
PConvIntToPyObjAttr(atom, "hetatm", ai->hetatm); PConvIntToPyObjAttr(atom, "hetatm", ai->hetatm);
PConvIntToPyObjAttr(atom, "flags", ai->flags); PConvIntToPyObjAttr(atom, "flags", ai->flags);
PConvIntToPyObjAttr(atom, "id", ai->id); /* not necc. unique */ PConvIntToPyObjAttr(atom, "id", ai->id); /* not necc. unique */
PConvIntToPyObjAttr(atom, "index", index + 1); /* fragile */ PConvIntToPyObjAttr(atom, "index", index + 1); /* fragile */
} }
if(PyErr_Occurred()) if(PyErr_Occurred())
PyErr_Print(); PyErr_Print();
return (atom); return (atom);
skipping to change at line 1293 skipping to change at line 1309
if(I->Active[cRepSphere]) if(I->Active[cRepSphere])
RepSphereRenderImmediate(I, info); RepSphereRenderImmediate(I, info);
if(I->Active[cRepCyl]) if(I->Active[cRepCyl])
RepCylBondRenderImmediate(I, info); RepCylBondRenderImmediate(I, info);
if(I->Active[cRepRibbon]) if(I->Active[cRepRibbon])
RepRibbonRenderImmediate(I, info); RepRibbonRenderImmediate(I, info);
} }
} else { } else {
int pass = info->pass; int pass = info->pass;
CRay *ray = info->ray; CRay *ray = info->ray;
Picking **pick = info->pick; auto pick = info->pick;
int a, aa, abit, aastart = 0, aaend = cRepCnt; int a, aa, abit, aastart = 0, aaend = cRepCnt;
::Rep *r; ::Rep *r;
int sculpt_vdw_vis_mode = SettingGet_i(G, I->Setting, int sculpt_vdw_vis_mode = SettingGet_i(G, I->Setting,
I->Obj->Obj.Setting, I->Obj->Obj.Setting,
cSetting_sculpt_vdw_vis_mode); cSetting_sculpt_vdw_vis_mode);
if((!pass) && sculpt_vdw_vis_mode && if((!pass) && sculpt_vdw_vis_mode &&
I->SculptCGO && (I->Obj->Obj.visRep & cRepCGOBit)) { I->SculptCGO && (I->Obj->Obj.visRep & cRepCGOBit)) {
if(ray) { if(ray) {
int ok = CGORenderRay(I->SculptCGO, ray, info, int ok = CGORenderRay(I->SculptCGO, ray, info,
ColorGet(G, I->Obj->Obj.Color), NULL, I->Setting, I ->Obj->Obj.Setting); ColorGet(G, I->Obj->Obj.Color), NULL, I->Setting, I ->Obj->Obj.Setting);
skipping to change at line 1418 skipping to change at line 1434
r->fRender(r, info); r->fRender(r, info);
break; break;
case cRepLine: case cRepLine:
case cRepMesh: case cRepMesh:
case cRepDash: case cRepDash:
case cRepCell: case cRepCell:
case cRepExtent: case cRepExtent:
if(!pass) if(!pass)
r->fRender(r, info); r->fRender(r, info);
break; break;
case cRepCartoon:
case cRepNonbonded: case cRepNonbonded:
case cRepRibbon: case cRepRibbon:
render_both = false; // cartoon and nonbonded do not have atom-lev el transparency render_both = false; // cartoon and nonbonded do not have atom-lev el transparency
case cRepNonbondedSphere: case cRepNonbondedSphere:
case cRepSurface: case cRepSurface:
case cRepEllipsoid: case cRepEllipsoid:
case cRepCyl: case cRepCyl:
case cRepCartoon:
case cRepSphere: case cRepSphere:
{ {
if (render_both){ if (render_both){
// for transparency_mode 3, render both opaque and transparent pass // for transparency_mode 3, render both opaque and transparent pass
if (pass != 0){ if (pass != 0){
r->fRender(r, info); r->fRender(r, info);
} }
} else { } else {
bool checkAlphaCGO = abit & (cRepSurfaceBit | cRepCartoonBit); bool checkAlphaCGO = abit & (cRepSurfaceBit);
int check_setting = RepToTransparencySetting(a); int check_setting = RepToTransparencySetting(a);
bool cont = true; bool cont = true;
if (checkAlphaCGO){ if (checkAlphaCGO){
if(info->alpha_cgo) { if(info->alpha_cgo) {
if(pass == 1){ if(pass == 1){
r->fRender(r, info); r->fRender(r, info);
} }
cont = false; cont = false;
} }
} }
 End of changes. 23 change blocks. 
9 lines changed or deleted 25 lines changed or added

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