#include "GLGizmoEmboss.hpp"#include "EmbossStyleManager.hpp"#include "slic3r/GUI/GLCanvas3D.hpp"#include "slic3r/GUI/GUI_App.hpp"#include "slic3r/GUI/Shortcuts.hpp"#include "slic3r/GUI/GUI_ObjectList.hpp"#include "slic3r/GUI/Gizmos/GizmoObjectManipulation.hpp"#include "slic3r/GUI/MainFrame.hpp"#include "slic3r/GUI/NotificationManager.hpp"#include "slic3r/GUI/Plater.hpp"#include "slic3r/GUI/MsgDialog.hpp"#include "slic3r/GUI/format.hpp"#include "slic3r/GUI/I18N.hpp"#include "slic3r/GUI/CameraUtils.hpp"#include "slic3r/GUI/Jobs/EmbossJob.hpp"#include "slic3r/GUI/Jobs/CreateFontNameImageJob.hpp"#include "slic3r/Utils/WxFontUtils.hpp"#include "slic3r/Utils/UndoRedo.hpp"#include "GLGizmoUtils.hpp"#include "libslic3r/Geometry.hpp"#include "libslic3r/Timer.hpp"#include "libslic3r/Model.hpp"#include "libslic3r/Preset.hpp"#include "libslic3r/AppConfig.hpp"#include "imgui/imgui_stdlib.h"#include <string>#include "libslic3r/Point.hpp"#include <memory>#include "slic3r/GUI/TextLines.hpp"#include <atomic>#include <imgui.h>#include "libslic3r/Emboss.hpp"#include "libslic3r/TextConfiguration.hpp"#include "libslic3r/EmbossShape.hpp"#include "slic3r/GUI/IconManager.hpp"#include <cstddef>#include <vector>#include <wx/fontenc.h>#include "slic3r/GUI/Gizmos/GLGizmoBase.hpp"#include <utility>#include <cassert>#include <optional>#include "libslic3r/libslic3r.h"#include "slic3r/GUI/SurfaceDrag.hpp"#include <Eigen/Geometry>#include "slic3r/GUI/Selection.hpp"#include "slic3r/GUI/3DScene.hpp"#include "libslic3r/Color.hpp"#include <algorithm>#include <wx/gdicmn.h>#include "libslic3r/Utils.hpp"#include <wx/settings.h>#include <cmath>#include <string_view>#include "libslic3r/Config.hpp"#include <wx/dataview.h>#include <limits>#include <wx/intl.h>#include <math.h>#include <boost/container_hash/hash.hpp>#include <cstdint>#include <boost/nowide/convert.hpp>#include "libslic3r/Polygon.hpp"#include <sstream>#include <boost/filesystem/path.hpp>#include <ios>#include <exception>#include <boost/filesystem/operations.hpp>#include "slic3r/GUI/Jobs/Worker.hpp"#include <cfloat>#include <wx/string.h>#include <imgui/imgui_internal.h>#include <wx/font.h>#include <wx/fontutil.h>#include <wx/fontdlg.h>#include <wx/fontenum.h>#include <wx/display.h>#include <wx/hashmap.h>#include <boost/log/trivial.hpp>#include <boost/nowide/fstream.hpp>#include <boost/functional/hash.hpp>#include <boost/filesystem.hpp>#include <cereal/cereal.hpp>#include <cereal/types/vector.hpp>#include <cereal/types/string.hpp>#include <cereal/archives/binary.hpp>#include <glad/gl.h>#include <chrono>#include "libslic3r/CutUtils.hpp"#include "libslic3r/ObjectID.hpp"#include "slic3r/GUI/GUI_Geometry.hpp"#include "slic3r/GUI/Gizmos/GLGizmoRotate.hpp"#include "slic3r/GUI/Gizmos/GLGizmosManager.hpp"#include "slic3r/GUI/ImGuiWrapper.hpp"#include "slic3r/Utils/RaycastManager.hpp"Go to the source code of this file.
Namespaces | |
| namespace | anonymous_namespace{GLGizmoEmboss.cpp} |
| namespace | Slic3r |
| |/ Copyright (c) Prusa Research 2020 - 2023 Enrico Turri @enricoturri1966 |/ |/ PrusaSlicer is released under the terms of the AGPLv3 or higher |/ | |
| namespace | Slic3r::GUI |
Macros | |
| #define | IMGUI_DEFINE_MATH_OPERATORS |
Functions | |
| std::unique_ptr< DataBase > | anonymous_namespace{GLGizmoEmboss.cpp}::create_emboss_data_base (const std::string &text, StyleManager &style_manager, TextLinesModel &text_lines, const Selection &selection, ModelVolumeType type, std::shared_ptr< std::atomic< bool > > &cancel) |
| Prepare data for emboss. | |
| CreateVolumeParams | anonymous_namespace{GLGizmoEmboss.cpp}::create_input (GLCanvas3D &canvas, const StyleManager::Style &style, RaycastManager &raycaster, ModelVolumeType volume_type) |
| ImVec2 | anonymous_namespace{GLGizmoEmboss.cpp}::calc_fine_position (const Selection &selection, const ImVec2 &windows_size, const Size &canvas_size) |
| Move window for edit emboss text near to embossed object NOTE: embossed object must be selected. | |
| const IconManager::Icon & | anonymous_namespace{GLGizmoEmboss.cpp}::get_icon (const IconManager::VIcons &icons, IconType type, IconState state) |
| bool | anonymous_namespace{GLGizmoEmboss.cpp}::draw_button (const IconManager::VIcons &icons, IconType type, bool disable=false) |
| bool | anonymous_namespace{GLGizmoEmboss.cpp}::store (const Facenames &facenames) |
| bool | anonymous_namespace{GLGizmoEmboss.cpp}::load (Facenames &facenames) |
| void | anonymous_namespace{GLGizmoEmboss.cpp}::init_face_names (Facenames &facenames) |
| void | anonymous_namespace{GLGizmoEmboss.cpp}::init_truncated_names (Facenames &face_names, float max_width) |
| GuiCfg | anonymous_namespace{GLGizmoEmboss.cpp}::create_gui_configuration () |
| void | anonymous_namespace{GLGizmoEmboss.cpp}::draw_font_preview (FaceName &face, const std::string &text, Facenames &faces, const GuiCfg &cfg, bool is_visible) |
| void | anonymous_namespace{GLGizmoEmboss.cpp}::init_text_lines (TextLinesModel &text_lines, const Selection &selection, StyleManager &style_manager, unsigned count_lines=0) |
| ModelVolumePtrs | anonymous_namespace{GLGizmoEmboss.cpp}::prepare_volumes_to_slice (const ModelVolume &mv) |
| bool | anonymous_namespace{GLGizmoEmboss.cpp}::check (ModelVolumeType volume_type) |
| bool | anonymous_namespace{GLGizmoEmboss.cpp}::can_write (StyleManager &style_manager, const std::string &text) |
| bool | anonymous_namespace{GLGizmoEmboss.cpp}::can_write (const EmbossStyle &style, const std::string &text) |
| void | anonymous_namespace{GLGizmoEmboss.cpp}::add_style_for_default_text (EmbossStyles &styles) |
| std::optional< wxString > | anonymous_namespace{GLGizmoEmboss.cpp}::get_installed_face_name (const std::optional< std::string > &face_name_opt, ::Facenames &face_names) |
| Check installed fonts whether optional face name exist in installed fonts. | |
| void | anonymous_namespace{GLGizmoEmboss.cpp}::fix_transformation (const StyleManager::Style &from, const StyleManager::Style &to, GLCanvas3D &canvas) |
| bool | anonymous_namespace{GLGizmoEmboss.cpp}::is_text_empty (std::string_view text) |
| template<typename T> | |
| bool | exist_change (const T &value, const T *default_value) |
| template<> | |
| bool | exist_change (const std::optional< float > &value, const std::optional< float > *default_value) |
| template<> | |
| bool | exist_change (const float &value, const float *default_value) |
| template<typename T> | |
| bool | imgui_input (const char *label, T *v, T step, T step_fast, const char *format, ImGuiInputTextFlags flags) |
| template<> | |
| bool | imgui_input (const char *label, float *v, float step, float step_fast, const char *format, ImGuiInputTextFlags flags) |
| template<> | |
| bool | imgui_input (const char *label, double *v, double step, double step_fast, const char *format, ImGuiInputTextFlags flags) |
| static std::size_t | hash_value (wxString const &s) |
| template<class Archive> | |
| void | save (Archive &archive, wxString const &d) |
| template<class Archive> | |
| void | load (Archive &archive, wxString &d) |
| template<class Archive> | |
| void | serialize (Archive &ar, FacenamesSerializer &t, const std::uint32_t version) |
| CEREAL_CLASS_VERSION (::FacenamesSerializer, FACENAMES_VERSION) | |
| std::string | anonymous_namespace{GLGizmoEmboss.cpp}::concat (std::vector< wxString > data) |
| boost::filesystem::path | anonymous_namespace{GLGizmoEmboss.cpp}::get_fontlist_cache_path () |
Variables | |
| const std::string | anonymous_namespace{GLGizmoEmboss.cpp}::rotation_snapshot_name = L("Text rotate") |
| const std::string | anonymous_namespace{GLGizmoEmboss.cpp}::move_snapshot_name = L("Text move") |
| static const struct anonymous_namespace{GLGizmoEmboss.cpp}::Limits | anonymous_namespace{GLGizmoEmboss.cpp}::limits |
| static const float | anonymous_namespace{GLGizmoEmboss.cpp}::SELECTABLE_INNER_OFFSET = 8.0f |
| const char *const | anonymous_namespace{GLGizmoEmboss.cpp}::default_text = L("Embossed text") |
| constexpr std::uint32_t | FACENAMES_VERSION = 1 |
| struct anonymous_namespace{GLGizmoEmboss.cpp}::Limit |
| struct anonymous_namespace{GLGizmoEmboss.cpp}::Limits |
| Class Members | ||
|---|---|---|
| MinMax< float > | angle {-180.f, 180.f} | |
| Limit< float > | boldness {{-.5f, .5f}, {-5e5f, 5e5f}} | |
| MinMax< int > | char_gap {-20000, 20000} | |
| MinMax< double > | emboss {0.01, 1e4} | |
| MinMax< int > | line_gap {-20000, 20000} | |
| MinMax< float > | size_in_mm {0.1f, 1000.f} | |
| Limit< float > | skew {{-1.f, 1.f}, {-100.f, 100.f}} | |
| struct anonymous_namespace{GLGizmoEmboss.cpp}::FaceName |
| struct anonymous_namespace{GLGizmoEmboss.cpp}::GuiCfg |
| Class Members | ||
|---|---|---|
| float | advanced_input_offset = 0.f | |
| bool | dark_mode = false | |
| float | delete_pos_x = 0.f | |
| Vec2i32 | face_name_size = Vec2i32(0, 0) | |
| float | face_name_texture_offset_x = 0.f | |
| float | height_of_volume_type_selector = 0.f | |
| unsigned int | icon_width = 0 | |
| float | indent = 0.f | |
| float | input_offset = 0.f | |
| float | input_width = 0.f | |
| float | lock_offset = 0.f | |
| unsigned int | max_count_opened_font_files = 10 | |
| Vec2i32 | max_style_image_size = Vec2i32(0, 0) | |
| float | max_style_name_width = 0.f | |
| float | max_tooltip_width = 0.f | |
| double | screen_scale | |
| ImVec2 | text_size | |
| Translations | translations | |
| struct anonymous_namespace{GLGizmoEmboss.cpp}::GuiCfg::Translations |
| struct FacenamesSerializer |
| #define IMGUI_DEFINE_MATH_OPERATORS |
| CEREAL_CLASS_VERSION | ( | ::FacenamesSerializer | , |
| FACENAMES_VERSION | ) |
References FACENAMES_VERSION.
| bool exist_change | ( | const float & | value, |
| const float * | default_value ) |
References Slic3r::is_approx().
| bool exist_change | ( | const std::optional< float > & | value, |
| const std::optional< float > * | default_value ) |
References Slic3r::is_approx().
| bool exist_change | ( | const T & | value, |
| const T * | default_value ) |
Referenced by Slic3r::GUI::GLGizmoEmboss::calculate_scale(), Slic3r::GUI::GLGizmoEmboss::draw_advanced(), Slic3r::GUI::GLGizmoEmboss::draw_delete_style_button(), Slic3r::GUI::GLGizmoEmboss::draw_font_list_line(), and Slic3r::GUI::GLGizmoEmboss::revertible().
|
static |
| bool imgui_input | ( | const char * | label, |
| double * | v, | ||
| double | step, | ||
| double | step_fast, | ||
| const char * | format, | ||
| ImGuiInputTextFlags | flags ) |
| bool imgui_input | ( | const char * | label, |
| float * | v, | ||
| float | step, | ||
| float | step_fast, | ||
| const char * | format, | ||
| ImGuiInputTextFlags | flags ) |
| bool imgui_input | ( | const char * | label, |
| T * | v, | ||
| T | step, | ||
| T | step_fast, | ||
| const char * | format, | ||
| ImGuiInputTextFlags | flags ) |
References Slic3r::format().
Referenced by Slic3r::GUI::GLGizmoEmboss::rev_input().
| void load | ( | Archive & | archive, |
| wxString & | d ) |
Referenced by Slic3r::MachineObject::command_ams_change_filament(), glad_gl_load_GL_ARB_framebuffer_object(), glad_gl_load_GL_ES_VERSION_2_0(), glad_gl_load_GL_ES_VERSION_3_0(), glad_gl_load_GL_EXT_framebuffer_blit(), glad_gl_load_GL_EXT_framebuffer_multisample(), glad_gl_load_GL_EXT_framebuffer_object(), glad_gl_load_GL_VERSION_1_0(), glad_gl_load_GL_VERSION_1_1(), glad_gl_load_GL_VERSION_1_2(), glad_gl_load_GL_VERSION_1_3(), glad_gl_load_GL_VERSION_1_4(), glad_gl_load_GL_VERSION_1_5(), glad_gl_load_GL_VERSION_2_0(), glad_gl_load_GL_VERSION_2_1(), glad_gl_load_GL_VERSION_3_0(), glad_gl_load_GL_VERSION_3_1(), glad_gl_load_GL_VERSION_3_2(), glad_gl_load_GL_VERSION_3_3(), glad_gl_load_GL_VERSION_4_0(), glad_gl_load_GL_VERSION_4_1(), glad_gl_load_GL_VERSION_4_2(), glad_gl_load_GL_VERSION_4_3(), glad_gl_load_GL_VERSION_4_4(), glad_gl_load_GL_VERSION_4_5(), glad_gl_load_GL_VERSION_4_6(), gladLoadGL(), gladLoadGLES2(), gladLoadGLES2UserPtr(), gladLoadGLUserPtr(), Slic3r::GUI::DesignRowList::load_icons(), Slic3r::PresetBundle::load_vendors(), Slic3r::GUI::AMSextruder::OnAmsLoading(), Slic3r::GUI::AMSextruderImage::OnAmsLoading(), Slic3r::GUI::AMSextruder::OnVamsLoading(), Slic3r::GUI::AMSRoad::OnVamsLoading(), Slic3r::GUI::AMSRoadDownPart::OnVamsLoading(), Slic3r::GUI::AMSRoadUpPart::OnVamsLoading(), and Slic3r::GUI::GuideFrame::SetStartPage().
| void save | ( | Archive & | archive, |
| wxString const & | d ) |
Referenced by QuadricEdgeCollapse::change_neighbors(), Slic3r::MachineObject::command_set_save_remote_print_file_to_storage(), and Slic3r::PhysicalPrinterCollection::load_printer().
| void serialize | ( | Archive & | ar, |
| FacenamesSerializer & | t, | ||
| const std::uint32_t | version ) |
References FacenamesSerializer::bad, FACENAMES_VERSION, FacenamesSerializer::good, and FacenamesSerializer::hash.
Referenced by Slic3r::GUI::get_string_value(), Slic3r::CLI::run(), and Slic3r::TriangleSelector::serialize().
|
constexpr |
Referenced by CEREAL_CLASS_VERSION(), and serialize().