2012-03-08 15:10:25 +00:00
|
|
|
#ifndef _PAYSAGES_QT_WIDGETCURVEEDITOR_H_
|
|
|
|
#define _PAYSAGES_QT_WIDGETCURVEEDITOR_H_
|
|
|
|
|
|
|
|
#include <QWidget>
|
2012-03-31 11:32:03 +00:00
|
|
|
#include <QColor>
|
2012-03-08 15:10:25 +00:00
|
|
|
#include "../lib_paysages/curve.h"
|
|
|
|
|
|
|
|
class WidgetCurveEditor : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
WidgetCurveEditor(QWidget* parent);
|
|
|
|
~WidgetCurveEditor();
|
|
|
|
|
2012-03-08 15:56:44 +00:00
|
|
|
void setCurve(Curve* curve);
|
|
|
|
void getCurve(Curve* curve);
|
|
|
|
|
2012-03-31 11:32:03 +00:00
|
|
|
void setPenColor(QColor color);
|
|
|
|
|
2012-03-29 20:19:50 +00:00
|
|
|
signals:
|
|
|
|
void liveChanged();
|
|
|
|
|
2012-03-08 15:10:25 +00:00
|
|
|
protected:
|
|
|
|
void paintEvent(QPaintEvent* event);
|
2012-03-29 20:19:50 +00:00
|
|
|
void mousePressEvent(QMouseEvent* event);
|
|
|
|
void mouseMoveEvent(QMouseEvent* event);
|
|
|
|
void mouseReleaseEvent(QMouseEvent* event);
|
2012-03-31 11:32:03 +00:00
|
|
|
void mouseDoubleClickEvent(QMouseEvent* event);
|
2012-03-08 15:10:25 +00:00
|
|
|
|
|
|
|
private:
|
2012-03-31 11:32:03 +00:00
|
|
|
int getPointAt(int x, int y);
|
|
|
|
|
2012-03-08 15:10:25 +00:00
|
|
|
Curve* _curve;
|
2012-03-29 20:19:50 +00:00
|
|
|
int _dragged;
|
2012-03-31 11:32:03 +00:00
|
|
|
QColor _pen;
|
2012-03-08 15:10:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|