PyMOLObject.cpp (pymol-open-source-2.2.0) | : | PyMOLObject.cpp (pymol-open-source-2.3.0) | ||
---|---|---|---|---|
skipping to change at line 41 | skipping to change at line 41 | |||
#include"Matrix.h" | #include"Matrix.h" | |||
#include"MemoryDebug.h" | #include"MemoryDebug.h" | |||
#include"Movie.h" | #include"Movie.h" | |||
#include"View.h" | #include"View.h" | |||
#include"Err.h" | #include"Err.h" | |||
#include"Executive.h" | #include"Executive.h" | |||
#include"CGO.h" | #include"CGO.h" | |||
#include"Selector.h" | #include"Selector.h" | |||
int ObjectGetNFrames(CObject * I); | ||||
CSetting **ObjectGetSettingHandle(CObject * I, int state); | ||||
void ObjectPurgeSettings(CObject * I) | void ObjectPurgeSettings(CObject * I) | |||
{ | { | |||
SettingFreeP(I->Setting); | SettingFreeP(I->Setting); | |||
I->Setting = NULL; | I->Setting = NULL; | |||
} | } | |||
void ObjectMotionTrim(CObject *I, int n_frame) | void ObjectMotionTrim(CObject *I, int n_frame) | |||
{ | { | |||
if(I->ViewElem) { | if(I->ViewElem) { | |||
VLASize(I->ViewElem,CViewElem,n_frame); | VLASize(I->ViewElem,CViewElem,n_frame); | |||
skipping to change at line 747 | skipping to change at line 743 | |||
int ok = true; | int ok = true; | |||
int ll = 0; | int ll = 0; | |||
I->G = G; | I->G = G; | |||
if(ok) | if(ok) | |||
ok = (list != NULL); | ok = (list != NULL); | |||
if(ok) | if(ok) | |||
ok = PyList_Check(list); | ok = PyList_Check(list); | |||
if(ok) | if(ok) | |||
ll = PyList_Size(list); | ll = PyList_Size(list); | |||
if(ok) | if(ok) | |||
ok = PConvPyIntToInt(PyList_GetItem(list, 0), &I->type); | ok = CPythonVal_PConvPyIntToInt_From_List(G, list, 0, reinterpret_cast<int*> (&I->type)); | |||
if(ok) | if(ok) | |||
ok = PConvPyStrToStr(PyList_GetItem(list, 1), I->Name, WordLength); | ok = PConvPyStrToStr(PyList_GetItem(list, 1), I->Name, WordLength); | |||
if(ok) | if(ok) | |||
ok = PConvPyIntToInt(PyList_GetItem(list, 2), &I->Color); | ok = PConvPyIntToInt(PyList_GetItem(list, 2), &I->Color); | |||
if(ok) | if(ok) | |||
I->Color = ColorConvertOldSessionIndex(G, I->Color); | I->Color = ColorConvertOldSessionIndex(G, I->Color); | |||
if(ok) { | if(ok) { | |||
PyObject *val = PyList_GetItem(list, 3); | PyObject *val = PyList_GetItem(list, 3); | |||
if(PyList_Check(val)) { | if(PyList_Check(val)) { | |||
ok = PConvPyListToBitmask(val, &I->visRep, cRepCnt); | ok = PConvPyListToBitmask(val, &I->visRep, cRepCnt); | |||
skipping to change at line 1094 | skipping to change at line 1090 | |||
homo[11] += post[2]; | homo[11] += post[2]; | |||
dst = homo + 12; | dst = homo + 12; | |||
invert3f3f(origin, dst); | invert3f3f(origin, dst); | |||
copy44f(homo, I->TTT); | copy44f(homo, I->TTT); | |||
} | } | |||
/*========================================================================*/ | /*========================================================================*/ | |||
static | ||||
CSetting **ObjectGetSettingHandle(CObject * I, int state) | CSetting **ObjectGetSettingHandle(CObject * I, int state) | |||
{ | { | |||
return (&I->Setting); | return (&I->Setting); | |||
} | } | |||
/*========================================================================*/ | /*========================================================================*/ | |||
static void ObjectDescribeElement(CObject * I, int index, char *buffer) | static void ObjectDescribeElement(CObject * I, int index, char *buffer) | |||
{ | { | |||
buffer[0] = 0; | buffer[0] = 0; | |||
} | } | |||
skipping to change at line 1142 | skipping to change at line 1139 | |||
/*========================================================================*/ | /*========================================================================*/ | |||
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); | |||
} | } | |||
/*========================================================================*/ | /*========================================================================*/ | |||
void ObjectUpdate(CObject * I); | static | |||
/*========================================================================*/ | ||||
void ObjectUpdate(CObject * I) | void ObjectUpdate(CObject * I) | |||
{ | { | |||
} | } | |||
/*========================================================================*/ | /*========================================================================*/ | |||
void ObjectPurge(CObject * I) | void ObjectPurge(CObject * I) | |||
{ | { | |||
if(I) { | if(I) { | |||
SceneObjectDel(I->G, I, false); | SceneObjectDel(I->G, I, false); | |||
skipping to change at line 1168 | skipping to change at line 1163 | |||
} | } | |||
/*========================================================================*/ | /*========================================================================*/ | |||
void ObjectFree(CObject * I) | void ObjectFree(CObject * I) | |||
{ | { | |||
if(I) | if(I) | |||
ObjectPurge(I); | ObjectPurge(I); | |||
} | } | |||
/*========================================================================*/ | /*========================================================================*/ | |||
static | ||||
int ObjectGetNFrames(CObject * I) | int ObjectGetNFrames(CObject * I) | |||
{ | { | |||
return 1; | return 1; | |||
} | } | |||
/*========================================================================*/ | /*========================================================================*/ | |||
void ObjectUseColor(CObject * I) | void ObjectUseColor(CObject * I) | |||
{ | { | |||
PyMOLGlobals *G = I->G; | PyMOLGlobals *G = I->G; | |||
if(G->HaveGUI && G->ValidContext) { | if(G->HaveGUI && G->ValidContext) { | |||
skipping to change at line 1470 | skipping to change at line 1466 | |||
PyList_SetItem(result, 0, PConvAutoNone(Py_None)); | PyList_SetItem(result, 0, PConvAutoNone(Py_None)); | |||
} | } | |||
} | } | |||
return (PConvAutoNone(result)); | return (PConvAutoNone(result)); | |||
} | } | |||
int ObjectStateFromPyList(PyMOLGlobals * G, PyObject * list, CObjectState * I) | int ObjectStateFromPyList(PyMOLGlobals * G, PyObject * list, CObjectState * I) | |||
{ | { | |||
PyObject *tmp; | PyObject *tmp; | |||
int ok = true; | int ok = true; | |||
int ll = 0; | ||||
ObjectStateInit(G, I); | ObjectStateInit(G, I); | |||
if(list && (list != Py_None)) { /* allow None */ | if(list && (list != Py_None)) { /* allow None */ | |||
if(ok) | if(ok) | |||
ok = (list != NULL); | ok = (list != NULL); | |||
if(ok) | if(ok) | |||
ok = PyList_Check(list); | ok = PyList_Check(list); | |||
if(ok) | ||||
ll = PyList_Size(list); | ||||
/* TO SUPPORT BACKWARDS COMPATIBILITY... | /* TO SUPPORT BACKWARDS COMPATIBILITY... | |||
Always check ll when adding new PyList_GetItem's */ | Always check ll when adding new PyList_GetItem's */ | |||
if(ok) { | if(ok) { | |||
tmp = PyList_GetItem(list, 0); | tmp = PyList_GetItem(list, 0); | |||
if(tmp != Py_None) | if(tmp != Py_None) | |||
ok = PConvPyListToDoubleArray(tmp, &I->Matrix); | ok = PConvPyListToDoubleArray(tmp, &I->Matrix); | |||
} | } | |||
} | } | |||
return (ok); | return (ok); | |||
} | } | |||
End of changes. 7 change blocks. | ||||
11 lines changed or deleted | 4 lines changed or added |