Fixed conflicts after merge with master

This commit is contained in:
enricoturri1966 2020-03-25 12:07:59 +01:00
commit a1a4d49f15
249 changed files with 51509 additions and 33846 deletions

View file

@ -3,15 +3,18 @@
#include <stddef.h>
#include <memory>
#if ENABLE_CANVAS_TOOLTIP_USING_IMGUI
#include <chrono>
#endif // ENABLE_CANVAS_TOOLTIP_USING_IMGUI
#include "3DScene.hpp"
#include "GLToolbar.hpp"
#include "GLShader.hpp"
#include "Event.hpp"
#include "3DBed.hpp"
#include "Camera.hpp"
#include "Selection.hpp"
#include "Gizmos/GLGizmosManager.hpp"
#include "GUI_ObjectLayers.hpp"
#include "GLSelectionRectangle.hpp"
#include "MeshUtils.hpp"
#if ENABLE_GCODE_VIEWER
#include "libslic3r/GCode/GCodeProcessor.hpp"
@ -21,7 +24,6 @@
#include <wx/timer.h>
class wxWindow;
class wxSizeEvent;
class wxIdleEvent;
class wxKeyEvent;
@ -35,20 +37,16 @@ class wxGLCanvas;
namespace Slic3r {
class GLShader;
class ExPolygon;
class Bed3D;
struct Camera;
class BackgroundSlicingProcess;
class GCodePreviewData;
#if ENABLE_THUMBNAIL_GENERATOR
struct ThumbnailData;
#endif // ENABLE_THUMBNAIL_GENERATOR
struct SlicingParameters;
enum LayerHeightEditActionType : unsigned int;
namespace GUI {
class GLGizmoBase;
#if ENABLE_RETINA_GL
class RetinaHelper;
#endif
@ -116,9 +114,7 @@ wxDECLARE_EVENT(EVT_GLCANVAS_RELOAD_FROM_DISK, SimpleEvent);
class GLCanvas3D
{
#if ENABLE_THUMBNAIL_GENERATOR
static const double DefaultCameraZoomToBoxMarginFactor;
#endif // ENABLE_THUMBNAIL_GENERATOR
public:
struct GCodePreviewVolumeIndex
@ -392,6 +388,24 @@ private:
void render(const std::vector<const ModelInstance*>& sorted_instances) const;
};
#if ENABLE_CANVAS_TOOLTIP_USING_IMGUI
class Tooltip
{
std::string m_text;
std::chrono::steady_clock::time_point m_start_time;
// Indicator that the mouse is inside an ImGUI dialog, therefore the tooltip should be suppressed.
bool m_in_imgui = false;
public:
bool is_empty() const { return m_text.empty(); }
void set_text(const std::string& text);
void render(const Vec2d& mouse_position, GLCanvas3D& canvas) const;
// Indicates that the mouse is inside an ImGUI dialog, therefore the tooltip should be suppressed.
void set_in_imgui(bool b) { m_in_imgui = b; }
bool is_in_imgui() const { return m_in_imgui; }
};
#endif // ENABLE_CANVAS_TOOLTIP_USING_IMGUI
public:
enum ECursorType : unsigned char
{
@ -470,6 +484,9 @@ private:
int m_selected_extruder;
Labels m_labels;
#if ENABLE_CANVAS_TOOLTIP_USING_IMGUI
mutable Tooltip m_tooltip;
#endif // ENABLE_CANVAS_TOOLTIP_USING_IMGUI
public:
GLCanvas3D(wxGLCanvas* canvas, Bed3D& bed, Camera& camera, GLToolbar& view_toolbar);
@ -559,11 +576,9 @@ public:
bool is_dragging() const { return m_gizmos.is_dragging() || m_moving; }
void render();
#if ENABLE_THUMBNAIL_GENERATOR
// printable_only == false -> render also non printable volumes as grayed
// parts_only == false -> render also sla support and pad
void render_thumbnail(ThumbnailData& thumbnail_data, unsigned int w, unsigned int h, bool printable_only, bool parts_only, bool show_bed, bool transparent_background) const;
#endif // ENABLE_THUMBNAIL_GENERATOR
void select_all();
void deselect_all();
@ -653,7 +668,7 @@ public:
Linef3 mouse_ray(const Point& mouse_pos);
void set_mouse_as_dragging() { m_mouse.dragging = true; }
void refresh_camera_scene_box() { m_camera.set_scene_box(scene_bounding_box()); }
void refresh_camera_scene_box();
bool is_mouse_dragging() const { return m_mouse.dragging; }
double get_size_proportional_to_max_bed_size(double factor) const;
@ -688,11 +703,7 @@ private:
BoundingBoxf3 _max_bounding_box(bool include_gizmos, bool include_bed_model) const;
#if ENABLE_THUMBNAIL_GENERATOR
void _zoom_to_box(const BoundingBoxf3& box, double margin_factor = DefaultCameraZoomToBoxMarginFactor);
#else
void _zoom_to_box(const BoundingBoxf3& box);
#endif // ENABLE_THUMBNAIL_GENERATOR
void _update_camera_zoom(double zoom);
void _refresh_if_shown_on_screen();
@ -720,8 +731,7 @@ private:
#endif // ENABLE_SHOW_CAMERA_TARGET
void _render_sla_slices() const;
void _render_selection_sidebar_hints() const;
void _render_undo_redo_stack(const bool is_undo, float pos_x) const;
#if ENABLE_THUMBNAIL_GENERATOR
bool _render_undo_redo_stack(const bool is_undo, float pos_x) const;
void _render_thumbnail_internal(ThumbnailData& thumbnail_data, bool printable_only, bool parts_only, bool show_bed, bool transparent_background) const;
// render thumbnail using an off-screen framebuffer
void _render_thumbnail_framebuffer(ThumbnailData& thumbnail_data, unsigned int w, unsigned int h, bool printable_only, bool parts_only, bool show_bed, bool transparent_background) const;
@ -729,7 +739,6 @@ private:
void _render_thumbnail_framebuffer_ext(ThumbnailData& thumbnail_data, unsigned int w, unsigned int h, bool printable_only, bool parts_only, bool show_bed, bool transparent_background) const;
// render thumbnail using the default framebuffer
void _render_thumbnail_legacy(ThumbnailData& thumbnail_data, unsigned int w, unsigned int h, bool printable_only, bool parts_only, bool show_bed, bool transparent_background) const;
#endif // ENABLE_THUMBNAIL_GENERATOR
void _update_volumes_hover_state() const;