"Fossies" - the Fresh Open Source Software Archive  

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

PyMOLObject.cpp  (pymol-v1.8.6.0.tar.bz2):PyMOLObject.cpp  (pymol-v2.1.0.tar.bz2)
skipping to change at line 674 skipping to change at line 674
/* /*
* Strip invalid characters from `name`, and if `name` equals a reserved * Strip invalid characters from `name`, and if `name` equals a reserved
* selection keyword, then also append an underscore. * selection keyword, then also append an underscore.
*/ */
void ObjectMakeValidName(PyMOLGlobals * G, char *name) void ObjectMakeValidName(PyMOLGlobals * G, char *name)
{ {
ObjectMakeValidName(name); ObjectMakeValidName(name);
if (SelectorNameIsKeyword(G, name)) { if (SelectorNameIsKeyword(G, name)) {
PRINTFB(G, FB_Executive, FB_Warnings)
" Warning: '%s' is a reserved keyword, appending underscore\n", name
ENDFB(G);
strcat(name, "_"); strcat(name, "_");
} else if (strcmp(name, "protein") == 0 || strcmp(name, "nucleic") == 0) {
// Warn the user if "protein" or "nucleic" are used as names, but
// don't modify the name (yet).
PRINTFB(G, FB_Executive, FB_Warnings)
" Warning: '%s' may become a reserved selection keyword in the future\n",
name
ENDFB(G);
} }
} }
int ObjectGetCurrentState(CObject * I, int ignore_all_states) int ObjectGetCurrentState(CObject * I, int ignore_all_states)
{ {
// the previous implementation (up to PyMOL 1.7.6) ignored // the previous implementation (up to PyMOL 1.7.6) ignored
// object-level state=0 (all states) // object-level state=0 (all states)
if (!ignore_all_states && if (!ignore_all_states &&
SettingGet_b(I->G, I->Setting, NULL, cSetting_all_states)) SettingGet_b(I->G, I->Setting, NULL, cSetting_all_states))
skipping to change at line 1097 skipping to change at line 1106
} }
/*========================================================================*/ /*========================================================================*/
void ObjectToggleRepVis(CObject * I, int rep) void ObjectToggleRepVis(CObject * I, int rep)
{ {
if((rep >= 0) && (rep < cRepCnt)) if((rep >= 0) && (rep < cRepCnt))
I->visRep ^= (1 << rep); I->visRep ^= (1 << rep);
} }
/*========================================================================*/ /*========================================================================*/
void ObjectSetRepVis(CObject * I, int rep, int state) void ObjectSetRepVisMask(CObject * I, int repmask, int value)
{ {
if((rep >= 0) && (rep < cRepCnt)) switch (value) {
SET_BIT_TO(I->visRep, rep, state); case cVis_HIDE:
I->visRep &= ~repmask;
break;
case cVis_SHOW:
I->visRep |= repmask;
break;
case cVis_AS:
I->visRep = repmask;
break;
case cVis_TOGGLE:
I->visRep ^= repmask;
break;
default:
printf("error: invalid value: %d\n", value);
}
} }
/*========================================================================*/ /*========================================================================*/
void ObjectSetName(CObject * I, const char *name) void ObjectSetName(CObject * I, const char *name)
{ {
UtilNCopy(I->Name, name, WordLength); UtilNCopy(I->Name, name, WordLength);
if(SettingGetGlobal_b(I->G, cSetting_validate_object_names)) if(SettingGetGlobal_b(I->G, cSetting_validate_object_names))
ObjectMakeValidName(I->G, I->Name); ObjectMakeValidName(I->G, I->Name);
} }
 End of changes. 4 change blocks. 
3 lines changed or deleted 27 lines changed or added

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