RepSphere.cpp (pymol-open-source-2.2.0) | : | RepSphere.cpp (pymol-open-source-2.3.0) | ||
---|---|---|---|---|
skipping to change at line 59 | skipping to change at line 59 | |||
2) rectangles with constant size relative to vdw and scene scale (i.e., chang es when zoomed) | 2) rectangles with constant size relative to vdw and scene scale (i.e., chang es when zoomed) | |||
maxed by a multiple of sphere_point_max_size (set it below 1 to see it inf luence, 3*pixel_scale max) | maxed by a multiple of sphere_point_max_size (set it below 1 to see it inf luence, 3*pixel_scale max) | |||
3) same as 2 but with circles | 3) same as 2 but with circles | |||
4) no longer available | 4) no longer available | |||
5) Uses the fast ARB Shader that approximates spheres as circles | 5) Uses the fast ARB Shader that approximates spheres as circles | |||
6-8) same as 1-3 but with normals computed from close atoms to mimic nice lig hting | 6-8) same as 1-3 but with normals computed from close atoms to mimic nice lig hting | |||
9) GLSL Shader Spheres (only when shaders are available) | 9) GLSL Shader Spheres (only when shaders are available) | |||
*/ | */ | |||
void RepSphereFree(RepSphere * I); | static | |||
int RepSphereSameVis(RepSphere * I, CoordSet * cs); | ||||
void RepSphereFree(RepSphere * I) | void RepSphereFree(RepSphere * I) | |||
{ | { | |||
if (I->primitiveCGO == I->renderCGO) { | if (I->primitiveCGO == I->renderCGO) { | |||
I->primitiveCGO = 0; | I->primitiveCGO = 0; | |||
} | } | |||
CGOFree(I->primitiveCGO); | CGOFree(I->primitiveCGO); | |||
CGOFree(I->renderCGO); | CGOFree(I->renderCGO); | |||
CGOFree(I->spheroidCGO); | CGOFree(I->spheroidCGO); | |||
FreeP(I->LastColor); | FreeP(I->LastColor); | |||
FreeP(I->LastVisib); | FreeP(I->LastVisib); | |||
skipping to change at line 178 | skipping to change at line 176 | |||
if (!use_shader || !G->ShaderMgr->ShaderPrgExists("sphere")) { | if (!use_shader || !G->ShaderMgr->ShaderPrgExists("sphere")) { | |||
sphere_mode = 0; | sphere_mode = 0; | |||
} | } | |||
} | } | |||
return sphere_mode; | return sphere_mode; | |||
} | } | |||
static void RepSphereRender(RepSphere * I, RenderInfo * info) | static void RepSphereRender(RepSphere * I, RenderInfo * info) | |||
{ | { | |||
CRay *ray = info->ray; | CRay *ray = info->ray; | |||
Picking **pick = info->pick; | auto pick = info->pick; | |||
PyMOLGlobals *G = I->R.G; | PyMOLGlobals *G = I->R.G; | |||
int ok = true; | int ok = true; | |||
bool use_shader = SettingGetGlobal_b(G, cSetting_sphere_use_shader) && | bool use_shader = SettingGetGlobal_b(G, cSetting_sphere_use_shader) && | |||
SettingGetGlobal_b(G, cSetting_use_shaders); | SettingGetGlobal_b(G, cSetting_use_shaders); | |||
if(ray) { | if(ray) { | |||
#ifndef _PYMOL_NO_RAY | #ifndef _PYMOL_NO_RAY | |||
ok &= RepSphereRenderRay(G, I, info); | ok &= RepSphereRenderRay(G, I, info); | |||
#endif | #endif | |||
return; | return; | |||
} | } | |||
skipping to change at line 239 | skipping to change at line 237 | |||
I->R.fInvalidate(&I->R, I->R.cs, cRepInvPurge); | I->R.fInvalidate(&I->R, I->R.cs, cRepInvPurge); | |||
I->R.cs->Active[cRepSphere] = false; | I->R.cs->Active[cRepSphere] = false; | |||
} | } | |||
if (I->renderCGO) | if (I->renderCGO) | |||
CGORenderGL(I->renderCGO, NULL, NULL, NULL, info, &I->R); | CGORenderGL(I->renderCGO, NULL, NULL, NULL, info, &I->R); | |||
} | } | |||
} | } | |||
} | } | |||
static | ||||
int RepSphereSameVis(RepSphere * I, CoordSet * cs) | int RepSphereSameVis(RepSphere * I, CoordSet * cs) | |||
{ | { | |||
bool *lv; | bool *lv; | |||
int *lc; | int *lc; | |||
int a; | int a; | |||
AtomInfoType *ai; | AtomInfoType *ai; | |||
if(I->LastVisib && I->LastColor) { | if(I->LastVisib && I->LastColor) { | |||
lv = I->LastVisib; | lv = I->LastVisib; | |||
lc = I->LastColor; | lc = I->LastColor; | |||
skipping to change at line 500 | skipping to change at line 499 | |||
ObjectMolecule *obj; | ObjectMolecule *obj; | |||
int ok = true; | int ok = true; | |||
int a, a1; | int a, a1; | |||
bool *lv; | bool *lv; | |||
int *lc; | int *lc; | |||
float sphere_scale, sphere_add = 0.f; | float sphere_scale, sphere_add = 0.f; | |||
int sphere_color; | int sphere_color; | |||
int cartoon_side_chain_helper = 0; | int cartoon_side_chain_helper = 0; | |||
int ribbon_side_chain_helper = 0; | int ribbon_side_chain_helper = 0; | |||
AtomInfoType *ati1; | AtomInfoType *ati1; | |||
int sphere_mode; | int sphere_mode = 0; | |||
bool *marked = NULL; | bool *marked = NULL; | |||
float transp; | float transp; | |||
int variable_alpha = false; | int variable_alpha = false; | |||
short use_shader = SettingGetGlobal_b(G, cSetting_sphere_use_shader) && | short use_shader = SettingGetGlobal_b(G, cSetting_sphere_use_shader) && | |||
SettingGetGlobal_b(G, cSetting_use_shaders); | SettingGetGlobal_b(G, cSetting_use_shaders); | |||
// skip if not visible | // skip if not visible | |||
if(!cs->hasRep(cRepSphereBit)) | if(!cs->hasRep(cRepSphereBit)) | |||
return NULL; | return NULL; | |||
OOCalloc(G, RepSphere); | OOCalloc(G, RepSphere); | |||
End of changes. 4 change blocks. | ||||
5 lines changed or deleted | 4 lines changed or added |