-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlot.cpp
More file actions
38 lines (33 loc) · 668 Bytes
/
Plot.cpp
File metadata and controls
38 lines (33 loc) · 668 Bytes
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
#include "Plot.h"
#include "ListArrayIterator.h"
using CSC2110::ListArrayIterator;
Plot::Plot()
{
data = new ListArray<Points>();
}
Plot::~Plot()
{
ListArrayIterator<Points>* iter = data->iterator();
while(iter->hasNext())
{
Points* pts = iter->next();
delete pts;
}
delete iter;
delete data;
}
void Plot::addPoints(Points* points)
{
data->add(points);
}
void Plot::draw(wxDC& dc, int width, int height)
{
ListArrayIterator<Points>* iter = data->iterator();
while(iter->hasNext())
{
Points* pts = iter->next();
pts->draw(dc, width, height);
}
delete iter;
}
void Plot::mouseClicked(int x, int y) {}