diff options
author | bubnikv <bubnikv@gmail.com> | 2017-05-31 13:55:59 +0300 |
---|---|---|
committer | bubnikv <bubnikv@gmail.com> | 2017-05-31 13:55:59 +0300 |
commit | c8b934f8d33bcd2985af24f586e23dc5a74008f6 (patch) | |
tree | b592dc41d8c15bf04bd63c7fe48f914df7ff3d76 /xs/src/libslic3r/Print.hpp | |
parent | 0a692cc4971906979c82180f7b4da20cc69eef2d (diff) |
Yet more refactoring of Print / PrintObject in regard to
C++11 loops, configuration and step invalidation.
Diffstat (limited to 'xs/src/libslic3r/Print.hpp')
-rw-r--r-- | xs/src/libslic3r/Print.hpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/xs/src/libslic3r/Print.hpp b/xs/src/libslic3r/Print.hpp index 348da28a4..c54ff847f 100644 --- a/xs/src/libslic3r/Print.hpp +++ b/xs/src/libslic3r/Print.hpp @@ -96,10 +96,8 @@ class PrintObject friend class Print; public: - // map of (vectors of volume ids), indexed by region_id - /* (we use map instead of vector so that we don't have to worry about - resizing it and the [] operator adds new items automagically) */ - std::map< size_t,std::vector<int> > region_volumes; + // vector of (vectors of volume ids), indexed by region_id + std::vector<std::vector<int>> region_volumes; PrintObjectConfig config; t_layer_height_ranges layer_height_ranges; @@ -146,7 +144,11 @@ public: BoundingBox bounding_box() const { return BoundingBox(Point(0,0), this->size); } // adds region_id, too, if necessary - void add_region_volume(int region_id, int volume_id) { region_volumes[region_id].push_back(volume_id); } + void add_region_volume(int region_id, int volume_id) { + if (region_id >= region_volumes.size()) + region_volumes.resize(region_id + 1); + region_volumes[region_id].push_back(volume_id); + } // This is the *total* layer count (including support layers) // this value is not supposed to be compared with Layer::id // since they have different semantics. |