1
2 /*
3 A* -------------------------------------------------------------------
4 B* This file contains source code for the PyMOL computer program
5 C* copyright 1998-2000 by Warren Lyford Delano of DeLano Scientific.
6 D* -------------------------------------------------------------------
7 E* It is unlawful to modify or remove this copyright notice.
8 F* -------------------------------------------------------------------
9 G* Please see the accompanying LICENSE file for further information.
10 H* -------------------------------------------------------------------
11 I* Additional authors of this source file include:
12 -*
13 -*
14 -*
15 Z* -------------------------------------------------------------------
16 */
17 #ifndef _H_Executive
18 #define _H_Executive
19
20 #include <string>
21 #include "pymol/zstring_view.h"
22 #include"os_python.h"
23
24 #include"PyMOLGlobals.h"
25 #include"PyMOLObject.h"
26 #include"ObjectMolecule.h"
27 #include"Field.h"
28
29 #include"Tracker.h"
30 #include"Ortho.h"
31 #include"Word.h"
32 #include "PyMOL.h"
33 #include "Executive_pre.h"
34 #include "Scene.h"
35 #include "Result.h"
36 #include "vla.h"
37 #include "TrackerList.h"
38 #include "Selector.h"
39
40 enum cLoadType_t : int {
41 cLoadTypeUnknown = -1,
42 cLoadTypePDB = 0,
43 cLoadTypeMOL = 1,
44 cLoadTypeSDF1 = 2, /* SDF1 - python-based loader */
45 cLoadTypeMOLStr = 3,
46 cLoadTypeMMD = 4,
47 cLoadTypeMMDSeparate = 5,
48 cLoadTypeMMDStr = 6,
49 cLoadTypeXPLORMap = 7,
50 cLoadTypeChemPyModel = 8,
51 cLoadTypePDBStr = 9,
52 cLoadTypeChemPyBrick = 10,
53 cLoadTypeChemPyMap = 11,
54 cLoadTypeCallback = 12,
55 cLoadTypeCGO = 13,
56 cLoadTypeR3D = 14,
57 cLoadTypeXYZ = 15,
58 cLoadTypeCCP4Map = 18,
59 cLoadTypePMO = 19,
60 cLoadTypeTOP = 21,
61 cLoadTypeTRJ = 22,
62 cLoadTypeCRD = 23,
63 cLoadTypeRST = 24,
64 cLoadTypePSE = 25,
65 cLoadTypeXPLORStr = 26,
66 cLoadTypePHIMap = 27,
67 cLoadTypeFLDMap = 28,
68 cLoadTypeBRIXMap = 29,
69 cLoadTypeGRDMap = 30,
70 cLoadTypePQR = 31,
71 cLoadTypeDXMap = 32,
72 cLoadTypeMOL2 = 33,
73 cLoadTypeMOL2Str = 34,
74 cLoadTypeP1M = 35,
75 cLoadTypeCCP4Str = 36,
76 cLoadTypeSDF2 = 37,
77 cLoadTypeSDF2Str = 38,
78 cLoadTypeXTC = 42,
79 cLoadTypeTRR = 43,
80 cLoadTypeGRO = 44,
81 cLoadTypeTRJ2 = 45,
82 cLoadTypeG96 = 46,
83 cLoadTypeDCD = 47,
84 cLoadTypeCUBEMap = 48,
85 cLoadTypeXYZStr = 49,
86
87 /* 50 is Python-based CIF (cif1) */
88 cLoadTypePHIStr = 51,
89
90 /* 52 is PIM */
91
92 /* 53 is PWG */
93
94 /* 54 is ALN */
95
96 /* 55 is FASTA */
97 cLoadTypeACNTMap = 56,
98
99 cLoadTypeDTR = 57,
100 /* 58/59 are pze, pzw */
101 cLoadTypeCIF = 60,
102 cLoadTypeCIFStr = 61,
103
104 cLoadTypeSpider = 62,
105 cLoadTypeCMS = 63,
106 cLoadTypePlugin = 64,
107
108 cLoadTypeMAE = 65,
109 cLoadTypeMAEStr = 66,
110 cLoadTypePDBQT = 67,
111 /* 68 is Python-based MAE */
112 cLoadTypeVDBStr = 69,
113
114 cLoadTypeMMTF = 71,
115 cLoadTypeMMTFStr = 72,
116
117 // Distinguish CCP4-like map types:
118 // - cLoadTypeCCP4Str/cLoadTypeCCP4Map : CCP4 format, ignore MRC features
119 // - cLoadTypeCCP4Unspecified : CCP4 or MRC format (auto-detect)
120 // - cLoadTypeMRC : MRC format, ignore CCP4 features
121 cLoadTypeCCP4Unspecified = 73,
122 cLoadTypeMRC = 74,
123 };
124
125 /* NOTE: if you add new content/object type above, then be sure to add
126 corresponding code in:
127 ExecutiveGetExistingCompatible
128 ExecutiveLoad
129 */
130
131 struct ExecutiveObjectOffset{
132 ObjectMolecule *obj;
133 int atm;
134 };
135
136 class SpecRec;
137
138 /*
139 * Iterator over objects (uses SpecRec list)
140 */
141 class ObjectIterator {
142 PyMOLGlobals * G;
143 SpecRec *rec;
144
145 public:
ObjectIterator(PyMOLGlobals * G)146 ObjectIterator(PyMOLGlobals * G) : G(G) {
147 reset();
148 };
149
150 void reset();
151 bool next();
152 CObject * getObject();
getSpecRec()153 SpecRec * getSpecRec() { return rec; }
154 };
155
156
157 const char * ExecutiveMapGenerate(PyMOLGlobals * G, const char * name, const char * reflection_file, const char * tempFile,
158 char * amplitudes, const char * phases, const char * weights, double reso_low,
159 double reso_high, const char * space_group, double cell[6], int quiet, int zoom);
160
161 int ExecutiveReference(PyMOLGlobals * G, int action, const char *sele, int state, int quiet);
162 int ExecutiveGetExpandedGroupList(PyMOLGlobals * G, const char *name);
163 int ExecutiveGetExpandedGroupListFromPattern(PyMOLGlobals * G, const char *name);
164 void ExecutiveFreeGroupList(PyMOLGlobals * G, int list_id);
165
166 int ExecutiveCheckGroupMembership(PyMOLGlobals * G, int list_id, CObject * obj); /* 0.5*N for group size */
167
168 #define cExecutiveGroupAdd 1
169 #define cExecutiveGroupRemove 2
170 #define cExecutiveGroupOpen 3
171 #define cExecutiveGroupClose 4
172 #define cExecutiveGroupToggle 5
173 #define cExecutiveGroupAuto 6
174 #define cExecutiveGroupUngroup 7
175 #define cExecutiveGroupEmpty 8
176 #define cExecutiveGroupPurge 9
177 #define cExecutiveGroupExcise 10
178
179 int ExecutiveGroup(PyMOLGlobals * G, const char *name, const char *members, int action, int quiet);
180 int ExecutiveScrollTo(PyMOLGlobals * G, const char * name, int);
181
182 void ExecutiveInvalidateGroups(PyMOLGlobals * G, int force);
183 void ExecutiveUpdateGroups(PyMOLGlobals * G, int force);
184 void ExecutiveUpdateSceneMembers(PyMOLGlobals*);
185
186 int *ExecutiveGetG3d(PyMOLGlobals * G);
187 int ExecutiveOrder(PyMOLGlobals * G, const char *s1, int sort, int location);
188 pymol::Result<> ExecutiveFixChemistry(
189 PyMOLGlobals* G, const char* s1, const char* s2, int invalidate, int quiet);
190 pymol::Result<std::array<float, 3>> ExecutiveGetAtomVertex(PyMOLGlobals * G, const char *s1, int state, int index);
191 int ExecutiveProcessPDBFile(PyMOLGlobals * G, CObject * origObj,
192 const char *fname, const char *buffer, const char *oname,
193 int frame, int discrete, int finish, OrthoLineType buf,
194 int variant, int quiet,
195 int multiplex, int zoom);
196
197 const ExecutiveObjectOffset * ExecutiveUniqueIDAtomDictGet(PyMOLGlobals * G, int i);
198 void ExecutiveUniqueIDAtomDictInvalidate(PyMOLGlobals * G);
199
200 pymol::Result<> ExecutiveLoad(
201 PyMOLGlobals * G,
202 const char *fname,
203 const char *content, int content_length,
204 cLoadType_t content_format,
205 const char *object_name,
206 int state, int zoom,
207 int discrete, int finish, int multiplex, int quiet, const char *plugin,
208 const char * object_props=NULL, const char * atom_props=NULL,
209 bool mimic=true);
210
211 int ExecutiveDebug(PyMOLGlobals * G, const char *name);
212
213 typedef struct {
214 int n_residues_aligned;
215 float raw_alignment_score;
216 int initial_n_atom;
217 float initial_rms;
218 int n_cycles_run;
219 int final_n_atom;
220 float final_rms;
221 } ExecutiveRMSInfo;
222
223 std::string ExecutivePreparePseudoatomName(PyMOLGlobals* G, pymol::zstring_view object_name);
224
225 pymol::Result<> ExecutivePseudoatom(PyMOLGlobals* G, pymol::zstring_view object_name,
226 const char* sele, const char* name, const char* resn, const char* resi,
227 const char* chain, const char* segi, const char* elem, float vdw,
228 int hetatm, float b, float q, const char* label, const float* pos, int color,
229 int state, int mode, int quiet);
230
231 pymol::Result<> ExecutiveMapSet(PyMOLGlobals* G, const char* name, int,
232 const char* operands, int target_state, int source_state, int zoom,
233 int quiet);
234
235 int ExecutiveAlign(PyMOLGlobals * G, const char *s1, const char *s2, const char *mat_file,
236 float gap, float extend,
237 int max_gap, int max_skip,
238 float cutoff, int cycles, int quiet,
239 const char *oname, int state1, int state2,
240 ExecutiveRMSInfo * rms_info, int transform, int reset,
241 float seq_wt, float radius, float scale, float base,
242 float coord_wt, float expect, int window, float ante);
243
244 void ExecutiveUpdateColorDepends(PyMOLGlobals * G, ObjectMolecule * mol);
245 void ExecutiveUpdateCoordDepends(PyMOLGlobals * G, ObjectMolecule * mol);
246 pymol::Result<float> ExecutiveDistance(PyMOLGlobals* G, const char* nam,
247 const char* s1, const char* s2, int mode, float cutoff, int labels,
248 int quiet, int reset, int state, int zoom, int state1 = -4,
249 int state2 = -4);
250 pymol::Result<> ExecutiveBond(PyMOLGlobals* G, const char* s1,
251 const char* s2, int order, int mode, int quiet);
252 pymol::Result<> ExecutiveAddBondByIndices(PyMOLGlobals* G, pymol::zstring_view oname,
253 unsigned int atm1, unsigned int atm2, int order);
254 pymol::Result<> ExecutiveRevalence(PyMOLGlobals* G, const char* s1,
255 const char* s2, const char* src, int target_state, int source_state,
256 int reset, int quiet);
257 int ExecutiveVdwFit(PyMOLGlobals * G, const char *s1, int state1, const char *s2, int state2,
258 float buffer, int quiet);
259 #ifdef _WEBGL
260 #else
261 pymol::Result<int> ExecutiveIterate(PyMOLGlobals * G, const char *str1, const char *expr, int read_only, int quiet,
262 PyObject * space);
263 #endif
264 pymol::Result<int> ExecutiveIterateList(PyMOLGlobals* G, const char* s1,
265 PyObject* list, int read_only, int quiet, PyObject* space);
266
267 pymol::Result<int> ExecutiveSelect(PyMOLGlobals* G, const char* sname,
268 const char* sele, int enable, int quiet, int merge, int state,
269 const char* domain);
270
271 int ExecutiveSelectList(PyMOLGlobals * G, const char *sele_name, const char *s1, int *list,
272 int list_len, int state, int mode, int quiet);
273
274 #define cExecutiveLabelEvalOff 0
275 #define cExecutiveLabelEvalOn 1
276 #define cExecutiveLabelEvalAlt 2
277
278 pymol::Result<> ExecutiveLabel(PyMOLGlobals * G, const char *s1, const char *expr, int quiet, int eval_mode);
279
280 int ExecutiveCountMotions(PyMOLGlobals * G);
281 #ifdef _WEBGL
282 #else
283 pymol::Result<int> ExecutiveIterateState(PyMOLGlobals* G, int state,
284 const char* str1, const char* expr, int read_only, int atomic_props,
285 int quiet, PyObject* space);
286 #endif
287 pymol::Result<> ExecutiveColor(
288 PyMOLGlobals* G, const char* name, const char* color, int flags, int quiet);
289 pymol::Result<> ExecutiveColorFromSele(
290 PyMOLGlobals* G, const char* sele, const char* color, int flags, int quiet);
291 int ExecutiveInit(PyMOLGlobals * G);
292 void ExecutiveFree(PyMOLGlobals * G);
293 int ExecutivePop(PyMOLGlobals * G, const char *target, const char *source, int quiet);
294 void ExecutiveManageObject(PyMOLGlobals * G, CObject * obj, int allow_zoom, int quiet);
295 void ExecutiveUpdateObjectSelection(PyMOLGlobals * G, CObject * obj);
296 void ExecutiveManageSelection(PyMOLGlobals * G, const char *name);
297 Block *ExecutiveGetBlock(PyMOLGlobals * G);
298 CObject *ExecutiveFindObjectByName(PyMOLGlobals * G, const char *name);
299
300 /**
301 * Typed version of `ExecutiveFindObjectByName`
302 * @param name Object name
303 * @return NULL if object can't be found or has the wrong type
304 */
ExecutiveFindObject(PyMOLGlobals * G,const char * name)305 template <typename T> T* ExecutiveFindObject(PyMOLGlobals* G, const char* name)
306 {
307 return dynamic_cast<T*>(ExecutiveFindObjectByName(G, name));
308 }
309
310 #define ExecutiveFindObjectMoleculeByName ExecutiveFindObject<ObjectMolecule>
311 #define ExecutiveFindObjectMapByName ExecutiveFindObject<ObjectMap>
312
313 CObject ** ExecutiveFindObjectsByType(PyMOLGlobals * G, int objType);
314 int ExecutiveIterateObject(PyMOLGlobals * G, CObject ** obj, void **hidden);
315 void ExecutiveDelete(PyMOLGlobals * G, const char *name);
316 void ExecutiveDump(PyMOLGlobals * G, const char *fname, const char *obj, int state, int quiet);
317 pymol::Result<> ExecutiveSort(PyMOLGlobals * G, const char *name);
318 PyObject *ExecutiveGetBondSetting(PyMOLGlobals * G, int index,
319 char *s1, const char *s2, int state, int quiet, int updates);
320 int ExecutiveSetBondSetting(PyMOLGlobals * G, int index, PyObject * tuple,
321 const char *s1, const char *s2, int state, int quiet, int updates);
322 int ExecutiveSetBondSettingFromString(PyMOLGlobals * G,
323 int index, const char *value,
324 const char *s1, const char *s2, int state,
325 int quiet, int updates);
326
327 int ExecutiveUnsetBondSetting(PyMOLGlobals * G, int index, const char *s1, const char *s2,
328 int state, int quiet, int updates);
329
330 int ExecutiveSetSetting(PyMOLGlobals * G, int index, PyObject * tuple,
331 const char *sele, int state, int quiet, int updates);
332 int ExecutiveGetSettingFromString(PyMOLGlobals * G, PyMOLreturn_value *result,
333 int index, const char *sele,
334 int state, int quiet);
335 int ExecutiveSetSettingFromString(PyMOLGlobals * G, int index, const char *value,
336 const char *sele, int state, int quiet, int updates);
337 int ExecutiveSetObjSettingFromString(PyMOLGlobals * G,
338 int index, const char *value, CObject * obj,
339 int state, int quiet, int updates);
340 int ExecutiveRay(PyMOLGlobals * G, int width, int height, int mode,
341 float angle, float shift, int quiet, int defer, int antialias);
342 pymol::Result<float> ExecutiveGetDistance(
343 PyMOLGlobals* G, const char* s0, const char* s1, int state);
344 pymol::Result<float> ExecutiveGetAngle(
345 PyMOLGlobals* G, const char* s0, const char* s1, const char* s2, int state);
346 pymol::Result<float> ExecutiveGetDihe(PyMOLGlobals* G, const char* s0,
347 const char* s1, const char* s2, const char* s3, int state);
348 pymol::Result<> ExecutiveSetDihe(PyMOLGlobals* G, const char* s0,
349 const char* s1, const char* s2, const char* s3, float value, int state = 0,
350 int quiet = 1);
351 int ExecutiveRMS(PyMOLGlobals * G, const char *sele1, const char *sele2, int mode, float refine,
352 int max_cyc, int quiet, const char *oname, int state1, int state2,
353 int ordered_selections, int matchmaker, ExecutiveRMSInfo * rms_info);
354
355 pymol::Result<> ExecutiveUpdateCmd(PyMOLGlobals* G, const char* sele1,
356 const char* sele2, int sta1, int sta2, int method, int quiet);
357 float ExecutiveRMSPairs(PyMOLGlobals* G, const std::vector<SelectorTmp>& sele, int mode, bool quiet);
358 pymol::Result<pymol::vla<float>> ExecutiveRMSStates(
359 PyMOLGlobals * G, const char *s1, int target, int mode, int quiet, int mix);
360 int ExecutiveIndex(PyMOLGlobals * G, const char *s1, int mode, int **indexVLA,
361 ObjectMolecule *** objVLA);
362 pymol::Result<> ExecutiveReset(PyMOLGlobals*, pymol::zstring_view);
363 pymol::Result<> ExecutiveResetMatrix(
364 PyMOLGlobals* G, const char* name, int mode, int state, int log, int quiet);
365 void ExecutiveDrawNow(PyMOLGlobals * G);
366 int ExecutiveDrawCmd(PyMOLGlobals * G, int width, int height, int antialias,
367 int entire_window, int quiet);
368 pymol::Result<int> ExecutiveCartoon(PyMOLGlobals* G, int type, const char* s1);
369 pymol::Result<> ExecutiveSetRepVisib(PyMOLGlobals * G, pymol::zstring_view name, int rep, int state);
370 pymol::Result<> ExecutiveSetRepVisMask(PyMOLGlobals * G, pymol::zstring_view name, int repmask, int state);
371 pymol::Result<> ExecutiveToggleRepVisib(PyMOLGlobals * G, const char *name, int rep);
372
373 pymol::Result<> ExecutiveSetObjVisib(PyMOLGlobals * G, pymol::zstring_view name, int onoff, int parents);
374
375
376 /**
377 * Sets the rotation center for the scene or object around a selection's center (or provided coords)
378 * @param sele (null-safe) selection expression used to calculate rotation center
379 * @param preserve preserves the current viewing location
380 * @param oname (null-safe) object name
381 * @param pos optional explicit coordinates for rotation center
382 * @param state state(s) considered to calculate rotation center
383 * Note: Either seletion or explicit center position must be provided
384 * Note: selection's center is preferred over explicit pos if both are provided
385 */
386 pymol::Result<> ExecutiveOrigin(PyMOLGlobals* G, const char* sele, int preserve,
387 const char* oname, float* pos, int state);
388 pymol::Result<> ExecutiveCenter(PyMOLGlobals* G, const char* name, int state,
389 int inclusive, float animate, float* pos, int quiet);
390 void ExecutiveDoZoom(PyMOLGlobals * G, CObject * obj, int is_new, int zoom, int quiet);
391 pymol::Result<> ExecutiveWindowZoom(PyMOLGlobals* G,
392 const char* name, float buffer, int state, int inclusive, float animate,
393 int quiet);
394 int ExecutiveGetMoment(PyMOLGlobals * G, const char *name, double *mi, int state);
395
396 pymol::Result<std::vector<const char*>> ExecutiveGetChains(PyMOLGlobals* G, const char* sele, int state);
397
398 pymol::Result<> ExecutiveOrient(PyMOLGlobals* G, const char* sele,
399 int state, float animate, int complete, float buffer, int quiet);
400 pymol::Result<> ExecutiveMove(
401 PyMOLGlobals* G, pymol::zstring_view axis, float dist);
402 char *ExecutiveNameToSeqAlignStrVLA(PyMOLGlobals * G, const char *name, int state, int format,
403 int quiet);
404
405 pymol::Result<> ExecutiveStereo(PyMOLGlobals * G, int flag);
406 pymol::Result<> ExecutiveCopy(
407 PyMOLGlobals* G, const char* src, const char* dst, int zoom);
408 float ExecutiveOverlap(PyMOLGlobals * G, const char *s1, int state1, const char *s2, int state2,
409 float adjust);
410 int ExecutiveCountStates(PyMOLGlobals * G, const char *s1);
411 void ExecutiveSymExp(PyMOLGlobals * G, const char *name, const char *obj, const char *sele, float cutoff,
412 int segi, int quiet);
413 int ExecutiveGetExtent(PyMOLGlobals * G, const char *name, float *mn, float *mx,
414 int transformed, int state, int weighted);
415 int ExecutiveGetCameraExtent(PyMOLGlobals * G, const char *name, float *mn, float *mx,
416 int transformed, int state);
417 pymol::Result<> ExecutiveSeleToObject(PyMOLGlobals* G, const char* name,
418 const char* s1, int source, int target, int discrete, int zoom, int quiet,
419 int singletons, int copy_properties = 0);
420
421 PyObject *ExecutiveSeleToChemPyModel(PyMOLGlobals * G, const char *s1, int state,
422 const char *ref_object, int ref_state);
423 pymol::Result<> ExecutiveInvalidateRep(
424 PyMOLGlobals* G, const char* name, int rep, int level);
425 pymol::Result<> ExecutiveFlag(PyMOLGlobals * G, int flag, const char *sele, int action, int quiet);
426 pymol::Result<> ExecutiveRemoveAtoms(PyMOLGlobals * G, const char *s1, int quiet);
427 pymol::Result<> ExecutiveProtect(PyMOLGlobals * G, const char *s1, int mode, int quiet);
428 pymol::Result<> ExecutiveMask(
429 PyMOLGlobals* G, const char* s1, int mode = 1, int quiet = 1);
430 void ExecutiveRebuildAll(PyMOLGlobals * G);
431 pymol::Result<> ExecutiveSpheroid(PyMOLGlobals * G, const char *name, int average);
432 pymol::Result<> ExecutiveAddHydrogens(PyMOLGlobals* G, const char* s1 = "(all)",
433 int quiet = 1, int state = -1, bool legacy = false);
434 void ExecutiveFixHydrogens(PyMOLGlobals * G, const char *s1, int quiet);
435 pymol::Result<> ExecutiveFuse(PyMOLGlobals* G, const char* s0 = "(pk1)",
436 const char* s1 = "(pk2)", int mode = 0, int recolor = 1, int move_flag = 1);
437 pymol::Result<> ExecutiveRenameObjectAtoms(
438 PyMOLGlobals* G, const char* name, int force, int quiet);
439
440 pymol::Result<std::vector<const char*>> ExecutiveGetNames(PyMOLGlobals*, int, int, const char*);
441 bool ExecutiveIsMoleculeOrSelection(PyMOLGlobals * G, const char *name);
442 int ExecutiveGetType(PyMOLGlobals * G, const char *name, WordType type);
443 float ExecutiveGetArea(PyMOLGlobals * G, const char *s0, int sta0, int load_b);
444 void ExecutiveInvalidateSceneMembers(PyMOLGlobals * G);
445 void ExecutiveInvalidateSelectionIndicators(PyMOLGlobals *G);
446 void ExecutiveInvalidateSelectionIndicatorsCGO(PyMOLGlobals *G);
447 void ExecutiveRenderSelections(PyMOLGlobals * G, int curState, int slot, GridInfo *grid);
448 void ExecutiveHideSelections(PyMOLGlobals * G);
449 pymol::Result<> ExecutiveSetTitle(PyMOLGlobals * G, const char *name, int state, const char *text);
450 const char *ExecutiveGetTitle(PyMOLGlobals * G, const char *name, int state);
451 void ExecutiveSetLastObjectEdited(PyMOLGlobals * G, CObject * o);
452 CObject *ExecutiveGetLastObjectEdited(PyMOLGlobals * G);
453 bool ExecutiveIsFullScreen(PyMOLGlobals * G);
454 void ExecutiveFullScreen(PyMOLGlobals * G, int flag);
455
456 #ifndef _PYMOL_NOPY
457 PyObject *ExecutiveGetSettingOfType(PyMOLGlobals * G, int index, const char *object, int state,
458 int type);
459 #endif
460
461 pymol::vla<ObjectMolecule*> ExecutiveGetObjectMoleculeVLA(PyMOLGlobals * G, const char *sele);
462 pymol::Result<int> ExecutivePairIndices(PyMOLGlobals * G, const char *s1, const char *s2, int state1, int state2,
463 int mode, float cutoff, float h_angle,
464 int **indexVLA, ObjectMolecule *** objVLA);
465 void ExecutiveRebuildAllObjectDist(PyMOLGlobals * G);
466 int ExecutivePhiPsi(PyMOLGlobals * G, const char *s1, ObjectMolecule *** objVLA, int **iVLA,
467 float **phiVLA, float **psiVLA, int state);
468 float *ExecutiveGetVertexVLA(PyMOLGlobals * G, const char *s1, int state);
469 int ExecutiveValidName(PyMOLGlobals * G, const char *name);
470 int ExecutiveValidNamePattern(PyMOLGlobals * G, const char *name);
471 void ExecutiveMakeUnusedName(PyMOLGlobals * G, char * prefix, int length, bool alwaysnumber=true, int start=1, const char * pattern="%02d");
472 std::string ExecutiveGetUnusedName(PyMOLGlobals * G, const char * prefix="tmp", bool alwaysnumber=true);
473 int ExecutiveProcessObjectName(PyMOLGlobals * G, const char *proposed, char *actual);
474
475 pymol::Result<> ExecutiveIsolevel(PyMOLGlobals* G, const char* name, float level, int state, int quiet);
476 pymol::Result<float> ExecutiveGetIsolevel(PyMOLGlobals* G, const char* name, int state);
477 pymol::Result<> ExecutiveTransformObjectSelection(PyMOLGlobals* G,
478 const char* name, int state, const char* s1, int log, const float* matrix,
479 int homogenous, int global);
480 pymol::Result<> ExecutiveTransformSelection(PyMOLGlobals* G,
481 int state, const char* s1, int log, const float* ttt, int homogenous);
482 pymol::Result<> ExecutiveTranslateAtom(
483 PyMOLGlobals* G, const char* sele, const float* v, int state, int mode, int log);
484 void ExecutiveSelectRect(PyMOLGlobals * G, BlockRect * rect, int mode);
485 int ExecutiveMapSetBorder(PyMOLGlobals * G, const char *name, float level, int state);
486 pymol::Result<> ExecutiveMapTrim(PyMOLGlobals* G, const char* name,
487 const char* sele, float buffer, int map_state, int sele_state, int quiet);
488 pymol::Result<> ExecutiveMapDouble(PyMOLGlobals * G, const char *name, int state);
489 pymol::Result<> ExecutiveMapHalve(PyMOLGlobals * G, const char *name, int state, int smooth);
490
491 int ExecutiveIdentifyObjects(PyMOLGlobals * G, const char *s1, int mode, int **indexVLA,
492 ObjectMolecule *** objVLA);
493 pymol::Result<> ExecutiveTranslateObjectTTT(PyMOLGlobals* G,
494 const char* name, const float* trans, int store, int quiet);
495 pymol::Result<> ExecutiveCombineObjectTTT(PyMOLGlobals* G,
496 const char* name, const float* ttt, int reverse_order, int store);
497 pymol::Result<> ExecutiveSetObjectTTT(PyMOLGlobals* G,
498 const char* name, const float* ttt, int state, int quiet, int store);
499 int ExecutiveGetObjectTTT(PyMOLGlobals * G, const char *name, const float **ttt, int state,
500 int quiet);
501 int ExecutiveGetObjectMatrix(PyMOLGlobals * G, const char *name, int state, double **matrix,
502 int incl_ttt);
503 int ExecutiveSetObjectMatrix(PyMOLGlobals * G, const char *name, int state, double *matrix);
504
505 pymol::Result<> ExecutiveSetGeometry(
506 PyMOLGlobals* G, const char* s1, int geom, int valence);
507 int ExecutiveSculptIterateAll(PyMOLGlobals * G);
508 pymol::Result<> ExecutiveSmooth(PyMOLGlobals* G, const char* name, int cycles,
509 int window, int first, int last, int ends, int quiet);
510 int ExecutiveSculptDeactivate(PyMOLGlobals * G, const char *name);
511 int ExecutiveSculptActivate(PyMOLGlobals * G, const char *name, int state=-1, int match_state=-2,
512 int match_by_segment=0);
513 float ExecutiveSculptIterate(PyMOLGlobals * G, const char *name, int state=-1, int n_cycle=10);
514 pymol::Result<> ExecutiveMapNew(PyMOLGlobals* G, const char* name, int type,
515 float grid_spacing, const char* sele, float buffer, const float* minCorner,
516 const float* maxCorner, int state, int have_corners, int quiet, int zoom,
517 int normalize, float clamp_floor, float clamp_ceiling, float resolution);
518
519 int ***ExecutiveGetBondPrint(PyMOLGlobals * G, const char *name, int max_bond, int max_type,
520 int *dim);
521
522 pymol::Result<bool>
523 ExecutiveGetSymmetry(PyMOLGlobals * G, const char *sele, int state, float *a, float *b, float *c,
524 float *alpha, float *beta, float *gamma, char *sgroup);
525 pymol::Result<> ExecutiveSetSymmetry(PyMOLGlobals* G, const char* sele,
526 int state, float a, float b, float c, float alpha, float beta, float gamma,
527 const char* sgroup, int quiet);
528 pymol::Result<> ExecutiveSymmetryCopy(PyMOLGlobals * G,
529 const char *source_name, const char *target_name,
530 int source_state, int target_state, int quiet);
531 int ExecutiveGetSession(PyMOLGlobals * G, PyObject * dict, const char *names, int partial,
532 int quiet);
533 int ExecutiveSetSession(PyMOLGlobals * G, PyObject * session, int partial_restore,
534 int quiet);
535
536 int ExecutiveUnsetSetting(PyMOLGlobals * G, int index, const char *sele,
537 int state, int quiet, int updates);
538
539 pymol::Result<> ExecutiveAssignSS(PyMOLGlobals* G,
540 const char* target, int state, const char* context, int preserve,
541 ObjectMolecule* single_object, int quiet);
542
543 pymol::Result<> ExecutiveRampNew(PyMOLGlobals* G, const char* name,
544 const char* src_name, pymol::vla<float> range, pymol::vla<float> color,
545 int src_state, const char* sele, float beyond, float within, float sigma,
546 int zero, int calc_mode, int quiet);
547
548 int ExecutiveValidateObjectPtr(PyMOLGlobals * G, CObject * ptr, int object_type);
549
550 /**
551 * Colors atoms with a spectrum of colors based on atomic property
552 * @param G pointer to global pymol singletons
553 * @param s1 selection of atoms to color
554 * @param expr property expression
555 * @param min minimum of color range
556 * @param max maximum of color range
557 * @param first color idx of first color
558 * @param last color idx of last color
559 * @param prefix specifies spectrum mode
560 * @param digits (unknown)
561 * @param byres determines whether coloring is applied per-residue
562 * @param quiet determines whether feedback is displayed
563 * @return pair of minimum and maximum of spectrum range
564 */
565 pymol::Result<std::pair<float, float>> ExecutiveSpectrum(PyMOLGlobals* G,
566 const char* s1, const char* expr, float min, float max, int first, int last,
567 const char* prefix, int digits, int byres, int quiet);
568
569 pymol::Result<> ExecutiveReinitialize(PyMOLGlobals * G, int what, pymol::zstring_view pattern);
570 const char *ExecutiveFindBestNameMatch(PyMOLGlobals * G, const char *name);
571 int ExecutiveSetVisFromPyDict(PyMOLGlobals * G, PyObject * dict);
572 PyObject *ExecutiveGetVisAsPyDict(PyMOLGlobals * G);
573 CField *ExecutiveGetVolumeField(PyMOLGlobals * G, const char * objName, int state);
574 pymol::Result<> ExecutiveSetVolumeRamp(PyMOLGlobals * G, const char * objName, std::vector<float> ramp_list);
575 PyObject *ExecutiveGetVolumeRamp(PyMOLGlobals * G, const char * objName);
576
577 pymol::Result<std::vector<float>>
578 ExecutiveGetHistogram(PyMOLGlobals * G, const char * objName, int n_points,
579 float min_val, float max_val);
580
581 int ExecutiveIterateObjectMolecule(PyMOLGlobals * G, ObjectMolecule ** obj,
582 void **hidden);
583 pymol::Result<> ExecutiveSetObjectColor(PyMOLGlobals * G, const char *name, const char *color, int quiet);
584 int ExecutiveGetObjectColorIndex(PyMOLGlobals * G, const char *name);
585 pymol::Result<> ExecutiveSetOnOffBySele(PyMOLGlobals * G, pymol::zstring_view sname, int onoff);
586 pymol::Result<> ExecutiveSetName(PyMOLGlobals * G, const char *old_name, const char *new_name);
587 int ExecutiveSetDrag(PyMOLGlobals * G, const char *name, int quiet,int mode);
588 int ExecutiveGetActiveSeleName(PyMOLGlobals * G, char *name, int create_new, int log);
589 int ExecutiveGetActiveSeleName(PyMOLGlobals * G, std::string& name, int create_new, int log);
590 int ExecutiveGetActiveSele(PyMOLGlobals * G);
591 int ExecutiveGetActiveAlignmentSele(PyMOLGlobals * G);
592 const char* ExecutiveGetActiveAlignment(PyMOLGlobals* G);
593 CObject *ExecutiveGetExistingCompatible(PyMOLGlobals * G, const char *oname, cLoadType_t type);
594 pymol::Result<float> ExecutiveAngle(PyMOLGlobals* G, const char* nam,
595 const char* s1, const char* s2, const char* s3, int mode, int labels,
596 int reset, int zoom, int quiet, int state, int state1 = -4, int state2 = -4,
597 int state3 = -4);
598
599 pymol::Result<float> ExecutiveDihedral(PyMOLGlobals* G, const char* nam,
600 const char* s1, const char* s2, const char* s3, const char* s4, int mode,
601 int labels, int reset, int zoom, int quiet, int state);
602
603 int ExecutiveMatrixCopy2(PyMOLGlobals * G,
604 CObject * source_obj, CObject * target_obj,
605 int source_mode, int target_mode,
606 int source_state, int target_state,
607 int target_undo, int log, int quiet);
608
609 int ExecutiveMatrixCopy(PyMOLGlobals* G, const char* source_name,
610 const char* target_name, int source_mode, int target_mode, int source_state,
611 int target_state, int target_undo, int log, int quiet);
612
613 void ExecutiveMemoryDump(PyMOLGlobals * G);
614 void ExecutiveObjMolSeleOp(PyMOLGlobals * G, int sele, ObjectMoleculeOpRec * op);
615
616 pymol::Result<> ExecutiveIsomeshEtc(PyMOLGlobals * G,
617 const char *mesh_name, const char *map_name, float lvl,
618 const char *sele, float fbuf, int state,
619 float carve, int map_state, int quiet,
620 int mesh_mode, float alt_lvl);
621
622 pymol::Result<> ExecutiveIsosurfaceEtc(PyMOLGlobals * G,
623 const char *surf_name, const char *map_name, float lvl,
624 const char *sele, float fbuf, int state,
625 float carve, int map_state, int side,
626 int quiet, int surf_mode);
627
628 pymol::Result<> ExecutiveVolume(PyMOLGlobals * G, const char *volume_name, const char *map_name,
629 float lvl,
630 const char *sele, float fbuf, int state,
631 float carve, int map_state, int quiet);
632
633 int ExecutiveVolumeColor(PyMOLGlobals * G, const char * volume_name, float * colors, int ncolors );
634
635 void ExecutiveMotionDraw(PyMOLGlobals * G, BlockRect *rect, int expected ORTHOCGOARG);
636
637 void ExecutiveMotionReinterpolate(PyMOLGlobals * G);
638
639 pymol::Result<> ExecutiveMotionViewModify(PyMOLGlobals* G, int action,
640 int index, int count, int target, const char* name, int freeze, int quiet);
641
642 void ExecutiveMotionMenuActivate(PyMOLGlobals * G, BlockRect *rect, int expected,int passive,
643 int x, int y, int same);
644 int ExecutiveGroupMotionModify(PyMOLGlobals *G, CObject *group, int action,
645 int index, int count, int target, int freeze);
646 int ExecutiveGroupMotion(PyMOLGlobals *G, CObject *group,int action, int first,
647 int last, float power, float bias,
648 int simple, float linear, int wrap,
649 int hand, int window, int cycles, int state, int quiet);
650 int ExecutiveGroupCombineTTT(PyMOLGlobals *G, CObject *group, const float *ttt, int reverse_order, int store);
651 int ExecutiveGroupTranslateTTT(PyMOLGlobals *G, CObject *group, const float *v, int store);
652 void ExecutiveMotionClick(PyMOLGlobals * G, BlockRect *rect, int mode, int expected, int x, int y, int nearest);
653 void ExecutiveMotionTrim(PyMOLGlobals * G);
654 void ExecutiveMotionExtend(PyMOLGlobals * G, int freeze);
655 int ExecutiveMotionView(PyMOLGlobals *G, int action, int first,
656 int last, float power, float bias,
657 int simple, float linear, const char *name, int wrap,
658 int hand, int window, int cycles,
659 const char *scene_name, float scene_cut, int state, int quiet, int autogen);
660 int ExecutiveIsomeshEtc(PyMOLGlobals * G,
661 const char *volume_name, const char *map_name, float lvl,
662 const char *sele, float fbuf, int state,
663 float carve, int map_state, int quiet,
664 int mesh_mode, int box_mode, float alt_lvl);
665 int ExecutiveAssignAtomTypes(PyMOLGlobals * G, const char *s1, int format, int state, int quiet);
666
667 PyObject * ExecutiveCEAlign(PyMOLGlobals * G, PyObject * listA, PyObject * listB, int lenA, int lenB,
668 float d0, float d1, int windowSize, int gapMax);
669
670 pymol::Result<> ExecutiveSetFeedbackMask(
671 PyMOLGlobals* G, int action, unsigned int sysmod, unsigned char mask);
672 pymol::Result<> ExecutiveClip(PyMOLGlobals* G, pymol::zstring_view clipStr);
673
674 pymol::Result<> ExecutiveSliceNew(PyMOLGlobals* G, const char* slice_name,
675 const char* map_name, int state, int map_state);
676
677 pymol::Result<ExecutiveRMSInfo> ExecutiveFit(PyMOLGlobals* G,
678 pymol::zstring_view str1, pymol::zstring_view str2, int mode, int cutoff,
679 int cycles, int quiet, pymol::zstring_view object, int state1, int state2,
680 int matchmaker);
681
682 #ifdef _PYMOL_LIB
683 int *ExecutiveGetRepsInSceneForObject(PyMOLGlobals *G, const char *name);
684 int *ExecutiveGetRepsForObject(PyMOLGlobals *G, const char *name);
685 #endif
686
687 char *ExecutiveGetObjectNames(PyMOLGlobals * G, int mode, const char *name, int enabled_only, int *numstrs);
688
689 CoordSet * ExecutiveGetCoordSet(PyMOLGlobals * G, const char * name, int state, ObjectMolecule ** omp=NULL);
690
691 void ExecutiveUndo(PyMOLGlobals * G, int dir);
692 int ExecutiveSaveUndo(PyMOLGlobals * G, const char *s1, int state);
693
694 pymol::Result<> ExecutiveRebond(PyMOLGlobals* G, const char* oname, int state);
695
696 #endif
697