mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-15 11:51:33 +00:00
* Add Missing Includes Across src/slic3r/GUI Every GUI source and header now directly includes the headers declaring what it uses, rather than relying on the precompiled header or transitive includes. Generated with clang-tidy misc-include-cleaner, plus one hand edit making CalibrationPanel.hpp self-contained. * Drop the OS-Specific Includes Added Outside Their Platform Guards GLib, GTK, D-Bus and POSIX headers are only used inside platform #if blocks, which already include them. Added unconditionally at the top of the file they broke the Windows build. * Add the clang-tidy Configuration That Generated These Includes Only misc-include-cleaner's missing-include check, with the headers it must never suggest: per-platform, internal and OS-specific ones that would break other platforms or are not meant to be included directly. * Match Windows Paths in the clang-tidy Ignore List Header paths use backslashes on Windows, so every / in a pattern is now [/\\]. The Windows SDK headers are ignored alongside the other OS-specific ones, and the list is one pattern per line. Suggested by @raistlin7447 from a Windows clang-cl run.
90 lines
2.8 KiB
C++
90 lines
2.8 KiB
C++
#ifndef slic3r_GLGizmoMove_hpp_
|
|
#define slic3r_GLGizmoMove_hpp_
|
|
|
|
#include "GLGizmoBase.hpp"
|
|
//BBS: add size adjust related
|
|
#include "GizmoObjectManipulation.hpp"
|
|
#include "libslic3r/Point.hpp"
|
|
#include "slic3r/GUI/GLModel.hpp"
|
|
#include <array>
|
|
#include <string>
|
|
#include <wx/event.h>
|
|
|
|
|
|
namespace Slic3r {
|
|
namespace GUI {
|
|
|
|
//BBS: GUI refactor: add object manipulation
|
|
class GizmoObjectManipulation;
|
|
class GLGizmoMove3D : public GLGizmoBase
|
|
{
|
|
static const double Offset;
|
|
|
|
Vec3d m_displacement{ Vec3d::Zero() };
|
|
Vec3d m_center{ Vec3d::Zero() };
|
|
BoundingBoxf3 m_bounding_box;
|
|
double m_snap_step{ 1.0 };
|
|
Vec3d m_starting_drag_position{ Vec3d::Zero() };
|
|
Vec3d m_starting_box_center{ Vec3d::Zero() };
|
|
Vec3d m_starting_box_bottom_center{ Vec3d::Zero() };
|
|
|
|
struct GrabberConnection
|
|
{
|
|
GLModel model;
|
|
Vec3d old_center{ Vec3d::Zero() };
|
|
};
|
|
std::array<GrabberConnection, 3> m_grabber_connections;
|
|
|
|
//BBS: add size adjust related
|
|
GizmoObjectManipulation* m_object_manipulation;
|
|
|
|
public:
|
|
//BBS: add obj manipulation logic
|
|
//GLGizmoMove3D(GLCanvas3D& parent, const std::string& icon_filename, unsigned int sprite_id);
|
|
GLGizmoMove3D(GLCanvas3D& parent, const std::string& icon_filename, unsigned int sprite_id, GizmoObjectManipulation* obj_manipulation);
|
|
virtual ~GLGizmoMove3D() = default;
|
|
|
|
double get_snap_step(double step) const { return m_snap_step; }
|
|
void set_snap_step(double step) { m_snap_step = step; }
|
|
|
|
std::string get_tooltip() const override;
|
|
|
|
/// <summary>
|
|
/// Postpone to Grabber for move
|
|
/// </summary>
|
|
/// <param name="mouse_event">Keep information about mouse click</param>
|
|
/// <returns>Return True when use the information otherwise False.</returns>
|
|
bool on_mouse(const wxMouseEvent &mouse_event) override;
|
|
|
|
/// <summary>
|
|
/// Detect reduction of move for wipetover on selection change
|
|
/// </summary>
|
|
void data_changed(bool is_serializing) override;
|
|
protected:
|
|
bool on_init() override;
|
|
std::string on_get_name() const override;
|
|
bool on_is_activable() const override;
|
|
virtual void on_set_state() override;
|
|
void on_start_dragging() override;
|
|
void on_stop_dragging() override;
|
|
void on_dragging(const UpdateData& data) override;
|
|
void on_render() override;
|
|
void on_register_raycasters_for_picking() override;
|
|
void on_unregister_raycasters_for_picking() override;
|
|
//BBS: GUI refactor: add object manipulation
|
|
virtual void on_render_input_window(float x, float y, float bottom_limit) override;
|
|
|
|
private:
|
|
double calc_projection(const UpdateData& data) const;
|
|
void change_cs_by_selection(); //cs mean Coordinate System
|
|
private:
|
|
int m_last_selected_obejct_idx, m_last_selected_volume_idx;
|
|
};
|
|
|
|
|
|
|
|
} // namespace GUI
|
|
} // namespace Slic3r
|
|
|
|
#endif // slic3r_GLGizmoMove_hpp_
|