Adding isConnectionState here to make direct comparisons, whether the current state is the correct one.
Looks better than `self._connection_state == <my_connection_state>` in my point of view.
My previous fix was wrong; It only worked on what I wanted to fix (and broke the normal behavior). The current fix should fix both issues (merging works & merging groups works)
CURA-2932
I do not want to add the rebuild() call to the update function itself since there may be other changes to the build volume before we should rebuild (such as raft).
Contributes to issue CURA-2625.
Requires some multi-levelled trickery to get the event listeners working. This also assumes that the per-object stack decorator is not deleted at any point unless the mesh is deleted (which is currently a correct assumption). If that ever changes though, the harm is just that the update function is still listening on the deleted decorator's stack.
Contributes to issue CURA-2625.
Because the new object may use an extruder that wasn't used so far, and if you remove an object it may remove the need for a certain extruder.
Contributes to issue CURA-2625.
It's a bit counter-intuitive, so let me explain. The total build volume is defined as the rectangle around the union of the areas that all extruders can reach. The nozzle offset for the left extruder though is 0,0, so what should the border on the right side be? It should be 18 since there is a nozzle to the right of the left nozzle which has a relative x-offset of 18mm. Therefore we need to compute the relative offsets with each of the other nozzles and create sort of a bounding box around it, and the distance to the edge of that bounding box is the unreachable border on each of the sides.
Contributes to issue CURA-2625.
These disallowed areas are only at nozzle-height, not at head-height. They therefore won't move along with the nozzle offset.
Contributes to issue CURA-2625.
Also the old line obtained brim_line_count from the global stack, while it is settable_per_extruder!
Also we now assume selecting a brim means you want to print it.
I don't think having a brim line count of zero meant that you wouldnt get a brim; the minimal brim length also plays a role...
In single extrusion, the machine_nozzle_offset_x and machine_nozzle_offset_y were not defined in the used extruder stacks, because the used extruder stack is the global stack.
Contributes to issue CURA-2625.
Otherwise just a string gets added, which gives an error when the disallowed areas are being built as meshes. The front-end runs again, though the disallowed areas seem to be wrong now.
Contributes to issue CURA-2625.