pulsescopewidget.h 2.17 KB
Newer Older
Oliver Bock's avatar
Oliver Bock committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
/******************************************************************************
 *   Copyright (C) 2009 by Oliver Bock                                        *
 *   oliver.bock[AT]aei.mpg.de                                                *
 *                                                                            *
 *   This file is part of PulsatingScience.                                   *
 *                                                                            *
 *   PulsatingScience is free software: you can redistribute it and/or modify *
 *   it under the terms of the GNU General Public License as published        *
 *   by the Free Software Foundation, version 3 of the License.               *
 *                                                                            *
 *   PulsatingScience is distributed in the hope that it will be useful,      *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of           *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
 *   GNU General Public License for more details.                             *
 *                                                                            *
 *   You should have received a copy of the GNU General Public License        *
 *   along with PulsatingScience. If not, see <http://www.gnu.org/licenses/>. *
 *                                                                            *
 ******************************************************************************/

#ifndef PULSESCOPEWIDGET_H_
#define PULSESCOPEWIDGET_H_

#include <cmath>

#include <QGraphicsView>
#include <QGraphicsScene>
#include <QGLContext>
29
#include <QGraphicsPathItem>
Oliver Bock's avatar
Oliver Bock committed
30
#include <QGraphicsLineItem>
Oliver Bock's avatar
Oliver Bock committed
31
#include <QDebug>
Oliver Bock's avatar
Oliver Bock committed
32 33 34 35 36 37 38 39 40 41 42 43 44


class PulseScopeWidget : public QGraphicsView
{
	Q_OBJECT

public:
	PulseScopeWidget(QWidget *parent = 0);
	virtual ~PulseScopeWidget();

	void resizeEvent(QResizeEvent *event);

public slots:
Oliver Bock's avatar
Oliver Bock committed
45
	void drawCurve(const QVector<double>& vector);
46
	void setMarker(double position);
Oliver Bock's avatar
Oliver Bock committed
47 48 49

private:
	QGraphicsScene m_scene;
Oliver Bock's avatar
Oliver Bock committed
50
	QVector<double> m_data;
51 52 53
	QGraphicsPathItem *m_path;
	QGraphicsLineItem *m_marker;

Oliver Bock's avatar
Oliver Bock committed
54 55
	double m_scopeSizeH;
	double m_scopeSizeV;
Oliver Bock's avatar
Oliver Bock committed
56 57 58
};

#endif /* PULSESCOPEWIDGET_H_ */