Tech ENABLE_MEASURE_GIZMO set as default

This commit is contained in:
enricoturri1966 2022-11-02 08:50:12 +01:00
parent 2c9d047520
commit da5a9277fa
15 changed files with 5 additions and 86 deletions

View File

@ -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);
}

View File

@ -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

View File

@ -1,8 +1,6 @@
#ifndef Slic3r_Measure_hpp_
#define Slic3r_Measure_hpp_
#if ENABLE_MEASURE_GIZMO
#include <optional>
#include <memory>
@ -197,5 +195,3 @@ inline bool are_perpendicular(const SurfaceFeature& f1, const SurfaceFeature& f2
} // namespace Slic3r
#endif // Slic3r_Measure_hpp_
#endif // ENABLE_MEASURE_GIZMO

View File

@ -1,8 +1,6 @@
#ifndef Slic3r_MeasureUtils_hpp_
#define Slic3r_MeasureUtils_hpp_
#if ENABLE_MEASURE_GIZMO
#include <initializer_list>
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

View File

@ -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_

View File

@ -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

View File

@ -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<Vec2d>;

View File

@ -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
}}

View File

@ -19,8 +19,6 @@
#include <wx/clipbrd.h>
#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

View File

@ -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_

View File

@ -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,

View File

@ -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<GLGizmoSeam*>(m_gizmos[Seam].get())->gizmo_event(action, mouse_position, shift_down, alt_down, control_down);
else if (m_current == MmuSegmentation)
return dynamic_cast<GLGizmoMmuSegmentation*>(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<GLGizmoMeasure*>(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<GLGizmoCut3D*>(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)

View File

@ -56,9 +56,7 @@ static const std::map<const wchar_t, std::string> 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)
{

View File

@ -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);

View File

@ -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();