2012-10-06 02:40:46 -06:00
|
|
|
bool empty() const { return x.empty(); }
|
2016-10-14 22:47:38 -06:00
|
|
|
size_t size() const { return x.size(); }
|
2012-01-19 03:30:22 -07:00
|
|
|
|
2012-10-06 02:40:46 -06:00
|
|
|
void clear() {
|
|
|
|
x.clear();
|
|
|
|
y.clear();
|
|
|
|
z.clear();
|
|
|
|
}
|
|
|
|
|
2016-10-14 22:47:38 -06:00
|
|
|
coord operator[] (size_t idx) const {
|
2012-01-21 06:18:53 -07:00
|
|
|
if (idx >= x.size())
|
2012-01-19 03:30:22 -07:00
|
|
|
return coord();
|
|
|
|
else
|
|
|
|
return coord(x[idx], y[idx], z[idx]);
|
|
|
|
}
|
2012-01-21 06:18:53 -07:00
|
|
|
|
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);
|
|
|
|
z.erase(z.begin()+idx);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void push_back(const coord &crd) {
|
|
|
|
x.push_back(crd.x);
|
|
|
|
y.push_back(crd.y);
|
|
|
|
z.push_back(crd.z);
|
|
|
|
}
|