2016-10-14 22:47:38 -06:00
|
|
|
size_t size() const { return x.size(); }
|
2012-01-21 06:18:53 -07:00
|
|
|
|
2016-10-14 22:47:38 -06:00
|
|
|
coord2d operator[] (size_t idx) const {
|
2012-01-21 06:18:53 -07:00
|
|
|
if (idx >= x.size())
|
|
|
|
return coord2d();
|
|
|
|
else
|
|
|
|
return coord2d(x[idx], y[idx]);
|
|
|
|
}
|
|
|
|
|
2016-10-14 22:47:38 -06:00
|
|
|
void erase(size_t idx) {
|
2012-01-21 06:18:53 -07:00
|
|
|
if (idx < x.size()) {
|
|
|
|
x.erase(x.begin()+idx);
|
|
|
|
y.erase(y.begin()+idx);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void push_back(const coord2d &crd) {
|
|
|
|
x.push_back(crd.x);
|
|
|
|
y.push_back(crd.y);
|
|
|
|
}
|