Debian Codegraph @

window.h

raw symbols SCIP
1
2 /****************************************************************************
3 **
4 ** Copyright (C) 2011 Christian B. Huebschle & George M. Sheldrick
5 ** All rights reserved.
6 ** Contact: [email protected]
7 **
8 ** This file is part of the ShelXle
9 **
10 ** This file may be used under the terms of the GNU Lesser
11 ** General Public License version 2.1 as published by the Free Software
12 ** Foundation and appearing in the file COPYING included in the
13 ** packaging of this file. Please review the following information to
14 ** ensure the GNU Lesser General Public License version 2.1 requirements
15 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
16 **
17 **
18 ****************************************************************************/
19 #ifndef WINDOW_H
20 #define WINDOW_H
21 #include <locale.h>
22 #include <QtGui>
23 #include <QtNetwork>
24 #include "chgl.h"
25 #include "codeeditor.h"
26 #include "qpeakview.h"
27 #include "psewidget.h"
28 #include "historywidget.h"
29 #include "fourxle.h"
30 #include "itsme.h"
31 #include "opengltestwidget.h"
32 #ifndef nullptr
33 #define nullptr NULL
34 #endif
35 #if defined _MSC_VER && _MSC_VER == 1500
36 #ifndef fmin
37 #define fmin(x, y) (((x) < (y)) ? (x) : (y))
38 #endif
39 #define round(x) (x<0?ceil((x)-0.5):floor((x)+0.5))
40 #endif
41 #undef vc7hack1
42 #ifdef _MSC_VER
43 #include <float.h>
44 #define std_isfinite _finite
45 #define vc7hack1 1
46 #else
47 #define std_isfinite std::isfinite
48 #endif
49
50 #ifndef FONTFAM
51 #if defined Q_WS_WIN || defined Q_OS_WIN
52 #define FONTFAM "Droid Sans Mono"
53 #elif defined Q_WS_MAC || defined Q_OS_MAC
54 #define FONTFAM "Monaco"
55 #else
56 #define FONTFAM "Droid Sans Mono"
57 #endif
58 #endif
59
60 #include "calculator.h"
61 #include "dsrgui.h"
62 #include "listfile.h"
63 #define SX_LINE_LENGTH 80
64
65 /*! \brief Window is the main window class of ShelXle most of the magic happens here ;-)
66 *
67 */
68
69 class Window : public QMainWindow {
70 Q_OBJECT
71 public:
72 //Window(ChGL *_chgl);
73 Window(PlayOpenGL *_chgl=nullptr);
74 virtual ~Window();
75 //bool scroller;
76 static int Version();//!< This return the actual Revision
77 QString theIconPath;
78 QString CurrentCellString;
79 bool restraintsOrConstraints();
80 int MaxNumberOfPeaks;
81 int wght_max_cycls;
82 static QString programName(){return QString(PROGRAM_NAME);}//!<get the actual programname
83 //ChGL *chgl = nullptr;
84 PlayOpenGL *chgl = nullptr;
85 PlayOpenGL *ogl;
86 OpenGLTestWidget *tgl = nullptr;
87 QTextEdit *extraOutPut;
88 CodeEditor *editor;
89 CodeEditor *xlPutor;
90 QSettings *einstellung;
91 #if (QT_VERSION >=0x050000)
92 QScreen *screen;
93 #endif
94 QDockWidget *dock, *renamDock, *qPeakDock, *histDock;
95 QDockWidget *shxEditorDock,*shxOutputDock,*infotainmentDock;
96 QAction *enterRenameMode;
97 QAction *showQPeakLegend;
98 QAction *openAct;
99 QAction *screenshotAct;
100 QAction *objExport;
101 QAction *separateLabelFile;
102 //QAction *toggleOrthoView;
103 QAction *belocube;
104 QAction *actionUniq;
105 QAction *actionSearch;
106 QAction *actionNext;
107 QAction *actionPrev;
108 QAction *actionSave;
109 QAction *actionSaveAs;
110 QAction *actionUndo;
111 QAction *actionRedo;
112 QAction *actionCut;
113 QAction *actionCopy;
114 QAction *actionPaste;
115 QAction *actionQPeakLimit;
116 QAction *actionHFix;
117 QAction *wghtRefineAct;
118 QAction *actionEP;
119 QAction *actionEM;
120 QAction *togAtom;
121 QAction *togBond;
122 QAction *togLabel;
123 //QAction *togUnit;
124 //QAction *togElli;
125 //QAction *togHBond;
126 QAction *togBackGr;
127 QAction *togDepthCueing;
128 QAction *actionPovRay;
129 QAction *actionExportCC;
130 QAction *killQs;
131 QAction *killHs;
132 QAction *astdlg;
133 QAction *equivHighlighting;
134 QAction *wghtAct;
135 QAction *sinaAct;
136 QAction *squeezeAct;
137 QAction *recalcSDM;
138 QAction *renamUpdateAct;
139 QAction *cntrPlot;
140 QAction *useNativeDlg;
141 QAction *darkTheme;
142 QAction *switch2HKLF5;
143 QAction *switch2HKLF4;
144 QAction *symmElementsAct;
145 QTextBrowser *brs;
146 QProcess *runffmpeg;
147 QLineEdit *ffmpegedt,*mp4file;
148 QString fffn;
149 QLabel *ffl;
150 QString oldFileName;
151 QProgressBar *bar;
152 QPushButton *closeFF ;
153 QDialog *extraOutput;
154
155 QToolBar *editToolBar,//!< Edit toolbar (redo undo copy cut and paste...)
156 *refineToolBar,//!< WGHTrefine, autoHFIX, +kill Hs, kill Qs, refine XL and anis refine
157 *bottomToolBar,//!< selection toolbar with context specific content.
158 *fito,//!< File toolbar
159 *vito,//!< View toolbar to toggle bonds atoms etc...
160 *extraTB; //!< External programs can be startet from here.
161 QMenu *runMenu;//!< the SHELX menu where you also run XL and do convientent stuff with the res file.
162 QMenu *fileMenu, //!< file menu including the save history
163 *editMenu, //!< standart edit menu
164 *dialogMenu, //!< settings menu
165 *viewMenu, //!< View menu
166 *packMenu, //!< Packing, growing, fusing etc...
167 *extraMenu;//!< add and start external programs...
168
169 QCheckBox *qGrowPeak;
170 QCheckBox *search4duplicates;
171 QToolButton *zoomIn;
172 QToolButton *zoomOut;
173 QToolButton *homeMe;
174 QToolButton *quickReLoadButton;
175 QSpinBox *lodsp;
176 QCheckBox *sr_same;//use same restraint for part atoms
177 QCheckBox *sr_simu;//use sumu restraint for part atoms
178 QCheckBox *sr_rigu;//use rigu restarint for part atoms
179 QCheckBox *sr_alter_name;//give alternataive name to 2nd part atoms
180 QCheckBox *sr_ExyzAadp_ifclose; // apply EXYZ and EADP if atoms are very close
181 bool notRefine;
182 bool shaderInfo = false;
183 int tbiconSize;
184 QHash<QString,QVariant> myHash;//!< This Hash connects recent file names with cursor positions. So that files are opened always at the same position.
185 QAction *refineAct;
186 QAction *refineActAnis;
187 QAction *refineActActa;
188 QAction *refineActExti;
189 QAction *refineActConf;
190 QAction *clearVoro;
191 FourXle *fxle;//!<The fourier map object.
192 // QList<V3> orte;
193 // QList<V3> normalen,nnn;
194 // QList<QColor> farben;
195 // int zoff,yoff,xoff;
196 // QList<int> sfac;//!<List of Scattering factors.
197 QList<double> fvar;//!<List of Free Variables.
198 QMap<int,int> fvarCntr;//!<Free Variable counter QMap.
199 bool isLabelInUse();//!< Checks if the current Label in the reaname dialog is in use. \returns true if Label is already in use.
200 QString dirName; //!< Full path of the currently opened file (including file name).
201 QString lastDirName;
202 QString actionInfo;
203 void setFocus(bool b){focusSet=b;}
204 bool isFocusSet() {return focusSet;}
205 int getFvarCntr(int fvar);//!< returns the number of uses of a free variable.
206 int getFvarNr(double v, const QList<double> fv);
207 int firstAtomLine;
208 int extraIndex;
209 bool finWasPressed;
210 QAction *ydleStart;
211 QAction *ydleStop;
212 QSpinBox *lpart;
213 QSpinBox *rpart;
214 bool canWeSqueeze();
215 int cifCheckSum(const QString &block);
216
217 const QRegularExpression buchstaben = QRegularExpression("[A-Za-z]");
218 const QRegularExpression vorneweg = QRegularExpression("[^A-Za-z']+");
219 const QRegularExpression resorins = QRegularExpression("(.res$)|(.ins$)", QRegularExpression::CaseInsensitiveOption);
220 const QRegularExpression punkthkl = QRegularExpression(".hkl$",QRegularExpression::CaseInsensitiveOption);
221 const QRegularExpression unitinst = QRegularExpression("^UNIT",QRegularExpression::CaseInsensitiveOption);
222 const QRegularExpression punktres = QRegularExpression(".res$", QRegularExpression::CaseInsensitiveOption);
223 const QRegularExpression punktins = QRegularExpression(".ins$",QRegularExpression::CaseInsensitiveOption);
224 const QRegularExpression punktpov = QRegularExpression("(.pov)",QRegularExpression::CaseInsensitiveOption);
225 const QRegularExpression leer = QRegularExpression("\\s+");
226 const QRegularExpression numbers = QRegularExpression("\\d+");
227 const QRegularExpression startnumbers = QRegularExpression("^[0-9]+");
228
229 const QRegularExpression nonumbers = QRegularExpression("\\D+");
230 const QRegularExpression commaspace = QRegularExpression(", $");
231
232
233 signals:
234 void fileLoaded(void);
235 void pipeStatus(const QString& s); //!<changes the statusbar text to s @param s text for the status bar
236 void movedByUser();
237
238 public slots:
239 void loadMolInTest(bool fromloadref=false);
240 void qinitres();
241 void addNewScatteringFactor(int oz, bool HisD);//!<Adds a new scattering factor to the SFAC / UNIT list.
242 void addDissorderedMethyl();//!<Adds rotation dissordered hydroghen atoms to a R-C carbon atom. (methyl group) AFIX 127.
243 void addMethyl();//!<Adds hydroghen atoms to a R-C carbon atom. (methyl group) AFIX 137.
244 void addHydroxyl();//!<Adds hydroghen atoms to a O-X oxygen atom. (hydroxyl group) AFIX 148.
245 void addH43();
246 void addH23();
247 void addH93();
248 void addH163();
249 void addHnonplanarAminR2();
250 void addHnonplanarAminR1();
251 void addMoreQPeaks();//!<Creates Q-Peaks from the Fo-Fc map.
252 void adoptEditToolBar(bool b);//editToolbar is child of shxMW or the MainWindow
253 void aula();//!< Auto Labeling
254 void autoHFix();//!<Automatically adds H atoms and AFIX instructions to the file uses the Fo-Fc map.
255 void brwsIcon();//!< Select an alternative icon for external program
256 void changeFixes(int i);//!< Variable that should not be refined get a 10 added.
257 void changeEditorFont();//!<Changes the Editor font via an font dialog.
258 void changeElemetofLabel(const QString &pse);//!<NextLabel of rename mode consists of labelPSE labelIndex labelSuffix, this changes the LabelPSE to pse. @param pse next labelPSE.
259 void changeElement();//!<Changes the element of an atom (chgl->ImeanThisAtom) to an other scattering factor (acation->data)
260 void changeSelectedElements();
261 void changeIconSize();//!<Changes the size of the tool bar icons.
262 void changeInvRad(double r);
263 void changePlaneTransparence(double t);
264 void changeglideVectorThickness(double t);
265 void changeaxisThickness(double t);
266 void changeplaneFrameThinkness(double t);
267
268 void changeQPeakLimit();//!<Maximum number of Q-peaks created by addMoreQPeaks
269 void changeIndexofLabel(const int i);//!<NextLabel of rename mode consists of labelPSE labelIndex labelSuffix, this changes the LabelIndex to pse. @param i next labelIndex. For i < 0 no number in label.
270 void changeLabelFont();//!<Changes the font of the on screen Labels of the atoms.
271 void changeResiPart();//!< change the resi or part of selected atoms.
272 void changeScalefactor();//!<Changes the screen shot scale factor.
273 void changeSuffixofLabel(int);//!<NextLabel of rename mode consists of labelPSE labelIndex labelSuffix, this changes the labelSuffix @param fix next labelSuffix.
274 void checkForUpdates();//!<Checks via the internet if new versions of ShelXle are availabe.
275 void clipboardDataChanged();//!<Enables the paste action if something is in the clipboard.
276 void clearStructure();
277 void closeEvent(QCloseEvent *event);//!<Tidys everything up and stores settings before closing the ShelXle app.
278 void configBeLos();//!< Configure BEDE LONE Objects style
279 void connectEdior();
280 void darkEdit();
281 void brwsEPS();
282 void everyPointOne();
283 void everyAIM();
284 void contourPlot();
285 void nocontourPlot();
286 void delayedLoad();
287 void colorButtonDialog();
288 void convergeWght();//!<Tries to refine until the wheighting scheme converges.
289 bool compareWGHTS(QString w1, QString w2, double &diff, double tolerance = 0.001);//!<Compare 2 WGHT strings by value
290 void complete();//!<forces the display list to be updated.
291 void configureBottomToolbar();//!<Changes the look and feel and position of the Selection Tool Bar.
292 void copySymmMate();//!<copies the fractional coordinates of a symmetry generated part -n atom in the file.
293 void createCentroid();//!<creates a centroid dummy atom which can be used for restraints and measurements.
294 void deleteAllH();//!<Deletes all Hydrogen atoms and associated AFIX instructions.
295 void deleteAllQ();//!<Deletes all Q-Peaks.
296 void deleteSelectedAtoms();//!<Deletes all selected atoms.
297 void displayResiduals(XLOutputParser &lfo, QString s);//!<Displays the residuals from SHELXL in a clear way
298 int duplicates();//!<searches for identical labeled Atoms and add them to a list.
299 void editorIsVisible(bool);//!is Editor really visble
300 void effuenf();//!<F5 recalculates the display lists sets the focus to the openGL widget and raises it on top.
301 void expandAll();//!<Expands all contacts .
302 void extraSettings();//!<A dialog to add/edit exteral programs started from ShelXle with or without arguments.
303 void extraSettingsLast();//!<A dialog to add/edit exteral programs started from ShelXle with or without arguments.
304 void exportCoordinates();//!<Exports all visible atoms to an extra file.
305 void exportCC();//!< Export coordinates to computational chemistry program inputs like Gaussian or Turbomol
306 void exportFMaps();
307 void fileNative();
308 bool fileSave(bool spell=true, bool loadafter=true);//!<saves the editor content to the current file. @param spell disable spell checking during save @param loadafter disable reloading of file.
309 bool fileSaveAs();//!<Saves the editor content to a specified file.
310 void fileSave4hklf5();
311 void fillCell();//!<Uses symmetry until the unit cell box is full.
312 void showSearch();//!< shows the search and repleace for the editor.
313 void findNext();//!<Find next (F3) functionality of search and replace in the editor.
314 void findPrev();//!<Find previous functionality of search and replace in the editor.
315 void findInStructure(const QString &info);//!<the atom with the matching orgiginal line gets centered and selected.@param info original line content.
316 void openIncludeFile(const QString &info);
317 void finXL();//!Finish XL by name.fin
318 void fixIt();//!< Fix some parameters from being refined.
319 void foversusfc();//!< Shows a duialog to analyse and omit outlier reflections.
320 void fuse();//!< show only the asymetric unit.
321 void go2hklf5();
322 void go2hklf4();
323 void grossRC(const QString &text);//!< Capitalizes the text and sets the resiResiClass text to text @param text new text for resiResiClass.
324 void grow();//!< completes the molecule by symmetry.
325 void grow_plus();
326 void growQPeaks(bool qpg);//!< applies symmetrie operations used for the main structure also for the Q-Peaks.
327 void hereAreMyKeys();
328 void hideToolz(bool b);//!< Hides all tool bars.
329 void hintLhide();//!< Hides a hint in the reaname mode for ever.
330 void idleRotStart();
331 void idleRotStop();
332 void incResiNr();
333 void decResiNr();
334 void infoKanalNews(const QString& s);//!< passes a string to the Info widget. @param s a new text for the info widget.
335 void inheritLabels();//!< opens an inherit labels dialog.
336 void insertSADI(int selected); //!< Insert SADI restraint into ins file
337 void insertTwin();
338 void invert();//!< inverts the structure and changes ot the right enantiomorph space group.
339 // inline int Intersect( double& vm, double& vp ){ return vm*vp <= 0.0 && (vm<0.0 || vp<0.0); }//!<
340 void isUpToDate(QNetworkReply* antwort);//!< Interpretes the network reply for the check for updates (manual version)
341 void jnk();//!< Julian Henn and Kathrin Meindl frcatal dimension analisis
342 void jumpToAtom(int index);//!< if rename mode is visible the atom at index gets renamed if not the cursor of the editor is pointed to the specified atom.
343 void linkHelp();//!< Show a Link to the online help.
344 void loadAFile();//!< (re)loads the file specified in dirName.
345 void loadFile(QString fileName, bool fromloadref=false);//!< loads the file with the specified path the listfile is also loaded. @param fileName path to the res / ins file.
346 void load_sheldrick(QString fileName, QString &inhalt);//!< Loads a shelx file from a string. You have to take care that the file is valid beforehand.
347 bool quickReLoad(QString fn, QString &cont);//!< Updates a structure after refinement or save With keeping grow and hide states unchanged. If differences are to large false is returned 1/19/2021
348 void loadLst();//!< loads the .lst file if it exists.
349 void loadrefres();//!< loads the refinement results from the res file.
350 void loadThisFile();//!< loads a file from an QAction with path as Action data.
351 void makeItHKLF5();
352 void makeVoro();
353 void clearVoros();
354 void moveSymmMate();//!< Moves the specified symmetry generated atom to the asymmetric unit.
355 void moveSymmMateSel();//!< Moves selected symmetry generated atoms to the asymmetric unit.
356 void obj();
357 void omitRfl();
358 void openFile();//!< Open res file dialog
359 void openRecentFile();//!< opens a recently used file
360 void openSaveHistory();//!< sows the save history dialog
361 void outputIsVisible(bool);//!< is Output really visble
362 void packInLimits();//!< Pack inside given limits (eg multiple unit cells)
363 // bool peakcomp(MyAtom &a1,MyAtom &a2);
364 void raiseTaff();// show visual refinement output
365 void raiseTaz();// show text refinement output
366 void redoRename();//!<if redo is clicked and it was a rename a rename is redone.
367 void removeExtra(QAbstractButton *button);//!<removes an external program from the menu / tool bar.
368 void renameRNchanged(int ii);//!< Residue Number of rename mode is changed to ii @param ii residue number.
369 void renameThisAtom();//!< The label of the specified atom is used to feed the inputs of rename mode and the latter is opened.
370 void renameThisAtom(int index);//!< specified atom is renamed as given by rename mode
371 void rename2ThisAtom(int index);//!< tries to find an apropriate H label
372 void renamUpdate(bool vis);//!<rename mode gets shown or hidden. @param vis visibitity of rename mode.
373 void replyFinished(QNetworkReply* antwort);//!<Interpretes the network reply for the check for updates (automatic version)
374 void resiSelectorCheck();//!<updates the 'Residue Finder' when the text cursor moves.
375 void rotd();//!< rotates down
376 void rotl();//!< rotates left
377 void rotr();//!< rotates right
378 void rotu();//!< rotates up
379 void rufmode();//!< new labels can not be duplicates if this mode is on
380 void runShelXL();//!< copies res to ins file and runs shelxl
381 void runExtra();//!< runs rexternal programs
382 void runSqueeze();
383 void runXLWGHT();//!< runs shelxl for convergeWght.
384
385 void saveScene();//!< saves a srceen shot of the OpenGL widget
386 void savePovRay();
387 void savePovInc(QString povName);
388 void sdm();//!< the shortest distance matrix is (re)calculated and the structure is grown
389 void selectInStructure(const QString &info);//!< selects all atoms found in selected text in the structure @params info seleted text.
390 void setCalculatorsCurrentCell();
391 void shredCIF();//!< runs shredcif and loads ins/res file
392 void selectParts();//!< selects atoms for 'Part Selector'
393 void setShelxlOptions();//!< sets path and command line options for ShelXl executable.
394 void setShelxlPath();//!< sets path for ShelXl executable
395 void setExtraPath();//!<sets path for an external program
396 void setDefaultPath();//!<when the first recent file does not exists then open dialog starts here
397 void selOmitG5();
398 void selOmitG10();
399 void updateExtraIcon();//!< redraws the icon preview
400 void sColorDLG();
401 void setSDMLimit();//!< max atoms in au to skip sdm calculation
402 void setMaxWGHTCycls();//!< maximum cycles in WGHT refine
403 void setMonoQ(bool vis);//!<sets monochome modus for Q-Peaks to vis @param vis mochrome mode of Q-Peaks.
404 void shxActUpdate(bool vis);//!< the editor tool bar gets visible when the editor is visible.
405 void shxOPTUpdate(bool vis);//!< the editor tool bar gets visible when the editor is visible.
406 void sina();//!< ANIS backwards is SINA! makes specified, selected or all atoms isotrop again with uiso = 0.05
407 // void springSlider();
408 void testOGL();
409 void spellCheck();//!< a syntax check for the res file.
410 void closeSR(bool vis);
411 void splitRotate();
412 QString strippedName(const QString &fullFileName);//!< the file name without the path is retrned \returns the filename without path. @param total file path.
413 void styleDialog();//!< Atom style dialog is shown.
414 void symmElements(bool b);
415 void symmetryManager();//!< a symmetry manager is shown
416 void testMerohedral();
417 void toggDocWid(bool weg);//!< hides Text Windows
418 void toggleEQHighlighting(bool);//!< toggles higlighting of symmetry generated atoms.
419 void toggleFullScreen();
420 void toggleHFSAO(bool on);
421 void togOMIT(bool b);
422 void togSop(bool b);
423 void togSel(bool b);
424 void toggleOrtho(bool ov);//!< toggles orthographic and perspective projection.
425 void undoRename();//!<if undo is clicked and it was a rename a rename is undone.
426 void uniq();//!< moves centers of gravity of all molecules into the unit cell box. !does not heal scrambled molecules!
427 void unique();//!< !does ?not? heal scrambled molecules!
428 void updateLabel();//!< the rename mode is updated
429 void updateLC();//!<updates the Lines and Columns display.
430 void updateRecentFileActions();//!<updates the recent file list
431 void updateScaleDlg();//!< recalculates scale factor with and heigth of the screen shot scale factor dialog
432 void updateSelectResi();//!< updates the ResiFinder ComboBox for each editor line starting with RESI a new item is issued .
433 void updateSM1();//!< for the symmetry manager dialog
434 void updateSM2();//!< for the symmetry manager dialog
435 void updateSM3(const QUrl link);//!< for the symmetry manager dialog
436 void updateSM4(QString s);//!< for the symmetry manager dialog
437 void updateStatusBar(const QString& s) ; //!<changes the statusbar text to s @param s text for the status bar
438 void updateTieFreeVar();//!< if the occupancy factor should be tied to a free variable the rename mode
439 void updateTwinTest();
440 void updateXLput();//!< the output view for the shelxl run is updated
441 void updateExtraOutput();//!< the output view for the external program is updated.
442 void updateExtraSettings(int index);//!< the external programs dialog gets updated.
443 void updateExtraSettings();//!< the external programs dialog gets updated.
444 void wasDelete();//!< for undo redo fuctionality of atom deletion.
445 void worstReflections();
446 void setFFMPEGEXE();
447 void setMP4();
448 void updateOutput();
449 void makeRotMovi();
450 void split();
451 void notsplit();
452 void wasRename();//!< for undo redo fuctionality of atom renameing.
453 void withdrawres();//!< discard the results of the refinement. Copies back the ins file to the res file and loads that.
454 void zoomin(); //!< zoomes in
455 void zoomout();//!< zoomes out
456 void calculator(); //!< A dialog to work with resolution and 1,3 distances via the angle
457 void create_DSRGui(); //!< A dialog for DSR
458 void insertDSRLine(QString dsrline, int position, QVector<int> previousLine);
459 void dsrClosed();
460 void aboutXLE();//!<Shows the about dialog of ShelXle.
461 CEnvironment lonesome(QString s,int startNummer);//!< calculates LONE objects
462 void beloWriteCube();//bello braf!
463 static int isacommand(QString command);
464 void displayDisagreeableRestraints();
465 void defineBarray();
466 protected:
467 void paintEvent(QPaintEvent *event);
468 //void moveEvent(QMoveEvent *event);
469 void dragEnterEvent(QDragEnterEvent *event);
470 void dropEvent(QDropEvent *event);
471 void showEvent(QShowEvent * event);// override;
472 void hideEvent(QHideEvent * event);// override;
473 private:
474 friend class AulaWorker;
475 bool focusSet;
476 bool fullscreen;
477 int wght_cycls; //!< Number of cycles during the wght refinement.
478 int ls_cycls; //!< Number of least-squares cycles during L.S. or CGLS refinement.
479 bool nowaste;// start labeling always at 1
480 QNetworkAccessManager *net;
481 QNetworkReply *reply;
482 V3 urs;
483 QString altText,popel;//popel is original line of old rotation center rotze
484 PSEWidget *psew;
485 QSpinBox *symmIntBx;
486 QSpinBox *symmXBx;
487 QSpinBox *symmYBx;
488 QSpinBox *symmZBx;
489 QSpinBox *symmFrgBx;
490 QLineEdit *prosaSymm;
491 QTimer prosaTimer;
492 QTimer *tim;
493 QTextBrowser *OrtepCodesbrowser;
494 QLabel *shortestDistanceLabel;
495 QPushButton *willpse;
496 QPushButton *beloColorButton;
497
498 bool machPlatz,FehlerTeufel;
499 int hhh;
500 // QSlider *zoomer;
501 // QTimer *sliderTimer;
502 QSignalMapper *dsm;
503 HistoryWidget *hw;
504 double range,weight;
505 int falschAtom;
506 QCompleter *completer;
507 QString labelPSE,labelSuffix,nextLabel,title;
508 int labelIndex;
509 QLabel *nextNameL, *hintL;
510 QCheckBox *rufModeBox,*indexIncr;
511 QSpinBox *resiNrSpin;
512 QSpinBox *indexSpin;
513 QSpinBox *partSpin;
514 QSpinBox *spinSelectPart;
515 QCheckBox *inculdePartNull;
516 QCheckBox *selectPart;
517 QLabel *tieOccL;
518 QComboBox *tieType;
519 QLabel *tieFVNrL;
520 QSpinBox *tieFVNr;
521 QLabel *tieUsedL;
522 QDoubleSpinBox *tieFix;
523 QString FFTErrorString;
524 QComboBox *sufixBox;
525 QLineEdit *resiResiClass;
526 QComboBox *resiResiClassCB;
527 QPeakView *qpv;
528 CEnvironment undoAtom,redoAtom,deletedAtom,restoredAtom;
529 QList<int> undoAtomIndex,redoAtomIndex,gehtMichAn,gehtMichAn2;
530 int altursize;
531 int mode;
532 void getMinMaxSintl(double &smin, double &smax);
533 QMenu *recentFilesMenu,*stereoMenu,*moveMenu,*helpMenu,*sortMenu;
534 QActionGroup *stereoGroup,*tubeGroup,*sortGroup;
535 enum { MaxRecentFiles = 20 };
536 QAction *recentFileActs[MaxRecentFiles];
537 bool otherOpenFiles,doNotAnnoyMe;
538 Molecule mole;
539 QSpinBox *widthBox;
540 QSpinBox *heightBox;
541 QDoubleSpinBox *scalefBox;
542 QDoubleSpinBox *cStepBx;
543 QDialog *scalDlg;
544 QTextBrowser *infoKanal;
545 QRadioButton *pserbt[111];
546 QGroupBox *sfacBox;
547 double scalePic;
548 QString saveName,fvarinfo;
549 QProcess *shelxl,*extraProc;
550 QString shelxlPath, shelxlArgs;
551 bool useMyBArray; //! If set to true, the b-array is not automatically set by ShelXle
552 QStringList extraProgramNames,extraProgramPaths,extraOptions,extraExt2;
553 QList<Qt::CheckState> extraArguments,extraExtensions, extraDetach, extraResIns, extraOpenFileDialogBefore, extraIconOverlay, extraAbsolutePath;
554
555 QLineEdit *extraPath,*extraName,*extraAltExtEdit,*extraArgumentsEdit,*shxPath,*shxOptions;
556 QList<int> extraOverlayPointSize;
557 QSpinBox *iovlPointSize;
558 QComboBox *pgms;
559 QToolButton *extraFakeButton;
560 QString altExtraIconPath;
561 QStringList altExtraIconPaths;
562 QDockWidget *helpDock;
563 // QWebView *hilfe;
564 //QTextBrowser *hilfe;
565 QWidget *shx_group;
566 QMainWindow *shxMW;
567 QVBoxLayout *sss;
568 QVBoxLayout *hwl;
569 QHBoxLayout *nlt;
570 QGroupBox *renameBox ;
571 QVBoxLayout *rnla;
572 QLabel *nliL,*resiResiClassL,*resiNrSpinL,*partSpinL;
573 QHBoxLayout *sfacla;
574 QScrollArea *qsa,*qsa2;
575 //QAction *zm_stereo;
576 QAction *pe_stereo;
577 QAction *xe_stereo;
578 QAction *an_stereo;
579 //QAction *hw_stereo;
580 QAction *no_stereo;
581 QAction *fcvsfoAct, *calcAct, *dsrAct;
582 QAction *soact;
583 QString shredCIFPath;
584 QAction *backColor,*labelColor;
585 QVBoxLayout *lt;
586 QLabel *sLabel, *fvused;
587 QTimer *hidwillpse;
588
589 QLabel *indexL,*sufixL;
590 QLabel *scalwla, *scalhla, *scalsla, *header;
591 QDialogButtonBox *buttonBoxRN;
592 QHBoxLayout *indexla;
593 QStringList alpha;
594 QGridLayout *scalla;
595 //QHBoxLayout *slt2;
596 QVBoxLayout *vlt, *resid_layout;
597 QTextEdit *resid_label; //! display the refinement residuals
598 QTextEdit *restr_table; //! display the bad restraints
599 //RenderPlot *plot;
600 LstData listf_info;
601 QGroupBox *resid_gb;
602 QGroupBox *gp;QHBoxLayout *rhla,*rhla2;
603 QHBoxLayout *buttomLt;
604 QPushButton *showLst;
605 QIcon extraIcon;
606 QCheckBox *useArgument;
607 QCheckBox *omitExtension;
608 QCheckBox *absolutePath;
609 QCheckBox *detach;
610 QCheckBox *copyResIns;
611 QCheckBox *openFileDialogBefore;
612 QCheckBox *iconOverlay;
613 QSize ediSize;
614 QPoint ediPos;
615 QLabel *lineColumn;
616 QGroupBox *navibox,*refineButtonBox,*refineButtonBox2;
617 QPushButton *stoppRefinement,*finishRefinement;
618 QPushButton *loadRes;
619 QPushButton *withdraw;
620 QPushButton *pro7;
621 QPushButton *stoppRefinement2,*finishRefinement2;// this is for infotainment dock
622 QPushButton *loadRes2;
623 QPushButton *withdraw2;
624 QToolButton *spellCheckact,*spellCheckact2;
625 QSettings *vis_settings;
626 void shx_editor(QString filename);//16.10.2019: title is class glabal variable. no need to give it as parameter her
627 double getNumber(double v,const QList<double> fv,double uiso);//to be changed!
628 double getNumber(double v,const QList<double> fv,int idx,int &fixFlag);//to be changed!
629 MyAtom findOH(V3 donor, V3 acceptor,int dindex,QStringList alab);
630 bool maybeSave();
631 bool maybeSave2();
632 bool doWeHaveHKLF5here(QStringList &hk5s);
633 bool startFused;
634 QStringList hklf5files;
635 Calculator *calcmenu;
636 DSRGui *dsr;
637 QString pngName;//output file of povray export
638 QScrollArea *qsaPNG ;
639
640 QList<bool> twinRedundant;
641 QList<bool> twinDone;
642 QDialog *twinDlg;
643 double rvalue2beat, wr2value2beat;
644 QVBoxLayout *twinvbl;
645 QGroupBox *twingpx;
646 QLabel *twinpatlab;
647 //QGroupBox *gpx =new QGroupBox("Posible twin laws for this structure:",twinDlg);
648 //QVBoxLayout *vbl = new QVBoxLayout();
649 //QString selectedRestraintsAtoms(QString buffer, QList<MyAtom> selected, QString resiSpec, bool exclude_H=false);
650
651 };
652 class AulaWorker : public QThread {
653 Q_OBJECT
654 public:
655 AulaWorker(Window *parent, bool ur){
656 _w = parent;
657 useResis = ur;
658 rzeit.start();
659 }
660 void run() override {
661 /* expensive or blocking operation */
662 aula();
663 }
664 Window *_w;
665 bool saveruf;
666 int possible;
667 QList<int> chain;
668 void aula();
669 bool useResis;
670 public slots:
671 void finalize();
672 signals:
673 void message(const QString &);//!< small text messages to the status bar.
674 void rename(int);
675 private:
676 QElapsedTimer rzeit;
677 QString all;
678 void extendChain(QList<Ring > &rings, QList<int> &currentChain, QList<QList<int> > &neighbors,QSet<int> &nogo);
679 void inventNewLabels(QList<int> &result);
680 };
681 #endif
682