diff --git a/src/imgui/imconfig.h b/src/imgui/imconfig.h index 2fb6d7daf..6dabace5b 100644 --- a/src/imgui/imconfig.h +++ b/src/imgui/imconfig.h @@ -157,8 +157,8 @@ namespace ImGui const wchar_t InfoMarker = 0x2603; const wchar_t SliderFloatEditBtnIcon = 0x2604; const wchar_t SliderFloatEditBtnPressedIcon = 0x2605; -#if ENABLE_MEASURE_GIZMO const wchar_t ClipboardBtnIcon = 0x2606; + const wchar_t LegendTravel = 0x2701; const wchar_t LegendWipe = 0x2702; const wchar_t LegendRetract = 0x2703; @@ -175,25 +175,7 @@ namespace ImGui const wchar_t ExpandBtn = 0x2714; const wchar_t CollapseBtn = 0x2715; const wchar_t InfoMarkerSmall = 0x2716; -#else - const wchar_t LegendTravel = 0x2606; - const wchar_t LegendWipe = 0x2607; - const wchar_t LegendRetract = 0x2608; - const wchar_t LegendDeretract = 0x2609; - const wchar_t LegendSeams = 0x2610; - const wchar_t LegendToolChanges = 0x2611; - const wchar_t LegendColorChanges = 0x2612; - const wchar_t LegendPausePrints = 0x2613; - const wchar_t LegendCustomGCodes = 0x2614; - const wchar_t LegendCOG = 0x2615; - const wchar_t LegendShells = 0x2616; - const wchar_t LegendToolMarker = 0x2617; - const wchar_t WarningMarkerSmall = 0x2618; - const wchar_t ExpandBtn = 0x2619; - const wchar_t CollapseBtn = 0x2620; - const wchar_t InfoMarkerSmall = 0x2621; -#endif // ENABLE_MEASURE_GIZMO -// void MyFunction(const char* name, const MyMatrix44& v); + // void MyFunction(const char* name, const MyMatrix44& v); } diff --git a/src/libslic3r/Measure.cpp b/src/libslic3r/Measure.cpp index c060ae893..f64b79e22 100644 --- a/src/libslic3r/Measure.cpp +++ b/src/libslic3r/Measure.cpp @@ -5,8 +5,6 @@ #include "libslic3r/Geometry/Circle.hpp" #include "libslic3r/SurfaceMesh.hpp" -#if ENABLE_MEASURE_GIZMO - namespace Slic3r { namespace Measure { @@ -1082,5 +1080,3 @@ void AngleAndEdges::transform(const Transform3d& trafo) { } // namespace Measure } // namespace Slic3r - -#endif // ENABLE_MEASURE_GIZMO diff --git a/src/libslic3r/Measure.hpp b/src/libslic3r/Measure.hpp index ff1757d7a..d1a0e3866 100644 --- a/src/libslic3r/Measure.hpp +++ b/src/libslic3r/Measure.hpp @@ -1,8 +1,6 @@ #ifndef Slic3r_Measure_hpp_ #define Slic3r_Measure_hpp_ -#if ENABLE_MEASURE_GIZMO - #include #include @@ -197,5 +195,3 @@ inline bool are_perpendicular(const SurfaceFeature& f1, const SurfaceFeature& f2 } // namespace Slic3r #endif // Slic3r_Measure_hpp_ - -#endif // ENABLE_MEASURE_GIZMO diff --git a/src/libslic3r/MeasureUtils.hpp b/src/libslic3r/MeasureUtils.hpp index 34fea9855..0ab4ac121 100644 --- a/src/libslic3r/MeasureUtils.hpp +++ b/src/libslic3r/MeasureUtils.hpp @@ -1,8 +1,6 @@ #ifndef Slic3r_MeasureUtils_hpp_ #define Slic3r_MeasureUtils_hpp_ -#if ENABLE_MEASURE_GIZMO - #include namespace Slic3r { @@ -386,5 +384,3 @@ inline Vec3d get_orthogonal(const Vec3d& v, bool unitLength) } // namespace Measure #endif // Slic3r_MeasureUtils_hpp_ - -#endif // ENABLE_MEASURE_GIZMO diff --git a/src/libslic3r/Technologies.hpp b/src/libslic3r/Technologies.hpp index 10db1e57e..e390ff209 100644 --- a/src/libslic3r/Technologies.hpp +++ b/src/libslic3r/Technologies.hpp @@ -26,6 +26,8 @@ #define ENABLE_PROJECT_DIRTY_STATE_DEBUG_WINDOW 0 // Disable using instanced models to render options in gcode preview #define DISABLE_GCODEVIEWER_INSTANCED_MODELS 1 +// Enable Measure Gizmo debug window +#define ENABLE_MEASURE_GIZMO_DEBUG 0 // Enable rendering of objects using environment map @@ -64,9 +66,6 @@ // Enable picking using raytracing #define ENABLE_RAYCAST_PICKING (1 && ENABLE_LEGACY_OPENGL_REMOVAL) #define ENABLE_RAYCAST_PICKING_DEBUG (0 && ENABLE_RAYCAST_PICKING) -// Enable Measure Gizmo -#define ENABLE_MEASURE_GIZMO (1 && ENABLE_RAYCAST_PICKING) -#define ENABLE_MEASURE_GIZMO_DEBUG (0 && ENABLE_MEASURE_GIZMO) #endif // _prusaslicer_technologies_h_ diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 347522181..440f97fac 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -5441,15 +5441,9 @@ void GLCanvas3D::_picking_pass() const GLVolume* volume = m_volumes.volumes[hit.raycaster_id]; if (volume->is_active && !volume->disabled && (volume->composite_id.volume_id >= 0 || m_render_sla_auxiliaries)) { // do not add the volume id if any gizmo is active and CTRL is pressed - if (m_gizmos.get_current_type() == GLGizmosManager::EType::Undefined || !wxGetKeyState(WXK_CONTROL)) { + if (m_gizmos.get_current_type() == GLGizmosManager::EType::Undefined || !wxGetKeyState(WXK_CONTROL)) m_hover_volume_idxs.emplace_back(hit.raycaster_id); -#if !ENABLE_MEASURE_GIZMO - m_gizmos.set_hover_id(-1); -#endif // !ENABLE_MEASURE_GIZMO - } -#if ENABLE_MEASURE_GIZMO m_gizmos.set_hover_id(-1); -#endif // ENABLE_MEASURE_GIZMO } } else diff --git a/src/slic3r/GUI/GLCanvas3D.hpp b/src/slic3r/GUI/GLCanvas3D.hpp index 7ce488ae5..a5ec9c191 100644 --- a/src/slic3r/GUI/GLCanvas3D.hpp +++ b/src/slic3r/GUI/GLCanvas3D.hpp @@ -19,9 +19,7 @@ #if ENABLE_RAYCAST_PICKING #include "SceneRaycaster.hpp" #endif // ENABLE_RAYCAST_PICKING -#if ENABLE_MEASURE_GIZMO #include "GUI_Utils.hpp" -#endif // ENABLE_MEASURE_GIZMO #include "libslic3r/Slicing.hpp" @@ -138,18 +136,6 @@ private: wxTimer* m_timer; }; -#if !ENABLE_MEASURE_GIZMO -class KeyAutoRepeatFilter -{ - size_t m_count{ 0 }; - -public: - void increase_count() { ++m_count; } - void reset_count() { m_count = 0; } - bool is_first() const { return m_count == 0; } -}; -#endif // !ENABLE_MEASURE_GIZMO - wxDECLARE_EVENT(EVT_GLCANVAS_OBJECT_SELECT, SimpleEvent); using Vec2dEvent = Event; diff --git a/src/slic3r/GUI/GUI_Utils.hpp b/src/slic3r/GUI/GUI_Utils.hpp index e2152edd6..55ca43248 100644 --- a/src/slic3r/GUI/GUI_Utils.hpp +++ b/src/slic3r/GUI/GUI_Utils.hpp @@ -416,7 +416,6 @@ public: ~TaskTimer(); }; -#if ENABLE_MEASURE_GIZMO class KeyAutoRepeatFilter { size_t m_count{ 0 }; @@ -426,7 +425,6 @@ public: void reset_count() { m_count = 0; } bool is_first() const { return m_count == 0; } }; -#endif // ENABLE_MEASURE_GIZMO }} diff --git a/src/slic3r/GUI/Gizmos/GLGizmoMeasure.cpp b/src/slic3r/GUI/Gizmos/GLGizmoMeasure.cpp index 58e23b695..74be878f1 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoMeasure.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoMeasure.cpp @@ -19,8 +19,6 @@ #include -#if ENABLE_MEASURE_GIZMO - namespace Slic3r { namespace GUI { @@ -1691,5 +1689,3 @@ void GLGizmoMeasure::on_unregister_raycasters_for_picking() } // namespace GUI } // namespace Slic3r - -#endif // ENABLE_MEASURE_GIZMO diff --git a/src/slic3r/GUI/Gizmos/GLGizmoMeasure.hpp b/src/slic3r/GUI/Gizmos/GLGizmoMeasure.hpp index 9db2a73aa..7d20ca26a 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoMeasure.hpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoMeasure.hpp @@ -1,8 +1,6 @@ #ifndef slic3r_GLGizmoMeasure_hpp_ #define slic3r_GLGizmoMeasure_hpp_ -#if ENABLE_MEASURE_GIZMO - #include "GLGizmoBase.hpp" #include "slic3r/GUI/GLModel.hpp" #include "slic3r/GUI/GUI_Utils.hpp" @@ -162,6 +160,4 @@ protected: } // namespace GUI } // namespace Slic3r -#endif // ENABLE_MEASURE_GIZMO - #endif // slic3r_GLGizmoMeasure_hpp_ diff --git a/src/slic3r/GUI/Gizmos/GLGizmosCommon.hpp b/src/slic3r/GUI/Gizmos/GLGizmosCommon.hpp index f2a668f87..757940226 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmosCommon.hpp +++ b/src/slic3r/GUI/Gizmos/GLGizmosCommon.hpp @@ -24,10 +24,8 @@ enum class SLAGizmoEventType : unsigned char { Dragging, Delete, SelectAll, -#if ENABLE_MEASURE_GIZMO CtrlDown, CtrlUp, -#endif // ENABLE_MEASURE_GIZMO ShiftUp, AltUp, ApplyChanges, diff --git a/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp b/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp index f0617f524..51a0386ed 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp @@ -21,9 +21,7 @@ #include "slic3r/GUI/Gizmos/GLGizmoSeam.hpp" #include "slic3r/GUI/Gizmos/GLGizmoMmuSegmentation.hpp" #include "slic3r/GUI/Gizmos/GLGizmoSimplify.hpp" -#if ENABLE_MEASURE_GIZMO #include "slic3r/GUI/Gizmos/GLGizmoMeasure.hpp" -#endif // ENABLE_MEASURE_GIZMO #include "libslic3r/format.hpp" #include "libslic3r/Model.hpp" @@ -109,9 +107,7 @@ bool GLGizmosManager::init() m_gizmos.emplace_back(new GLGizmoSeam(m_parent, "seam.svg", 8)); m_gizmos.emplace_back(new GLGizmoMmuSegmentation(m_parent, "mmu_segmentation.svg", 9)); m_gizmos.emplace_back(new GLGizmoSimplify(m_parent, "cut.svg", 10)); -#if ENABLE_MEASURE_GIZMO m_gizmos.emplace_back(new GLGizmoMeasure(m_parent, "measure.svg", 11)); -#endif // ENABLE_MEASURE_GIZMO m_common_gizmos_data.reset(new CommonGizmosDataPool(&m_parent)); @@ -294,10 +290,8 @@ bool GLGizmosManager::gizmo_event(SLAGizmoEventType action, const Vec2d& mouse_p return dynamic_cast(m_gizmos[Seam].get())->gizmo_event(action, mouse_position, shift_down, alt_down, control_down); else if (m_current == MmuSegmentation) return dynamic_cast(m_gizmos[MmuSegmentation].get())->gizmo_event(action, mouse_position, shift_down, alt_down, control_down); -#if ENABLE_MEASURE_GIZMO else if (m_current == Measure) return dynamic_cast(m_gizmos[Measure].get())->gizmo_event(action, mouse_position, shift_down, alt_down, control_down); -#endif // ENABLE_MEASURE_GIZMO else if (m_current == Cut) return dynamic_cast(m_gizmos[Cut].get())->gizmo_event(action, mouse_position, shift_down, alt_down, control_down); else @@ -631,11 +625,9 @@ bool GLGizmosManager::on_key(wxKeyEvent& evt) processed = true; } } -#if ENABLE_MEASURE_GIZMO else if (m_current == Measure && keyCode == WXK_CONTROL) { gizmo_event(SLAGizmoEventType::CtrlUp, Vec2d::Zero(), false); } -#endif // ENABLE_MEASURE_GIZMO // if (processed) // m_parent.set_cursor(GLCanvas3D::Standard); @@ -670,11 +662,9 @@ bool GLGizmosManager::on_key(wxKeyEvent& evt) if (simplify != nullptr) processed = simplify->on_esc_key_down(); } -#if ENABLE_MEASURE_GIZMO else if (m_current == Measure && keyCode == WXK_CONTROL) { gizmo_event(SLAGizmoEventType::CtrlDown, Vec2d::Zero(), true); } -#endif // ENABLE_MEASURE_GIZMO } if (processed) diff --git a/src/slic3r/GUI/ImGuiWrapper.cpp b/src/slic3r/GUI/ImGuiWrapper.cpp index 14c9b641f..01cd8ec30 100644 --- a/src/slic3r/GUI/ImGuiWrapper.cpp +++ b/src/slic3r/GUI/ImGuiWrapper.cpp @@ -56,9 +56,7 @@ static const std::map font_icons = { {ImGui::PreferencesHoverButton, "notification_preferences_hover"}, {ImGui::SliderFloatEditBtnIcon, "edit_button" }, {ImGui::SliderFloatEditBtnPressedIcon, "edit_button_pressed" }, -#if ENABLE_MEASURE_GIZMO {ImGui::ClipboardBtnIcon , "copy_menu" }, -#endif // ENABLE_MEASURE_GIZMO {ImGui::ExpandBtn , "expand_btn" }, {ImGui::CollapseBtn , "collapse_btn" }, {ImGui::RevertButton , "undo" }, @@ -1129,12 +1127,10 @@ ImFontAtlasCustomRect* ImGuiWrapper::GetTextureCustomRect(const wchar_t& tex_id) return (item != m_custom_glyph_rects_ids.end()) ? ImGui::GetIO().Fonts->GetCustomRectByIndex(m_custom_glyph_rects_ids[tex_id]) : nullptr; } -#if ENABLE_MEASURE_GIZMO void ImGuiWrapper::disable_background_fadeout_animation() { GImGui->DimBgRatio = 1.0f; } -#endif // ENABLE_MEASURE_GIZMO ImU32 ImGuiWrapper::to_ImU32(const ColorRGBA& color) { diff --git a/src/slic3r/GUI/ImGuiWrapper.hpp b/src/slic3r/GUI/ImGuiWrapper.hpp index 8be16fcd0..040e5e491 100644 --- a/src/slic3r/GUI/ImGuiWrapper.hpp +++ b/src/slic3r/GUI/ImGuiWrapper.hpp @@ -130,9 +130,7 @@ public: void set_requires_extra_frame() { m_requires_extra_frame = true; } void reset_requires_extra_frame() { m_requires_extra_frame = false; } -#if ENABLE_MEASURE_GIZMO void disable_background_fadeout_animation(); -#endif // ENABLE_MEASURE_GIZMO static ImU32 to_ImU32(const ColorRGBA& color); static ImVec4 to_ImVec4(const ColorRGBA& color); diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index ee3a3c3a9..63b0a4e21 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -3034,9 +3034,7 @@ void Plater::priv::delete_all_objects_from_model() gcode_result.reset(); view3D->get_canvas3d()->reset_sequential_print_clearance(); -#if ENABLE_MEASURE_GIZMO view3D->get_canvas3d()->reset_all_gizmos(); -#endif // ENABLE_MEASURE_GIZMO m_worker.cancel_all();