Measuring: code for Measure gizmo embedded into new tech ENABLE_MEASURE_GIZMO

Fixed conflicts while rebasing to master
This commit is contained in:
enricoturri1966 2022-08-25 13:01:26 +02:00
parent 7b43786124
commit aeb8dec463
4 changed files with 15 additions and 22 deletions

View file

@ -66,8 +66,10 @@
// 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_LEGACY_OPENGL_REMOVAL)
// Enable debug code for Measure Gizmo
#define ENABLE_MEASURE_GIZMO_DEBUG (0 && ENABLE_2_5_0_ALPHA1)
#define ENABLE_MEASURE_GIZMO_DEBUG (0 && ENABLE_MEASURE_GIZMO)
#endif // _prusaslicer_technologies_h_

View file

@ -14,6 +14,8 @@
#include <GL/glew.h>
#if ENABLE_MEASURE_GIZMO
namespace Slic3r {
namespace GUI {
@ -261,20 +263,6 @@ void GLGizmoMeasure::on_render()
#if ! ENABLE_LEGACY_OPENGL_REMOVAL
#error NOT IMPLEMENTED
#endif
#if ! ENABLE_GL_SHADERS_ATTRIBUTES
#error NOT IMPLEMENTED
#endif
void GLGizmoMeasure::on_render_for_picking()
{
}
void GLGizmoMeasure::update_if_needed()
{
auto update_plane_models_cache = [this](const indexed_triangle_set& its) {
@ -354,3 +342,5 @@ void GLGizmoMeasure::update_if_needed()
} // namespace GUI
} // namespace Slic3r
#endif // ENABLE_MEASURE_GIZMO

View file

@ -1,15 +1,10 @@
#ifndef slic3r_GLGizmoMeasure_hpp_
#define slic3r_GLGizmoMeasure_hpp_
#if ENABLE_MEASURE_GIZMO
#include "GLGizmoBase.hpp"
#if ENABLE_LEGACY_OPENGL_REMOVAL
#include "slic3r/GUI/GLModel.hpp"
#else
#include "slic3r/GUI/3DScene.hpp"
#endif // ENABLE_LEGACY_OPENGL_REMOVAL
#include <memory>
namespace Slic3r {
@ -81,4 +76,6 @@ protected:
} // namespace GUI
} // namespace Slic3r
#endif // ENABLE_MEASURE_GIZMO
#endif // slic3r_GLGizmoMeasure_hpp_

View file

@ -21,7 +21,9 @@
#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"
@ -107,7 +109,9 @@ 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));