-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathYSDrawableObject.h
56 lines (44 loc) · 1.96 KB
/
YSDrawableObject.h
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//
// YSDrawableObject.cpp
// A basic 1D function
//
// Created by Yves Schutz on 10/05/14.
// Copyright (c) 2014 Yves Schutz. All rights reserved.
#ifndef YSDRAWABLEOBJECT_H
#define YSDRAWABLEOBJECT_H
#include <QObject>
#include "qcustomplot.h"
class YSDrawableObject : public QObject
{
Q_OBJECT
public:
YSDrawableObject();
void FillXValues();
QString GetAxisLabel(QString xOrY) const
{ if ( xOrY == "X" ) return mXLabel;
else if (xOrY == "Y") return mYLabel;
else return 0;}
qreal GetDx() const { return mDx; }
QString GetName() const { return mName; }
int GetNumberOfBins() const { return mNumberOfBins; }
qreal GetXMin() const { return mXMin; }
qreal GetXMax() const { return mXMax; }
virtual qreal GetYMax() = 0;
QVector<double> GetXValues() const { return mXValues; }
QVector<double> GetYValues() const { return mYValues; }
virtual bool IsF1() { return false; }
virtual bool IsH1() { return false; }
void SetAxisLabel(QString xLabel, QString yLabel) { mXLabel = xLabel; mYLabel = yLabel; }
protected:
qreal mDx; // x step
QString mName; // name of the function
int mNumberOfBins; // number of bins
qreal mXMax; // maximum x value
qreal mXMin; // minimum x value
QString mXLabel, mYLabel; // labels on x and y axis
QVector<double> mXValues; // calculated x values
qreal mYMax; // calculated max y value
qreal mYMin; // min y value
QVector<double> mYValues; // calculated y values
};
#endif // YSDRAWABLEOBJECT_H