Update to match the data definitions.
parent
1b419313f4
commit
2449b80010
@ -0,0 +1,20 @@
|
|||||||
|
unsigned size() const { return x.size(); }
|
||||||
|
|
||||||
|
coord2d operator[] (unsigned idx) const {
|
||||||
|
if (idx >= x.size())
|
||||||
|
return coord2d();
|
||||||
|
else
|
||||||
|
return coord2d(x[idx], y[idx]);
|
||||||
|
}
|
||||||
|
|
||||||
|
void erase(unsigned idx) {
|
||||||
|
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);
|
||||||
|
}
|
@ -1,8 +1,22 @@
|
|||||||
unsigned size() const { return x.size(); }
|
unsigned size() const { return x.size(); }
|
||||||
|
|
||||||
coord operator[] (unsigned idx) const {
|
coord operator[] (unsigned idx) const {
|
||||||
if (idx >= x.size() || idx >= y.size() || idx >= z.size())
|
if (idx >= x.size())
|
||||||
return coord();
|
return coord();
|
||||||
else
|
else
|
||||||
return coord(x[idx], y[idx], z[idx]);
|
return coord(x[idx], y[idx], z[idx]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void erase(unsigned idx) {
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 8f9f7cf3bc4cff3dc721dc9e0ba51bc54b069587
|
Subproject commit f6d09c95153150d7d1f00592336012af5e6e02ad
|
Loading…
Reference in New Issue