Merge remote-tracking branch 'upstream/main' into libvgcode

# Conflicts:
#	src/libslic3r/GCode/GCodeProcessor.cpp
#	src/libslic3r/GCode/GCodeProcessor.hpp
#	src/slic3r/CMakeLists.txt
#	src/slic3r/GUI/GCodeViewer.cpp
#	src/slic3r/GUI/GCodeViewer.hpp
#	src/slic3r/GUI/GLCanvas3D.cpp
#	src/slic3r/GUI/GLCanvas3D.hpp
#	src/slic3r/GUI/GUI_Preview.cpp
This commit is contained in:
Andrew Sun
2025-11-09 18:48:04 -05:00
2978 changed files with 1208720 additions and 66304 deletions

View File

@@ -46,6 +46,7 @@ struct ThumbnailData;
struct ThumbnailsParams;
class ModelObject;
class ModelInstance;
struct TextInfo;
class PrintObject;
class Print;
class SLAPrint;
@@ -375,8 +376,20 @@ class GLCanvas3D
SlaSupportsOutside,
SomethingNotShown,
ObjectClashed,
ObjectLimited,
GCodeConflict,
ToolHeightOutside
ToolHeightOutside,
TPUPrintableError,
FilamentPrintableError,
LeftExtruderPrintableError, // before slice
RightExtruderPrintableError, // before slice
MultiExtruderPrintableError, // after slice
MultiExtruderHeightOutside, // after slice
FilamentUnPrintableOnFirstLayer,
MixUsePLAAndPETG,
PrimeTowerOutside,
NozzleFilamentIncompatible,
MixtureFilamentIncompatible,
};
class RenderStats
@@ -524,6 +537,8 @@ private:
mutable IMToolbar m_sel_plate_toolbar;
mutable GLToolbar m_assemble_view_toolbar;
mutable IMReturnToolbar m_return_toolbar;
mutable Vec2i32 m_axis_button_pos = {128, 5};
mutable float m_sc{1};
mutable float m_paint_toolbar_width;
//BBS: add canvas type for assemble view usage
@@ -607,7 +622,7 @@ private:
PrinterTechnology current_printer_technology() const;
bool m_show_world_axes{false};
bool m_show_world_axes{true};
Bed3D::Axes m_axes;
//BBS:record key botton frequency
int auto_orient_count = 0;
@@ -752,7 +767,7 @@ public:
unsigned int get_volumes_count() const { return (unsigned int)m_volumes.volumes.size(); }
const GLVolumeCollection& get_volumes() const { return m_volumes; }
void reset_volumes();
ModelInstanceEPrintVolumeState check_volumes_outside_state(bool selection_only = true) const;
ModelInstanceEPrintVolumeState check_volumes_outside_state(ObjectFilamentResults* object_results = nullptr) const;
void check_volumes_outside_state(GLVolumeCollection& volumes) const { check_volumes_outside_state(volumes, nullptr, false); }
bool is_all_plates_selected() { return m_sel_plate_toolbar.m_all_plates_stats_item && m_sel_plate_toolbar.m_all_plates_stats_item->selected; }
const float get_scale() const;
@@ -817,7 +832,7 @@ public:
void set_color_clip_plane(const Vec3d& cp_normal, double offset) { m_volumes.set_color_clip_plane(cp_normal, offset); }
void set_color_clip_plane_colors(const std::array<ColorRGBA, 2>& colors) { m_volumes.set_color_clip_plane_colors(colors); }
void set_show_world_axes(bool flag) { m_show_world_axes = flag; }
void toggle_world_axes_visibility(bool force_show = false);
void refresh_camera_scene_box();
void set_color_by(const std::string& value);
@@ -899,26 +914,68 @@ public:
// parts_only == false -> render also sla support and pad
void render_thumbnail(ThumbnailData& thumbnail_data, unsigned int w, unsigned int h, const ThumbnailsParams& thumbnail_params,
Camera::EType camera_type,
bool use_top_view = false,
Camera::ViewAngleType camera_view_angle_type = Camera::ViewAngleType::Iso,
bool for_picking = false,
bool ban_light = false);
void render_thumbnail(ThumbnailData& thumbnail_data, unsigned int w, unsigned int h, const ThumbnailsParams& thumbnail_params,
void render_thumbnail(ThumbnailData & thumbnail_data,
unsigned int w,
unsigned int h,
const ThumbnailsParams & thumbnail_params,
ModelObjectPtrs & model_objects,
const GLVolumeCollection &volumes,
Camera::EType camera_type,
bool use_top_view = false,
Camera::ViewAngleType camera_view_angle_type = Camera::ViewAngleType::Iso,
bool for_picking = false,
bool ban_light = false);
void render_thumbnail(ThumbnailData & thumbnail_data,
std::vector<ColorRGBA> & extruder_colors,
unsigned int w,
unsigned int h,
const ThumbnailsParams & thumbnail_params,
ModelObjectPtrs & model_objects,
const GLVolumeCollection &volumes,
Camera::EType camera_type,
Camera::ViewAngleType camera_view_angle_type = Camera::ViewAngleType::Iso,
bool for_picking = false,
bool ban_light = false);
static void render_thumbnail_internal(ThumbnailData& thumbnail_data, const ThumbnailsParams& thumbnail_params, PartPlateList& partplate_list, ModelObjectPtrs& model_objects,
const GLVolumeCollection& volumes, std::vector<ColorRGBA>& extruder_colors,
GLShaderProgram* shader, Camera::EType camera_type, bool use_top_view = false, bool for_picking = false, bool ban_light = false);
GLShaderProgram * shader,
Camera::EType camera_type,
Camera::ViewAngleType camera_view_angle_type = Camera::ViewAngleType::Iso,
bool for_picking = false,
bool ban_light = false);
// render thumbnail using an off-screen framebuffer
static void render_thumbnail_framebuffer(ThumbnailData& thumbnail_data, unsigned int w, unsigned int h, const ThumbnailsParams& thumbnail_params,
PartPlateList& partplate_list, ModelObjectPtrs& model_objects, const GLVolumeCollection& volumes, std::vector<ColorRGBA>& extruder_colors,
GLShaderProgram* shader, Camera::EType camera_type, bool use_top_view = false, bool for_picking = false, bool ban_light = false);
GLShaderProgram * shader,
Camera::EType camera_type,
Camera::ViewAngleType camera_view_angle_type = Camera::ViewAngleType::Iso,
bool for_picking = false,
bool ban_light = false);
// render thumbnail using an off-screen framebuffer when GLEW_EXT_framebuffer_object is supported
static void render_thumbnail_framebuffer_ext(ThumbnailData& thumbnail_data, unsigned int w, unsigned int h, const ThumbnailsParams& thumbnail_params,
PartPlateList& partplate_list, ModelObjectPtrs& model_objects, const GLVolumeCollection& volumes, std::vector<ColorRGBA>& extruder_colors,
GLShaderProgram* shader, Camera::EType camera_type, bool use_top_view = false, bool for_picking = false, bool ban_light = false);
GLShaderProgram * shader,
Camera::EType camera_type,
Camera::ViewAngleType camera_view_angle_type = Camera::ViewAngleType::Iso,
bool for_picking = false,
bool ban_light = false);
// render thumbnail using the default framebuffer
static void render_thumbnail_legacy(ThumbnailData & thumbnail_data,
unsigned int w,
unsigned int h,
const ThumbnailsParams & thumbnail_params,
PartPlateList & partplate_list,
ModelObjectPtrs & model_objects,
const GLVolumeCollection & volumes,
std::vector<ColorRGBA> & extruder_colors,
GLShaderProgram * shader,
Camera::EType camera_type,
Camera::ViewAngleType camera_view_angle_type = Camera::ViewAngleType::Iso,
bool for_picking = false,
bool ban_light = false);
//BBS
void select_curr_plate_all();
@@ -1149,6 +1206,8 @@ public:
private:
bool _is_shown_on_screen() const;
void _update_slice_error_status();
void _switch_toolbars_icon_filename();
bool _init_toolbars();
bool _init_main_toolbar();
@@ -1199,6 +1258,7 @@ private:
void _render_imgui_select_plate_toolbar();
void _render_assemble_view_toolbar() const;
void _render_return_toolbar() const;
void _render_camera_toolbar();
void _render_separator_toolbar_right() const;
void _render_separator_toolbar_left() const;
void _render_collapse_toolbar() const;
@@ -1217,8 +1277,6 @@ private:
bool _render_orient_menu(float left, float right, float bottom, float top);
bool _render_arrange_menu(float left, float right, float bottom, float top);
void _render_3d_navigator();
// render thumbnail using the default framebuffer
void render_thumbnail_legacy(ThumbnailData& thumbnail_data, unsigned int w, unsigned int h, const ThumbnailsParams& thumbnail_params, PartPlateList& partplate_list, ModelObjectPtrs& model_objects, const GLVolumeCollection& volumes, std::vector<ColorRGBA>& extruder_colors, GLShaderProgram* shader, Camera::EType camera_type);
void _update_volumes_hover_state();