view gui/src/Plot2dWidget.h @ 13476:bf51c1bb7033

Changing background color is possible now.
author Jacob Dawid <jacob.dawid@googlemail.com>
date Wed, 20 Apr 2011 12:35:21 +0200
parents 3b7573c783cc
children
line wrap: on
line source

#ifndef PLOT2DWIDGET_H
#define PLOT2DWIDGET_H

#include <QWidget>
#include <QGLWidget>
#include <QTabWidget>
#include <QStackedWidget>
#include <QComboBox>
#include <QWheelEvent>
#include <QMouseEvent>
#include <QLineEdit>
#include <QPushButton>
#include <QColor>

class Plot2dView : public QGLWidget {
    Q_OBJECT
public:
    explicit Plot2dView(QWidget *parent = 0);
    QColor backgroundColor();

public slots:
    void setBackgroundColor(QColor color);

protected:
    void initializeGL();
    void paintGL();
    void resizeGL(int w, int h);
    void wheelEvent(QWheelEvent *wheelEvent);
    void mousePressEvent(QMouseEvent *mouseEvent);
    void mouseReleaseEvent(QMouseEvent *mouseEvent);
    void mouseMoveEvent(QMouseEvent *mouseEvent);

private slots:
    void animate();

private:
    void construct();
    bool m_leftMouseButtonDown;
    double m_lastMouseButtonDownX;
    double m_lastMouseButtonDownY;
    double m_scrollX;
    double m_scrollY;
    double m_zoom;
    double m_zoomAcceleration;
    QColor m_backgroundColor;
};

class Plot2dWidget : public QWidget
{
    Q_OBJECT
public:
    explicit Plot2dWidget(QWidget *parent = 0);

signals:

public slots:
    void dataSourceTypeChanged(QString type);
    void selectBackgroundColor();

private:
    void construct();

    Plot2dView *m_plot2dView;
    QTabWidget *m_tabWidget;
    QWidget *m_generalTab;
    QWidget *m_dataSourceTab;
    QWidget *m_seriesTab;
    QPushButton *m_backgroundColorSelectionButton;
    QComboBox *m_dataSourceTypeComboBox;
    QStackedWidget *m_dataSourceStackedWidget;
    QLineEdit *m_sampledFromLineEdit;
    QLineEdit *m_sampledToLineEdit;
    QLineEdit *m_parameterizedFromLineEdit;
    QLineEdit *m_parameterizedToLineEdit;
    QPushButton *m_refreshDataRangeButton;
};

#endif // PLOT2DWIDGET_H