diff --git a/src/libslic3r/SLA/SLASupportTree.cpp b/src/libslic3r/SLA/SLASupportTree.cpp index 66ec0d5edd..9ebaa98e0a 100644 --- a/src/libslic3r/SLA/SLASupportTree.cpp +++ b/src/libslic3r/SLA/SLASupportTree.cpp @@ -1635,6 +1635,12 @@ SlicedSupports SLASupportTree::slice(float layerh, float init_layerh) const return {}; } +// Here we should implement the support editing +void SLASupportTree::mouse_event(const MouseEvent &) +{ + +} + SLASupportTree::SLASupportTree(const Model& model, const SupportConfig& cfg, const Controller& ctl): m_impl(new Impl()) diff --git a/src/libslic3r/SLA/SLASupportTree.hpp b/src/libslic3r/SLA/SLASupportTree.hpp index 1658eb6b38..0ebbacdadb 100644 --- a/src/libslic3r/SLA/SLASupportTree.hpp +++ b/src/libslic3r/SLA/SLASupportTree.hpp @@ -106,10 +106,25 @@ public: SLASupportsStoppedException(): std::runtime_error("") {} }; +/// A simple type carrying mouse event info. For support editing purposes +struct MouseEvent { + enum Buttons { + M_RIGHT, M_LEFT, M_MIDDLE + } button; + + enum Type { + ENGAGE, RELEASE, MOVE + } type; + + Vec3d coords; +}; + /// The class containing mesh data for the generated supports. class SLASupportTree { class Impl; std::unique_ptr m_impl; + std::function m_vcallback; + Impl& get() { return *m_impl; } const Impl& get() const { return *m_impl; } @@ -144,6 +159,16 @@ public: /// Get the sliced 2d layers of the support geometry. SlicedSupports slice(float layerh, float init_layerh = -1.0) const; + + /// The function to call when mouse events should be propagated to the + /// supports for editing + void mouse_event(const MouseEvent&); + + /// The provided callback will be called if the supports change their shape + /// or need to be repainted + inline void on_supports_changed(std::function callback) { + m_vcallback = callback; + } }; }