Refactored PrintObject::m_copies to PrintInstances,

so that the ordering code at G-code export may work directly with
pointers to PrintInstances instead of with pair of <PrintObject, copy idx>.
Also the PrintInstance knows its source ModelInstance, which allows
sorting of PrintInstances for sequential printing in the order
they appear in Plater's object list.
This commit is contained in:
bubnikv 2020-01-23 09:53:06 +01:00
parent cea7cbfaa0
commit 71fa411100
10 changed files with 226 additions and 209 deletions

View file

@ -5251,7 +5251,7 @@ void GLCanvas3D::_load_print_object_toolpaths(const PrintObject& print_object, c
struct Ctxt
{
const Points *shifted_copies;
const PrintInstances *shifted_copies;
std::vector<const Layer*> layers;
bool has_perimeters;
bool has_infill;
@ -5384,7 +5384,7 @@ void GLCanvas3D::_load_print_object_toolpaths(const PrintObject& print_object, c
ctxt.is_single_material_print = this->fff_print()->extruders().size()==1;
ctxt.extruders_cnt = wxGetApp().extruders_edited_cnt();
ctxt.shifted_copies = &print_object.copies();
ctxt.shifted_copies = &print_object.instances();
// order layers by print_z
{
@ -5473,7 +5473,8 @@ void GLCanvas3D::_load_print_object_toolpaths(const PrintObject& print_object, c
vol->offsets.push_back(vol->indexed_vertex_array.quad_indices.size());
vol->offsets.push_back(vol->indexed_vertex_array.triangle_indices.size());
}
for (const Point &copy : *ctxt.shifted_copies) {
for (const PrintInstance &instance : *ctxt.shifted_copies) {
const Point &copy = instance.shift;
for (const LayerRegion *layerm : layer->regions()) {
if (is_selected_separate_extruder)
{