Editor.cpp (pymol-v2.1.0.tar.bz2) | : | Editor.cpp (pymol-open-source-2.2.0) | ||
---|---|---|---|---|
skipping to change at line 65 | skipping to change at line 65 | |||
float V0[3], V1[3], Axis[3], Center[3], DragBase[3]; | float V0[3], V1[3], Axis[3], Center[3], DragBase[3]; | |||
float *PosVLA; | float *PosVLA; | |||
int ShowFrags; | int ShowFrags; | |||
int DihedralInvalid; | int DihedralInvalid; | |||
int MouseInvalid; | int MouseInvalid; | |||
int FavorOrigin; | int FavorOrigin; | |||
float FavoredOrigin[3]; | float FavoredOrigin[3]; | |||
CGO *shaderCGO; | CGO *shaderCGO; | |||
}; | }; | |||
void EditorInvalidateShaderCGO(PyMOLGlobals * G); | ||||
int EditorGetScheme(PyMOLGlobals * G) | int EditorGetScheme(PyMOLGlobals * G) | |||
{ | { | |||
CEditor *I = G->Editor; | CEditor *I = G->Editor; | |||
int scheme = EDITOR_SCHEME_OBJ; | int scheme = EDITOR_SCHEME_OBJ; | |||
if(EditorActive(G)) | if(EditorActive(G)) | |||
scheme = EDITOR_SCHEME_FRAG; | scheme = EDITOR_SCHEME_FRAG; | |||
else if(I->DragObject) { | else if(I->DragObject) { | |||
if(I->DragIndex >= 0) { | if(I->DragIndex >= 0) { | |||
scheme = EDITOR_SCHEME_OBJ; | scheme = EDITOR_SCHEME_OBJ; | |||
skipping to change at line 114 | skipping to change at line 112 | |||
obj1 = SelectorGetFastSingleAtomObjectIndex(G, sele1, &at1); | obj1 = SelectorGetFastSingleAtomObjectIndex(G, sele1, &at1); | |||
obj2 = SelectorGetFastSingleAtomObjectIndex(G, sele2, &at2); | obj2 = SelectorGetFastSingleAtomObjectIndex(G, sele2, &at2); | |||
if(obj1 && (obj1 == obj2)) { | if(obj1 && (obj1 == obj2)) { | |||
CEditor *I = G->Editor; | CEditor *I = G->Editor; | |||
I->DihedObject = obj1; | I->DihedObject = obj1; | |||
at0 = ObjectMoleculeGetTopNeighbor(G, obj1, at1, at2); | at0 = ObjectMoleculeGetTopNeighbor(G, obj1, at1, at2); | |||
at3 = ObjectMoleculeGetTopNeighbor(G, obj1, at2, at1); | at3 = ObjectMoleculeGetTopNeighbor(G, obj1, at2, at1); | |||
if((at0 >= 0) && (at3 >= 0)) { | if((at0 >= 0) && (at3 >= 0)) { | |||
int sele0, sele3; | ||||
float result; | float result; | |||
/* find the highest priority atom attached to index1 */ | /* find the highest priority atom attached to index1 */ | |||
SelectorCreateOrderedFromObjectIndices(G, cEditorDihe1, obj1, &at0, 1) ; | SelectorCreateOrderedFromObjectIndices(G, cEditorDihe1, obj1, &at0, 1) ; | |||
SelectorCreateOrderedFromObjectIndices(G, cEditorDihe2, obj2, &at3, 1) ; | SelectorCreateOrderedFromObjectIndices(G, cEditorDihe2, obj2, &at3, 1) ; | |||
sele0 = SelectorIndexByName(G, cEditorDihe1); | ||||
sele3 = SelectorIndexByName(G, cEditorDihe2); | ||||
ExecutiveDihedral(G, &result, cEditorDihedral, cEditorDihe1, | ExecutiveDihedral(G, &result, cEditorDihedral, cEditorDihe1, | |||
cEditorSele1, cEditorSele2, cEditorDihe2, | cEditorSele1, cEditorSele2, cEditorDihe2, | |||
0, true, true, false, true, -1); | 0, true, true, false, true, -1); | |||
ExecutiveColor(G, cEditorDihedral, "white", 1, true); | ExecutiveColor(G, cEditorDihedral, "white", 1, true); | |||
ExecutiveSetSettingFromString(G, cSetting_float_labels, | ExecutiveSetSettingFromString(G, cSetting_float_labels, | |||
"1", cEditorDihedral, 0, true, true); | "1", cEditorDihedral, 0, true, true); | |||
#ifndef _PYMOL_FREETYPE | #ifndef _PYMOL_FREETYPE | |||
ExecutiveSetSettingFromString(G, cSetting_label_font_id, | ExecutiveSetSettingFromString(G, cSetting_label_font_id, | |||
"4", cEditorDihedral, 0, true, true); | "4", cEditorDihedral, 0, true, true); | |||
skipping to change at line 1009 | skipping to change at line 1004 | |||
} | } | |||
} | } | |||
#undef cEditorRemoveSele | #undef cEditorRemoveSele | |||
} | } | |||
/*========================================================================*/ | /*========================================================================*/ | |||
void EditorHFill(PyMOLGlobals * G, int quiet) | void EditorHFill(PyMOLGlobals * G, int quiet) | |||
{ | { | |||
int sele0, sele1; | int sele0, sele1; | |||
int i0; | int i0; | |||
OrthoLineType buffer, s1; | OrthoLineType buffer, s1, s2; | |||
ObjectMolecule *obj0 = NULL, *obj1 = NULL; | ObjectMolecule *obj0 = NULL, *obj1 = NULL; | |||
if(EditorActive(G)) { | if(EditorActive(G)) { | |||
sele0 = SelectorIndexByName(G, cEditorSele1); | sele0 = SelectorIndexByName(G, cEditorSele1); | |||
obj0 = SelectorGetFastSingleObjectMolecule(G, sele0); | obj0 = SelectorGetFastSingleObjectMolecule(G, sele0); | |||
ObjectMoleculeVerifyChemistry(obj0, -1); /* remember chemistry for later */ | ObjectMoleculeVerifyChemistry(obj0, -1); /* remember chemistry for later */ | |||
if(sele0 >= 0) { | if(sele0 >= 0) { | |||
sele1 = SelectorIndexByName(G, cEditorSele2); | sele1 = SelectorIndexByName(G, cEditorSele2); | |||
if(sele0 >= 0) { | if(sele0 >= 0) { | |||
if(sele1 >= 0) | if(sele1 >= 0){ | |||
sprintf(buffer, "((neighbor (%s)) and hydro and not (%s))", | sprintf(s2, "(%s) or (%s)", | |||
cEditorSele1, cEditorSele2); | cEditorSele1, cEditorSele2); | |||
else | sprintf(buffer, "((neighbor (%s)) and hydro and not (%s))", | |||
s2, s2); | ||||
} else { | ||||
sprintf(s2, "(%s)", cEditorSele1); | ||||
sprintf(buffer, "((neighbor %s) & hydro)", cEditorSele1); | sprintf(buffer, "((neighbor %s) & hydro)", cEditorSele1); | |||
} | ||||
SelectorGetTmp(G, buffer, s1); | SelectorGetTmp(G, buffer, s1); | |||
ExecutiveRemoveAtoms(G, s1, quiet); | ExecutiveRemoveAtoms(G, s1, quiet); | |||
SelectorFreeTmp(G, s1); | SelectorFreeTmp(G, s1); | |||
i0 = ObjectMoleculeGetAtomIndex(obj0, sele0); | i0 = ObjectMoleculeGetAtomIndex(obj0, sele0); | |||
obj0->AtomInfo[i0].chemFlag = false; | obj0->AtomInfo[i0].chemFlag = false; | |||
ExecutiveAddHydrogens(G, cEditorSele1, quiet); | ExecutiveAddHydrogens(G, cEditorSele1, quiet); | |||
if(sele1 >= 0) { | if(sele1 >= 0) { | |||
obj1 = SelectorGetFastSingleObjectMolecule(G, sele1); | obj1 = SelectorGetFastSingleObjectMolecule(G, sele1); | |||
i0 = ObjectMoleculeGetAtomIndex(obj1, sele1); | i0 = ObjectMoleculeGetAtomIndex(obj1, sele1); | |||
skipping to change at line 1281 | skipping to change at line 1280 | |||
if(nEdge < 3) | if(nEdge < 3) | |||
nEdge = 3; | nEdge = 3; | |||
subdivide(nEdge, x, y); | subdivide(nEdge, x, y); | |||
n0[0] = 1.0; | n0[0] = 1.0; | |||
n0[1] = 0.0; | n0[1] = 0.0; | |||
n0[2] = 0.0; | n0[2] = 0.0; | |||
get_system1f3f(n0, n1, n2); | get_system1f3f(n0, n1, n2); | |||
#ifndef PURE_OPENGL_ES_2 | ||||
glColor3fv(ColorGet(G, 0)); | glColor3fv(ColorGet(G, 0)); | |||
#endif | ||||
if (shaderCGO) | ||||
CGOColorv(shaderCGO, ColorGet(G, 0)); | ||||
cycle_counter = number; | cycle_counter = number; | |||
while(cycle_counter) { | while(cycle_counter) { | |||
switch (number) { | switch (number) { | |||
case 1: | case 1: | |||
width = width_base; | width = width_base; | |||
offset = 0.0F; | offset = 0.0F; | |||
break; | break; | |||
case 2: | case 2: | |||
skipping to change at line 1630 | skipping to change at line 1632 | |||
} | } | |||
} | } | |||
if (shaderCGO){ | if (shaderCGO){ | |||
CGO *convertcgo = NULL; | CGO *convertcgo = NULL; | |||
int ok = true; | int ok = true; | |||
CGOStop(shaderCGO); | CGOStop(shaderCGO); | |||
CHECKOK(ok, shaderCGO); | CHECKOK(ok, shaderCGO); | |||
convertcgo = CGOCombineBeginEnd(shaderCGO, 0); | convertcgo = CGOCombineBeginEnd(shaderCGO, 0); | |||
CHECKOK(ok, convertcgo); | CHECKOK(ok, convertcgo); | |||
CGOFree(shaderCGO); | CGOFree(shaderCGO); | |||
if (ok) | ||||
I->shaderCGO = CGOOptimizeToVBONotIndexed(convertcgo, 0); | ||||
CHECKOK(ok, I->shaderCGO); | ||||
CGOFree(convertcgo); | ||||
if (ok){ | if (ok){ | |||
CGO *tmpCGO = CGONew(G), *convertcgo2 = NULL; | ||||
if (ok) ok &= CGOEnable(tmpCGO, GL_DEFAULT_SHADER); | ||||
if (ok) ok &= CGODisable(tmpCGO, GL_TWO_SIDED_LIGHTING); | ||||
convertcgo2 = CGOOptimizeToVBONotIndexedNoShader(convertcgo, 0); | ||||
if (ok) ok &= CGOAppendNoStop(tmpCGO, convertcgo2); | ||||
if (ok) ok &= CGODisable(tmpCGO, GL_DEFAULT_SHADER); | ||||
if (ok) ok &= CGOStop(tmpCGO); | ||||
CGOFreeWithoutVBOs(convertcgo2); | ||||
I->shaderCGO = tmpCGO; | ||||
I->shaderCGO->use_shader = true; | I->shaderCGO->use_shader = true; | |||
I->shaderCGO->enable_shaders = true; | } | |||
CGOFree(convertcgo); | ||||
if (ok){ | ||||
CGORenderGL(I->shaderCGO, NULL, NULL, NULL, NULL, NULL); | CGORenderGL(I->shaderCGO, NULL, NULL, NULL, NULL, NULL); | |||
} | } | |||
} | } | |||
} | } | |||
} | } | |||
/*========================================================================*/ | /*========================================================================*/ | |||
void EditorInactivate(PyMOLGlobals * G) | void EditorInactivate(PyMOLGlobals * G) | |||
{ | { | |||
CEditor *I = G->Editor; | CEditor *I = G->Editor; | |||
End of changes. 12 change blocks. | ||||
15 lines changed or deleted | 24 lines changed or added |