"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "layer3/Executive.cpp" between
pymol-open-source-2.2.0.tar.gz and pymol-open-source-2.3.0.tar.gz

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.

Executive.cpp  (pymol-open-source-2.2.0):Executive.cpp  (pymol-open-source-2.3.0)
skipping to change at line 120 skipping to change at line 120
int is_group; int is_group;
int is_open; int is_open;
struct PanelRec *next; struct PanelRec *next;
} PanelRec; } PanelRec;
typedef struct { typedef struct {
int list_id; int list_id;
int next; int next;
} ListMember; } ListMember;
struct _CExecutive { struct CExecutive : public Block {
::Block *Block; SpecRec *Spec {};
SpecRec *Spec; CTracker *Tracker {};
CTracker *Tracker; int Width {}, Height {}, HowFarDown { 0 };
int Width, Height, HowFarDown; int ScrollBarActive { 0 };
int ScrollBarActive; int NSkip { 0 };
int NSkip; ScrollBar m_ScrollBar;
struct CScrollBar *ScrollBar; CObject *LastEdited { nullptr };
CObject *LastEdited; int DragMode { 0 };
int DragMode; int Pressed { -1 }, Over { -1 }, LastOver {}, OldVisibility {}, ToggleMode {},
int Pressed, Over, LastOver, OldVisibility, ToggleMode, PressedWhat, OverWhat; PressedWhat {}, OverWhat {};
SpecRec *LastChanged, *LastZoomed, *RecoverPressed; SpecRec *LastChanged { nullptr }, *LastZoomed { nullptr }, *RecoverPressed { n
int ReorderFlag; ullptr };
OrthoLineType ReorderLog; int ReorderFlag { false };
OrthoLineType ReorderLog {};
#ifndef GLUT_FULL_SCREEN #ifndef GLUT_FULL_SCREEN
// freeglut has glutLeaveFullScreen, no need to remember window dimensions // freeglut has glutLeaveFullScreen, no need to remember window dimensions
int oldPX, oldPY, oldWidth, oldHeight; int oldPX {}, oldPY {}, oldWidth {}, oldHeight {};
#endif #endif
int all_names_list_id, all_obj_list_id, all_sel_list_id; int all_names_list_id {}, all_obj_list_id {}, all_sel_list_id {};
OVLexicon *Lex; OVLexicon *Lex {};
OVOneToOne *Key; OVOneToOne *Key {};
int ValidGroups; bool ValidGroups { false };
int ValidSceneMembers; bool ValidSceneMembers { false };
int ValidGridSlots; int ValidGridSlots {};
PanelRec *Panel; PanelRec *Panel {};
int ValidPanel; bool ValidPanel { false };
int CaptureFlag; #ifdef _WEBGL
int LastMotionCount; #endif
CGO *selIndicatorsCGO; int CaptureFlag {};
int selectorTexturePosX, selectorTexturePosY, selectorTextureAllocatedSize, se int LastMotionCount {};
lectorTextureSize; CGO *selIndicatorsCGO { nullptr };
short selectorIsRound; int selectorTexturePosX { 0 }, selectorTexturePosY { 0 }, selectorTextureAlloc
atedSize { 0 }, selectorTextureSize { 0 };
short selectorIsRound { 0 };
// AtomInfoType::unique_id -> (object, atom-index) // AtomInfoType::unique_id -> (object, atom-index)
ExecutiveObjectOffset *m_eoo; // VLA of (object, atom-index) ExecutiveObjectOffset *m_eoo {}; // VLA of (object, atom-index)
OVOneToOne *m_id2eoo; // unique_id -> m_eoo-index OVOneToOne *m_id2eoo {}; // unique_id -> m_eoo-index
CExecutive(PyMOLGlobals * G) : Block(G), m_ScrollBar(G, false) {};
int release(int button, int x, int y, int mod) override;
int click(int button, int x, int y, int mod) override;
int drag(int x, int y, int mod) override;
void draw(CGO* orthoCGO) override;
void reshape(int width, int height) override;
}; };
#ifndef NO_MMLIBS #ifndef NO_MMLIBS
#include "mmpymolx.h" #include "mmpymolx.h"
#endif #endif
/* routines that still need to be updated for Tracker list iteration /* routines that still need to be updated for Tracker list iteration
Low priority: Low priority:
skipping to change at line 179 skipping to change at line 188
ExecutiveSpheroid ExecutiveSpheroid
*/ */
static int ExecutiveGetNamesListFromPattern(PyMOLGlobals * G, const char *name, static int ExecutiveGetNamesListFromPattern(PyMOLGlobals * G, const char *name,
int allow_partial, int expand_groups ); int allow_partial, int expand_groups );
static void ExecutiveSpecEnable(PyMOLGlobals * G, SpecRec * rec, int parents, in t log); static void ExecutiveSpecEnable(PyMOLGlobals * G, SpecRec * rec, int parents, in t log);
static void ExecutiveSetAllRepVisMask(PyMOLGlobals * G, int repmask, int state); static void ExecutiveSetAllRepVisMask(PyMOLGlobals * G, int repmask, int state);
static SpecRec *ExecutiveFindSpec(PyMOLGlobals * G, const char *name); static SpecRec *ExecutiveFindSpec(PyMOLGlobals * G, const char *name);
static int ExecutiveDrag(Block * block, int x, int y, int mod);
static void ExecutiveSpecSetVisibility(PyMOLGlobals * G, SpecRec * rec, static void ExecutiveSpecSetVisibility(PyMOLGlobals * G, SpecRec * rec,
int new_vis, int mod, int parents); int new_vis, int mod, int parents);
static int ExecutiveSetObjectMatrix2(PyMOLGlobals * G, CObject * obj, int state, static int ExecutiveSetObjectMatrix2(PyMOLGlobals * G, CObject * obj, int state,
double *matrix); double *matrix);
static int ExecutiveGetObjectMatrix2(PyMOLGlobals * G, CObject * obj, int state, static int ExecutiveGetObjectMatrix2(PyMOLGlobals * G, CObject * obj, int state,
double **matrix, int incl_ttt); double **matrix, int incl_ttt);
static
int ExecutiveTransformObjectSelection2(PyMOLGlobals * G, CObject * obj, int stat e, int ExecutiveTransformObjectSelection2(PyMOLGlobals * G, CObject * obj, int stat e,
const char *s1, int log, float *matrix, i nt homogenous, const char *s1, int log, float *matrix, i nt homogenous,
int global); int global);
/* /*
* ObjectIterator methods * ObjectIterator methods
*/ */
void ObjectIterator::reset() { void ObjectIterator::reset() {
rec = G->Executive->Spec; rec = G->Executive->Spec;
skipping to change at line 1909 skipping to change at line 1918
ExecutiveInvalidatePanelList(G); ExecutiveInvalidatePanelList(G);
} }
} }
// in case any parent got opened // in case any parent got opened
ExecutiveUpdatePanelList(G); ExecutiveUpdatePanelList(G);
// scroll that record to the top // scroll that record to the top
while(ListIterate(I->Panel, panel, next)) { while(ListIterate(I->Panel, panel, next)) {
if(panel->spec == spec) { if(panel->spec == spec) {
ScrollBarSetValueNoCheck(I->ScrollBar, pos); I->m_ScrollBar.setValueNoCheck(pos);
return numhits; return numhits;
} }
pos++; pos++;
} }
ok_except1: ok_except1:
return numhits; return numhits;
} }
void ExecutiveUpdateColorDepends(PyMOLGlobals * G, ObjectMolecule * mol) void ExecutiveUpdateColorDepends(PyMOLGlobals * G, ObjectMolecule * mol)
skipping to change at line 2440 skipping to change at line 2449
} }
ExecutiveTransformObjectSelection2(G, target_obj, target_state, ExecutiveTransformObjectSelection2(G, target_obj, target_state,
"", log, historyf, true, fals e); "", log, historyf, true, fals e);
} }
} }
if(copy_ttt_too) { if(copy_ttt_too) {
const float *tttf; const float *tttf;
int found = ObjectGetTTT(source_obj, &tttf, -1); int found = ObjectGetTTT(source_obj, &tttf, -1);
if(found) { if(found) {
ObjectSetTTT(target_obj, tttf, -1, -1); ObjectSetTTT(target_obj, tttf, -1, -1);
if(target_obj->fInvalidate) target_obj->invalidate(cRepNone, cRepInvExtents, -1);
target_obj->fInvalidate(target_obj, cRepNone, cRepInvExtents,
-1);
} }
} }
} }
break; break;
case 1: /* applying changes to the object's TTT matrix */ case 1: /* applying changes to the object's TTT matrix */
if(history) { if(history) {
float tttf[16]; float tttf[16];
convertR44dTTTf(history, tttf); convertR44dTTTf(history, tttf);
ObjectSetTTT(target_obj, tttf, -1, -1); ObjectSetTTT(target_obj, tttf, -1, -1);
} else { } else {
ObjectSetTTT(target_obj, NULL, -1, -1); ObjectSetTTT(target_obj, NULL, -1, -1);
} }
if(target_obj->fInvalidate) target_obj->invalidate(cRepNone, cRepInvExtents, -1);
target_obj->fInvalidate(target_obj, cRepNone, cRepInvExtents, -1);
break; break;
case 2: /* applying changes to the state matrix */ case 2: /* applying changes to the state matrix */
ok = ExecutiveSetObjectMatrix2(G, target_obj, target_state, history); ok = ExecutiveSetObjectMatrix2(G, target_obj, target_state, history);
break; break;
} }
break; break;
} }
} }
break; break;
case 1: /* from the TTT matrix */ case 1: /* from the TTT matrix */
skipping to change at line 2480 skipping to change at line 2487
const float *tttf; const float *tttf;
int found = ObjectGetTTT(source_obj, &tttf, -1); int found = ObjectGetTTT(source_obj, &tttf, -1);
if(found) { if(found) {
switch (target_mode) { switch (target_mode) {
case 0: /* coordinates & history unsupported.. */ case 0: /* coordinates & history unsupported.. */
/* should complain */ /* should complain */
break; break;
case 1: /* TTT */ case 1: /* TTT */
ObjectSetTTT(target_obj, tttf, -1, -1); ObjectSetTTT(target_obj, tttf, -1, -1);
if(target_obj->fInvalidate) target_obj->invalidate(cRepNone, cRepInvExtents, -1);
target_obj->fInvalidate(target_obj, cRepNone, cRepInvExtents, -1);
break; break;
case 2: /* State */ case 2: /* State */
if(tttf) { if(tttf) {
double homo[16]; double homo[16];
convertTTTfR44d(tttf, homo); convertTTTfR44d(tttf, homo);
ok = ExecutiveSetObjectMatrix2(G, target_obj, -1, homo); ok = ExecutiveSetObjectMatrix2(G, target_obj, -1, homo);
} else { } else {
ok = ExecutiveSetObjectMatrix2(G, target_obj, -1, NULL); ok = ExecutiveSetObjectMatrix2(G, target_obj, -1, NULL);
} }
break; break;
skipping to change at line 2510 skipping to change at line 2516
if(found) { if(found) {
switch (target_mode) { switch (target_mode) {
case 0: /* coordinates & history */ case 0: /* coordinates & history */
/* TODO */ /* TODO */
break; break;
case 1: /* TTT */ case 1: /* TTT */
if(homo) { if(homo) {
float tttf[16]; float tttf[16];
convertR44dTTTf(homo, tttf); convertR44dTTTf(homo, tttf);
ObjectSetTTT(target_obj, tttf, -1, -1); ObjectSetTTT(target_obj, tttf, -1, -1);
if(target_obj->fInvalidate) target_obj->invalidate(cRepNone, cRepInvExtents, -1);
target_obj->fInvalidate(target_obj, cRepNone, cRepInvExtents, -1);
} else { } else {
ObjectSetTTT(target_obj, NULL, -1, -1); ObjectSetTTT(target_obj, NULL, -1, -1);
if(target_obj->fInvalidate) target_obj->invalidate(cRepNone, cRepInvExtents, -1);
target_obj->fInvalidate(target_obj, cRepNone, cRepInvExtents, -1);
} }
break; break;
case 2: /* State */ case 2: /* State */
ok = ExecutiveSetObjectMatrix2(G, target_obj, target_state, homo); ok = ExecutiveSetObjectMatrix2(G, target_obj, target_state, homo);
if(copy_ttt_too) { if(copy_ttt_too) {
const float *tttf; const float *tttf;
int found = ObjectGetTTT(source_obj, &tttf, -1); int found = ObjectGetTTT(source_obj, &tttf, -1);
if(found) { if(found) {
ObjectSetTTT(target_obj, tttf, -1, -1); ObjectSetTTT(target_obj, tttf, -1, -1);
if(target_obj->fInvalidate) target_obj->invalidate(cRepNone, cRepInvExtents, -1);
target_obj->fInvalidate(target_obj, cRepNone, cRepInvExtents, -1
);
} }
} }
break; break;
} }
} }
} }
break; break;
} }
SceneInvalidate(G); SceneInvalidate(G);
return ok; return ok;
skipping to change at line 2906 skipping to change at line 2909
float historyf[16]; float historyf[16];
invert_special44d44d(history, temp_inverse); invert_special44d44d(history, temp_inverse);
convert44d44f(temp_inverse, historyf); convert44d44f(temp_inverse, historyf);
ExecutiveTransformObjectSelection(G, rec->name, state, "", ExecutiveTransformObjectSelection(G, rec->name, state, "",
log, historyf, true, false); log, historyf, true, false);
} }
} }
break; break;
case 1: /* operate on the TTT display matrix */ case 1: /* operate on the TTT display matrix */
ObjectResetTTT(obj,SettingGetGlobal_b(G,cSetting_movie_auto_store)); ObjectResetTTT(obj,SettingGetGlobal_b(G,cSetting_movie_auto_store));
if(obj->fInvalidate) obj->invalidate(cRepNone, cRepInvExtents, -1);
obj->fInvalidate(obj, cRepNone, cRepInvExtents, -1);
break; break;
case 2: /* applying changes to the state matrix */ case 2: /* applying changes to the state matrix */
{ {
double ident[16]; double ident[16];
identity44d(ident); identity44d(ident);
ExecutiveSetObjectMatrix(G, rec->name, state, ident); ExecutiveSetObjectMatrix(G, rec->name, state, ident);
} }
break; break;
} }
skipping to change at line 3359 skipping to change at line 3361
} }
} }
if(!result) if(!result)
ExecutiveDelete(G, target); ExecutiveDelete(G, target);
if(!ok) if(!ok)
return -1; return -1;
else else
return result; return result;
} }
/*
* Return the selector index of the "active" alignment.
*/
int ExecutiveGetActiveAlignmentSele(PyMOLGlobals * G) int ExecutiveGetActiveAlignmentSele(PyMOLGlobals * G)
{ {
const char* alignment = ExecutiveGetActiveAlignment(G);
if (alignment && alignment[0]) {
return SelectorIndexByName(G, alignment);
}
return -1;
}
/*
* Return the name of the "active" alignment. That is:
*
* 1) The "seq_view_alignment" setting if it's set
* 2) or the name of the first enabled alignment object
* 3) or NULL
*/
const char* ExecutiveGetActiveAlignment(PyMOLGlobals* G)
{
const char *alignment = SettingGetGlobal_s(G, cSetting_seq_view_alignment); const char *alignment = SettingGetGlobal_s(G, cSetting_seq_view_alignment);
int align_sele = -1;
if(alignment && alignment[0]) { /* explicit alignment setting name */ if(alignment && alignment[0]) { /* explicit alignment setting name */
align_sele = SelectorIndexByName(G, alignment); return alignment;
} else { /* otherwise, use the first active alignment */ } else { /* otherwise, use the first active alignment */
SpecRec *rec = NULL; SpecRec *rec = NULL;
CExecutive *I = G->Executive; CExecutive *I = G->Executive;
while(ListIterate(I->Spec, rec, next)) { while(ListIterate(I->Spec, rec, next)) {
if(rec->visible) { if(rec->visible) {
if(rec->type == cExecObject) if(rec->type == cExecObject)
if(rec->obj->type == cObjectAlignment) { if(rec->obj->type == cObjectAlignment) {
if(rec->obj->fUpdate) /* allow object to update selection, if return rec->obj->Name;
necessary */
rec->obj->fUpdate(rec->obj);
align_sele = SelectorIndexByName(G, rec->obj->Name);
if(align_sele >= 0)
break;
} }
} }
} }
} }
return align_sele; return nullptr;
} }
int ExecutiveGetActiveSele(PyMOLGlobals * G) int ExecutiveGetActiveSele(PyMOLGlobals * G)
{ {
ObjectNameType name; ObjectNameType name;
if(ExecutiveGetActiveSeleName(G, name, false, false)) if(ExecutiveGetActiveSeleName(G, name, false, false))
return SelectorIndexByName(G, name); return SelectorIndexByName(G, name);
else else
return -1; return -1;
skipping to change at line 3645 skipping to change at line 3661
* zoom: Zoom on new loaded atoms * zoom: Zoom on new loaded atoms
* discrete: Make discrete states * discrete: Make discrete states
* finish: update object selection & zoom * finish: update object selection & zoom
* multiplex: Split new states into objects * multiplex: Split new states into objects
* quiet: Suppress feedback * quiet: Suppress feedback
* object_props: names of object properties to load * object_props: names of object properties to load
* atom_props: names of atom properties to load * atom_props: names of atom properties to load
*/ */
int ExecutiveLoad(PyMOLGlobals * G, int ExecutiveLoad(PyMOLGlobals * G,
const char *content, int content_length, const char *content, int content_length,
int content_format, cLoadType_t content_format,
const char *object_name_proposed, const char *object_name_proposed,
int state, int zoom, int state, int zoom,
int discrete, int finish, int multiplex, int quiet, int discrete, int finish, int multiplex, int quiet,
const char * plugin_arg, const char * plugin_arg,
const char * object_props, const char * object_props,
const char * atom_props, const char * atom_props,
bool mimic) bool mimic)
{ {
int ok = true; int ok = true;
const char * fname = content; const char * fname = content;
skipping to change at line 4004 skipping to change at line 4020
* oname -- object name * oname -- object name
* type -- new object type * type -- new object type
* *
* RETURNS * RETURNS
* (CObject *) Base-class object ptr * (CObject *) Base-class object ptr
* *
* SIDE EFFECTS * SIDE EFFECTS
* If an object with the same name but different type already exists, * If an object with the same name but different type already exists,
* then it is deleted. * then it is deleted.
*/ */
CObject *ExecutiveGetExistingCompatible(PyMOLGlobals * G, const char *oname, int type) CObject* ExecutiveGetExistingCompatible(PyMOLGlobals * G, const char* oname, cLo adType_t type)
{ {
CObject *origObj = NULL; CObject *origObj = NULL;
origObj = ExecutiveFindObjectByName(G, oname); origObj = ExecutiveFindObjectByName(G, oname);
/* check for existing object of right type, delete if not */ /* check for existing object of right type, delete if not */
if(origObj) { if(origObj) {
int new_type = -1; int new_type = -1;
switch (type) { switch (type) {
case cLoadTypePlugin: case cLoadTypePlugin:
// let PlugIOManager delete incompatible objects // let PlugIOManager delete incompatible objects
return origObj; return origObj;
skipping to change at line 4630 skipping to change at line 4646
} }
} }
} }
if(ll > 3) { /* object color */ if(ll > 3) { /* object color */
col = PyList_GetItem(list, 3); col = PyList_GetItem(list, 3);
if(ok) if(ok)
ok = (col != NULL); ok = (col != NULL);
if(ok) if(ok)
if(PyInt_Check(col)) { if(PyInt_Check(col)) {
ok = PConvPyObjectToInt(col, &rec->obj->Color); ok = PConvPyObjectToInt(col, &rec->obj->Color);
if(rec->obj->fInvalidate) rec->obj->invalidate(cRepAll, cRepInvColor, -1);
rec->obj->fInvalidate(rec->obj, cRepAll, cRepInvColor, -1);
} }
} }
} }
if(rec->visible && (rec->type == cExecObject)) { if(rec->visible && (rec->type == cExecObject)) {
(*(++recstack)) = rec; (*(++recstack)) = rec;
} }
} }
} }
} }
skipping to change at line 4885 skipping to change at line 4900
value[a] = ai->hetatm; value[a] = ai->hetatm;
continue; continue;
case cPType_index: case cPType_index:
value[a] = iter.getAtm() + 1.f; value[a] = iter.getAtm() + 1.f;
continue; continue;
} }
// enumerated values // enumerated values
switch (ap->Ptype) { switch (ap->Ptype) {
case cPType_int_as_string: case cPType_int_as_string:
value_e = *reinterpret_cast<const lexidx_t*>(raw_ptr); value_e = LexNumeric(*reinterpret_cast<const lexidx_t*>(raw_ptr) );
break; break;
case cPType_string: case cPType_string:
// works for small strings // works for small strings
strncpy(value_s, raw_ptr, sizeof(value_e)); strncpy(value_s, raw_ptr, sizeof(value_e));
break; break;
case cPType_model: case cPType_model:
value_e = (size_t) iter.obj; value_e = (size_t) iter.obj;
break; break;
default: default:
PRINTFB(G, FB_Executive, FB_Errors) PRINTFB(G, FB_Executive, FB_Errors)
skipping to change at line 4971 skipping to change at line 4986
static int fStrOrderFn(const char ** array, int l, int r) { static int fStrOrderFn(const char ** array, int l, int r) {
return strcmp(array[l], array[r]) < 0; return strcmp(array[l], array[r]) < 0;
} }
/* /*
* Returns an VLA with pointers into G->Lexicon * Returns an VLA with pointers into G->Lexicon
*/ */
const char **ExecutiveGetChains(PyMOLGlobals * G, const char *sele, int state) const char **ExecutiveGetChains(PyMOLGlobals * G, const char *sele, int state)
{ {
const char **result = NULL; const char **result = NULL;
std::set<ov_word> chains; std::set<lexidx_t> chains;
int c = 0; int c = 0;
ObjectMoleculeOpRec op; ObjectMoleculeOpRec op;
SelectorTmp tmpsele1(G, sele); SelectorTmp tmpsele1(G, sele);
int sele1 = tmpsele1.getIndex(); int sele1 = tmpsele1.getIndex();
if(sele1 >= 0) { if(sele1 >= 0) {
ObjectMoleculeOpRecInit(&op); ObjectMoleculeOpRecInit(&op);
op.code = OMOP_GetChains; op.code = OMOP_GetChains;
op.ii1 = (int*) (void*) &chains; // pointer pack op.ii1 = (int*) (void*) &chains; // pointer pack
op.i1 = 0; op.i1 = 0;
ExecutiveObjMolSeleOp(G, sele1, &op); ExecutiveObjMolSeleOp(G, sele1, &op);
result = VLAlloc(const char*, chains.size()); result = VLAlloc(const char*, chains.size());
for (std::set<ov_word>::iterator it = chains.begin(), for (const auto& chain : chains) {
it_end = chains.end(); it != it_end; ++it) { result[c++] = LexStr(G, chain);
result[c++] = LexStr(G, *it);
} }
// sort the array // sort the array
UtilSortInPlace(G, result, chains.size(), sizeof(char *), UtilSortInPlace(G, result, chains.size(), sizeof(char *),
(UtilOrderFn *) fStrOrderFn); (UtilOrderFn *) fStrOrderFn);
} else { } else {
ErrMessage(G, "ExecutiveGetChains", "Bad selection."); ErrMessage(G, "ExecutiveGetChains", "Bad selection.");
} }
return (result); return (result);
} }
skipping to change at line 5558 skipping to change at line 5572
Py_XDECREF(tmp); Py_XDECREF(tmp);
tmp = MovieAsPyList(G); tmp = MovieAsPyList(G);
PyDict_SetItemString(dict, "movie", tmp); PyDict_SetItemString(dict, "movie", tmp);
Py_XDECREF(tmp); Py_XDECREF(tmp);
tmp = EditorAsPyList(G); tmp = EditorAsPyList(G);
PyDict_SetItemString(dict, "editor", tmp); PyDict_SetItemString(dict, "editor", tmp);
Py_XDECREF(tmp); Py_XDECREF(tmp);
tmp = MainAsPyList(); tmp = MainAsPyList(G);
PyDict_SetItemString(dict, "main", tmp); PyDict_SetItemString(dict, "main", tmp);
Py_XDECREF(tmp); Py_XDECREF(tmp);
#ifdef PYMOL_EVAL #ifdef PYMOL_EVAL
ExecutiveEvalMessage(G, dict); ExecutiveEvalMessage(G, dict);
#endif #endif
} }
if(Feedback(G, FB_Executive, FB_Errors)) { if(Feedback(G, FB_Executive, FB_Errors)) {
skipping to change at line 5966 skipping to change at line 5980
PParse(G, "viewport"); /* refresh window/internal_gui status */ PParse(G, "viewport"); /* refresh window/internal_gui status */
} }
// Do not load viewport size when we have a GUI // Do not load viewport size when we have a GUI
if(ok) { if(ok) {
tmp = PyDict_GetItemString(session, "main"); tmp = PyDict_GetItemString(session, "main");
if(tmp) { if(tmp) {
if (!G->HaveGUI && if (!G->HaveGUI &&
/* PYMOL-775 added suspend_updates check, but does it make sense? */ /* PYMOL-775 added suspend_updates check, but does it make sense? */
!SettingGetGlobal_b(G, cSetting_suspend_updates) && !SettingGetGlobal_b(G, cSetting_suspend_updates) &&
!partial_restore) { !partial_restore) {
ok = MainFromPyList(tmp); ok = MainFromPyList(G, tmp);
#ifndef _PYMOL_NOPY #ifndef _PYMOL_NOPY
} else if (!quiet) { } else if (!quiet) {
int viewport[2]; int viewport[2];
PConvPyListToIntArrayInPlace(tmp, viewport, 2); PConvPyListToIntArrayInPlace(tmp, viewport, 2);
PRINTFB(G, FB_Executive, FB_Actions) PRINTFB(G, FB_Executive, FB_Actions)
" Session was saved with: viewport %d, %d\n", " Session was saved with: viewport %d, %d\n",
viewport[0], viewport[1] ENDFB(G); viewport[0], viewport[1] ENDFB(G);
#endif #endif
} }
} }
skipping to change at line 7555 skipping to change at line 7569
} }
void ExecutiveSelectRect(PyMOLGlobals * G, BlockRect * rect, int mode) void ExecutiveSelectRect(PyMOLGlobals * G, BlockRect * rect, int mode)
{ {
Multipick smp; Multipick smp;
OrthoLineType buffer, buf2; OrthoLineType buffer, buf2;
char selName[WordLength] = cLeftButSele; char selName[WordLength] = cLeftButSele;
char prefix[3] = ""; char prefix[3] = "";
int log_box = 0; int log_box = 0;
int logging; int logging;
char empty_string[1] = ""; const char *sel_mode_kw = "";
char *sel_mode_kw = empty_string;
logging = SettingGetGlobal_i(G, cSetting_logging); logging = SettingGetGlobal_i(G, cSetting_logging);
if(logging) if(logging)
log_box = SettingGetGlobal_b(G, cSetting_log_box_selections); log_box = SettingGetGlobal_b(G, cSetting_log_box_selections);
/* if(logging==cPLog_pml) /* if(logging==cPLog_pml)
strcpy(prefix,"_ "); */ strcpy(prefix,"_ "); */
smp.picked = VLAlloc(Picking, 1000); smp.picked = VLAlloc(Picking, 1000);
smp.x = rect->left; smp.x = rect->left;
smp.y = rect->bottom; smp.y = rect->bottom;
smp.w = rect->right - rect->left; smp.w = rect->right - rect->left;
skipping to change at line 7722 skipping to change at line 7735
CExecutive *I = G->Executive; CExecutive *I = G->Executive;
if((!name)||(!name[0])||(!strcmp(name,cKeywordAll))||(!strcmp(name,cKeywordSam e))) { if((!name)||(!name[0])||(!strcmp(name,cKeywordAll))||(!strcmp(name,cKeywordSam e))) {
SpecRec *rec = NULL; SpecRec *rec = NULL;
while(ListIterate(I->Spec, rec, next)) { while(ListIterate(I->Spec, rec, next)) {
switch(rec->type) { switch(rec->type) {
case cExecObject: case cExecObject:
{ {
CObject *obj = rec->obj; CObject *obj = rec->obj;
if((ObjectGetSpecLevel(rec->obj,0)>=0)||(!strcmp(name,cKeywordAll))) { if((ObjectGetSpecLevel(rec->obj,0)>=0)||(!strcmp(name,cKeywordAll))) {
ObjectCombineTTT(obj, ttt, reverse_order, store); ObjectCombineTTT(obj, ttt, reverse_order, store);
if(obj->fInvalidate) obj->invalidate(cRepNone, cRepInvExtents, -1);
obj->fInvalidate(obj, cRepNone, cRepInvExtents, -1);
} }
} }
break; break;
} }
} }
if(store && SettingGetGlobal_i(G,cSetting_movie_auto_interpolate)) { if(store && SettingGetGlobal_i(G,cSetting_movie_auto_interpolate)) {
ExecutiveMotionReinterpolate(G); ExecutiveMotionReinterpolate(G);
} }
} else { /* pattern */ } else { /* pattern */
CTracker *I_Tracker = I->Tracker; CTracker *I_Tracker = I->Tracker;
skipping to change at line 7745 skipping to change at line 7757
int list_id = ExecutiveGetNamesListFromPattern(G, name, true, true); int list_id = ExecutiveGetNamesListFromPattern(G, name, true, true);
int iter_id = TrackerNewIter(I_Tracker, 0, list_id); int iter_id = TrackerNewIter(I_Tracker, 0, list_id);
while(TrackerIterNextCandInList(I_Tracker, iter_id, (TrackerRef **) (void *) &rec)) { while(TrackerIterNextCandInList(I_Tracker, iter_id, (TrackerRef **) (void *) &rec)) {
if(rec) { if(rec) {
switch (rec->type) { switch (rec->type) {
case cExecObject: case cExecObject:
{ {
CObject *obj = rec->obj; CObject *obj = rec->obj;
ObjectCombineTTT(obj, ttt, reverse_order, store); ObjectCombineTTT(obj, ttt, reverse_order, store);
if(obj->fInvalidate) obj->invalidate(cRepNone, cRepInvExtents, -1);
obj->fInvalidate(obj, cRepNone, cRepInvExtents, -1);
} }
break; break;
} }
} }
} }
TrackerDelList(I_Tracker, list_id); TrackerDelList(I_Tracker, list_id);
TrackerDelIter(I_Tracker, iter_id); TrackerDelIter(I_Tracker, iter_id);
if(store && SettingGetGlobal_i(G,cSetting_movie_auto_interpolate)) { if(store && SettingGetGlobal_i(G,cSetting_movie_auto_interpolate)) {
ExecutiveMotionReinterpolate(G); ExecutiveMotionReinterpolate(G);
} }
skipping to change at line 7776 skipping to change at line 7787
CExecutive *I = G->Executive; CExecutive *I = G->Executive;
if((!name)||(!name[0])||(!strcmp(name,cKeywordAll))||(!strcmp(name,cKeywordSam e))) { if((!name)||(!name[0])||(!strcmp(name,cKeywordAll))||(!strcmp(name,cKeywordSam e))) {
SpecRec *rec = NULL; SpecRec *rec = NULL;
while(ListIterate(I->Spec, rec, next)) { while(ListIterate(I->Spec, rec, next)) {
switch(rec->type) { switch(rec->type) {
case cExecObject: case cExecObject:
{ {
CObject *obj = rec->obj; CObject *obj = rec->obj;
if((ObjectGetSpecLevel(rec->obj,0)>=0)||(!strcmp(name,cKeywordAll))) { if((ObjectGetSpecLevel(rec->obj,0)>=0)||(!strcmp(name,cKeywordAll))) {
ObjectTranslateTTT(obj, trans, store); ObjectTranslateTTT(obj, trans, store);
if(obj->fInvalidate) obj->invalidate(cRepNone, cRepInvExtents, -1);
obj->fInvalidate(obj, cRepNone, cRepInvExtents, -1);
} }
} }
break; break;
} }
} }
if(store && SettingGetGlobal_i(G,cSetting_movie_auto_interpolate)) { if(store && SettingGetGlobal_i(G,cSetting_movie_auto_interpolate)) {
ExecutiveMotionReinterpolate(G); ExecutiveMotionReinterpolate(G);
} }
} else { /* pattern */ } else { /* pattern */
CTracker *I_Tracker = I->Tracker; CTracker *I_Tracker = I->Tracker;
SpecRec *rec = NULL; SpecRec *rec = NULL;
int list_id = ExecutiveGetNamesListFromPattern(G, name, true, true); int list_id = ExecutiveGetNamesListFromPattern(G, name, true, true);
int iter_id = TrackerNewIter(I_Tracker, 0, list_id); int iter_id = TrackerNewIter(I_Tracker, 0, list_id);
while(TrackerIterNextCandInList(I_Tracker, iter_id, (TrackerRef **) (void *) &rec)) { while(TrackerIterNextCandInList(I_Tracker, iter_id, (TrackerRef **) (void *) &rec)) {
if(rec) { if(rec) {
switch (rec->type) { switch (rec->type) {
case cExecObject: case cExecObject:
{ {
CObject *obj = rec->obj; CObject *obj = rec->obj;
ObjectTranslateTTT(obj, trans, store); ObjectTranslateTTT(obj, trans, store);
if(obj->fInvalidate) obj->invalidate(cRepNone, cRepInvExtents, -1);
obj->fInvalidate(obj, cRepNone, cRepInvExtents, -1);
} }
break; break;
} }
} }
} }
TrackerDelList(I_Tracker, list_id); TrackerDelList(I_Tracker, list_id);
TrackerDelIter(I_Tracker, iter_id); TrackerDelIter(I_Tracker, iter_id);
if(store && SettingGetGlobal_i(G,cSetting_movie_auto_interpolate)) { if(store && SettingGetGlobal_i(G,cSetting_movie_auto_interpolate)) {
ExecutiveMotionReinterpolate(G); ExecutiveMotionReinterpolate(G);
} }
skipping to change at line 7828 skipping to change at line 7837
CExecutive *I = G->Executive; CExecutive *I = G->Executive;
if((!name)||(!name[0])||(!strcmp(name,cKeywordAll))||(!strcmp(name,cKeywordSam e))) { if((!name)||(!name[0])||(!strcmp(name,cKeywordAll))||(!strcmp(name,cKeywordSam e))) {
SpecRec *rec = NULL; SpecRec *rec = NULL;
while(ListIterate(I->Spec, rec, next)) { while(ListIterate(I->Spec, rec, next)) {
switch(rec->type) { switch(rec->type) {
case cExecObject: case cExecObject:
{ {
CObject *obj = rec->obj; CObject *obj = rec->obj;
if((ObjectGetSpecLevel(rec->obj,0)>=0)||(!strcmp(name,cKeywordAll))) { if((ObjectGetSpecLevel(rec->obj,0)>=0)||(!strcmp(name,cKeywordAll))) {
ObjectSetTTT(obj, ttt, state, store); ObjectSetTTT(obj, ttt, state, store);
if(obj->fInvalidate) obj->invalidate(cRepNone, cRepInvExtents, -1);
obj->fInvalidate(obj, cRepNone, cRepInvExtents, -1);
} }
} }
break; break;
} }
} }
if(store && SettingGetGlobal_i(G,cSetting_movie_auto_interpolate)) { if(store && SettingGetGlobal_i(G,cSetting_movie_auto_interpolate)) {
ExecutiveMotionReinterpolate(G); ExecutiveMotionReinterpolate(G);
} }
} else { /* pattern */ } else { /* pattern */
CTracker *I_Tracker = I->Tracker; CTracker *I_Tracker = I->Tracker;
skipping to change at line 7851 skipping to change at line 7859
int list_id = ExecutiveGetNamesListFromPattern(G, name, true, true); int list_id = ExecutiveGetNamesListFromPattern(G, name, true, true);
int iter_id = TrackerNewIter(I_Tracker, 0, list_id); int iter_id = TrackerNewIter(I_Tracker, 0, list_id);
while(TrackerIterNextCandInList(I_Tracker, iter_id, (TrackerRef **) (void *) &rec)) { while(TrackerIterNextCandInList(I_Tracker, iter_id, (TrackerRef **) (void *) &rec)) {
if(rec) { if(rec) {
switch (rec->type) { switch (rec->type) {
case cExecObject: case cExecObject:
{ {
CObject *obj = rec->obj; CObject *obj = rec->obj;
ObjectSetTTT(obj, ttt, state, store); ObjectSetTTT(obj, ttt, state, store);
if(obj->fInvalidate) obj->invalidate(cRepNone, cRepInvExtents, -1);
obj->fInvalidate(obj, cRepNone, cRepInvExtents, -1);
} }
break; break;
} }
} }
} }
TrackerDelList(I_Tracker, list_id); TrackerDelList(I_Tracker, list_id);
TrackerDelIter(I_Tracker, iter_id); TrackerDelIter(I_Tracker, iter_id);
if(store && SettingGetGlobal_i(G,cSetting_movie_auto_interpolate)) { if(store && SettingGetGlobal_i(G,cSetting_movie_auto_interpolate)) {
ExecutiveMotionReinterpolate(G); ExecutiveMotionReinterpolate(G);
} }
skipping to change at line 8143 skipping to change at line 8150
} }
} }
MatchFree(match); MatchFree(match);
} }
} else { } else {
ok = false; ok = false;
PRINTFB(G, FB_Executive, FB_Errors) PRINTFB(G, FB_Executive, FB_Errors)
" ExecutiveAlign: invalid selections for alignment.\n" ENDFB(G); " ExecutiveAlign: invalid selections for alignment.\n" ENDFB(G);
} }
} }
ExecutiveUpdateCoordDepends(G, mobile_obj); //Updates dynamic_measures - see PYMOL-3090
} }
VLAFreeP(vla1); VLAFreeP(vla1);
VLAFreeP(vla2); VLAFreeP(vla2);
return ok; return ok;
} }
int ExecutivePairIndices(PyMOLGlobals * G, const char *s1, const char *s2, int s tate1, int state2, int ExecutivePairIndices(PyMOLGlobals * G, const char *s1, const char *s2, int s tate1, int state2,
int mode, float cutoff, float h_angle, int mode, float cutoff, float h_angle,
int **indexVLA, ObjectMolecule *** objVLA) int **indexVLA, ObjectMolecule *** objVLA)
skipping to change at line 9444 skipping to change at line 9452
ObjectMoleculeInvalidate((ObjectMolecule *) rec->obj, cRepAll, cRepInv Rep, -1); ObjectMoleculeInvalidate((ObjectMolecule *) rec->obj, cRepAll, cRepInv Rep, -1);
break; break;
case cObjectMeasurement: case cObjectMeasurement:
ObjectDistInvalidateRep((ObjectDist *) rec->obj, cRepAll); ObjectDistInvalidateRep((ObjectDist *) rec->obj, cRepAll);
break; break;
case cObjectSurface: case cObjectSurface:
case cObjectMesh: case cObjectMesh:
case cObjectSlice: case cObjectSlice:
case cObjectAlignment: case cObjectAlignment:
case cObjectCGO: case cObjectCGO:
if(rec->obj->fInvalidate) { rec->obj->invalidate(cRepAll, cRepInvAll, -1);
rec->obj->fInvalidate((CObject *) rec->obj, cRepAll, cRepInvAll, -1);
}
break; break;
} }
} }
} }
SeqChanged(G); SeqChanged(G);
SceneChanged(G); SceneChanged(G);
} }
/*========================================================================*/ /*========================================================================*/
void ExecutiveRebuildAllObjectDist(PyMOLGlobals * G) void ExecutiveRebuildAllObjectDist(PyMOLGlobals * G)
skipping to change at line 9624 skipping to change at line 9630
} }
} }
} }
} }
/*========================================================================*/ /*========================================================================*/
void ExecutiveAddHydrogens(PyMOLGlobals * G, const char *s1, int quiet, int stat e, bool legacy) void ExecutiveAddHydrogens(PyMOLGlobals * G, const char *s1, int quiet, int stat e, bool legacy)
{ {
ObjectMoleculeOpRec op; ObjectMoleculeOpRec op;
/* Needs 4 passes */ if (legacy) {
int passes = legacy ? 4 : 1; PRINTFB(G, FB_Executive, FB_Warnings)
for (int cnt = 0; cnt < passes; ++cnt) { " %s-Warning: legacy mode was removed\n", __FUNCTION__ ENDFB(G);
}
{
SelectorTmp tmpsele1(G, s1); SelectorTmp tmpsele1(G, s1);
int sele1 = tmpsele1.getIndex(); int sele1 = tmpsele1.getIndex();
ObjectMoleculeOpRecInit(&op); ObjectMoleculeOpRecInit(&op);
op.code = OMOP_AddHydrogens; /* 4 passes completes the job */ op.code = OMOP_AddHydrogens;
op.i1 = state; op.i1 = state;
op.i2 = legacy;
ExecutiveObjMolSeleOp(G, sele1, &op); ExecutiveObjMolSeleOp(G, sele1, &op);
} }
} }
/*========================================================================*/ /*========================================================================*/
void ExecutiveFixHydrogens(PyMOLGlobals * G, const char *s1, int quiet) void ExecutiveFixHydrogens(PyMOLGlobals * G, const char *s1, int quiet)
{ {
int sele1; int sele1;
ObjectMoleculeOpRec op; ObjectMoleculeOpRec op;
skipping to change at line 9814 skipping to change at line 9822
case -1: case -1:
SettingSetGlobal_f(G, cSetting_stereo_shift, -SettingGetGlobal_f(G, cSetting _stereo_shift)); SettingSetGlobal_f(G, cSetting_stereo_shift, -SettingGetGlobal_f(G, cSetting _stereo_shift));
break; break;
default: /* -2 */ default: /* -2 */
SettingSet(G, cSetting_chromadepth, 0); SettingSet(G, cSetting_chromadepth, 0);
{ {
stereo_mode = SettingGetGlobal_i(G, cSetting_stereo_mode); stereo_mode = SettingGetGlobal_i(G, cSetting_stereo_mode);
switch (stereo_mode) { switch (stereo_mode) {
case 0: /* off */ case 0: /* off */
break; break;
case cStereo_quadbuffer: /* hardware stereo-in-a-window *
/
SceneSetStereo(G, flag);
#ifndef _PYMOL_NOPY
PSGIStereo(G, flag); /* does this have any effect anymore? */
#endif
break;
default: default:
SceneSetStereo(G, flag); SceneSetStereo(G, flag);
break; break;
} }
} }
} }
// for chromadepth // for chromadepth
G->ShaderMgr->Set_Reload_Bits(RELOAD_VARIABLES); G->ShaderMgr->Set_Reload_Bits(RELOAD_VARIABLES);
skipping to change at line 11614 skipping to change at line 11616
ExecutiveObjMolSeleOp(G, sele1, &op2); ExecutiveObjMolSeleOp(G, sele1, &op2);
result = op2.f1VLA; result = op2.f1VLA;
VLAFreeP(op1.vv1); VLAFreeP(op1.vv1);
VLAFreeP(op1.i1VLA); VLAFreeP(op1.i1VLA);
VLAFreeP(op2.vv1); VLAFreeP(op2.vv1);
} }
return (result); return (result);
} }
/*========================================================================*/ /*========================================================================*/
float ExecutiveRMSPairs(PyMOLGlobals * G, WordType * sele, int pairs, int mode) float ExecutiveRMSPairs(PyMOLGlobals * G, WordType * sele, int pairs, int mode,
bool quiet)
{ {
int sele1, sele2; int sele1, sele2;
int a, c; int a, c;
float rms = 0.0, inv, *f; float rms = 0.0, inv, *f;
OrthoLineType buffer; OrthoLineType buffer;
ObjectMoleculeOpRec op1; ObjectMoleculeOpRec op1;
ObjectMoleculeOpRec op2; ObjectMoleculeOpRec op2;
OrthoLineType combi, s1; OrthoLineType combi, s1;
skipping to change at line 11683 skipping to change at line 11686
if(op1.vv1 && op2.vv1) { if(op1.vv1 && op2.vv1) {
if(op1.nvv1 != op2.nvv1) { if(op1.nvv1 != op2.nvv1) {
sprintf(buffer, "Atom counts between selection sets don't match (%d != %d) .", sprintf(buffer, "Atom counts between selection sets don't match (%d != %d) .",
op1.nvv1, op2.nvv1); op1.nvv1, op2.nvv1);
ErrMessage(G, "ExecutiveRMS", buffer); ErrMessage(G, "ExecutiveRMS", buffer);
} else if(op1.nvv1) { } else if(op1.nvv1) {
if(mode != 0) if(mode != 0)
rms = MatrixFitRMSTTTf(G, op1.nvv1, op1.vv1, op2.vv1, NULL, op2.ttt); rms = MatrixFitRMSTTTf(G, op1.nvv1, op1.vv1, op2.vv1, NULL, op2.ttt);
else else
rms = MatrixGetRMS(G, op1.nvv1, op1.vv1, op2.vv1, NULL); rms = MatrixGetRMS(G, op1.nvv1, op1.vv1, op2.vv1, NULL);
if (!quiet)
PRINTFB(G, FB_Executive, FB_Results) PRINTFB(G, FB_Executive, FB_Results)
" ExecutiveRMS: RMSD = %8.3f (%d to %d atoms)\n", rms, op1.nvv1, op2.nvv 1 ENDFB(G); " ExecutiveRMS: RMSD = %8.3f (%d to %d atoms)\n", rms, op1.nvv1, op2.nvv 1 ENDFB(G);
op2.code = OMOP_TTTF; op2.code = OMOP_TTTF;
SelectorGetTmp(G, combi, s1); SelectorGetTmp(G, combi, s1);
sele1 = SelectorIndexByName(G, s1); sele1 = SelectorIndexByName(G, s1);
ExecutiveObjMolSeleOp(G, sele1, &op2); ExecutiveObjMolSeleOp(G, sele1, &op2);
SelectorFreeTmp(G, s1); SelectorFreeTmp(G, s1);
} else { } else {
ErrMessage(G, "ExecutiveRMS", "No atoms selected."); ErrMessage(G, "ExecutiveRMS", "No atoms selected.");
skipping to change at line 11730 skipping to change at line 11735
CExecutive *I = G->Executive; CExecutive *I = G->Executive;
if((!name)||(!name[0])||(!strcmp(name,cKeywordAll))||(!strcmp(name,cKeywordS ame))) { if((!name)||(!name[0])||(!strcmp(name,cKeywordAll))||(!strcmp(name,cKeywordS ame))) {
SpecRec *rec = NULL; SpecRec *rec = NULL;
while(ListIterate(I->Spec, rec, next)) { while(ListIterate(I->Spec, rec, next)) {
switch(rec->type) { switch(rec->type) {
case cExecObject: case cExecObject:
{ {
CObject *obj = rec->obj; CObject *obj = rec->obj;
if((ObjectGetSpecLevel(rec->obj,0)>=0)||(!strcmp(name,cKeywordAll))) { if((ObjectGetSpecLevel(rec->obj,0)>=0)||(!strcmp(name,cKeywordAll))) {
ObjectResetTTT(obj, SettingGetGlobal_b(G,cSetting_movie_auto_store )); ObjectResetTTT(obj, SettingGetGlobal_b(G,cSetting_movie_auto_store ));
if(obj->fInvalidate) obj->invalidate(cRepNone, cRepInvExtents, -1);
obj->fInvalidate(obj, cRepNone, cRepInvExtents, -1);
} }
} }
break; break;
} }
} }
if(store && SettingGetGlobal_i(G,cSetting_movie_auto_interpolate)) { if(store && SettingGetGlobal_i(G,cSetting_movie_auto_interpolate)) {
ExecutiveMotionReinterpolate(G); ExecutiveMotionReinterpolate(G);
} }
} else { /* pattern */ } else { /* pattern */
CTracker *I_Tracker = I->Tracker; CTracker *I_Tracker = I->Tracker;
skipping to change at line 11753 skipping to change at line 11757
int list_id = ExecutiveGetNamesListFromPattern(G, name, true, true); int list_id = ExecutiveGetNamesListFromPattern(G, name, true, true);
int iter_id = TrackerNewIter(I_Tracker, 0, list_id); int iter_id = TrackerNewIter(I_Tracker, 0, list_id);
while(TrackerIterNextCandInList(I_Tracker, iter_id, (TrackerRef **) (void *) &rec)) { while(TrackerIterNextCandInList(I_Tracker, iter_id, (TrackerRef **) (void *) &rec)) {
if(rec) { if(rec) {
switch (rec->type) { switch (rec->type) {
case cExecObject: case cExecObject:
{ {
CObject *obj = rec->obj; CObject *obj = rec->obj;
ObjectResetTTT(obj, SettingGetGlobal_b(G,cSetting_movie_auto_store )); ObjectResetTTT(obj, SettingGetGlobal_b(G,cSetting_movie_auto_store ));
if(obj->fInvalidate) obj->invalidate(cRepNone, cRepInvExtents, -1);
obj->fInvalidate(obj, cRepNone, cRepInvExtents, -1);
} }
break; break;
} }
} }
} }
TrackerDelList(I_Tracker, list_id); TrackerDelList(I_Tracker, list_id);
TrackerDelIter(I_Tracker, iter_id); TrackerDelIter(I_Tracker, iter_id);
if(store && SettingGetGlobal_i(G,cSetting_movie_auto_interpolate)) { if(store && SettingGetGlobal_i(G,cSetting_movie_auto_interpolate)) {
ExecutiveMotionReinterpolate(G); ExecutiveMotionReinterpolate(G);
} }
skipping to change at line 13019 skipping to change at line 13022
ExecutiveObjMolSeleOp(G, sele, &op); ExecutiveObjMolSeleOp(G, sele, &op);
} }
} }
} }
break; break;
} }
switch (rec->type) { /* sets object color */ switch (rec->type) { /* sets object color */
case cExecObject: case cExecObject:
rec->obj->Color = col_ind; rec->obj->Color = col_ind;
if(rec->obj->fInvalidate) rec->obj->invalidate(cRepAll, cRepInvColor, -1);
rec->obj->fInvalidate(rec->obj, cRepAll, cRepInvColor, -1);
n_obj++; n_obj++;
ok = true; ok = true;
SceneInvalidate(G); SceneInvalidate(G);
break; break;
case cExecAll: case cExecAll:
rec = NULL; rec = NULL;
while(ListIterate(I->Spec, rec, next)) { while(ListIterate(I->Spec, rec, next)) {
if(rec->type == cExecObject) { if(rec->type == cExecObject) {
rec->obj->Color = col_ind; rec->obj->Color = col_ind;
if(rec->obj->fInvalidate) rec->obj->invalidate(cRepAll, cRepInvColor, -1);
rec->obj->fInvalidate(rec->obj, cRepAll, cRepInvColor, -1);
n_obj++; n_obj++;
ok = true; ok = true;
SceneInvalidate(G); SceneInvalidate(G);
} }
} }
break; break;
} }
} }
} }
TrackerDelList(I_Tracker, list_id); TrackerDelList(I_Tracker, list_id);
skipping to change at line 14248 skipping to change at line 14249
case cExecSelection: case cExecSelection:
case cExecObject: case cExecObject:
{ {
int sele = SelectorIndexByName(G, rec->name); int sele = SelectorIndexByName(G, rec->name);
if(sele >= 0) { if(sele >= 0) {
ObjectMoleculeOpRecInit(&op); ObjectMoleculeOpRecInit(&op);
op.code = OMOP_INVA; op.code = OMOP_INVA;
op.i1 = (rep == cRepAll) ? cRepBitmask : (1 << rep); op.i1 = (rep == cRepAll) ? cRepBitmask : (1 << rep);
op.i2 = level; op.i2 = level;
ExecutiveObjMolSeleOp(G, sele, &op); ExecutiveObjMolSeleOp(G, sele, &op);
} else if(rec->obj->fInvalidate) { } else {
rec->obj->fInvalidate(rec->obj, rep, level, -1); rec->obj->invalidate(rep, level, -1);
} }
} }
break; break;
case cExecAll: case cExecAll:
rec = NULL; rec = NULL;
while(ListIterate(I->Spec, rec, next)) { while(ListIterate(I->Spec, rec, next)) {
if(rec->type == cExecObject) { if(rec->type == cExecObject) {
if(rec->obj->fInvalidate) { if(rec->obj->fInvalidate) {
rec->obj->fInvalidate(rec->obj, rep, level, -1); rec->obj->invalidate(rep, level, -1);
SceneInvalidate(G); SceneInvalidate(G);
} }
} }
} }
break; break;
} }
} }
} }
TrackerDelList(I_Tracker, list_id); TrackerDelList(I_Tracker, list_id);
TrackerDelIter(I_Tracker, iter_id); TrackerDelIter(I_Tracker, iter_id);
skipping to change at line 14435 skipping to change at line 14436
if(obj) if(obj)
if(obj->type != cObjectMolecule) if(obj->type != cObjectMolecule)
obj = NULL; obj = NULL;
return ((ObjectMolecule *) obj); return ((ObjectMolecule *) obj);
} }
/*========================================================================*/ /*========================================================================*/
Block *ExecutiveGetBlock(PyMOLGlobals * G) Block *ExecutiveGetBlock(PyMOLGlobals * G)
{ {
CExecutive *I = G->Executive; CExecutive *I = G->Executive;
return (I->Block); return (I);
} }
/*========================================================================*/ /*========================================================================*/
void ExecutiveSymExp(PyMOLGlobals * G, const char *name, void ExecutiveSymExp(PyMOLGlobals * G, const char *name,
const char *oname, const char *s1, float cutoff, int segi, int quiet) const char *oname, const char *s1, float cutoff, int segi, int quiet)
{ /* TODO state */ { /* TODO state */
CObject *ob; CObject *ob;
ObjectMolecule *obj = NULL; ObjectMolecule *obj = NULL;
ObjectMolecule *new_obj = NULL; ObjectMolecule *new_obj = NULL;
ObjectMoleculeOpRec op; ObjectMoleculeOpRec op;
skipping to change at line 15070 skipping to change at line 15071
} }
} }
if(rec->visible) if(rec->visible)
SceneInvalidate(G); SceneInvalidate(G);
ExecutiveDoAutoGroup(G, rec); ExecutiveDoAutoGroup(G, rec);
} }
SeqDirty(G); SeqDirty(G);
} }
/*========================================================================*/ /*========================================================================*/
static int ExecutiveClick(Block * block, int button, int x, int y, int mod) int CExecutive::click(int button, int x, int y, int mod)
{ {
PyMOLGlobals *G = block->G; PyMOLGlobals *G = m_G;
CExecutive *I = G->Executive; CExecutive *I = G->Executive;
int n, a; int n, a;
SpecRec *rec = NULL; SpecRec *rec = NULL;
PanelRec *panel = NULL; PanelRec *panel = NULL;
int t, xx; int t, xx;
int pass = false; int pass = false;
int skip; int skip;
int ExecLineHeight = DIP2PIXEL(SettingGetGlobal_i(G, cSetting_internal_gui_con trol_size)); int ExecLineHeight = DIP2PIXEL(SettingGetGlobal_i(G, cSetting_internal_gui_con trol_size));
int hide_underscore = SettingGetGlobal_b(G, cSetting_hide_underscore_names); int hide_underscore = SettingGetGlobal_b(G, cSetting_hide_underscore_names);
int op_cnt = get_op_cnt(G); int op_cnt = get_op_cnt(G);
if(y < I->HowFarDown) { if(y < I->HowFarDown) {
if(SettingGetGlobal_b(G, cSetting_internal_gui_mode) == 1) if(SettingGetGlobal_b(G, cSetting_internal_gui_mode) == 1)
return SceneDeferClick(SceneGetBlock(G), button, x, y, mod); return SceneGetBlock(G)->click(button, x, y, mod);
} }
switch(button) { switch(button) {
case P_GLUT_BUTTON_SCROLL_FORWARD: case P_GLUT_BUTTON_SCROLL_FORWARD:
ScrollBarMoveBy(I->ScrollBar, -1); I->m_ScrollBar.moveBy(-1);
return 1; return 1;
case P_GLUT_BUTTON_SCROLL_BACKWARD: case P_GLUT_BUTTON_SCROLL_BACKWARD:
ScrollBarMoveBy(I->ScrollBar, 1); I->m_ScrollBar.moveBy(1);
return 1; return 1;
} }
n = ((I->Block->rect.top - y) - (ExecTopMargin + ExecClickMargin)) / ExecLineH eight; n = ((I->rect.top - y) - (ExecTopMargin + ExecClickMargin)) / ExecLineHeight;
a = n; a = n;
xx = (x - I->Block->rect.left); xx = (x - rect.left);
if(I->ScrollBarActive) { if(I->ScrollBarActive) {
if((x - I->Block->rect.left) < if((x - rect.left) <
(ExecScrollBarWidth + ExecScrollBarMargin + ExecToggleMargin)) { (ExecScrollBarWidth + ExecScrollBarMargin + ExecToggleMargin)) {
pass = 1; pass = 1;
ScrollBarDoClick(I->ScrollBar, button, x, y, mod); I->m_ScrollBar.click(button, x, y, mod);
} }
xx -= (ExecScrollBarWidth + ExecScrollBarMargin); xx -= (ExecScrollBarWidth + ExecScrollBarMargin);
} }
skip = I->NSkip; skip = I->NSkip;
if(!pass) { if(!pass) {
I->RecoverPressed = NULL; I->RecoverPressed = NULL;
/* while(ListIterate(I->Spec,rec,next)) { */ /* while(ListIterate(I->Spec,rec,next)) { */
while(ListIterate(I->Panel, panel, next)) { while(ListIterate(I->Panel, panel, next)) {
rec = panel->spec; rec = panel->spec;
if((rec->name[0] != '_') || (!hide_underscore)) { if((rec->name[0] != '_') || (!hide_underscore)) {
if(skip) { if(skip) {
skip--; skip--;
} else { } else {
if(!a) { if(!a) {
t = ((I->Block->rect.right - ExecRightMargin) - x - 1) / ExecToggleW idth; t = ((rect.right - ExecRightMargin) - x - 1) / ExecToggleWidth;
if(t < op_cnt) { if(t < op_cnt) {
int my = I->Block->rect.top - (ExecTopMargin + n * ExecLineHeight) int my = rect.top - (ExecTopMargin + n * ExecLineHeight) - 3;
- 3; int mx = rect.right - (ExecRightMargin + t * ExecToggleWidth);
int mx = I->Block->rect.right - (ExecRightMargin + t * ExecToggleW
idth);
#if 0 #if 0
// prefix name with % as guarantee to not match a selection keywor d // prefix name with % as guarantee to not match a selection keywor d
WordType namesele = "%"; WordType namesele = "%";
UtilNCopy(namesele + 1, (rec->type == cExecObject) ? UtilNCopy(namesele + 1, (rec->type == cExecObject) ?
rec->obj->Name : rec->name, WordLength - 1); rec->obj->Name : rec->name, WordLength - 1);
#else #else
char *namesele = (rec->type == cExecObject) ? rec->obj->Name : rec ->name; char *namesele = (rec->type == cExecObject) ? rec->obj->Name : rec ->name;
#endif #endif
skipping to change at line 15429 skipping to change at line 15430
break; break;
case P_GLUT_RIGHT_BUTTON: case P_GLUT_RIGHT_BUTTON:
I->DragMode = 2; /* reorder */ I->DragMode = 2; /* reorder */
I->Pressed = n; I->Pressed = n;
I->Over = n; I->Over = n;
I->LastOver = I->Over; I->LastOver = I->Over;
I->PressedWhat = 1; I->PressedWhat = 1;
I->OverWhat = 1; I->OverWhat = 1;
break; break;
} }
OrthoGrab(G, I->Block); OrthoGrab(G, this);
OrthoDirty(G); OrthoDirty(G);
} else if(panel->is_group) { } else if(panel->is_group) {
/* clicked on group control */ /* clicked on group control */
rec->hilight = 2; rec->hilight = 2;
I->DragMode = 1; I->DragMode = 1;
I->Pressed = n; I->Pressed = n;
I->Over = n; I->Over = n;
I->LastOver = I->Over; I->LastOver = I->Over;
I->PressedWhat = 2; I->PressedWhat = 2;
I->OverWhat = 2; I->OverWhat = 2;
OrthoGrab(G, I->Block); OrthoGrab(G, this);
OrthoDirty(G); OrthoDirty(G);
} }
} }
} }
a--; a--;
} }
} }
} }
} }
PyMOL_NeedRedisplay(G->PyMOL); PyMOL_NeedRedisplay(G->PyMOL);
skipping to change at line 15589 skipping to change at line 15590
{ {
int unblock = PAutoBlock(G); /* PBlock(G); PBlockAndUnlockAPI(); */ int unblock = PAutoBlock(G); /* PBlock(G); PBlockAndUnlockAPI(); */
if(sele1 >= 0) { if(sele1 >= 0) {
result = SelectorAssignAtomTypes(G, sele1, state, quiet, format); result = SelectorAssignAtomTypes(G, sele1, state, quiet, format);
} }
PAutoUnblock(G, unblock); /* PUnblock(G); PLockAPIAndUnblock(); */ PAutoUnblock(G, unblock); /* PUnblock(G); PLockAPIAndUnblock(); */
} }
return (result); return (result);
} }
static int ExecutiveRelease(Block * block, int button, int x, int y, int mod) int CExecutive::release(int button, int x, int y, int mod)
{ {
PyMOLGlobals *G = block->G; PyMOLGlobals *G = m_G;
CExecutive *I = G->Executive; CExecutive *I = G->Executive;
SpecRec *rec = NULL; SpecRec *rec = NULL;
PanelRec *panel = NULL; PanelRec *panel = NULL;
int pass = false; int pass = false;
int skip; int skip;
int xx; int xx;
int hide_underscore = SettingGetGlobal_b(G, cSetting_hide_underscore_names); int hide_underscore = SettingGetGlobal_b(G, cSetting_hide_underscore_names);
if(y < I->HowFarDown) { if(y < I->HowFarDown) {
if(SettingGetGlobal_b(G, cSetting_internal_gui_mode) == 1) if(SettingGetGlobal_b(G, cSetting_internal_gui_mode) == 1)
return SceneDeferRelease(SceneGetBlock(G), button, x, y, mod); return SceneGetBlock(G)->release(button, x, y, mod);
} }
xx = (x - I->Block->rect.left); xx = (x - rect.left);
if(I->ScrollBarActive) { if(I->ScrollBarActive) {
if((x - I->Block->rect.left) < if((x - rect.left) <
(ExecScrollBarWidth + ExecScrollBarMargin + ExecToggleMargin)) { (ExecScrollBarWidth + ExecScrollBarMargin + ExecToggleMargin)) {
pass = 1; pass = 1;
ScrollBarDoRelease(I->ScrollBar, button, x, y, mod); I->m_ScrollBar.release(button, x, y, mod);
OrthoUngrab(G); OrthoUngrab(G);
} }
xx -= (ExecScrollBarWidth + ExecScrollBarMargin); xx -= (ExecScrollBarWidth + ExecScrollBarMargin);
} }
skip = I->NSkip; skip = I->NSkip;
if(!pass) { if(!pass) {
ExecutiveDrag(block, x, y, mod); /* incorporate final changes in cursor p osition */ I->drag(x, y, mod); /* incorporate final changes in cursor position */
switch (I->DragMode) { switch (I->DragMode) {
case 1: case 1:
/*while(ListIterate(I->Spec,rec,next)) { */ /*while(ListIterate(I->Spec,rec,next)) { */
while(ListIterate(I->Panel, panel, next)) { while(ListIterate(I->Panel, panel, next)) {
rec = panel->spec; rec = panel->spec;
if((rec->name[0] != '_') || (!hide_underscore)) { if((rec->name[0] != '_') || (!hide_underscore)) {
if(skip) { if(skip) {
skip--; skip--;
skipping to change at line 15683 skipping to change at line 15684
I->Over = -1; I->Over = -1;
I->Pressed = -1; I->Pressed = -1;
I->DragMode = 0; I->DragMode = 0;
I->PressedWhat = 0; I->PressedWhat = 0;
OrthoUngrab(G); OrthoUngrab(G);
PyMOL_NeedRedisplay(G->PyMOL); PyMOL_NeedRedisplay(G->PyMOL);
return (1); return (1);
} }
/*========================================================================*/ /*========================================================================*/
static int ExecutiveDrag(Block * block, int x, int y, int mod) int CExecutive::drag(int x, int y, int mod)
{ {
PyMOLGlobals *G = block->G; PyMOLGlobals *G = m_G;
CExecutive *I = G->Executive; CExecutive *I = G->Executive;
int xx, t; int xx, t;
int ExecLineHeight = DIP2PIXEL(SettingGetGlobal_i(G, cSetting_internal_gui_con trol_size)); int ExecLineHeight = DIP2PIXEL(SettingGetGlobal_i(G, cSetting_internal_gui_con trol_size));
int hide_underscore = SettingGetGlobal_b(G, cSetting_hide_underscore_names); int hide_underscore = SettingGetGlobal_b(G, cSetting_hide_underscore_names);
int op_cnt = get_op_cnt(G); int op_cnt = get_op_cnt(G);
ExecutiveUpdateGroups(G, false); ExecutiveUpdateGroups(G, false);
ExecutiveUpdatePanelList(G); ExecutiveUpdatePanelList(G);
if(y < I->HowFarDown) { if(y < I->HowFarDown) {
if(SettingGetGlobal_b(G, cSetting_internal_gui_mode) == 1) if(SettingGetGlobal_b(G, cSetting_internal_gui_mode) == 1)
return SceneDeferDrag(SceneGetBlock(G), x, y, mod); return SceneGetBlock(G)->drag(x, y, mod);
} }
if(I->DragMode) { if(I->DragMode) {
xx = (x - I->Block->rect.left); xx = (x - rect.left);
t = ((I->Block->rect.right - ExecRightMargin) - x) / ExecToggleWidth; t = ((rect.right - ExecRightMargin) - x) / ExecToggleWidth;
if(I->ScrollBarActive) { if(I->ScrollBarActive) {
xx -= (ExecScrollBarWidth + ExecScrollBarMargin); xx -= (ExecScrollBarWidth + ExecScrollBarMargin);
} }
{ {
int row_offset; int row_offset;
if((xx >= 0) && (t >= op_cnt)) { if((xx >= 0) && (t >= op_cnt)) {
row_offset = ((I->Block->rect.top - y) - row_offset = ((rect.top - y) -
(ExecTopMargin + ExecClickMargin)) / ExecLineHeight; (ExecTopMargin + ExecClickMargin)) / ExecLineHeight;
I->Over = row_offset; I->Over = row_offset;
} else { } else {
I->Over = -1; I->Over = -1;
row_offset = -1; row_offset = -1;
{ {
SpecRec *rec = NULL; SpecRec *rec = NULL;
while(ListIterate(I->Spec, rec, next)) while(ListIterate(I->Spec, rec, next))
rec->hilight = 0; rec->hilight = 0;
} }
skipping to change at line 16104 skipping to change at line 16105
#ifndef _PYMOL_NOPY #ifndef _PYMOL_NOPY
static void draw_button_char(PyMOLGlobals * G, int x2, int y2, char ch ORTHOCGOA RG) static void draw_button_char(PyMOLGlobals * G, int x2, int y2, char ch ORTHOCGOA RG)
{ {
TextSetColor3f(G, 0.0F, 0.0F, 0.0F); TextSetColor3f(G, 0.0F, 0.0F, 0.0F);
TextSetPos2i(G, x2 + ExecToggleTextShift, y2); TextSetPos2i(G, x2 + ExecToggleTextShift, y2);
TextDrawChar(G, ch ORTHOCGOARGVAR); TextDrawChar(G, ch ORTHOCGOARGVAR);
} }
#endif #endif
/*========================================================================*/ /*========================================================================*/
static void ExecutiveDraw(Block * block ORTHOCGOARG) void CExecutive::draw(CGO* orthoCGO)
{ {
PyMOLGlobals *G = block->G; PyMOLGlobals *G = m_G;
int x, y, xx, x2, y2; int x, y, xx, x2, y2;
WordType ch; WordType ch;
char *c = NULL; char *c = NULL;
float enabledColor[3] = { 0.5F, 0.5F, 0.5F }; float enabledColor[3] = { 0.5F, 0.5F, 0.5F };
float cloakedColor[3] = { 0.35F, 0.35F, 0.35F }; float cloakedColor[3] = { 0.35F, 0.35F, 0.35F };
float pressedColor[3] = { 0.7F, 0.7F, 0.7F }; float pressedColor[3] = { 0.7F, 0.7F, 0.7F };
float disabledColor[3] = { 0.25F, 0.25F, 0.25F }; float disabledColor[3] = { 0.25F, 0.25F, 0.25F };
float lightEdge[3] = { 0.6F, 0.6F, 0.6F }; float lightEdge[3] = { 0.6F, 0.6F, 0.6F };
float darkEdge[3] = { 0.35F, 0.35F, 0.35F }; float darkEdge[3] = { 0.35F, 0.35F, 0.35F };
float captionColor[3] = { 0.3F, 0.9F, 0.3F }; float captionColor[3] = { 0.3F, 0.9F, 0.3F };
skipping to change at line 16140 skipping to change at line 16141
int ExecLineHeight = DIP2PIXEL(SettingGetGlobal_i(G, cSetting_internal_gui_con trol_size)); int ExecLineHeight = DIP2PIXEL(SettingGetGlobal_i(G, cSetting_internal_gui_con trol_size));
int text_lift = (ExecLineHeight / 2) - DIP2PIXEL(5); int text_lift = (ExecLineHeight / 2) - DIP2PIXEL(5);
int hide_underscore = SettingGetGlobal_b(G, cSetting_hide_underscore_names); int hide_underscore = SettingGetGlobal_b(G, cSetting_hide_underscore_names);
int op_cnt = get_op_cnt(G); int op_cnt = get_op_cnt(G);
int full_names = SettingGetGlobal_b(G, cSetting_group_full_member_names); int full_names = SettingGetGlobal_b(G, cSetting_group_full_member_names);
int arrows = SettingGetGlobal_b(G, cSetting_group_arrow_prefix); int arrows = SettingGetGlobal_b(G, cSetting_group_arrow_prefix);
ExecutiveUpdatePanelList(G); ExecutiveUpdatePanelList(G);
/* if we're running with a GUI and have a valid panel */ /* if we're running with a GUI and have a valid panel */
if(G->HaveGUI && G->ValidContext && ((block->rect.right - block->rect.left) > 6) if(G->HaveGUI && G->ValidContext && ((rect.right - rect.left) > 6)
&& I->ValidPanel) { && I->ValidPanel) {
int max_char; int max_char;
int nChar; int nChar;
/* count entries /* count entries
* do we have enough structures to warrant a scroll bar? */ * do we have enough structures to warrant a scroll bar? */
n_ent = 0; n_ent = 0;
while(ListIterate(I->Panel, panel, next)) { while(ListIterate(I->Panel, panel, next)) {
rec = panel->spec; rec = panel->spec;
if(rec && ((rec->name[0] != '_') || (!hide_underscore))) if(rec && ((rec->name[0] != '_') || (!hide_underscore)))
n_ent++; n_ent++;
} }
n_disp = n_disp =
((I->Block->rect.top - I->Block->rect.bottom) - (ExecTopMargin)) / ExecLin eHeight; ((rect.top - rect.bottom) - (ExecTopMargin)) / ExecLineHeight;
if(n_disp < 1) if(n_disp < 1)
n_disp = 1; n_disp = 1;
/* we need a scrollbar */ /* we need a scrollbar */
if(n_ent > n_disp) { if(n_ent > n_disp) {
int bar_maxed = ScrollBarIsMaxed(I->ScrollBar); int bar_maxed = I->m_ScrollBar.isMaxed();
if(!I->ScrollBarActive) { if(!I->ScrollBarActive) {
ScrollBarSetLimits(I->ScrollBar, n_ent, n_disp); I->m_ScrollBar.setLimits(n_ent, n_disp);
if(bar_maxed) { if(bar_maxed) {
ScrollBarMaxOut(I->ScrollBar); I->m_ScrollBar.maxOut();
I->NSkip = (int) ScrollBarGetValue(I->ScrollBar); I->NSkip = static_cast<int>(I->m_ScrollBar.getValue());
} else { } else {
ScrollBarSetValue(I->ScrollBar, 0); I->m_ScrollBar.setValue(0);
I->NSkip = 0; I->NSkip = 0;
} }
} else { } else {
ScrollBarSetLimits(I->ScrollBar, n_ent, n_disp); I->m_ScrollBar.setLimits(n_ent, n_disp);
if(bar_maxed) if(bar_maxed)
ScrollBarMaxOut(I->ScrollBar); I->m_ScrollBar.maxOut();
I->NSkip = (int) ScrollBarGetValue(I->ScrollBar); I->NSkip = static_cast<int>(I->m_ScrollBar.getValue());
} }
I->ScrollBarActive = 1; I->ScrollBarActive = 1;
} else { } else {
I->ScrollBarActive = 0; I->ScrollBarActive = 0;
I->NSkip = 0; I->NSkip = 0;
} }
/* determination of longest string based on internal_gui_size, etc... */ /* determination of longest string based on internal_gui_size, etc... */
max_char = max_char =
(((I->Block->rect.right - I->Block->rect.left) - (((rect.right - rect.left) -
(ExecLeftMargin + ExecRightMargin + 4)) - (op_cnt * ExecToggleWidth)); (ExecLeftMargin + ExecRightMargin + 4)) - (op_cnt * ExecToggleWidth));
if(I->ScrollBarActive) { if(I->ScrollBarActive) {
max_char -= (ExecScrollBarMargin + ExecScrollBarWidth); max_char -= (ExecScrollBarMargin + ExecScrollBarWidth);
} }
max_char /= DIP2PIXEL(8); max_char /= DIP2PIXEL(8);
/* fill and outline the entire block */ /* fill and outline the entire block */
if(SettingGetGlobal_b(G, cSetting_internal_gui_mode) == 0) { if(SettingGetGlobal_b(G, cSetting_internal_gui_mode) == 0) {
if (orthoCGO) if (orthoCGO)
CGOColorv(orthoCGO, I->Block->BackColor); CGOColorv(orthoCGO, BackColor);
#ifndef PURE_OPENGL_ES_2
else else
glColor3fv(I->Block->BackColor); glColor3fv(BackColor);
BlockFill(I->Block ORTHOCGOARGVAR); #endif
BlockDrawLeftEdge(I->Block ORTHOCGOARGVAR); fill(orthoCGO);
drawLeftEdge(orthoCGO);
} }
/* draw the scroll bar */ /* draw the scroll bar */
if(I->ScrollBarActive) { if(I->ScrollBarActive) {
ScrollBarSetBox(I->ScrollBar, I->Block->rect.top - ExecScrollBarMargin, I->m_ScrollBar.setBox(rect.top - ExecScrollBarMargin,
I->Block->rect.left + ExecScrollBarMargin, rect.left + ExecScrollBarMargin,
I->Block->rect.bottom + 2, rect.bottom + 2,
I->Block->rect.left + ExecScrollBarMargin + ExecScrollBarW rect.left + ExecScrollBarMargin + ExecScrollBarWidth);
idth); I->m_ScrollBar.draw(orthoCGO);
ScrollBarDoDraw(I->ScrollBar ORTHOCGOARGVAR);
} }
x = I->Block->rect.left + ExecLeftMargin; x = rect.left + ExecLeftMargin;
y = (I->Block->rect.top - ExecLineHeight) - ExecTopMargin; y = (rect.top - ExecLineHeight) - ExecTopMargin;
/* xx = I->Block->rect.right-ExecRightMargin-ExecToggleWidth*(cRepCnt+op_ /* xx = rect.right-ExecRightMargin-ExecToggleWidth*(cRepCnt+op_cnt); */
cnt); */
#ifndef _PYMOL_NOPY #ifndef _PYMOL_NOPY
xx = I->Block->rect.right - ExecRightMargin - ExecToggleWidth * (op_cnt); xx = rect.right - ExecRightMargin - ExecToggleWidth * (op_cnt);
#else #else
xx = I->Block->rect.right - ExecRightMargin; xx = rect.right - ExecRightMargin;
#endif #endif
if(I->ScrollBarActive) { if(I->ScrollBarActive) {
x += ExecScrollBarWidth + ExecScrollBarMargin; x += ExecScrollBarWidth + ExecScrollBarMargin;
} }
skip = I->NSkip; skip = I->NSkip;
/* for each object in the Panel... */ /* for each object in the Panel... */
while(ListIterate(I->Panel, panel, next)) { while(ListIterate(I->Panel, panel, next)) {
rec = panel->spec; rec = panel->spec;
skipping to change at line 16331 skipping to change at line 16334
x2 += ExecToggleWidth; x2 += ExecToggleWidth;
} }
} }
/* end ASHLC */ /* end ASHLC */
#endif #endif
{ {
int x3 = x; int x3 = x;
int hidden_prefix = false; int hidden_prefix = false;
TextSetColor(G, I->Block->TextColor); TextSetColor(G, TextColor);
TextSetPos2i(G, x3 + DIP2PIXEL(2), y2 + text_lift); TextSetPos2i(G, x3 + DIP2PIXEL(2), y2 + text_lift);
if((rec->type == cExecObject) || if((rec->type == cExecObject) ||
(rec->type == cExecAll) || (rec->type == cExecSelection)) { (rec->type == cExecAll) || (rec->type == cExecSelection)) {
y2 = y; y2 = y;
x2 = xx; x2 = xx;
if((x - ExecToggleMargin) - (xx - ExecToggleMargin) > DIP2PIXEL(-1 0)) { if((x - ExecToggleMargin) - (xx - ExecToggleMargin) > DIP2PIXEL(-1 0)) {
x2 = x + DIP2PIXEL(10); x2 = x + DIP2PIXEL(10);
} }
skipping to change at line 16402 skipping to change at line 16405
} else { } else {
draw_button(x3, y2, but_width, (ExecLineHeight - 1), lightEd ge, draw_button(x3, y2, but_width, (ExecLineHeight - 1), lightEd ge,
darkEdge, cloakedColor ORTHOCGOARGVAR); darkEdge, cloakedColor ORTHOCGOARGVAR);
} }
} else { } else {
draw_button(x3, y2, but_width, (ExecLineHeight - 1), lightEdge , draw_button(x3, y2, but_width, (ExecLineHeight - 1), lightEdge ,
darkEdge, disabledColor ORTHOCGOARGVAR); darkEdge, disabledColor ORTHOCGOARGVAR);
} }
} }
TextSetColor(G, I->Block->TextColor); TextSetColor(G, TextColor);
/* object name */ /* object name */
c = rec->name; c = rec->name;
/* parse out the prefix if group.foo */ /* parse out the prefix if group.foo */
if(!full_names) { if(!full_names) {
if(rec->group) { /* if prefix matches group name, then tr uncate */ if(rec->group) { /* if prefix matches group name, then tr uncate */
char *p = c, *q = rec->group->name; char *p = c, *q = rec->group->name;
while((*p == *q) && (*q)) { while((*p == *q) && (*q)) {
p++; p++;
skipping to change at line 16484 skipping to change at line 16487
} else { } else {
TextDrawChar(G, *(c++) ORTHOCGOARGVAR); TextDrawChar(G, *(c++) ORTHOCGOARGVAR);
--nChar; --nChar;
} }
} }
} }
} }
} }
y -= ExecLineHeight; y -= ExecLineHeight;
if(y < (I->Block->rect.bottom)) if(y < (rect.bottom))
break; break;
} }
} }
} }
I->HowFarDown = y; I->HowFarDown = y;
} }
} }
/*========================================================================*/ /*========================================================================*/
int ExecutiveIterateObject(PyMOLGlobals * G, CObject ** obj, void **hidden) int ExecutiveIterateObject(PyMOLGlobals * G, CObject ** obj, void **hidden)
skipping to change at line 16524 skipping to change at line 16527
break; break;
} }
if(*rec) if(*rec)
(*obj) = (ObjectMolecule *) (*rec)->obj; (*obj) = (ObjectMolecule *) (*rec)->obj;
else else
(*obj) = NULL; (*obj) = NULL;
return ((*rec) != NULL); return ((*rec) != NULL);
} }
/*========================================================================*/ /*========================================================================*/
static void ExecutiveReshape(Block * block, int width, int height) void CExecutive::reshape(int width, int height)
{ {
PyMOLGlobals *G = block->G; PyMOLGlobals *G = m_G;
CExecutive *I = G->Executive; CExecutive *I = G->Executive;
BlockReshape(block, width, height); Block::reshape(width, height);
I->Width = block->rect.right - block->rect.left + 1; I->Width = rect.right - rect.left + 1;
I->Height = block->rect.top - block->rect.bottom + 1; I->Height = rect.top - rect.bottom + 1;
} }
/*========================================================================*/ /*========================================================================*/
int ExecutiveReinitialize(PyMOLGlobals * G, int what, const char *pattern) int ExecutiveReinitialize(PyMOLGlobals * G, int what, const char *pattern)
{ {
CExecutive *I = G->Executive; CExecutive *I = G->Executive;
int ok = true; int ok = true;
#ifndef _PYMOL_NOPY #ifndef _PYMOL_NOPY
int blocked = false; int blocked = false;
skipping to change at line 16617 skipping to change at line 16620
while(TrackerIterNextCandInList(I_Tracker, iter_id, (TrackerRef **) (void *) &rec)) { while(TrackerIterNextCandInList(I_Tracker, iter_id, (TrackerRef **) (void *) &rec)) {
if(rec) { if(rec) {
switch (rec->type) { switch (rec->type) {
case cExecObject: case cExecObject:
switch (what) { switch (what) {
case 0: case 0:
case 1: case 1:
if(rec->obj->Setting) { if(rec->obj->Setting) {
ObjectPurgeSettings(rec->obj); ObjectPurgeSettings(rec->obj);
if(rec->obj->fInvalidate) rec->obj->invalidate(cRepAll, cRepInvAll, -1);
rec->obj->fInvalidate(rec->obj, cRepAll, cRepInvAll, -1);
SceneInvalidate(G); SceneInvalidate(G);
SeqChanged(G); SeqChanged(G);
} }
break; break;
} }
} }
} }
} }
TrackerDelList(I_Tracker, list_id); TrackerDelList(I_Tracker, list_id);
TrackerDelIter(I_Tracker, iter_id); TrackerDelIter(I_Tracker, iter_id);
skipping to change at line 16640 skipping to change at line 16642
/* to do */ /* to do */
} }
return (ok); return (ok);
} }
/*========================================================================*/ /*========================================================================*/
int ExecutiveInit(PyMOLGlobals * G) int ExecutiveInit(PyMOLGlobals * G)
{ {
CExecutive *I = NULL; CExecutive *I = NULL;
if((I = (G->Executive = Calloc(CExecutive, 1)))) { if((I = (G->Executive = new CExecutive(G)))) {
SpecRec *rec = NULL; SpecRec *rec = NULL;
ListInit(I->Spec); ListInit(I->Spec);
I->Tracker = TrackerNew(G); I->Tracker = TrackerNew(G);
I->all_names_list_id = TrackerNewList(I->Tracker, NULL); I->all_names_list_id = TrackerNewList(I->Tracker, NULL);
I->all_obj_list_id = TrackerNewList(I->Tracker, NULL); I->all_obj_list_id = TrackerNewList(I->Tracker, NULL);
I->all_sel_list_id = TrackerNewList(I->Tracker, NULL); I->all_sel_list_id = TrackerNewList(I->Tracker, NULL);
I->Block = OrthoNewBlock(G, NULL); I->active = true;
I->Block->fRelease = ExecutiveRelease; OrthoAttach(G, I, cOrthoTool);
I->Block->fClick = ExecutiveClick;
I->Block->fDrag = ExecutiveDrag;
I->Block->fDraw = ExecutiveDraw;
I->Block->fReshape = ExecutiveReshape;
I->Block->active = true;
I->ScrollBarActive = 0;
I->ScrollBar = ScrollBarNew(G, false);
OrthoAttach(G, I->Block, cOrthoTool);
I->RecoverPressed = NULL;
I->Pressed = -1;
I->Over = -1;
I->LastEdited = NULL;
I->ReorderFlag = false;
I->NSkip = 0;
I->HowFarDown = 0;
I->DragMode = 0;
#ifndef GLUT_FULL_SCREEN #ifndef GLUT_FULL_SCREEN
I->oldWidth = 640; I->oldWidth = 640;
I->oldHeight = 480; I->oldHeight = 480;
#endif #endif
I->LastZoomed = NULL;
I->LastChanged = NULL;
I->ValidGroups = false;
I->ValidSceneMembers = false;
I->selIndicatorsCGO = NULL;
I->selectorTexturePosX = I->selectorTexturePosY = I->selectorTextureSize = I
->selectorTextureAllocatedSize = 0;
I->selectorIsRound = 0;
ListInit(I->Panel); ListInit(I->Panel);
I->ValidPanel = false; I->ValidPanel = false;
I->Lex = OVLexicon_New(G->Context->heap); I->Lex = OVLexicon_New(G->Context->heap);
I->Key = OVOneToOne_New(G->Context->heap); I->Key = OVOneToOne_New(G->Context->heap);
/* create "all" entry */ /* create "all" entry */
ListElemCalloc(G, rec, SpecRec); ListElemCalloc(G, rec, SpecRec);
skipping to change at line 16718 skipping to change at line 16697
SpecRec *rec = NULL; SpecRec *rec = NULL;
CGOFree(I->selIndicatorsCGO); CGOFree(I->selIndicatorsCGO);
while(ListIterate(I->Spec, rec, next)) { while(ListIterate(I->Spec, rec, next)) {
if(rec->type == cExecObject) if(rec->type == cExecObject)
rec->obj->fFree(rec->obj); rec->obj->fFree(rec->obj);
} }
ListFree(I->Spec, next, SpecRec); ListFree(I->Spec, next, SpecRec);
ListFree(I->Panel, next, PanelRec); ListFree(I->Panel, next, PanelRec);
if(I->Tracker) if(I->Tracker)
TrackerFree(I->Tracker); TrackerFree(I->Tracker);
if(I->ScrollBar)
ScrollBarFree(I->ScrollBar);
OrthoFreeBlock(G, I->Block);
I->Block = NULL;
OVLexicon_DEL_AUTO_NULL(I->Lex); OVLexicon_DEL_AUTO_NULL(I->Lex);
OVOneToOne_DEL_AUTO_NULL(I->Key); OVOneToOne_DEL_AUTO_NULL(I->Key);
ExecutiveUniqueIDAtomDictInvalidate(G); ExecutiveUniqueIDAtomDictInvalidate(G);
FreeP(G->Executive); DeleteP(G->Executive);
} }
#ifdef _undefined #ifdef _undefined
matrix checking code ... matrix checking code ...
double mt[3][3], mt2[3][3], pr[3][3], im[3][3], em[3][3]; double mt[3][3], mt2[3][3], pr[3][3], im[3][3], em[3][3];
printf("normalized matrix \n"); printf("normalized matrix \n");
for(a = 0; a < 3; a++) { for(a = 0; a < 3; a++) {
for(b = 0; b < 3; b++) { for(b = 0; b < 3; b++) {
 End of changes. 105 change blocks. 
211 lines changed or deleted 179 lines changed or added

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