-
Notifications
You must be signed in to change notification settings - Fork 0
/
CLineData.cpp
47 lines (43 loc) · 892 Bytes
/
CLineData.cpp
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
#include "CLineData.h"
#include <string.h>
LineData::LineData()
{
id = -1;
y_max = 0;
y_min = 0;
x_max = 0;
x_min = 0;
color = CRGB(128, 128, 128);
dataCount = 0;
ydata = NULL;
xdata = NULL;
dataPointMarker = DPM_NONE;
}
LineData &LineData::operator=(const LineData &rhs)
{
return *this;
}
LineData::LineData(const LineData &rhs)
{
id = rhs.id;
y_max = rhs.y_max;
y_min = rhs.y_min;
x_max = rhs.x_max;
x_min = rhs.x_min;
color = rhs.color;
dataCount = rhs.dataCount;
dataPointMarker = rhs.dataPointMarker;
xdata = new float[dataCount];
ydata = new float[dataCount];
for (int i = 0; i < dataCount; ++i)
{
xdata[i] = rhs.xdata[i];
ydata[i] = rhs.ydata[i];
}
}
LineData::~LineData(){
if (xdata != NULL)
delete[] xdata;
if (ydata != NULL)
delete[] ydata;
}