diff options
author | bubnikv <bubnikv@gmail.com> | 2018-09-14 11:25:20 +0300 |
---|---|---|
committer | bubnikv <bubnikv@gmail.com> | 2018-09-14 11:25:20 +0300 |
commit | 36faa090fcf57bdb7aceddfaa7148141165cb073 (patch) | |
tree | 7d06583b256d9003ab6c703acbf0b7a0d7fe2c6c /xs/src/libslic3r | |
parent | 9d9e4a0f7b2d9d3440c2a05bc65b2cab707d148a (diff) |
Removed the Controller, Layer View, System Info, ObjectCutDialog,
removed unused Perl modules.
Diffstat (limited to 'xs/src/libslic3r')
-rw-r--r-- | xs/src/libslic3r/Print.cpp | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/xs/src/libslic3r/Print.cpp b/xs/src/libslic3r/Print.cpp index a677d9e5a..651513c62 100644 --- a/xs/src/libslic3r/Print.cpp +++ b/xs/src/libslic3r/Print.cpp @@ -28,11 +28,13 @@ template class PrintState<PrintObjectStep, posCount>; void Print::clear_objects() { tbb::mutex::scoped_lock lock(m_mutex); - for (int i = int(m_objects.size())-1; i >= 0; --i) - this->delete_object(i); + for (PrintObject *object : m_objects) + delete object; + m_objects.clear(); for (PrintRegion *region : m_regions) delete region; m_regions.clear(); + this->invalidate_all_steps(); } void Print::delete_object(size_t idx) @@ -47,21 +49,28 @@ void Print::delete_object(size_t idx) void Print::reload_object(size_t /* idx */) { - tbb::mutex::scoped_lock lock(m_mutex); - /* TODO: this method should check whether the per-object config and per-material configs - have changed in such a way that regions need to be rearranged or we can just apply - the diff and invalidate something. Same logic as apply_config() - For now we just re-add all objects since we haven't implemented this incremental logic yet. - This should also check whether object volumes (parts) have changed. */ - - // collect all current model objects - ModelObjectPtrs model_objects; - model_objects.reserve(m_objects.size()); - for (PrintObject *object : m_objects) - model_objects.push_back(object->model_object()); - // remove our print objects - this->clear_objects(); - // re-add model objects + ModelObjectPtrs model_objects; + { + tbb::mutex::scoped_lock lock(m_mutex); + /* TODO: this method should check whether the per-object config and per-material configs + have changed in such a way that regions need to be rearranged or we can just apply + the diff and invalidate something. Same logic as apply_config() + For now we just re-add all objects since we haven't implemented this incremental logic yet. + This should also check whether object volumes (parts) have changed. */ + // collect all current model objects + model_objects.reserve(m_objects.size()); + for (PrintObject *object : m_objects) + model_objects.push_back(object->model_object()); + // remove our print objects + for (PrintObject *object : m_objects) + delete object; + m_objects.clear(); + for (PrintRegion *region : m_regions) + delete region; + m_regions.clear(); + this->invalidate_all_steps(); + } + // re-add model objects for (ModelObject *mo : model_objects) this->add_model_object(mo); } |