"Fossies" - the Fresh Open Source Software Archive  

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

Editor.cpp  (pymol-open-source-2.2.0):Editor.cpp  (pymol-open-source-2.3.0)
skipping to change at line 898 skipping to change at line 898
} }
} }
} }
/*========================================================================*/ /*========================================================================*/
void EditorAttach(PyMOLGlobals * G, const char *elem, int geom, int valence, void EditorAttach(PyMOLGlobals * G, const char *elem, int geom, int valence,
const char *name, int quiet) const char *name, int quiet)
{ {
int i0; int i0;
int sele0, sele1; int sele0, sele1;
AtomInfoType *ai;
ObjectMolecule *obj0 = NULL, *obj1 = NULL; ObjectMolecule *obj0 = NULL, *obj1 = NULL;
int ok = true; int ok = true;
ai = (AtomInfoType *) VLAMalloc(1, sizeof(AtomInfoType), 1, true); auto atInfo = pymol::vla<AtomInfoType>(1);
AtomInfoType* ai = atInfo.data();
if(EditorActive(G)) { if(EditorActive(G)) {
sele0 = SelectorIndexByName(G, cEditorSele1); sele0 = SelectorIndexByName(G, cEditorSele1);
if(sele0 >= 0) { if(sele0 >= 0) {
sele1 = SelectorIndexByName(G, cEditorSele2); sele1 = SelectorIndexByName(G, cEditorSele2);
obj0 = SelectorGetFastSingleObjectMolecule(G, sele0); obj0 = SelectorGetFastSingleObjectMolecule(G, sele0);
obj1 = SelectorGetFastSingleObjectMolecule(G, sele1); obj1 = SelectorGetFastSingleObjectMolecule(G, sele1);
if(obj0) { if(obj0) {
if(obj0->DiscreteFlag) { if(obj0->DiscreteFlag) {
skipping to change at line 931 skipping to change at line 932
} else { } else {
/* atom mode */ /* atom mode */
i0 = ObjectMoleculeGetAtomIndex(obj0, sele0); /* slow */ i0 = ObjectMoleculeGetAtomIndex(obj0, sele0); /* slow */
if(i0 >= 0) { if(i0 >= 0) {
UtilNCopy(ai->elem, elem, sizeof(ElemName)); UtilNCopy(ai->elem, elem, sizeof(ElemName));
ai->geom = geom; ai->geom = geom;
ai->valence = valence; ai->valence = valence;
if(name[0]) if(name[0])
LexAssign(G, ai->name, name); LexAssign(G, ai->name, name);
if (ok) if (ok)
ok &= ObjectMoleculeAttach(obj0, i0, ai); /* will free ai * ok &= ObjectMoleculeAttach(obj0, i0, std::move(atInfo));
/
ai = NULL;
} }
} }
} }
} }
} }
} }
VLAFreeP(ai); /* safety */
} }
/*========================================================================*/ /*========================================================================*/
void EditorRemove(PyMOLGlobals * G, int hydrogen, int quiet) void EditorRemove(PyMOLGlobals * G, int hydrogen, int quiet)
{ {
#define cEditorRemoveSele "_EditorRemove" #define cEditorRemoveSele "_EditorRemove"
if(EditorActive(G)) { if(EditorActive(G)) {
OrthoLineType buf; OrthoLineType buf;
skipping to change at line 1097 skipping to change at line 1096
if(i0 >= 0) { if(i0 >= 0) {
UtilNCopy(ai.elem, elem, sizeof(ElemName)); UtilNCopy(ai.elem, elem, sizeof(ElemName));
if(name[0]) if(name[0])
LexAssign(G, ai.name, name); LexAssign(G, ai.name, name);
ai.geom = geom; ai.geom = geom;
ai.valence = valence; ai.valence = valence;
if (ok) if (ok)
ok &= ObjectMoleculePrepareAtom(obj0, i0, &ai); ok &= ObjectMoleculePrepareAtom(obj0, i0, &ai);
if (ok) if (ok)
ok &= ObjectMoleculePreposReplAtom(obj0, i0, &ai); ok &= ObjectMoleculePreposReplAtom(obj0, i0, &ai);
ObjectMoleculeReplaceAtom(obj0, i0, &ai); /* invalidates */ ObjectMoleculeReplaceAtom(obj0, i0, std::move(ai));
ObjectMoleculeVerifyChemistry(obj0, -1); ObjectMoleculeVerifyChemistry(obj0, -1);
ObjectMoleculeFillOpenValences(obj0, i0); ObjectMoleculeFillOpenValences(obj0, i0);
if (ok) if (ok)
ok &= ObjectMoleculeSort(obj0); ok &= ObjectMoleculeSort(obj0);
ObjectMoleculeUpdateIDNumbers(obj0); ObjectMoleculeUpdateIDNumbers(obj0);
EditorInactivate(G); EditorInactivate(G);
} }
} }
} }
} }
 End of changes. 5 change blocks. 
7 lines changed or deleted 5 lines changed or added

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