| 1 |
#ifndef XMPSOLVE_QROOTSRENDERER_H |
| 2 |
#define XMPSOLVE_QROOTSRENDERER_H |
| 3 |
|
| 4 |
#include <QWidget> |
| 5 |
#include "rootsrenderer.h" |
| 6 |
|
| 7 |
namespace xmpsolve { |
| 8 |
|
| 9 |
class QRootsRenderer : public QWidget, public RootsRenderer |
| 10 |
{ |
| 11 |
Q_OBJECT |
| 12 |
public: |
| 13 |
explicit QRootsRenderer(QWidget *parent = 0); |
| 14 |
|
| 15 |
/** |
| 16 |
* @brief setRoots can be used to set the roots that the RootsRenderer |
| 17 |
* shall renderer. |
| 18 |
* @param model The roots model that should be displayed. |
| 19 |
*/ |
| 20 |
void setModel(RootsModel* model); |
| 21 |
|
| 22 |
void paintEvent(QPaintEvent* event); |
| 23 |
|
| 24 |
/** |
| 25 |
* @brief zoomIn handles the zooming operations triggering update(). |
| 26 |
*/ |
| 27 |
void zoomIn(); |
| 28 |
|
| 29 |
/** |
| 30 |
* @brief zoomOut handles the zoomin triggering update(). |
| 31 |
*/ |
| 32 |
void zoomOut(); |
| 33 |
|
| 34 |
/** |
| 35 |
* @brief setCenter handled the recentering calling update() |
| 36 |
* @param x The x coordinate of the new center point. |
| 37 |
* @param y The y coordinate of the new center point. |
| 38 |
*/ |
| 39 |
void setCenter(double x, double y); |
| 40 |
|
| 41 |
void mousePressEvent(QMouseEvent * event); |
| 42 |
void mouseReleaseEvent(QMouseEvent * event); |
| 43 |
void mouseMoveEvent(QMouseEvent * event); |
| 44 |
|
| 45 |
private slots: |
| 46 |
void reloadRootsWrapper(); |
| 47 |
|
| 48 |
private: |
| 49 |
bool mDragging; |
| 50 |
QPointF mPreviousPosition; |
| 51 |
|
| 52 |
signals: |
| 53 |
|
| 54 |
public slots: |
| 55 |
|
| 56 |
}; |
| 57 |
|
| 58 |
} // namespace xmpsolve |
| 59 |
|
| 60 |
#endif // XMPSOLVE_QROOTSRENDERER_H |