diff --git a/src/libslic3r/CutSurface.hpp b/src/libslic3r/CutSurface.hpp index 6d570c290f..dc8400d65c 100644 --- a/src/libslic3r/CutSurface.hpp +++ b/src/libslic3r/CutSurface.hpp @@ -49,7 +49,10 @@ struct SurfaceCut : public indexed_triangle_set // list of circulated open surface CutType cut; - // conversion map from vertex index to contour point + // Conversion map from vertex index to contour point + // Could be used for filtration of surface cuts + // Still I don't have an idea how to filtrate it. + // What is wanted result on wave? // std::map vertex2contour; }; using SurfaceCuts = std::vector; diff --git a/src/libslic3r/Emboss.cpp b/src/libslic3r/Emboss.cpp index 98032c4776..904cd11126 100644 --- a/src/libslic3r/Emboss.cpp +++ b/src/libslic3r/Emboss.cpp @@ -22,7 +22,7 @@ class Private public: Private() = delete; static std::optional load_font_info(const unsigned char *data, unsigned int index = 0); - static std::optional get_glyph(stbtt_fontinfo &font_info, int unicode_letter, float flatness); + static std::optional get_glyph(const stbtt_fontinfo &font_info, int unicode_letter, float flatness); static std::optional get_glyph(int unicode, const Emboss::FontFile &font, const FontProp &font_prop, Emboss::Glyphs &cache, std::optional &font_info_opt); @@ -56,7 +56,7 @@ std::optional Private::load_font_info( return font_info; } -std::optional Private::get_glyph(stbtt_fontinfo &font_info, int unicode_letter, float flatness) +std::optional Private::get_glyph(const stbtt_fontinfo &font_info, int unicode_letter, float flatness) { int glyph_index = stbtt_FindGlyphIndex(&font_info, unicode_letter); if (glyph_index == 0) { @@ -636,7 +636,7 @@ ExPolygons Emboss::text2shapes(FontFileWithCache &font_with_cache, } void Emboss::apply_transformation(const FontProp &font_prop, - Transform3d &transformation) + Transform3d &transformation) { if (font_prop.angle.has_value()) { double angle_z = *font_prop.angle; @@ -648,7 +648,7 @@ void Emboss::apply_transformation(const FontProp &font_prop, } } -bool Emboss::is_italic(FontFile &font, unsigned int font_index) +bool Emboss::is_italic(const FontFile &font, unsigned int font_index) { if (font_index >= font.count) return false; std::optional font_info_opt = Private::load_font_info(font.data->data(), font_index); diff --git a/src/libslic3r/Emboss.hpp b/src/libslic3r/Emboss.hpp index fa59a6946d..0e57f54c80 100644 --- a/src/libslic3r/Emboss.hpp +++ b/src/libslic3r/Emboss.hpp @@ -105,7 +105,7 @@ public: /// struct FontFileWithCache { - std::shared_ptr font_file; + std::shared_ptr font_file; // cache for glyph shape std::shared_ptr cache; @@ -157,7 +157,7 @@ public: /// /// Z-move as surface distance(FontProp::distance) /// Z-rotation as angle to Y axis(FontProp::angle) - /// + /// In / Out transformation to modify by property static void apply_transformation(const FontProp &font_prop, Transform3d &transformation); @@ -168,7 +168,7 @@ public: /// Selector of font /// Index of font in collection /// True when the font description contains italic/obligue otherwise False - static bool is_italic(FontFile &font, unsigned int font_index); + static bool is_italic(const FontFile &font, unsigned int font_index); /// /// Project 2d point into space diff --git a/src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp b/src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp index 7844252536..b00d4843e6 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp @@ -1301,7 +1301,7 @@ void GLGizmoEmboss::draw_style_list() { bool GLGizmoEmboss::italic_button() { std::optional &wx_font = m_font_manager.get_wx_font(); - std::shared_ptr &font_file = m_font_manager.get_font_file(); + const std::shared_ptr &font_file = m_font_manager.get_font_file(); if (!wx_font.has_value() || font_file == nullptr) { draw_icon(IconType::italic, IconState::disabled); return false; @@ -1343,7 +1343,7 @@ bool GLGizmoEmboss::italic_button() bool GLGizmoEmboss::bold_button() { std::optional &wx_font = m_font_manager.get_wx_font(); - std::shared_ptr &font_file = m_font_manager.get_font_file(); + const std::shared_ptr &font_file = m_font_manager.get_font_file(); if (!wx_font.has_value() || font_file==nullptr) { draw_icon(IconType::bold, IconState::disabled); return false; @@ -1652,7 +1652,7 @@ void GLGizmoEmboss::do_rotate(float relative_z_angle) void GLGizmoEmboss::draw_advanced() { - std::shared_ptr& font_file = m_font_manager.get_font_file(); + const std::shared_ptr& font_file = m_font_manager.get_font_file(); if (font_file == nullptr) { ImGui::Text("%s", _u8L("Advanced font options could be change only for corect font.\nStart with select correct font.").c_str()); return; diff --git a/src/slic3r/Utils/FontManager.cpp b/src/slic3r/Utils/FontManager.cpp index 2add68ff07..09c6ea5fa0 100644 --- a/src/slic3r/Utils/FontManager.cpp +++ b/src/slic3r/Utils/FontManager.cpp @@ -145,7 +145,7 @@ void FontManager::add_fonts(FontList font_list) add_font(fi); } -std::shared_ptr &FontManager::get_font_file() +std::shared_ptr &FontManager::get_font_file() { // TODO: fix not selected font //if (!is_activ_font()) return nullptr; diff --git a/src/slic3r/Utils/FontManager.hpp b/src/slic3r/Utils/FontManager.hpp index 93d183cbcf..eb95d66632 100644 --- a/src/slic3r/Utils/FontManager.hpp +++ b/src/slic3r/Utils/FontManager.hpp @@ -75,7 +75,7 @@ public: void add_fonts(FontList font_list); // getter on active font file for access to glyphs - std::shared_ptr &get_font_file(); + std::shared_ptr &get_font_file(); // getter on active font item for access to font property const FontItem &get_font_item() const;