| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
#ifndef DSRGUI_H |
| 12 |
#define DSRGUI_H |
| 13 |
|
| 14 |
#include <QtGui> |
| 15 |
#if (QT_VERSION >= 0x050000) |
| 16 |
#include <QtWidgets> |
| 17 |
#endif |
| 18 |
#include <QDialog> |
| 19 |
#include <QModelIndex> |
| 20 |
#include <QNetworkAccessManager> |
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
class Window; |
| 27 |
class Molecule; |
| 28 |
class DSRGlWindow; |
| 29 |
class DSREditWindow; |
| 30 |
|
| 31 |
typedef struct DSRMol { |
| 32 |
|
| 33 |
QString tag; |
| 34 |
QString comment; |
| 35 |
QString source; |
| 36 |
QList<double> cell; |
| 37 |
QString residue; |
| 38 |
QString dbtype; |
| 39 |
QStringList restr; |
| 40 |
QVector<QStringList> atoms; |
| 41 |
} DSRMol; |
| 42 |
|
| 43 |
class DSRGui : public QWidget |
| 44 |
{ |
| 45 |
Q_OBJECT |
| 46 |
|
| 47 |
public: |
| 48 |
explicit DSRGui(Molecule *mole, QString shelxlPath, Window *parent = 0); |
| 49 |
DSREditWindow *editwindow; |
| 50 |
DSRMol *header; |
| 51 |
QStringList SHXkeywords; |
| 52 |
virtual ~DSRGui(); |
| 53 |
DSRGlWindow *mygl; |
| 54 |
void checkForDSRexecutable(QSplashScreen *splash); |
| 55 |
QSize minimumSizeHint() const; |
| 56 |
QSize sizeHint() const; |
| 57 |
static QString textWrap(QString inText, QString indent = QString("=\n ")); |
| 58 |
private: |
| 59 |
QString getSelectedAtomsList(); |
| 60 |
QString getSelectedAtomsCoords(); |
| 61 |
Molecule *m_molecule; |
| 62 |
Window *m_shelxle; |
| 63 |
QVector<QStringList> *fragmentsList; |
| 64 |
QTextBrowser *outtext; |
| 65 |
QTextBrowser *info; |
| 66 |
QLineEdit *SearchInp; |
| 67 |
QLineEdit *occEdit; |
| 68 |
|
| 69 |
QLineEdit *resiclassEdit; |
| 70 |
QGridLayout *mainLayout; |
| 71 |
QHBoxLayout *editLayout; |
| 72 |
QGridLayout *optionsLayout1; |
| 73 |
QVBoxLayout *optionsLayout2; |
| 74 |
QVBoxLayout *optionsLayout3; |
| 75 |
QVBoxLayout *buttonLayout; |
| 76 |
QHBoxLayout *searchLayout; |
| 77 |
QHBoxLayout *resclassLayout; |
| 78 |
QHBoxLayout *optionboxes; |
| 79 |
QGridLayout *glo; |
| 80 |
QGridLayout *flo; |
| 81 |
QSpinBox *partspinner; |
| 82 |
QSpinBox *fvarspinner; |
| 83 |
QPushButton *editButton; |
| 84 |
QPushButton *openLastButton; |
| 85 |
QPushButton *fitDSRButton; |
| 86 |
QPushButton *exportFragButton; |
| 87 |
QPushButton *splitButton; |
| 88 |
QGroupBox *groupBox1; |
| 89 |
QGroupBox *groupBox2; |
| 90 |
QGroupBox *residueOptionsBox; |
| 91 |
QLabel *searchLabel, |
| 92 |
*partLabel, |
| 93 |
*occLabel, |
| 94 |
*resiLabel, |
| 95 |
*classLabel, |
| 96 |
*resiTextLabel, |
| 97 |
*usermanualLabel; |
| 98 |
QPushButton *fvarLabel; |
| 99 |
QTableView *fragmentTableView; |
| 100 |
QString dsrResulttext; |
| 101 |
QString *resnumbertext; |
| 102 |
QCheckBox *runExtBox, |
| 103 |
*invertFragBox, |
| 104 |
*dfixBox, |
| 105 |
*replaceModeBox, |
| 106 |
*rigidBox, |
| 107 |
*splitModeBox; |
| 108 |
bool runext; |
| 109 |
bool invert; |
| 110 |
bool norefine; |
| 111 |
bool replace; |
| 112 |
bool rigid; |
| 113 |
bool resiIsEnabled; |
| 114 |
bool cf3; |
| 115 |
bool splitmode; |
| 116 |
QString export_dir; |
| 117 |
QString target_atoms; |
| 118 |
QString dfix; |
| 119 |
QString part; |
| 120 |
QString fvarocc; |
| 121 |
QString resistr; |
| 122 |
QString resinum; |
| 123 |
QString resiclass; |
| 124 |
QString fragmentNameTag; |
| 125 |
QString dsrpath, dsr_db_path; |
| 126 |
QString combiDSRline; |
| 127 |
void displayFragmentsList(QVector<QStringList>, QString); |
| 128 |
QString getDSRDir(); |
| 129 |
QString getDSRdbDir(); |
| 130 |
void connect_signals_and_slots(); |
| 131 |
void setToolTips(); |
| 132 |
QString m_shelxlPath; |
| 133 |
QString dsrVersion; |
| 134 |
QNetworkAccessManager *net_manager; |
| 135 |
QNetworkReply *reply; |
| 136 |
void getVersionFromServer(); |
| 137 |
bool runTCPServer(); |
| 138 |
QLabel *statusLabel; |
| 139 |
|
| 140 |
signals: |
| 141 |
void optionTextChanged(void); |
| 142 |
void fragmentSelected(void); |
| 143 |
void exportDirChanged(QString export_dir); |
| 144 |
void currentFragmentChanged(DSRMol header); |
| 145 |
void closed(); |
| 146 |
|
| 147 |
public slots: |
| 148 |
void aboutDSR(); |
| 149 |
bool listDSRdbFragments(QString fav); |
| 150 |
void runEditWindow(); |
| 151 |
void setInfo(QString); |
| 152 |
bool getFragmentHeader(QString frag); |
| 153 |
int getCharWidth(int numchars); |
| 154 |
void activateFitButton(void); |
| 155 |
bool fitDSR(void); |
| 156 |
void fitDSRExtern(bool checked); |
| 157 |
void invertFrag(bool checked); |
| 158 |
void rigid_group(bool checked); |
| 159 |
void refineOrNot(bool checked); |
| 160 |
void replaceOrNot(bool checked); |
| 161 |
void setFragName(QModelIndex name); |
| 162 |
void searchFragment(QString searchName); |
| 163 |
bool exportFrag(QString dirname); |
| 164 |
void DFIX(bool checked); |
| 165 |
void setPART(int part); |
| 166 |
void setFvarOcc(void); |
| 167 |
void setResiClass(QString rclass); |
| 168 |
void combineOptionstext(void); |
| 169 |
void setExportDirDialog(void); |
| 170 |
bool isDSRVersionCorrect(QString version); |
| 171 |
QStringList readResfile(); |
| 172 |
void resetSelection(); |
| 173 |
int findFVARlines(QStringList *reslist); |
| 174 |
QVector<int> findDSRLines(QStringList *reslist); |
| 175 |
int decideDSRInsertLine(QStringList *reslist); |
| 176 |
QString findFreeResiNumber(); |
| 177 |
QStringList which(QString programName = "dsr"); |
| 178 |
QString loadFavoriteFragment(); |
| 179 |
void writeFavorites(QString name); |
| 180 |
void updateTarget(); |
| 181 |
void isDSRUpToDate(QNetworkReply* reply); |
| 182 |
void updateDSR(void); |
| 183 |
void invertFvar(); |
| 184 |
void splitDecide(); |
| 185 |
void splitSelectedAtoms(); |
| 186 |
bool runDSR(QString option, bool showresults=true, QString workdir=""); |
| 187 |
bool open_last_fileversion(); |
| 188 |
|
| 189 |
protected: |
| 190 |
virtual void closeEvent(QCloseEvent * event); |
| 191 |
|
| 192 |
protected slots: |
| 193 |
|
| 194 |
private slots: |
| 195 |
|
| 196 |
|
| 197 |
|
| 198 |
}; |
| 199 |
|
| 200 |
|
| 201 |
|
| 202 |
|
| 203 |
#endif |
| 204 |
|