-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPoints.cpp
More file actions
45 lines (38 loc) · 921 Bytes
/
Points.cpp
File metadata and controls
45 lines (38 loc) · 921 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
39
40
41
42
43
44
45
#include "Points.h"
#include "ListArrayIterator.h"
using CSC2110::ListArrayIterator;
Points::Points(Color* c, int r, double x_m, double y_m)
{
color = c;
radius = r;
x_max_data = x_m;
y_max_data = y_m;
points = new ListArray<Point>();
}
Points::~Points()
{
delete color;
//this class will adopt and delete the individual points
ListArrayIterator<Point>* iter = points->iterator();
while(iter->hasNext())
{
Point* p = iter->next();
delete p;
}
delete iter;
delete points;
}
void Points::addPoint(Point* p)
{
points->add(p);
}
void Points::draw(wxDC& dc, int width, int height)
{
ListArrayIterator<Point>* iter = points->iterator();
while(iter->hasNext())
{
Point* p = iter->next();
p->draw(dc, color, radius, width, height, x_max_data, y_max_data); //needs the info for the transformation
}
}
void Points::mouseClicked(int x, int y) {}