#include "GLSelectionRectangle.hpp" #include "Camera.hpp" #include "3DScene.hpp" //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ #include "GLCanvas3D.hpp" //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ #include namespace Slic3r { namespace GUI { //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ void GLSelectionRectangle::start_dragging(const Vec2d& mouse_position, EState status) { if (is_active() || (status == Off)) return; m_status = status; m_start_corner = mouse_position; m_end_corner = mouse_position; } void GLSelectionRectangle::dragging(const Vec2d& mouse_position) { if (!is_active()) return; m_end_corner = mouse_position; } std::vector GLSelectionRectangle::stop_dragging(const GLCanvas3D& canvas, const std::vector& points) { std::vector out; if (!is_active()) return out; m_status = Off; const Camera& camera = canvas.get_camera(); const std::array& viewport = camera.get_viewport(); const Transform3d& modelview_matrix = camera.get_view_matrix(); const Transform3d& projection_matrix = camera.get_projection_matrix(); // bounding box created from the rectangle corners - will take care of order of the corners BoundingBox rectangle(Points{ Point(m_start_corner.cast()), Point(m_end_corner.cast()) }); // Iterate over all points and determine whether they're in the rectangle. for (unsigned int i = 0; i GLSelectionRectangle::end_dragging(const Camera& camera, const std::vector& points) //{ // if (!is_active()) // return std::vector(); // // m_status = Off; // std::vector out; // // const std::array& viewport = camera.get_viewport(); // const Transform3d& modelview_matrix = camera.get_view_matrix(); // const Transform3d& projection_matrix = camera.get_projection_matrix(); // // // bounding box created from the rectangle corners - will take care of order of the corners // BoundingBox rectangle(Points{ Point(m_start_corner.cast()), Point(m_end_corner.cast()) }); // // // Iterate over all points and determine whether they're in the rectangle. // for (unsigned int i = 0; i