mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-08 00:01:09 +00:00
GCode: hold the writer by value again
Belt printing turned GCode::m_writer into a unique_ptr so BeltGCode could swap in a freshly built writer carrying the belt kinematics. Nothing subclasses GCodeWriter: the machine mapping lives in its MachineKinematics, which set_kinematics() installs on an existing writer. A GCode is built for every export and the only state on the writer when init_belt_writer() runs is the plate offset, which the swap had to copy across by hand. Install the belt kinematics on the writer in place, drop the copied offset, and drop the virtual markers on GCodeWriter that the old subclass needed. Every m_writer-> in GCode.cpp goes back to m_writer., which is most of the belt diff in that file and most of its conflicts with main. The pressure-advance pattern keeps its shared_ptr writer: the unique_ptr kinematics make GCodeWriter move-only and that class must stay copyable.
This commit is contained in:
+235
-235
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user