Classes | |
| struct | Limits |
| struct | GuiCfg |
Enumerations | |
| enum class | IconType : unsigned { reset_value , refresh , change_file , bake , save , exclamation , lock , unlock , reflection_x , reflection_y , _count } |
| enum class | IconState : unsigned { activable = 0 , hovered , disabled } |
Functions | |
| std::string | choose_svg_file () |
| Open file dialog with svg files. | |
| double | get_tesselation_tolerance (double scale) |
| EmbossShape | select_shape (std::string_view filepath="", double tesselation_tolerance_in_mm=get_tesselation_tolerance(1.)) |
| Let user to choose file with (S)calable (V)ector (G)raphics - SVG. Than let select contour. | |
| DataBasePtr | create_emboss_data_base (std::shared_ptr< std::atomic< bool > > &cancel, ModelVolumeType volume_type, std::string_view filepath="") |
| Create new embos data. | |
| std::string | get_file_name (const std::string &file_path) |
| Separate file name from file path. String after last delimiter and before last point. | |
| std::string | volume_name (const EmbossShape &shape) |
| Create volume name from shape information. | |
| CreateVolumeParams | create_input (GLCanvas3D &canvas, RaycastManager &raycaster, ModelVolumeType volume_type) |
| Create input for volume creation. | |
| const IconManager::Icon & | get_icon (const IconManager::VIcons &icons, IconType type, IconState state) |
| GuiCfg | create_gui_configuration () |
| IconManager::VIcons | init_icons (IconManager &mng, const GuiCfg &cfg) |
| bool | draw_clickable (const IconManager::VIcons &icons, IconType type) |
| bool | reset_button (const IconManager::VIcons &icons) |
| void | wu_draw_line_side (Linef line, const std::function< void(int x, int y, float brightess)> &plot) |
| template<unsigned int N> | |
| void | draw_side_outline (const ExPolygons &shape, const std::array< unsigned char, N > &color, std::vector< unsigned char > &data, size_t data_width, double scale) |
| template<unsigned int N> | |
| void | draw_filled (const ExPolygons &shape, const std::array< unsigned char, N > &color, std::vector< unsigned char > &data, size_t data_width, double scale) |
| Draw filled ExPolygon into data line by line inspired by: http://alienryderflex.com/polygon_fill/. | |
| ExPolygons | union_ex (const ExPolygonsWithIds &shapes) |
| Union shape defined by glyphs. | |
| bool | init_texture (Texture &texture, const ExPolygonsWithIds &shapes_with_ids, unsigned max_size_px, const std::vector< std::string > &shape_warnings) |
| bool | is_closed (NSVGpath *path) |
| void | add_comma_separated (std::string &result, const std::string &add) |
| std::string | create_fill_warning (const NSVGshape &shape) |
| std::string | create_stroke_warning (const NSVGshape &shape) |
| std::vector< std::string > | create_shape_warnings (const EmbossShape &shape, float scale) |
| Create warnings about shape. | |
| void | delete_texture (Texture &texture) |
Variables | |
| const std::string | rotation_snapshot_name = L("SVG rotate") |
| const std::string | move_snapshot_name = L("SVG move") |
| const struct anonymous_namespace{GLGizmoSVG.cpp}::Limits | limits |
| wxString | last_used_directory = wxEmptyString |
| const float | warning_preccission = 1e-4f |
| struct anonymous_namespace{GLGizmoSVG.cpp}::Limits |
| Class Members | ||
|---|---|---|
| MinMax< float > | angle {-180.f, 180.f} | |
| MinMax< double > | depth {0.01, 1e4} | |
| MinMax< double > | relative_scale_ratio {1e-5, 1e4} | |
| MinMax< float > | size {0.01f, 1e4f} | |
| MinMax< float > | ui_size {5.f, 100.f} | |
| MinMax< float > | ui_size_in {.1f, 4.f} | |
| struct anonymous_namespace{GLGizmoSVG.cpp}::GuiCfg |
| Class Members | ||
|---|---|---|
| bool | dark_mode = false | |
| float | icon_width = 0.f | |
| float | input_offset = 0.f | |
| float | input_width = 0.f | |
| float | lock_offset = 0.f | |
| float | max_tooltip_width = 0.f | |
| double | screen_scale = -1. | |
| unsigned | texture_max_size_px = 256 | |
| Translations | translations | |
|
strong |
|
strong |
| Enumerator | |
|---|---|
| reset_value | |
| refresh | |
| change_file | |
| bake | |
| save | |
| exclamation | |
| lock | |
| unlock | |
| reflection_x | |
| reflection_y | |
| _count | |
| void anonymous_namespace{GLGizmoSVG.cpp}::add_comma_separated | ( | std::string & | result, |
| const std::string & | add ) |
References add_comma_separated().
Referenced by add_comma_separated(), create_fill_warning(), and create_stroke_warning().
| std::string anonymous_namespace{GLGizmoSVG.cpp}::choose_svg_file | ( | ) |
Open file dialog with svg files.
References _L, choose_svg_file(), Slic3r::GUI::file_wildcards(), Slic3r::GUI::FT_SVG, Slic3r::GUI::into_u8(), last_used_directory, and style.
Referenced by choose_svg_file(), and select_shape().
| DataBasePtr anonymous_namespace{GLGizmoSVG.cpp}::create_emboss_data_base | ( | std::shared_ptr< std::atomic< bool > > & | cancel, |
| ModelVolumeType | volume_type, | ||
| std::string_view | filepath = "" ) |
Create new embos data.
| cancel | Cancel for previous job |
| volume_type | To distiquish whether it is outside of model |
| filepath | SVG file path |
References create_emboss_data_base(), Slic3r::MODEL_PART, select_shape(), Slic3r::EmbossShape::shapes_with_ids, and volume_name().
Referenced by create_emboss_data_base().
| std::string anonymous_namespace{GLGizmoSVG.cpp}::create_fill_warning | ( | const NSVGshape & | shape | ) |
References _L, _u8L, add_comma_separated(), create_fill_warning(), Slic3r::GUI::format(), is_closed(), and warning_preccission.
Referenced by create_fill_warning(), and create_shape_warnings().
| GuiCfg anonymous_namespace{GLGizmoSVG.cpp}::create_gui_configuration | ( | ) |
References _u8L, create_gui_configuration(), anonymous_namespace{GLGizmoSVG.cpp}::GuiCfg::Translations::depth, anonymous_namespace{GLGizmoSVG.cpp}::GuiCfg::Translations::distance, anonymous_namespace{GLGizmoSVG.cpp}::GuiCfg::icon_width, anonymous_namespace{GLGizmoSVG.cpp}::GuiCfg::input_offset, anonymous_namespace{GLGizmoSVG.cpp}::GuiCfg::input_width, anonymous_namespace{GLGizmoSVG.cpp}::GuiCfg::lock_offset, anonymous_namespace{GLGizmoSVG.cpp}::GuiCfg::max_tooltip_width, anonymous_namespace{GLGizmoSVG.cpp}::GuiCfg::Translations::mirror, anonymous_namespace{GLGizmoSVG.cpp}::GuiCfg::Translations::rotation, anonymous_namespace{GLGizmoSVG.cpp}::GuiCfg::Translations::size, style, anonymous_namespace{GLGizmoSVG.cpp}::GuiCfg::texture_max_size_px, anonymous_namespace{GLGizmoSVG.cpp}::GuiCfg::translations, and anonymous_namespace{GLGizmoSVG.cpp}::GuiCfg::Translations::use_surface.
Referenced by create_gui_configuration().
| CreateVolumeParams anonymous_namespace{GLGizmoSVG.cpp}::create_input | ( | GLCanvas3D & | canvas, |
| RaycastManager & | raycaster, | ||
| ModelVolumeType | volume_type ) |
Create input for volume creation.
| canvas | parent of gizmo |
| raycaster | Keep scene |
| volume_type | Type of volume to be created |
References create_input(), Slic3r::GUI::get_first_hovered_gl_volume(), Slic3r::GUI::plater(), and Slic3r::GUI::GLGizmosManager::Svg.
Referenced by create_input().
| std::vector< std::string > anonymous_namespace{GLGizmoSVG.cpp}::create_shape_warnings | ( | const EmbossShape & | shape, |
| float | scale ) |
Create warnings about shape.
| image | Input svg loaded to shapes |
References _L, _u8L, create_fill_warning(), create_shape_warnings(), create_stroke_warning(), Slic3r::EmbossShape::final_shape, Slic3r::GUI::format(), Slic3r::get_shapes_count(), Slic3r::ExPolygonsWithId::id, Slic3r::ExPolygonsWithId::is_healed, Slic3r::HealedExPolygons::is_healed, scale(), Slic3r::EmbossShape::shapes_with_ids, and Slic3r::EmbossShape::svg_file.
Referenced by create_shape_warnings().
| std::string anonymous_namespace{GLGizmoSVG.cpp}::create_stroke_warning | ( | const NSVGshape & | shape | ) |
References _L, _u8L, add_comma_separated(), create_stroke_warning(), Slic3r::GUI::format(), and warning_preccission.
Referenced by create_shape_warnings(), and create_stroke_warning().
| void anonymous_namespace{GLGizmoSVG.cpp}::delete_texture | ( | Texture & | texture | ) |
References delete_texture(), glDeleteTextures, glsafe, and Slic3r::GUI::Texture::id.
Referenced by delete_texture().
| bool anonymous_namespace{GLGizmoSVG.cpp}::draw_clickable | ( | const IconManager::VIcons & | icons, |
| IconType | type ) |
References activable, Slic3r::GUI::clickable(), draw_clickable(), get_icon(), and hovered.
Referenced by draw_clickable().
| void anonymous_namespace{GLGizmoSVG.cpp}::draw_filled | ( | const ExPolygons & | shape, |
| const std::array< unsigned char, N > & | color, | ||
| std::vector< unsigned char > & | data, | ||
| size_t | data_width, | ||
| double | scale ) |
Draw filled ExPolygon into data line by line inspired by: http://alienryderflex.com/polygon_fill/.
| N | Count channels for one pixel(RGBA = 4) |
| shape | Shape to draw |
| color | Color of shape contain count of channels(N) |
| data | Image(2d) stored in 1d array |
| data_width | Count of pixel on one line(size in data = N x data_width) |
| scale | Shape scale for conversion to pixels |
References Slic3r::Linef::a, Slic3r::Linef::b, Slic3r::AABBTreeLines::build_aabb_tree_over_indexed_lines(), Slic3r::GUI::draw(), draw_filled(), Slic3r::get_extents(), Slic3r::AABBTreeLines::get_intersections_with_line(), Slic3r::is_approx(), Slic3r::BoundingBoxBase< PointType, APointsType >::max, Slic3r::BoundingBoxBase< PointType, APointsType >::min, Slic3r::GUI::N, Slic3r::offset(), scale(), Slic3r::to_linesf(), and wu_draw_line_side().
Referenced by draw_filled(), and init_texture().
| void anonymous_namespace{GLGizmoSVG.cpp}::draw_side_outline | ( | const ExPolygons & | shape, |
| const std::array< unsigned char, N > & | color, | ||
| std::vector< unsigned char > & | data, | ||
| size_t | data_width, | ||
| double | scale ) |
References Slic3r::Linef::a, Slic3r::Linef::b, Slic3r::GUI::draw(), draw_side_outline(), Slic3r::get_extents(), Slic3r::is_approx(), Slic3r::BoundingBoxBase< PointType, APointsType >::max, Slic3r::BoundingBoxBase< PointType, APointsType >::min, Slic3r::GUI::N, Slic3r::offset(), scale(), Slic3r::to_linesf(), and wu_draw_line_side().
Referenced by draw_side_outline(), and init_texture().
| std::string anonymous_namespace{GLGizmoSVG.cpp}::get_file_name | ( | const std::string & | file_path | ) |
Separate file name from file path. String after last delimiter and before last point.
| file_path | path return by file dialog |
References count, get_file_name(), and Slic3r::offset().
Referenced by get_file_name(), and volume_name().
| const IconManager::Icon & anonymous_namespace{GLGizmoSVG.cpp}::get_icon | ( | const IconManager::VIcons & | icons, |
| IconType | type, | ||
| IconState | state ) |
References get_icon().
Referenced by draw_clickable(), get_icon(), and reset_button().
| double anonymous_namespace{GLGizmoSVG.cpp}::get_tesselation_tolerance | ( | double | scale | ) |
References get_tesselation_tolerance(), scale(), and SCALING_FACTOR.
Referenced by get_tesselation_tolerance().
| IconManager::VIcons anonymous_namespace{GLGizmoSVG.cpp}::init_icons | ( | IconManager & | mng, |
| const GuiCfg & | cfg ) |
References _count, Slic3r::GUI::IconManager::color_wite_gray, anonymous_namespace{GLGizmoSVG.cpp}::GuiCfg::icon_width, Slic3r::GUI::IconManager::init(), init_icons(), Slic3r::GUI::IconManager::release(), and Slic3r::resources_dir().
Referenced by init_icons().
| bool anonymous_namespace{GLGizmoSVG.cpp}::init_texture | ( | Texture & | texture, |
| const ExPolygonsWithIds & | shapes_with_ids, | ||
| unsigned | max_size_px, | ||
| const std::vector< std::string > & | shape_warnings ) |
References draw_filled(), draw_side_outline(), Slic3r::get_extents(), GL_LINEAR, GL_RGBA, GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_TEXTURE_MAX_LEVEL, GL_TEXTURE_MIN_FILTER, GL_UNPACK_ALIGNMENT, GL_UNSIGNED_BYTE, glBindTexture, glDeleteTextures, glGenTextures, glPixelStorei, glsafe, glTexImage2D, glTexParameteri, Slic3r::GUI::Texture::height, Slic3r::GUI::Texture::id, init_texture(), Slic3r::BoundingBoxBase< PointType, APointsType >::min, scale(), Slic3r::BoundingBoxBase< PointType, APointsType >::size(), Slic3r::translate(), Slic3r::union_ex(), and Slic3r::GUI::Texture::width.
Referenced by init_texture().
| bool anonymous_namespace{GLGizmoSVG.cpp}::is_closed | ( | NSVGpath * | path | ) |
References is_closed().
Referenced by create_fill_warning(), and is_closed().
| bool anonymous_namespace{GLGizmoSVG.cpp}::reset_button | ( | const IconManager::VIcons & | icons | ) |
References Slic3r::GUI::clickable(), get_icon(), hovered, reset_button(), and reset_value.
Referenced by reset_button().
| EmbossShape anonymous_namespace{GLGizmoSVG.cpp}::select_shape | ( | std::string_view | filepath = "", |
| double | tesselation_tolerance_in_mm = get_tesselation_tolerance(1.) ) |
Let user to choose file with (S)calable (V)ector (G)raphics - SVG. Than let select contour.
| filepath | SVG file path, when empty promt user to select one |
References _u8L, choose_svg_file(), Slic3r::create_shape_with_ids(), Slic3r::EmbossProjection::depth, Slic3r::GUI::format(), Slic3r::EmbossShape::SvgFile::image, Slic3r::init_image(), Slic3r::EmbossShape::SvgFile::path, Slic3r::EmbossShape::projection, select_shape(), Slic3r::EmbossShape::shapes_with_ids, Slic3r::GUI::show_error(), Slic3r::EmbossShape::svg_file, and Slic3r::EmbossProjection::use_surface.
Referenced by create_emboss_data_base(), and select_shape().
| ExPolygons anonymous_namespace{GLGizmoSVG.cpp}::union_ex | ( | const ExPolygonsWithIds & | shapes | ) |
Union shape defined by glyphs.
References Slic3r::expolygons_append(), and Slic3r::union_ex().
| std::string anonymous_namespace{GLGizmoSVG.cpp}::volume_name | ( | const EmbossShape & | shape | ) |
Create volume name from shape information.
| shape | File path |
References _u8L, get_file_name(), Slic3r::EmbossShape::svg_file, and volume_name().
Referenced by create_emboss_data_base(), and volume_name().
| void anonymous_namespace{GLGizmoSVG.cpp}::wu_draw_line_side | ( | Linef | line, |
| const std::function< void(int x, int y, float brightess)> & | plot ) |
References Slic3r::Linef::a, Slic3r::Linef::b, and wu_draw_line_side().
Referenced by draw_filled(), draw_side_outline(), and wu_draw_line_side().
| wxString anonymous_namespace{GLGizmoSVG.cpp}::last_used_directory = wxEmptyString |
Referenced by choose_svg_file().
| const struct anonymous_namespace{GLGizmoSVG.cpp}::Limits anonymous_namespace{GLGizmoSVG.cpp}::limits |
| const std::string anonymous_namespace{GLGizmoSVG.cpp}::move_snapshot_name = L("SVG move") |
| const std::string anonymous_namespace{GLGizmoSVG.cpp}::rotation_snapshot_name = L("SVG rotate") |
| const float anonymous_namespace{GLGizmoSVG.cpp}::warning_preccission = 1e-4f |
Referenced by create_fill_warning(), and create_stroke_warning().