| 1 |
#ifndef MAINWINDOW_H |
| 2 |
#define MAINWINDOW_H |
| 3 |
|
| 4 |
#include <QMainWindow> |
| 5 |
#include <QItemSelection> |
| 6 |
#include "root.h" |
| 7 |
#include "polynomialsolver.h" |
| 8 |
#include "polfileeditorwindow.h" |
| 9 |
#include <mps/mps.h> |
| 10 |
|
| 11 |
namespace Ui { |
| 12 |
class MainWindow; |
| 13 |
} |
| 14 |
|
| 15 |
namespace xmpsolve { |
| 16 |
|
| 17 |
class MainWindow : public QMainWindow |
| 18 |
{ |
| 19 |
Q_OBJECT |
| 20 |
|
| 21 |
public: |
| 22 |
explicit MainWindow(QWidget *parent = 0); |
| 23 |
~MainWindow(); |
| 24 |
|
| 25 |
/** |
| 26 |
* @brief selectedAlgorithm return the algorithm currently selected by the user. |
| 27 |
* @return An mps_algorithm with the value selected by the user. |
| 28 |
*/ |
| 29 |
mps_algorithm selectedAlgorithm(); |
| 30 |
|
| 31 |
/** |
| 32 |
* @brief requiredDigits returns the number of accuracy digits required by the user |
| 33 |
* @return A positive integer |
| 34 |
*/ |
| 35 |
int requiredDigits(); |
| 36 |
|
| 37 |
/** |
| 38 |
* @brief selectedGoal returns the goal for the computation. Can be either set to |
| 39 |
* MPS_OUTPUT_GOAL_ISOLATE or to MPS_OUTPUT_GOAL_APPROXIMATE. |
| 40 |
* |
| 41 |
* @return The goal for the computation selected by the user. |
| 42 |
*/ |
| 43 |
mps_output_goal selectedGoal(); |
| 44 |
|
| 45 |
/** |
| 46 |
* @brief polynomialBasis returns the polynomial basis selected by the user. |
| 47 |
* @return A PolynomialBasis value. |
| 48 |
*/ |
| 49 |
PolynomialBasis polynomialBasis(); |
| 50 |
|
| 51 |
/** |
| 52 |
* @brief openEditor performs the necessary steps to set up the PolFileEditorWindow |
| 53 |
* and activate it. |
| 54 |
* |
| 55 |
* @param polFile If a non empty string is passed as argument, the file is opened |
| 56 |
* in the Editor. |
| 57 |
* |
| 58 |
* In the case the window is already available, it just focuses it. |
| 59 |
*/ |
| 60 |
void openEditor(QString polFile = ""); |
| 61 |
|
| 62 |
public slots: |
| 63 |
void polynomial_solved(); |
| 64 |
|
| 65 |
/** |
| 66 |
* @brief openPolFile loads a .pol file given its path |
| 67 |
* @param path The path to the .pol file |
| 68 |
*/ |
| 69 |
void openPolFile(QString path); |
| 70 |
|
| 71 |
void onlistRootsView_selectionChanged(QItemSelection, QItemSelection); |
| 72 |
void onSolvePolFileRequested(QString path); |
| 73 |
|
| 74 |
private slots: |
| 75 |
void on_solveButton_clicked(); |
| 76 |
void lockInterface(); |
| 77 |
void unlockInterface(); |
| 78 |
|
| 79 |
void on_listRootsView_clicked(const QModelIndex &index); |
| 80 |
|
| 81 |
void on_actionOpen_pol_file_triggered(); |
| 82 |
|
| 83 |
void on_actionQuit_triggered(); |
| 84 |
|
| 85 |
void on_actionAbout_MPSolve_triggered(); |
| 86 |
|
| 87 |
void on_actionOpen_editor_triggered(); |
| 88 |
|
| 89 |
void on_actionAbort_computations_triggered(); |
| 90 |
|
| 91 |
void closeEvent(QCloseEvent *); |
| 92 |
|
| 93 |
void onPolFileEditorWindowDestroyed(); |
| 94 |
|
| 95 |
void on_openPolFileButton_clicked(); |
| 96 |
|
| 97 |
void on_zoomInButton_clicked(); |
| 98 |
|
| 99 |
void on_zoomOutButton_clicked(); |
| 100 |
|
| 101 |
private: |
| 102 |
Ui::MainWindow *ui; |
| 103 |
PolynomialSolver m_solver; |
| 104 |
QString m_selectedPolFile; |
| 105 |
PolFileEditorWindow *m_polFileEditorWindow; |
| 106 |
}; |
| 107 |
|
| 108 |
} // Namespace xmpsolve |
| 109 |
|
| 110 |
#endif // MAINWINDOW_H |