"Fossies" - the Fresh Open Source Software Archive  

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

ObjectGadgetRamp.cpp  (pymol-v1.8.6.0.tar.bz2):ObjectGadgetRamp.cpp  (pymol-v2.1.0.tar.bz2)
skipping to change at line 59 skipping to change at line 59
VLAFreeP(I->LevelTmp); VLAFreeP(I->LevelTmp);
ObjectGadgetPurge(&I->Gadget); ObjectGadgetPurge(&I->Gadget);
OOFreeP(I); OOFreeP(I);
} }
#ifdef _PYMOL_INLINE #ifdef _PYMOL_INLINE
__inline__ __inline__
#endif #endif
static void ObjectGadgetRampCalculate(ObjectGadgetRamp * I, float v, float *resu lt) static void ObjectGadgetRampCalculate(ObjectGadgetRamp * I, float v, float *resu lt)
{ {
int i;
const float _1 = 1.0F; const float _1 = 1.0F;
const float _0 = 0.0F; const float _0 = 0.0F;
/* from Filipe Maia */ /* from Filipe Maia */
/* All of this functions are taken right of the gnuplot manual */ /* All of this functions are taken right of the gnuplot manual */
if(v > _1) if(v > _1)
v = _1; v = _1;
else if(v < _0) else if(v < _0)
v = _0; v = _0;
skipping to change at line 117 skipping to change at line 116
result[0] = v; result[0] = v;
result[1] = v; result[1] = v;
result[2] = v; result[2] = v;
break; break;
default: /* default is simply white */ default: /* default is simply white */
result[0] = 1.0F; result[0] = 1.0F;
result[1] = 1.0F; result[1] = 1.0F;
result[2] = 1.0F; result[2] = 1.0F;
break; break;
} }
for(i = 0; i < 3; i++) { clamp3f(result);
if(result[i] > 1.0F) {
result[i] = 1.0F;
} else if(result[i] < 0.0F) {
result[i] = 0.0F;
}
}
} }
/* /*
* Get the "Level" array, eventually spaced out to match number of colors. * Get the "Level" array, eventually spaced out to match number of colors.
*/ */
static const float * ObjectGadgetRampGetLevel(ObjectGadgetRamp * I) { static const float * ObjectGadgetRampGetLevel(ObjectGadgetRamp * I) {
if (!I->Level || !I->Color) if (!I->Level || !I->Color)
return I->Level; return I->Level;
int n_color = VLAGetSize(I->Color) / 3; int n_color = VLAGetSize(I->Color) / 3;
skipping to change at line 367 skipping to change at line 360
} }
int ObjectGadgetRampInterpolate(ObjectGadgetRamp * I, float level, float *color) int ObjectGadgetRampInterpolate(ObjectGadgetRamp * I, float level, float *color)
{ {
int result = _ObjectGadgetRampInterpolate(I, level, color, I->Color); int result = _ObjectGadgetRampInterpolate(I, level, color, I->Color);
return result; return result;
} }
PyObject *ObjectGadgetRampAsPyList(ObjectGadgetRamp * I) PyObject *ObjectGadgetRampAsPyList(ObjectGadgetRamp * I)
{ {
#ifdef _PYMOL_NOPY
return NULL;
#else
PyObject *result = NULL; PyObject *result = NULL;
result = PyList_New(11); result = PyList_New(11);
PyList_SetItem(result, 0, ObjectGadgetPlainAsPyList(&I->Gadget, false)); PyList_SetItem(result, 0, ObjectGadgetPlainAsPyList(&I->Gadget, false));
PyList_SetItem(result, 1, PyInt_FromLong(I->RampType)); PyList_SetItem(result, 1, PyInt_FromLong(I->RampType));
PyList_SetItem(result, 2, PyInt_FromLong(I->NLevel)); PyList_SetItem(result, 2, PyInt_FromLong(I->NLevel));
if(I->Level && I->NLevel) { if(I->Level && I->NLevel) {
PyList_SetItem(result, 3, PConvFloatVLAToPyList(I->Level)); PyList_SetItem(result, 3, PConvFloatVLAToPyList(I->Level));
} else { } else {
skipping to change at line 409 skipping to change at line 398
special = VLAlloc(int, n_color); special = VLAlloc(int, n_color);
for (int a = 0; a < n_color; ++a) { for (int a = 0; a < n_color; ++a) {
any = (special[a] = GetSpecial(I->Color + a * 3)) || any; any = (special[a] = GetSpecial(I->Color + a * 3)) || any;
} }
} }
PyList_SetItem(result, 9, any ? PConvIntVLAToPyList(special) : PConvAutoNone(N ULL)); PyList_SetItem(result, 9, any ? PConvIntVLAToPyList(special) : PConvAutoNone(N ULL));
VLAFreeP(special); VLAFreeP(special);
PyList_SetItem(result, 10, PConvAutoNone(NULL) /* I->Extreme, removed in PyMOL 1.8 */); PyList_SetItem(result, 10, PConvAutoNone(NULL) /* I->Extreme, removed in PyMOL 1.8 */);
return (PConvAutoNone(result)); return (PConvAutoNone(result));
#endif
} }
int ObjectGadgetRampNewFromPyList(PyMOLGlobals * G, PyObject * list, int ObjectGadgetRampNewFromPyList(PyMOLGlobals * G, PyObject * list,
ObjectGadgetRamp ** result, int version) ObjectGadgetRamp ** result, int version)
{ {
#ifdef _PYMOL_NOPY
return 0;
#else
ObjectGadgetRamp *I = NULL; ObjectGadgetRamp *I = NULL;
int ok = true; int ok = true;
int ll = 0; int ll = 0;
if(ok) if(ok)
I = ObjectGadgetRampNew(G); I = ObjectGadgetRampNew(G);
if(ok) if(ok)
ok = (I != NULL); ok = (I != NULL);
if(ok) if(ok)
ok = (list != NULL); ok = (list != NULL);
skipping to change at line 492 skipping to change at line 476
} }
CPythonVal_Free(item); CPythonVal_Free(item);
} }
ObjectGadgetRampHandleInputColors(I); ObjectGadgetRampHandleInputColors(I);
ObjectGadgetRampBuild(I); ObjectGadgetRampBuild(I);
if(ok) if(ok)
(*result) = I; (*result) = I;
return (ok); return (ok);
#endif
} }
int ObjectGadgetRampInterVertex(ObjectGadgetRamp * I, const float *pos, float *c olor, int state) int ObjectGadgetRampInterVertex(ObjectGadgetRamp * I, const float *pos, float *c olor, int state)
{ {
float level; float level;
int ok = true; int ok = true;
switch (I->RampType) { switch (I->RampType) {
case cRampMap: case cRampMap:
if(!I->Map) if(!I->Map)
I->Map = ExecutiveFindObjectMapByName(I->Gadget.Obj.G, I->SrcName); I->Map = ExecutiveFindObjectMapByName(I->Gadget.Obj.G, I->SrcName);
 End of changes. 6 change blocks. 
18 lines changed or deleted 1 lines changed or added

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