diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index a6eee73e8..f9281434d 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -22,6 +22,8 @@ #include "slic3r/GUI/PresetBundle.hpp" #include "slic3r/GUI/Tab.hpp" #include "slic3r/GUI/GUI_Preview.hpp" +#include "slic3r/GUI/3DBed.hpp" +#include "slic3r/GUI/Camera.hpp" #include "GUI_App.hpp" #include "GUI_ObjectList.hpp" @@ -3978,6 +3980,13 @@ Linef3 GLCanvas3D::mouse_ray(const Point& mouse_pos) return Linef3(_mouse_to_3d(mouse_pos, &z0), _mouse_to_3d(mouse_pos, &z1)); } + +void GLCanvas3D::refresh_camera_scene_box() +{ + m_camera.set_scene_box(scene_bounding_box()); +} + + double GLCanvas3D::get_size_proportional_to_max_bed_size(double factor) const { return factor * m_bed.get_bounding_box(false).max_size(); diff --git a/src/slic3r/GUI/GLCanvas3D.hpp b/src/slic3r/GUI/GLCanvas3D.hpp index 9ae127880..2e84782aa 100644 --- a/src/slic3r/GUI/GLCanvas3D.hpp +++ b/src/slic3r/GUI/GLCanvas3D.hpp @@ -6,19 +6,18 @@ #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" #include #include -class wxWindow; class wxSizeEvent; class wxIdleEvent; class wxKeyEvent; @@ -32,8 +31,8 @@ class wxGLCanvas; namespace Slic3r { -class GLShader; -class ExPolygon; +class Bed3D; +struct Camera; class BackgroundSlicingProcess; class GCodePreviewData; #if ENABLE_THUMBNAIL_GENERATOR @@ -44,8 +43,6 @@ enum LayerHeightEditActionType : unsigned int; namespace GUI { -class GLGizmoBase; - #if ENABLE_RETINA_GL class RetinaHelper; #endif @@ -646,7 +643,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; diff --git a/src/slic3r/GUI/GLToolbar.cpp b/src/slic3r/GUI/GLToolbar.cpp index 61dba1c19..079e69b21 100644 --- a/src/slic3r/GUI/GLToolbar.cpp +++ b/src/slic3r/GUI/GLToolbar.cpp @@ -4,8 +4,7 @@ #include "GLToolbar.hpp" #include "../../slic3r/GUI/GLCanvas3D.hpp" - -#include +#include "../../slic3r/GUI/Camera.hpp" #include #include diff --git a/src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp b/src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp index f33a7bd8b..0027fb8be 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp @@ -1,5 +1,6 @@ #include "GLGizmoHollow.hpp" #include "slic3r/GUI/GLCanvas3D.hpp" +#include "slic3r/GUI/Camera.hpp" #include "slic3r/GUI/Gizmos/GLGizmos.hpp" #include diff --git a/src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp b/src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp index 0e98f7364..fa8de30ca 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp @@ -1,6 +1,7 @@ // Include GLGizmoBase.hpp before I18N.hpp as it includes some libigl code, which overrides our localization "L" macro. #include "GLGizmoSlaSupports.hpp" #include "slic3r/GUI/GLCanvas3D.hpp" +#include "slic3r/GUI/Camera.hpp" #include "slic3r/GUI/Gizmos/GLGizmos.hpp" #include diff --git a/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp b/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp index 35292f31c..d465196f3 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp @@ -8,8 +8,9 @@ #include "slic3r/Utils/UndoRedo.hpp" #include "libslic3r/SLAPrint.hpp" #include "slic3r/GUI/MeshUtils.hpp" +#include "slic3r/GUI/Gizmos/GLGizmos.hpp" +#include "slic3r/GUI/Camera.hpp" -#include #include namespace Slic3r { diff --git a/src/slic3r/GUI/Gizmos/GLGizmosManager.hpp b/src/slic3r/GUI/Gizmos/GLGizmosManager.hpp index a479b645b..2eac470f9 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmosManager.hpp +++ b/src/slic3r/GUI/Gizmos/GLGizmosManager.hpp @@ -3,8 +3,8 @@ #include "slic3r/GUI/GLTexture.hpp" #include "slic3r/GUI/GLToolbar.hpp" -#include "slic3r/GUI/Gizmos/GLGizmos.hpp" #include "libslic3r/ObjectID.hpp" +#include "slic3r/GUI/Gizmos/GLGizmoBase.hpp" #include @@ -18,6 +18,8 @@ namespace GUI { class GLCanvas3D; class ClippingPlane; +enum class SLAGizmoEventType : unsigned char; +class CommonGizmosData; class Rect { diff --git a/src/slic3r/GUI/ObjectDataViewModel.cpp b/src/slic3r/GUI/ObjectDataViewModel.cpp index 649b3c32e..0905f4915 100644 --- a/src/slic3r/GUI/ObjectDataViewModel.cpp +++ b/src/slic3r/GUI/ObjectDataViewModel.cpp @@ -5,6 +5,8 @@ #include "GUI_ObjectList.hpp" #include "I18N.hpp" +#include "libslic3r/Model.hpp" + #include #include diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index a57225954..6fc6ab86c 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -80,13 +80,14 @@ #include "../Utils/PrintHost.hpp" #include "../Utils/FixModelByWin10.hpp" #include "../Utils/UndoRedo.hpp" -#include "../Utils/Thread.hpp" #include "RemovableDriveManager.hpp" #include // Needs to be last because reasons :-/ #include "WipeTowerDialog.hpp" #include "libslic3r/CustomGCode.hpp" +#include "Gizmos/GLGizmoHollow.hpp" + using boost::optional; namespace fs = boost::filesystem; using Slic3r::_3DScene; @@ -1699,6 +1700,7 @@ struct Plater::priv void process() override; }; + // FIXME: This should be removed, as well as the #include of the gizmo class HollowJob : public PlaterJob { public: diff --git a/src/slic3r/GUI/Plater.hpp b/src/slic3r/GUI/Plater.hpp index 249e0a043..754a2a720 100644 --- a/src/slic3r/GUI/Plater.hpp +++ b/src/slic3r/GUI/Plater.hpp @@ -10,14 +10,11 @@ #include "Preset.hpp" -#include "3DScene.hpp" -#include "GLTexture.hpp" +#include "libslic3r/BoundingBox.hpp" #include "wxExtensions.hpp" class wxButton; class ScalableButton; -class wxBoxSizer; -class wxGLCanvas; class wxScrolledWindow; class wxString; @@ -30,9 +27,9 @@ class SLAPrint; enum SLAPrintObjectStep : unsigned int; namespace UndoRedo { - class Stack; - struct Snapshot; -}; + class Stack; + struct Snapshot; +} namespace GUI { @@ -44,6 +41,7 @@ class ObjectLayers; class ObjectList; class GLCanvas3D; class Mouse3DController; +struct Camera; using t_optgroups = std::vector >; diff --git a/src/slic3r/GUI/PresetBundle.cpp b/src/slic3r/GUI/PresetBundle.cpp index 9fa891da0..3e8e994a3 100644 --- a/src/slic3r/GUI/PresetBundle.cpp +++ b/src/slic3r/GUI/PresetBundle.cpp @@ -29,8 +29,10 @@ #include "libslic3r/libslic3r.h" #include "libslic3r/Utils.hpp" +#include "libslic3r/Model.hpp" #include "GUI_App.hpp" + // Store the print/filament/printer presets into a "presets" subdirectory of the Slic3rPE config dir. // This breaks compatibility with the upstream Slic3r if the --datadir is used to switch between the two versions. // #define SLIC3R_PROFILE_USE_PRESETS_SUBDIR diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 1033ffac4..615dd377e 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -4,6 +4,7 @@ #include "PresetBundle.hpp" #include "PresetHints.hpp" #include "libslic3r/Utils.hpp" +#include "libslic3r/Model.hpp" #include "slic3r/Utils/Http.hpp" #include "slic3r/Utils/PrintHost.hpp"