Push up the native iterators from Surfaces:: to SurfaceCollection, as it's just a souped-up Surface vector.

Enables things like
for (auto x : collection) { }
instead of
for (auto x : collection.surfaces) { }
and enables information hiding later.
This commit is contained in:
Joseph Lenox 2021-03-19 20:41:27 -05:00
parent 2d06cad830
commit 6f84732a70

View File

@ -70,6 +70,13 @@ public:
void append(ExPolygons &&src, const Surface &surfaceTempl) { surfaces_append(this->surfaces, std::move(src), surfaceTempl); }
void append(Surfaces &&src) { surfaces_append(this->surfaces, std::move(src)); }
Surfaces::iterator begin() { return this->surfaces.begin();}
Surfaces::iterator end() { return this->surfaces.end();}
Surfaces::const_iterator cbegin() const { return this->surfaces.cbegin();}
Surfaces::const_iterator cend() const { return this->surfaces.cend();}
Surfaces::const_iterator begin() const { return this->surfaces.cbegin();}
Surfaces::const_iterator end() const { return this->surfaces.cend();}
// For debugging purposes:
void export_to_svg(const char *path, bool show_labels);
};