-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPointsTable.h
More file actions
64 lines (38 loc) · 1.27 KB
/
PointsTable.h
File metadata and controls
64 lines (38 loc) · 1.27 KB
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
57
58
59
60
61
62
63
64
//
// Created by alex on 16.10.17.
//
#ifndef DYNAMIC_SYSTEMS_DSL_POINTSTABLE_H
#define DYNAMIC_SYSTEMS_DSL_POINTSTABLE_H
#include <map>
#include "ChartPoints.h"
using namespace std;
class PointsTable : public ChartPoints {
private:
string abscissa = string("t");
string ordinate = string("x");
map<double, double> *points;
string stringifyPoint(pair<double, double> point);
string pointToJson(pair<double, double> point);
public:
PointsTable();
PointsTable(map<double, double> *points);
explicit PointsTable(const string &ordinate);
PointsTable(const string &abscissa, const string &ordinate);
PointsTable(const string &ordinate, map<double, double> *points);
virtual ~PointsTable();
void clear();
void addPoint(double x, double y);
void removePoint(double x);
double getY(double x);
double getX(double y);
void replacePoint(double x, double y);
const string &getAbscissa() const;
void setAbscissa(const string &abscissa);
const string &getOrdinate() const;
void setOrdinate(const string &ordinate);
map<double, double> *getPoints() const;
void setPoints(map<double, double> *points);
string toString();
string toJson() override;
};
#endif //DYNAMIC_SYSTEMS_DSL_POINTSTABLE_H