OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::GUI::GLGizmoSVG Class Reference

#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/Gizmos/GLGizmoSVG.hpp>

Inheritance diagram for Slic3r::GUI::GLGizmoSVG:
Collaboration diagram for Slic3r::GUI::GLGizmoSVG:

Classes

struct  GuiCfg

Public Types

enum class  EGrabberExtension {
  None = 0 , PosX = 1 << 0 , NegX = 1 << 1 , PosY = 1 << 2 ,
  NegY = 1 << 3 , PosZ = 1 << 4 , NegZ = 1 << 5
}
enum  EState { Off , On , Num_States }

Public Member Functions

 GLGizmoSVG (GLCanvas3D &parent)
bool create_volume (ModelVolumeType volume_type, const Vec2d &mouse_pos)
 Create new embossed text volume by type on position of mouse.
bool create_volume (ModelVolumeType volume_type)
 Create new text without given position.
bool create_volume (std::string_view svg_file, const Vec2d &mouse_pos, ModelVolumeType volume_type=ModelVolumeType::MODEL_PART)
 Create volume from already selected svg file.
bool create_volume (std::string_view svg_file, ModelVolumeType volume_type=ModelVolumeType::MODEL_PART)
bool init ()
void load (cereal::BinaryInputArchive &ar)
void save (cereal::BinaryOutputArchive &ar) const
std::string get_name (bool include_shortcut=true) const
EState get_state () const
void set_state (EState state)
std::optional< Shortcut > shortcut () const
const std::string & get_icon_filename () const
void set_icon_filename (const std::string &filename)
bool is_activable () const
bool is_selectable () const
CommonGizmosDataID get_requirements () const
virtual bool render_follows_cursor () const
void set_common_data_pool (CommonGizmosDataPool *ptr)
virtual bool apply_clipping_plane ()
unsigned int get_sprite_id () const
int get_hover_id () const
void set_hover_id (int id)
bool is_dragging () const
bool update_items_state ()
void render ()
void render_input_window (float x, float y, float bottom_limit)
virtual void on_change_color_mode (bool is_dark)
virtual std::string get_tooltip () const
 Mouse tooltip text.
int get_count ()
std::string get_gizmo_name ()
void register_raycasters_for_picking ()
void unregister_raycasters_for_picking ()
virtual bool is_in_editing_mode () const
virtual bool is_selection_rectangle_dragging () const

Static Public Member Functions

static bool is_svg_object (const ModelVolume &volume)
 Check whether volume is object containing only emboss volume.
static bool is_svg (const ModelVolume &volume)
 Check whether volume has emboss data.
static void update_render_colors ()
static void load_render_colors ()

Static Public Attributes

static const unsigned int BASE_ID = 255 * 255 * 254
static const unsigned int GRABBER_ELEMENTS_MAX_COUNT = 7
static float INV_ZOOM = 1.0f
static ColorRGBA DEFAULT_BASE_COLOR = { 0.625f, 0.625f, 0.625f, 1.0f }
static ColorRGBA DEFAULT_DRAG_COLOR = { 1.0f, 1.0f, 1.0f, 1.0f }
static ColorRGBA DEFAULT_HIGHLIGHT_COLOR = {1.0f, 0.38f, 0.0f, 1.0f}
static std::array< ColorRGBA, 3 > AXES_COLOR
static std::array< ColorRGBA, 3 > AXES_HOVER_COLOR
static ColorRGBA CONSTRAINED_COLOR = {0.5f, 0.5f, 0.5f, 1.0f}
static ColorRGBA FLATTEN_COLOR = {0.96f, 0.93f, 0.93f, 0.5f}
static ColorRGBA FLATTEN_HOVER_COLOR = {1.0f, 1.0f, 1.0f, 0.75f}
static ColorRGBA GRABBER_NORMAL_COL = {1.0f, 1.0f, 1.0f, 1.0f}
static ColorRGBA GRABBER_HOVER_COL = {0.863f, 0.125f, 0.063f, 1.0f}
static ColorRGBA GRABBER_UNIFORM_COL = {0, 1.0, 1.0, 1.0f}
static ColorRGBA GRABBER_UNIFORM_HOVER_COL = {0, 0.7, 0.7, 1.0f}

Protected Member Functions

bool on_init () override
std::string on_get_name () const override
void on_render () override
void on_register_raycasters_for_picking () override
void on_unregister_raycasters_for_picking () override
void on_render_input_window (float x, float y, float bottom_limit) override
bool on_is_activable () const override
bool on_is_selectable () const override
void on_set_state () override
void data_changed (bool is_serializing) override
 Is called when data (Selection) is changed.
void on_set_hover_id () override
void on_enable_grabber (unsigned int id) override
void on_disable_grabber (unsigned int id) override
void on_start_dragging () override
void on_stop_dragging () override
void on_dragging (const UpdateData &data) override
bool on_mouse (const wxMouseEvent &mouse_event) override
 Rotate by text on dragging rotate grabers.
bool wants_enter_leave_snapshots () const override
std::string get_gizmo_entering_text () const override
std::string get_gizmo_leaving_text () const override
std::string get_action_snapshot_name () const override
bool render_combo (const std::string &label, const std::vector< std::string > &lines, int &selection_idx, float label_width, float item_width)
void render_cross_mark (const Vec3f &target, bool is_single=false)
virtual void on_load (cereal::BinaryInputArchive &ar)
virtual void on_save (cereal::BinaryOutputArchive &ar) const
virtual CommonGizmosDataID on_get_requirements () const
bool GizmoImguiBegin (const std::string &name, int flags)
void GizmoImguiEnd ()
void GizmoImguiSetNextWIndowPos (float &x, float y, int flag, float pivot_x=0.0f, float pivot_y=0.0f)
void GizmoImguiSetNextWIndowPos (float &x, float y, float w, float h, int flag, float pivot_x=0.0f, float pivot_y=0.0f)
void register_grabbers_for_picking ()
void unregister_grabbers_for_picking ()
void render_grabbers (const BoundingBoxf3 &box) const
void render_grabbers (float size) const
void render_grabbers (size_t first, size_t last, float size, bool force_hover) const
std::string format (float value, unsigned int decimals) const
void set_dirty ()
bool use_grabbers (const wxMouseEvent &mouse_event)
 function which Set up m_dragging and call functions on_start_dragging / on_dragging / on_stop_dragging
void do_stop_dragging (bool perform_mouse_cleanup)

Protected Attributes

GLCanvas3D & m_parent
int m_group_id
EState m_state
std::optional< Shortcut > m_shortcut
std::string m_icon_filename
unsigned int m_sprite_id
int m_hover_id { -1 }
bool m_dragging { false }
std::vector< Grabber > m_grabbers
ImGuiWrapper * m_imgui
bool m_first_input_window_render { true }
CommonGizmosDataPool * m_c { nullptr }
bool m_is_dark_mode = false
float last_input_window_width = 0

Private Member Functions

void set_volume_by_selection ()
void reset_volume ()
bool process (bool make_snapshot=true)
void close ()
void draw_window ()
void draw_preview ()
void draw_filename ()
void draw_depth ()
void draw_size ()
void draw_use_surface ()
void draw_distance ()
void draw_rotation ()
void draw_mirroring ()
void draw_face_the_camera ()
void draw_model_type ()
bool on_mouse_for_rotation (const wxMouseEvent &mouse_event)
bool on_mouse_for_translate (const wxMouseEvent &mouse_event)
void volume_transformation_changed ()
void calculate_scale ()
float get_scale_for_tolerance ()

Private Attributes

std::unique_ptr< const GuiCfg > m_gui_cfg
ModelVolume * m_volume = nullptr
EmbossShape m_volume_shape
std::vector< std::string > m_shape_warnings
ObjectID m_volume_id
std::shared_ptr< std::atomic< bool > > m_job_cancel = nullptr
GLGizmoRotate m_rotate_gizmo
std::optional< float > m_angle
std::optional< float > m_distance
std::optional< float > m_rotate_start_angle
RaycastManager m_raycast_manager
bool m_keep_up = true
bool m_keep_ratio = true
std::optional< SurfaceDrag > m_surface_drag
std::optional< float > m_scale_width
std::optional< float > m_scale_height
std::optional< float > m_scale_depth
Texture m_texture
BoundingBox m_shape_bb
std::string m_filename_preview
IconManager m_icon_manager
IconManager::VIcons m_icons
bool m_dirty { false }
int count = 0

Static Private Attributes

static const std::string M_ICON_FILENAME = "cut.svg"

Detailed Description

Member Enumeration Documentation

◆ EGrabberExtension

enum class Slic3r::GUI::GLGizmoBase::EGrabberExtension
stronginherited
Enumerator
None 
PosX 
NegX 
PosY 
NegY 
PosZ 
NegZ 
74 {
75 None = 0,
76 PosX = 1 << 0,
77 NegX = 1 << 1,
78 PosY = 1 << 2,
79 NegY = 1 << 3,
80 PosZ = 1 << 4,
81 NegZ = 1 << 5,
82 };
@ PosX
Definition PrintConfig.hpp:350
@ NegY
Definition PrintConfig.hpp:351
@ NegX
Definition PrintConfig.hpp:351
@ PosY
Definition PrintConfig.hpp:350
@ NegZ
Definition PrintConfig.hpp:351
@ PosZ
Definition PrintConfig.hpp:350
@ None
Definition SketchEngine.hpp:180

◆ EState

Enumerator
Off 
On 
Num_States 
126 {
127 Off,
128 On,
130 };
@ On
Definition GLGizmoBase.hpp:128
@ Num_States
Definition GLGizmoBase.hpp:129
@ Off
Definition GLGizmoBase.hpp:127

Constructor & Destructor Documentation

◆ GLGizmoSVG()

GLGizmoSVG::GLGizmoSVG ( GLCanvas3D & parent)
explicit
84 : GLGizmoBase(parent, M_ICON_FILENAME, -3)
85 , m_gui_cfg(nullptr)
86 , m_rotate_gizmo(parent, GLGizmoRotate::Axis::Z) // grab id = 2 (Z axis)
87{
88 m_rotate_gizmo.set_group_id(0);
89 m_rotate_gizmo.set_force_local_coordinate(true);
90}
GLGizmoBase(GLCanvas3D &parent, const std::string &icon_filename, unsigned int sprite_id)
Definition GLGizmoBase.cpp:327
@ Z
Definition GLGizmoRotate.hpp:36
GLGizmoRotate m_rotate_gizmo
Definition GLGizmoSVG.hpp:162
std::unique_ptr< const GuiCfg > m_gui_cfg
Definition GLGizmoSVG.hpp:142
static const std::string M_ICON_FILENAME
Definition GLGizmoSVG.hpp:202

References Slic3r::GUI::GLGizmoBase::GLGizmoBase(), m_gui_cfg, M_ICON_FILENAME, m_rotate_gizmo, and Slic3r::Z.

Here is the call graph for this function:

Member Function Documentation

◆ apply_clipping_plane()

virtual bool Slic3r::GUI::GLGizmoBase::apply_clipping_plane ( )
inlinevirtualinherited
195{ return true; }

Referenced by Slic3r::GUI::GLCanvas3D::_render_objects(), and Slic3r::GUI::GLCanvas3D::get_raycaster_clipping_plane().

Here is the caller graph for this function:

◆ calculate_scale()

void GLGizmoSVG::calculate_scale ( )
private
1272 {
1273 // be carefull m_volume is not set yet
1274 const Selection &selection = m_parent.get_selection();
1275 const GLVolume *gl_volume = selection.get_first_volume();
1276 if (gl_volume == nullptr)
1277 return;
1278
1279 Transform3d to_world = gl_volume->world_matrix();
1280
1281 const ModelVolume *volume_ptr = get_model_volume(*gl_volume, selection.get_model()->objects);
1282 assert(volume_ptr != nullptr);
1283 assert(volume_ptr->emboss_shape.has_value());
1284 // Fix for volume loaded from 3mf
1285 if (volume_ptr != nullptr &&
1286 volume_ptr->emboss_shape.has_value()) {
1287 const std::optional<Transform3d> &fix_tr = volume_ptr->emboss_shape->fix_3mf_tr;
1288 if (fix_tr.has_value())
1289 to_world = to_world * (fix_tr->inverse());
1290 }
1291
1292 auto to_world_linear = to_world.linear();
1293 auto calc = [&to_world_linear](const Vec3d &axe, std::optional<float>& scale) {
1294 Vec3d axe_world = to_world_linear * axe;
1295 double norm_sq = axe_world.squaredNorm();
1296 if (is_approx(norm_sq, 1.)) {
1297 if (!scale.has_value())
1298 return;
1299 scale.reset();
1300 } else {
1301 scale = sqrt(norm_sq);
1302 }
1303 };
1304
1305 calc(Vec3d::UnitX(), m_scale_width);
1306 calc(Vec3d::UnitY(), m_scale_height);
1307 calc(Vec3d::UnitZ(), m_scale_depth);
1308}
int scale(const int val)
Definition WipeTowerDialog.cpp:58
Transform3d world_matrix() const
Definition 3DScene.cpp:447
GLCanvas3D & m_parent
Definition GLGizmoBase.hpp:143
std::optional< float > m_scale_depth
Definition GLGizmoSVG.hpp:185
std::optional< float > m_scale_height
Definition GLGizmoSVG.hpp:184
std::optional< float > m_scale_width
Definition GLGizmoSVG.hpp:183
Model * get_model() const
Definition Selection.hpp:219
const GLVolume * get_first_volume() const
Definition Selection.hpp:317
std::optional< EmbossShape > emboss_shape
Definition Model.hpp:1019
ModelObjectPtrs objects
Definition Model.hpp:1702
@ Selection
Definition Shortcuts.hpp:72
static ModelVolume * get_model_volume(const Selection &selection, Model &model)
Definition GLGizmoBrimEars.cpp:66
Eigen::Matrix< double, 3, 1, Eigen::DontAlign > Vec3d
Definition Point.hpp:68
Eigen::Transform< double, 3, Eigen::Affine, Eigen::DontAlign > Transform3d
Definition Point.hpp:96
constexpr bool is_approx(Number value, Number test_value, Number precision=EPSILON)
Definition libslic3r.h:320

References Slic3r::ModelVolume::emboss_shape, Slic3r::GUI::Selection::get_first_volume(), Slic3r::GUI::Selection::get_model(), Slic3r::GUI::get_model_volume(), Slic3r::is_approx(), Slic3r::GUI::GLGizmoBase::m_parent, m_scale_depth, m_scale_height, m_scale_width, Slic3r::Model::objects, scale(), and Slic3r::GLVolume::world_matrix().

Referenced by draw_size(), on_mouse_for_translate(), set_volume_by_selection(), and volume_transformation_changed().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ close()

void GLGizmoSVG::close ( )
private
1339{
1340 // close gizmo == open it again
1341 auto &mng = m_parent.get_gizmos_manager();
1342 if (mng.get_current_type() == GLGizmosManager::Svg)
1343 mng.open_gizmo(GLGizmosManager::Svg);
1344 reset_volume();
1345}
void reset_volume()
Definition GLGizmoSVG.cpp:1258
@ Svg
Definition GLGizmosManager.hpp:100

References Slic3r::GUI::GLGizmoBase::m_parent, reset_volume(), and Slic3r::GUI::GLGizmosManager::Svg.

Referenced by data_changed(), and draw_filename().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_volume() [1/4]

bool GLGizmoSVG::create_volume ( ModelVolumeType volume_type)

Create new text without given position.

Parameters
volume_typeObject part / Negative volume / Modifier
Returns
True on succesfull start creation otherwise False
243{
244 CreateVolumeParams input = create_input(m_parent, m_raycast_manager, volume_type);
246 if (!base) return false; // Uninterpretable svg
247 return start_create_volume_without_position(input, std::move(base));
248}
RaycastManager m_raycast_manager
Definition GLGizmoSVG.hpp:171
std::shared_ptr< std::atomic< bool > > m_job_cancel
Definition GLGizmoSVG.hpp:159
std::unique_ptr< DataBase > DataBasePtr
Definition EmbossJob.hpp:105
bool start_create_volume_without_position(CreateVolumeParams &input, DataBasePtr data)
Same as previous function but without mouse position Need to suggest position or put near the selecti...
Definition EmbossJob.cpp:616
std::unique_ptr< DataBase > 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.
Definition GLGizmoEmboss.cpp:3468
CreateVolumeParams create_input(GLCanvas3D &canvas, const StyleManager::Style &style, RaycastManager &raycaster, ModelVolumeType volume_type)
Definition GLGizmoEmboss.cpp:3521

References m_job_cancel, Slic3r::GUI::GLGizmoBase::m_parent, m_raycast_manager, and Slic3r::GUI::Emboss::start_create_volume_without_position().

Here is the call graph for this function:

◆ create_volume() [2/4]

bool GLGizmoSVG::create_volume ( ModelVolumeType volume_type,
const Vec2d & mouse_pos )

Create new embossed text volume by type on position of mouse.

Parameters
volume_typeObject part / Negative volume / Modifier
mouse_posDefine position of new volume
Returns
True on succesfull start creation otherwise False
235{
236 CreateVolumeParams input = create_input(m_parent, m_raycast_manager, volume_type);
238 if (!base) return false; // Uninterpretable svg
239 return start_create_volume(input, std::move(base), mouse_pos);
240}
bool start_create_volume(CreateVolumeParams &input, DataBasePtr data, const Vec2d &mouse_pos)
Create new volume on position of mouse cursor.
Definition EmbossJob.cpp:601

References m_job_cancel, Slic3r::GUI::GLGizmoBase::m_parent, m_raycast_manager, and Slic3r::GUI::Emboss::start_create_volume().

Referenced by Slic3r::GUI::add_volume_with_gizmo(), and Slic3r::GUI::anonymous_namespace{Plater.cpp}::emboss_svg().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_volume() [3/4]

bool GLGizmoSVG::create_volume ( std::string_view svg_file,
const Vec2d & mouse_pos,
ModelVolumeType volume_type = ModelVolumeType::MODEL_PART )

Create volume from already selected svg file.

Parameters
svg_fileFile path
mouse_posPosition on screen where to create volume
volume_typeObject part / Negative volume / Modifier
Returns
True on succesfull start creation otherwise False
258{
259 CreateVolumeParams input = create_input(m_parent, m_raycast_manager, volume_type);
260 DataBasePtr base = create_emboss_data_base(m_job_cancel, volume_type, svg_file);
261 if (!base) return false; // Uninterpretable svg
262 return start_create_volume(input, std::move(base), mouse_pos);
263}

References m_job_cancel, Slic3r::GUI::GLGizmoBase::m_parent, m_raycast_manager, and Slic3r::GUI::Emboss::start_create_volume().

Here is the call graph for this function:

◆ create_volume() [4/4]

bool GLGizmoSVG::create_volume ( std::string_view svg_file,
ModelVolumeType volume_type = ModelVolumeType::MODEL_PART )
250 {
251 CreateVolumeParams input = create_input(m_parent, m_raycast_manager, volume_type);
252 DataBasePtr base = create_emboss_data_base(m_job_cancel, volume_type, svg_file);
253 if (!base) return false; // Uninterpretable svg
254 return start_create_volume_without_position(input, std::move(base));
255}

References m_job_cancel, Slic3r::GUI::GLGizmoBase::m_parent, m_raycast_manager, and Slic3r::GUI::Emboss::start_create_volume_without_position().

Here is the call graph for this function:

◆ data_changed()

void GLGizmoSVG::data_changed ( bool is_serializing)
overrideprotectedvirtual

Is called when data (Selection) is changed.

Reimplemented from Slic3r::GUI::GLGizmoBase.

568 {
570 if (!is_serializing && m_volume == nullptr)
571 close();
572}
ModelVolume * m_volume
Definition GLGizmoSVG.hpp:145
void close()
Definition GLGizmoSVG.cpp:1338
void set_volume_by_selection()
Definition GLGizmoSVG.cpp:1187

References close(), m_volume, and set_volume_by_selection().

Here is the call graph for this function:

◆ do_stop_dragging()

void Slic3r::GUI::GLGizmoBase::do_stop_dragging ( bool perform_mouse_cleanup)
protectedinherited
494{
495 for (auto& grabber : m_grabbers) grabber.dragging = false;
496 m_dragging = false;
497
498 // NOTE: This should be part of GLCanvas3D
499 // Reset hover_id when leave window
500 if (perform_mouse_cleanup) m_parent.mouse_up_cleanup();
501
503
504 // There is prediction that after draggign, data are changed
505 // Data are updated twice also by canvas3D::reload_scene.
506 // Should be fixed.
507 m_parent.get_gizmos_manager().update_data();
508
509 wxGetApp().obj_manipul()->set_dirty();
510
511 // Let the plater know that the dragging finished, so a delayed
512 // refresh of the scene with the background processing data should
513 // be performed.
514 m_parent.post_event(SimpleEvent(EVT_GLCANVAS_MOUSE_DRAGGING_FINISHED));
515 // updates camera target constraints
516 m_parent.refresh_camera_scene_box();
517}
bool m_dragging
Definition GLGizmoBase.hpp:151
std::vector< Grabber > m_grabbers
Definition GLGizmoBase.hpp:152
virtual void on_stop_dragging()
Definition GLGizmoBase.hpp:254

References m_dragging, m_grabbers, m_parent, and on_stop_dragging().

Referenced by use_grabbers().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ draw_depth()

void GLGizmoSVG::draw_depth ( )
private
1668{
1669 ImGui::AlignTextToFramePadding();
1670 ImGuiWrapper::text(m_gui_cfg->translations.depth);
1671 ImGui::SameLine(m_gui_cfg->input_offset);
1672 ImGui::SetNextItemWidth(m_gui_cfg->input_width);
1673
1674 bool use_inch = wxGetApp().app_config->get_bool("use_inches");
1675 double &value = m_volume_shape.projection.depth;
1676 constexpr double step = 1.;
1677 constexpr double step_fast = 10.;
1678 std::optional<double> result_scale;
1679 const char *size_format = "%.1f mm";
1680 double input = value;
1681 if (use_inch) {
1682 size_format = "%.2f in";
1683 // input in inches
1684 input *= GizmoObjectManipulation::mm_to_in * m_scale_depth.value_or(1.f);
1685 result_scale = GizmoObjectManipulation::in_to_mm / m_scale_depth.value_or(1.f);
1686 } else if (m_scale_depth.has_value()) {
1687 // scale input
1688 input *= (*m_scale_depth);
1689 result_scale = 1. / (*m_scale_depth);
1690 }
1691
1692 const bool input_changed = ImGui::InputDouble("##depth", &input, step, step_fast, size_format);
1693 m_imgui->request_frames_while_held(); // ORCA auto-repeat of the +/- buttons
1694 if (input_changed) {
1695 if (result_scale.has_value())
1696 input *= (*result_scale);
1697 apply(input, limits.depth);
1698 if (!is_approx(input, value, 1e-4)){
1699 value = input;
1700 process();
1701 }
1702 } else if (ImGui::IsItemHovered())
1703 m_imgui->tooltip(_u8L("Size in emboss direction."), m_gui_cfg->max_tooltip_width);
1704}
ImGuiWrapper * m_imgui
Definition GLGizmoBase.hpp:153
bool process(bool make_snapshot=true)
Definition GLGizmoSVG.cpp:1313
EmbossShape m_volume_shape
Definition GLGizmoSVG.hpp:149
static const double mm_to_in
Definition GizmoObjectManipulation.hpp:31
static const double in_to_mm
Definition GizmoObjectManipulation.hpp:30
static void text(const char *label)
Definition ImGuiWrapper.cpp:1128
static bool apply(std::optional< T > &val, const MinMax< T > &limit)
Definition Point.hpp:738
const struct anonymous_namespace{GLGizmoSVG.cpp}::Limits limits
void step(Coord &crd, const Dir d, const long n=1)
Definition MarchingSquares.hpp:213
#define _u8L(s)
Definition I18N.hpp:11

References _u8L, Slic3r::apply(), Slic3r::GUI::GizmoObjectManipulation::in_to_mm, Slic3r::is_approx(), m_gui_cfg, Slic3r::GUI::GLGizmoBase::m_imgui, m_scale_depth, m_volume_shape, Slic3r::GUI::GizmoObjectManipulation::mm_to_in, process(), and Slic3r::GUI::ImGuiWrapper::text().

Referenced by draw_window().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ draw_distance()

void GLGizmoSVG::draw_distance ( )
private
1870{
1871 const EmbossProjection& projection = m_volume->emboss_shape->projection;
1872 bool use_surface = projection.use_surface;
1873 bool allowe_surface_distance = !use_surface && !m_volume->is_the_only_one_part();
1874
1875 float prev_distance = m_distance.value_or(.0f);
1876 float min_distance = static_cast<float>(-2 * projection.depth);
1877 float max_distance = static_cast<float>(2 * projection.depth);
1878
1879 m_imgui->disabled_begin(!allowe_surface_distance);
1880 ScopeGuard sg([imgui = m_imgui]() { imgui->disabled_end(); });
1881
1882 ImGui::AlignTextToFramePadding();
1883 ImVec4 text_color = m_distance.has_value() ? ImGuiWrapper::COL_MODIFIED : ImGui::GetStyleColorVec4(ImGuiCol_Text); // ORCA use modified color on text
1884 ImGuiWrapper::text_colored(text_color, m_gui_cfg->translations.distance);
1885 ImGui::SameLine(m_gui_cfg->input_offset);
1886 ImGui::SetNextItemWidth(m_gui_cfg->input_width);
1887
1888 bool use_inch = wxGetApp().app_config->get_bool("use_inches");
1889 const wxString move_tooltip = _L("Distance of the center of the SVG to the model surface.");
1890 bool is_moved = false;
1891 if (use_inch) {
1892 std::optional<float> distance_inch;
1893 if (m_distance.has_value()) distance_inch = (*m_distance * GizmoObjectManipulation::mm_to_in);
1894 min_distance = static_cast<float>(min_distance * GizmoObjectManipulation::mm_to_in);
1895 max_distance = static_cast<float>(max_distance * GizmoObjectManipulation::mm_to_in);
1896 if (m_imgui->slider_optional_float("##distance", m_distance, min_distance, max_distance, "%.3f in", 1.f, false, move_tooltip)) {
1897 if (distance_inch.has_value()) {
1899 } else {
1900 m_distance.reset();
1901 }
1902 is_moved = true;
1903 }
1904 } else {
1905 if (m_imgui->slider_optional_float("##distance", m_distance, min_distance, max_distance, "%.2f mm", 1.f, false, move_tooltip))
1906 is_moved = true;
1907 }
1908 bool is_stop_sliding = m_imgui->get_last_slider_status().deactivated_after_edit;
1909 bool is_reseted = false;
1910 if (m_distance.has_value()) {
1911 if (reset_button(m_icons)) {
1912 m_distance.reset();
1913 is_reseted = true;
1914 } else if (ImGui::IsItemHovered())
1915 m_imgui->tooltip(_u8L("Reset distance"), m_gui_cfg->max_tooltip_width);
1916 }
1917
1918 if (is_moved || is_reseted)
1919 do_local_z_move(m_parent.get_selection(), m_distance.value_or(.0f) - prev_distance);
1920 if (is_stop_sliding || is_reseted)
1921 m_parent.do_move(move_snapshot_name);
1922}
#define _L(s)
Definition OBJ.cpp:34
const wxColour text_color(107, 107, 107)
IconManager::VIcons m_icons
Definition GLGizmoSVG.hpp:199
std::optional< float > m_distance
Definition GLGizmoSVG.hpp:164
static void text_colored(const ImVec4 &color, const char *label)
Definition ImGuiWrapper.cpp:1157
static const ImVec4 COL_MODIFIED
Definition ImGuiWrapper.hpp:412
void do_local_z_move(Selection &selection, double relative_move)
Translation along local z Axis (emboss direction).
Definition SurfaceDrag.cpp:438
bool reset_button(const IconManager::VIcons &icons)
Definition GLGizmoSVG.cpp:465
bool use_surface
Definition EmbossShape.hpp:27
double depth
Definition EmbossShape.hpp:23

References _L, _u8L, Slic3r::GUI::ImGuiWrapper::COL_MODIFIED, Slic3r::EmbossProjection::depth, Slic3r::GUI::do_local_z_move(), Slic3r::GUI::GizmoObjectManipulation::in_to_mm, m_distance, m_gui_cfg, m_icons, Slic3r::GUI::GLGizmoBase::m_imgui, Slic3r::GUI::GLGizmoBase::m_parent, m_volume, Slic3r::GUI::GizmoObjectManipulation::mm_to_in, text_color(), Slic3r::GUI::ImGuiWrapper::text_colored(), and Slic3r::EmbossProjection::use_surface.

Referenced by draw_window().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ draw_face_the_camera()

void GLGizmoSVG::draw_face_the_camera ( )
private
1401 {
1402 if (ImGui::Button(_u8L("Face the camera").c_str())) {
1403 const Camera &cam = wxGetApp().plater()->get_camera();
1404 auto wanted_up_limit = (m_keep_up) ? std::optional<double>(UP_LIMIT) : std::optional<double>{};
1405 if (face_selected_volume_to_camera(cam, m_parent, wanted_up_limit))
1407 }
1408}
void volume_transformation_changed()
Definition GLGizmoSVG.cpp:339
bool m_keep_up
Definition GLGizmoSVG.hpp:174
bool face_selected_volume_to_camera(const Camera &camera, GLCanvas3D &canvas, const std::optional< double > &wanted_up_limit)
Apply camera direction for emboss direction.
Definition SurfaceDrag.cpp:329
@ Camera
Definition Shortcuts.hpp:72
constexpr double UP_LIMIT
Definition SurfaceDrag.hpp:56

References _u8L, Slic3r::GUI::face_selected_volume_to_camera(), m_keep_up, Slic3r::GUI::GLGizmoBase::m_parent, Slic3r::GUI::UP_LIMIT, and volume_transformation_changed().

Referenced by draw_window().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ draw_filename()

void GLGizmoSVG::draw_filename ( )
private
1461 {
1462 const EmbossShape &es = *m_volume->emboss_shape;
1463 const EmbossShape::SvgFile &svg = *es.svg_file;
1464 if (m_filename_preview.empty()){
1465 // create filename preview
1466 if (!svg.path.empty()) {
1468 } else if (!svg.path_in_3mf.empty()) {
1470 }
1471
1472 if (m_filename_preview.empty())
1473 // TRN - Preview of filename after clear local filepath.
1474 m_filename_preview = _u8L("Unknown filename");
1475
1477 }
1478
1479 if (!m_shape_warnings.empty()){
1481 if (ImGui::IsItemHovered()) {
1482 std::string tooltip;
1483 for (const std::string &w: m_shape_warnings){
1484 if (w.empty())
1485 continue;
1486 if (!tooltip.empty())
1487 tooltip += "\n";
1488 tooltip += w;
1489 }
1490 m_imgui->tooltip(tooltip, m_gui_cfg->max_tooltip_width);
1491 }
1492 ImGui::SameLine();
1493 }
1494
1495 // Remove space between filename and gray suffix ".svg"
1496 ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0, 0));
1497 ImGui::AlignTextToFramePadding();
1498 ImGui::Text("%s", m_filename_preview.c_str());
1499 bool is_hovered = ImGui::IsItemHovered();
1500 ImGui::SameLine();
1501 m_imgui->text_colored(ImGuiWrapper::COL_GREY_LIGHT, ".svg");
1502 ImGui::PopStyleVar(); // ImGuiStyleVar_ItemSpacing
1503
1504 is_hovered |= ImGui::IsItemHovered();
1505 if (is_hovered) {
1506 std::string tooltip = GUI::format(_L("SVG file path is \"%1%\""), svg.path);
1507 m_imgui->tooltip(tooltip, m_gui_cfg->max_tooltip_width);
1508 }
1509
1510 bool file_changed = false;
1511
1512 // Re-Load button
1513 bool can_reload = !m_volume_shape.svg_file->path.empty();
1514 if (can_reload) {
1515 ImGui::SameLine();
1516 if (draw_clickable(m_icons, IconType::refresh)) {
1517 if (!boost::filesystem::exists(m_volume_shape.svg_file->path)) {
1518 m_volume_shape.svg_file->path.clear();
1519 } else {
1520 file_changed = true;
1521 }
1522 } else if (ImGui::IsItemHovered())
1523 m_imgui->tooltip(_u8L("Reload SVG file from disk."), m_gui_cfg->max_tooltip_width);
1524 }
1525
1526 std::string tooltip = "";
1527 ImGuiComboFlags flags = ImGuiComboFlags_PopupAlignLeft | ImGuiComboFlags_NoPreview;
1528 ImGui::SameLine();
1530 if (ImGui::BeginCombo("##file_options", nullptr, flags)) {
1531 ScopeGuard combo_sg([]() { ImGui::EndCombo(); });
1532
1533 ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, {ImGui::GetStyle().FramePadding.x, 0});
1534 draw(get_icon(m_icons, IconType::change_file, IconState::hovered));
1535 ImGui::SameLine();
1536 if (ImGui::Selectable((_L("Change file") + dots).ToUTF8().data())) {
1537 std::string new_path = choose_svg_file();
1538 if (!new_path.empty()) {
1539 file_changed = true;
1540 EmbossShape::SvgFile svg_file_new;
1541 svg_file_new.path = new_path;
1542 m_volume_shape.svg_file = svg_file_new; // clear data
1543 }
1544 } else if (ImGui::IsItemHovered()) {
1545 tooltip = _u8L("Change to another SVG file.");
1546 }
1547
1548 std::string forget_path = _u8L("Forget the file path");
1549 if (m_volume->emboss_shape->svg_file->path.empty()){
1550 draw(get_icon(m_icons, IconType::bake, IconState::disabled));
1551 ImGui::SameLine();
1552 m_imgui->text_colored(ImGuiWrapper::COL_GREY_DARK, forget_path.c_str());
1553 } else {
1554 draw(get_icon(m_icons, IconType::bake, IconState::hovered));
1555 ImGui::SameLine();
1556 if (ImGui::Selectable(forget_path.c_str())) {
1557 // set .svg_file.path_in_3mf to remember file name
1558 m_volume->emboss_shape->svg_file->path.clear();
1559 m_volume_shape.svg_file->path.clear();
1560 m_filename_preview.clear();
1561 } else if (ImGui::IsItemHovered()) {
1562 tooltip = _u8L("Do NOT save local path to 3MF file.\n"
1563 "Also disables 'reload from disk' option.");
1564 }
1565 }
1566
1567 //draw(get_icon(m_icons, IconType::bake));
1568 //ImGui::SameLine();
1569 //if (ImGui::Selectable(_u8L("Bake 2 ©").c_str())) {
1570 // EmbossShape::SvgFile &svg = m_volume_shape.svg_file;
1571 // std::stringstream ss;
1572 // Slic3r::save(*svg.image, ss);
1573 // svg.file_data = std::make_unique<std::string>(ss.str());
1574 // svg.image = nsvgParse(*svg.file_data);
1575 // assert(svg.image.get() != NULL);
1576 // if (svg.image.get() != NULL) {
1577 // m_volume->emboss_shape->svg_file = svg; // copy - write changes into volume
1578 // } else {
1579 // svg = m_volume->emboss_shape->svg_file; // revert changes
1580 // }
1581 //} else if (ImGui::IsItemHovered()) {
1582 // ImGui::SetTooltip("%s", _u8L("Use only paths from svg - recreate svg").c_str());
1583 //}
1584
1585 draw(get_icon(m_icons, IconType::bake, IconState::hovered));
1586 ImGui::SameLine();
1587 // TRN: An menu option to convert the SVG into an unmodifiable model part.
1588 if (ImGui::Selectable(_u8L("Bake").c_str())) {
1589 m_volume->emboss_shape.reset();
1590 close();
1591 } else if (ImGui::IsItemHovered()) {
1592 // TRN: Tooltip for the menu item.
1593 tooltip = _u8L("Bake into model as uneditable part");
1594 }
1595
1597 ImGui::SameLine();
1598 if (ImGui::Selectable((_L("Save as") + dots).ToUTF8().data())) {
1599 wxWindow *parent = nullptr;
1600 GUI::FileType file_type = FT_SVG;
1601 wxString wildcard = file_wildcards(file_type);
1602 wxString dlg_title = _L("Save SVG file");
1603 const EmbossShape::SvgFile& svg = *m_volume_shape.svg_file;
1604 wxString dlg_file = from_u8(get_file_name(((!svg.path.empty()) ? svg.path : svg.path_in_3mf))) + ".svg";
1605 wxFileDialog dlg(parent, dlg_title, last_used_directory, dlg_file, wildcard, wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
1606 if (dlg.ShowModal() == wxID_OK ){
1607 last_used_directory = dlg.GetDirectory();
1608 wxString out_path = dlg.GetPath();
1609 std::string path{out_path.c_str()};
1610 //Slic3r::save(*m_volume_shape.svg_file.image, path);
1611
1612 std::ofstream stream(path);
1613 if (stream.is_open()){
1614 stream << *svg.file_data;
1615
1616 // change source file
1617 m_filename_preview.clear();
1618 m_volume_shape.svg_file->path = path;
1619 m_volume_shape.svg_file->path_in_3mf.clear(); // possible change name
1620 m_volume->emboss_shape->svg_file = m_volume_shape.svg_file; // copy - write changes into volume
1621 } else {
1622 BOOST_LOG_TRIVIAL(error) << "Opening file: \"" << path << "\" Failed";
1623 }
1624
1625 }
1626 } else if (ImGui::IsItemHovered()) {
1627 tooltip = _u8L("Save as SVG file.");
1628 }
1629
1630 //draw(get_icon(m_icons, IconType::save));
1631 //ImGui::SameLine();
1632 //if (ImGui::Selectable((_L("Save used as") + dots).ToUTF8().data())) {
1633 // GUI::FileType file_type = FT_SVG;
1634 // wxString wildcard = file_wildcards(file_type);
1635 // wxString dlg_title = _L("Export SVG file:");
1636 // wxString dlg_dir = from_u8(wxGetApp().app_config->get_last_dir());
1637 // const EmbossShape::SvgFile& svg = m_volume_shape.svg_file;
1638 // wxString dlg_file = from_u8(get_file_name(((!svg.path.empty()) ? svg.path : svg.path_in_3mf))) + ".svg";
1639 // wxFileDialog dlg(nullptr, dlg_title, dlg_dir, dlg_file, wildcard, wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
1640 // if (dlg.ShowModal() == wxID_OK ){
1641 // wxString out_path = dlg.GetPath();
1642 // std::string path{out_path.c_str()};
1643 // Slic3r::save(*m_volume_shape.svg_file.image, path);
1644 // }
1645 //} else if (ImGui::IsItemHovered()) {
1646 // ImGui::SetTooltip("%s", _u8L("Save only used path as '.svg' file").c_str());
1647 //}
1648 ImGui::PopStyleVar(1);
1649 }
1651 if (!tooltip.empty())
1652 m_imgui->tooltip(tooltip, m_gui_cfg->max_tooltip_width);
1653
1654 if (file_changed) {
1656 double tes_tol = get_tesselation_tolerance(scale);
1657 EmbossShape es_ = select_shape(m_volume_shape.svg_file->path, tes_tol);
1658 m_volume_shape.svg_file = std::move(es_.svg_file);
1659 m_volume_shape.shapes_with_ids = std::move(es_.shapes_with_ids);
1660 m_volume_shape.final_shape = {}; // clear cache
1662 init_texture(m_texture, m_volume_shape.shapes_with_ids, m_gui_cfg->texture_max_size_px, m_shape_warnings);
1663 process();
1664 }
1665}
Texture m_texture
Definition GLGizmoSVG.hpp:190
std::vector< std::string > m_shape_warnings
Definition GLGizmoSVG.hpp:152
std::string m_filename_preview
Definition GLGizmoSVG.hpp:196
float get_scale_for_tolerance()
Definition GLGizmoSVG.cpp:1310
static const ImVec4 COL_GREY_LIGHT
Definition ImGuiWrapper.hpp:385
static std::string trunc(const std::string &text, float width, const char *tail=" ..")
Truncate text by ImGui draw function to specific width NOTE 1: ImGui must be initialized NOTE 2: Calc...
Definition ImGuiWrapper.cpp:2427
static void pop_combo_style()
Definition ImGuiWrapper.cpp:2932
static void push_combo_style(const float scale)
Definition ImGuiWrapper.cpp:2907
static const ImVec4 COL_GREY_DARK
Definition ImGuiWrapper.hpp:384
void draw(const IconManager::Icon &icon, const ImVec2 &size, const ImVec4 &tint_col, const ImVec4 &border_col)
Draw imgui image with icon.
Definition IconManager.cpp:373
static wxString dots("...", wxConvUTF8)
FileType
Definition GUI_App.hpp:119
@ FT_SVG
Definition GUI_App.hpp:133
wxString file_wildcards(FileType file_type, const std::string &custom_extension)
Definition GUI_App.cpp:695
std::string format(const char *fmt, TArgs &&... args)
Definition format.hpp:36
wxString from_u8(const std::string &str)
Definition GUI.cpp:544
const IconManager::Icon & get_icon(const IconManager::VIcons &icons, IconType type, IconState state)
Definition GLGizmoEmboss.cpp:3422
@ exclamation
Definition GLGizmoEmboss.cpp:208
@ save
Definition GLGizmoEmboss.cpp:200
@ disabled
Definition GLGizmoEmboss.cpp:223
@ activable
Definition GLGizmoEmboss.cpp:223
@ hovered
Definition GLGizmoEmboss.cpp:223
wxString last_used_directory
Definition GLGizmoSVG.cpp:116
double get_tesselation_tolerance(double scale)
Definition GLGizmoSVG.cpp:124
std::vector< std::string > create_shape_warnings(const EmbossShape &shape, float scale)
Create warnings about shape.
Definition GLGizmoSVG.cpp:1131
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.
Definition GLGizmoSVG.cpp:2245
std::string get_file_name(const std::string &file_path)
Separate file name from file path. String after last delimiter and before last point.
Definition GLGizmoSVG.cpp:2117
std::string choose_svg_file()
Open file dialog with svg files.
Definition GLGizmoSVG.cpp:2207
bool init_texture(Texture &texture, const ExPolygonsWithIds &shapes_with_ids, unsigned max_size_px, const std::vector< std::string > &shape_warnings)
Definition GLGizmoSVG.cpp:967
bool draw_clickable(const IconManager::VIcons &icons, IconType type)
Definition GLGizmoSVG.cpp:460
std::string path
Definition EmbossShape.hpp:92
std::string path_in_3mf
Definition EmbossShape.hpp:97
std::shared_ptr< std::string > file_data
Definition EmbossShape.hpp:104
std::optional< SvgFile > svg_file
Definition EmbossShape.hpp:122
ExPolygonsWithIds shapes_with_ids
Definition EmbossShape.hpp:68

References _L, _u8L, anonymous_namespace{GLGizmoEmboss.cpp}::activable, close(), Slic3r::GUI::ImGuiWrapper::COL_GREY_DARK, Slic3r::GUI::ImGuiWrapper::COL_GREY_LIGHT, anonymous_namespace{GLGizmoEmboss.cpp}::disabled, Slic3r::GUI::dots(), Slic3r::GUI::draw(), anonymous_namespace{GLGizmoEmboss.cpp}::exclamation, Slic3r::EmbossShape::SvgFile::file_data, Slic3r::GUI::file_wildcards(), Slic3r::GUI::format(), Slic3r::GUI::from_u8(), Slic3r::GUI::FT_SVG, get_scale_for_tolerance(), anonymous_namespace{GLGizmoEmboss.cpp}::hovered, m_filename_preview, m_gui_cfg, m_icons, Slic3r::GUI::GLGizmoBase::m_imgui, Slic3r::GUI::GLGizmoBase::m_parent, m_shape_warnings, m_texture, m_volume, m_volume_shape, Slic3r::EmbossShape::SvgFile::path, Slic3r::EmbossShape::SvgFile::path_in_3mf, Slic3r::GUI::ImGuiWrapper::pop_combo_style(), process(), Slic3r::GUI::ImGuiWrapper::push_combo_style(), anonymous_namespace{GLGizmoEmboss.cpp}::save, scale(), Slic3r::EmbossShape::shapes_with_ids, Slic3r::EmbossShape::svg_file, and Slic3r::GUI::ImGuiWrapper::trunc().

Referenced by draw_window().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ draw_mirroring()

void GLGizmoSVG::draw_mirroring ( )
private
1989{
1990 ImGui::AlignTextToFramePadding();
1991 ImGui::Text("%s", m_gui_cfg->translations.mirror.c_str());
1992 ImGui::SameLine(m_gui_cfg->input_offset);
1993 Axis axis = Axis::UNKNOWN_AXIS;
1994 if (draw_clickable(m_icons, IconType::reflection_x)) {
1995 axis = Axis::X;
1996 } else if (ImGui::IsItemHovered()) {
1997 m_imgui->tooltip(_u8L("Mirror vertically"), m_gui_cfg->max_tooltip_width);
1998 }
1999
2000 ImGui::SameLine();
2001 if (draw_clickable(m_icons, IconType::reflection_y)) {
2002 axis = Axis::Y;
2003 } else if (ImGui::IsItemHovered()) {
2004 m_imgui->tooltip(_u8L("Mirror horizontally"), m_gui_cfg->max_tooltip_width);
2005 }
2006
2007 if (axis != Axis::UNKNOWN_AXIS){
2008 Selection &selection = m_parent.get_selection();
2009 selection.setup_cache();
2010
2011 auto selection_mirror_fnc = [&selection, &axis](){
2012 selection.mirror(axis, get_drag_transformation_type(selection));
2013 };
2014 selection_transform(selection, selection_mirror_fnc);
2015 m_parent.do_mirror(L("Set Mirror"));
2016
2017 // Mirror is ignoring keep up !!
2018 if (m_keep_up)
2019 m_angle = calc_angle(selection);
2020
2022
2023
2024 if (m_volume_shape.projection.use_surface)
2025 process();
2026 }
2027}
#define L(s)
Definition ExtrusionEntity.cpp:25
std::optional< float > m_angle
Definition GLGizmoSVG.hpp:163
void mirror(Axis axis, TransformationType transformation_type)
Definition Selection.cpp:1708
void setup_cache()
Definition Selection.cpp:1238
void selection_transform(Selection &selection, const std::function< void()> &selection_transformation_fnc)
Wrap function around selection transformation to apply fix transformation Fix transformation is neede...
Definition SurfaceDrag.cpp:307
TransformationType get_drag_transformation_type(const Selection &selection)
Distiguish between object and volume Differ in possible transformation type.
Definition SurfaceDrag.cpp:450
std::optional< float > calc_angle(const Selection &selection)
Calculate up vector angle.
Definition SurfaceDrag.cpp:259
Axis
Definition libslic3r.h:140
@ Y
Definition libslic3r.h:142
@ UNKNOWN_AXIS
Definition libslic3r.h:152
@ X
Definition libslic3r.h:141

References _u8L, Slic3r::GUI::calc_angle(), Slic3r::GUI::get_drag_transformation_type(), L, m_angle, m_gui_cfg, m_icons, Slic3r::GUI::GLGizmoBase::m_imgui, m_keep_up, Slic3r::GUI::GLGizmoBase::m_parent, m_volume_shape, Slic3r::GUI::Selection::mirror(), process(), Slic3r::GUI::selection_transform(), Slic3r::GUI::Selection::setup_cache(), Slic3r::UNKNOWN_AXIS, volume_transformation_changed(), Slic3r::X, and Slic3r::Y.

Referenced by draw_window().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ draw_model_type()

void GLGizmoSVG::draw_model_type ( )
private
2030{
2031 //ImGui::AlignTextToFramePadding();
2032 bool is_last_solid_part = m_volume->is_the_only_one_part();
2033 std::string title = _u8L("Operation");
2034 if (is_last_solid_part) {
2035 ImVec4 color{.5f, .5f, .5f, 1.f};
2036 m_imgui->text_colored(color, title.c_str());
2037 } else {
2038 ImGui::Text("%s", title.c_str());
2039 }
2040
2041 std::optional<ModelVolumeType> new_type;
2045 ModelVolumeType type = m_volume->type();
2046
2047 ImGui::SameLine();
2048
2049 //TRN EmbossOperation
2050 ImGuiWrapper::push_radio_style(m_parent.get_scale()); //ORCA
2051 if (ImGui::RadioButton(_u8L("Join").c_str(), type == part))
2052 new_type = part;
2053 else if (ImGui::IsItemHovered())
2054 m_imgui->tooltip(_u8L("Click to change text into object part."), m_gui_cfg->max_tooltip_width);
2055 ImGui::SameLine();
2056
2057 std::string last_solid_part_hint = _u8L("You can't change a type of the last solid part of the object.");
2058 if (ImGui::RadioButton(_u8L_CONTEXT(L_CONTEXT("Cut", "EmbossOperation"), "EmbossOperation").c_str(), type == negative))
2059 new_type = negative;
2060 else if (ImGui::IsItemHovered()) {
2061 if (is_last_solid_part)
2062 m_imgui->tooltip(last_solid_part_hint, m_gui_cfg->max_tooltip_width);
2063 else if (type != negative)
2064 m_imgui->tooltip(_u8L("Click to change part type into negative volume."), m_gui_cfg->max_tooltip_width);
2065 }
2066
2067 // In simple mode are not modifiers
2068 if (wxGetApp().plater()->printer_technology() != ptSLA && wxGetApp().get_mode() != ConfigOptionMode::comSimple) {
2069 ImGui::SameLine();
2070 if (ImGui::RadioButton(_u8L("Modifier").c_str(), type == modifier))
2071 new_type = modifier;
2072 else if (ImGui::IsItemHovered()) {
2073 if (is_last_solid_part)
2074 m_imgui->tooltip(last_solid_part_hint, m_gui_cfg->max_tooltip_width);
2075 else if (type != modifier)
2076 m_imgui->tooltip(_u8L("Click to change part type into modifier."), m_gui_cfg->max_tooltip_width);
2077 }
2078 }
2080
2081 if (m_volume != nullptr && new_type.has_value() && !is_last_solid_part) {
2082 GUI_App &app = wxGetApp();
2083 Plater * plater = app.plater();
2084 // TRN: This is the name of the action that shows in undo/redo stack (changing part type from SVG to something else).
2085 Plater::TakeSnapshot snapshot(plater, _u8L("Change SVG Type"), UndoRedo::SnapshotType::GizmoAction);
2086 m_volume->set_type(*new_type);
2087
2088 bool is_volume_move_inside = (type == part);
2089 bool is_volume_move_outside = (*new_type == part);
2090 // Update volume position when switch (from part) or (into part)
2091 if ((is_volume_move_inside || is_volume_move_outside))
2092 process();
2093
2094 // inspiration in ObjectList::set_volume_type()
2095 // how to view correct side panel with objects
2096 ObjectList *obj_list = app.obj_list();
2097 wxDataViewItemArray sel = obj_list->reorder_volumes_and_get_selection(
2099 [volume = m_volume](const ModelVolume *vol) { return vol == volume; });
2100 if (!sel.IsEmpty()) obj_list->select_item(sel.front());
2101
2102 // NOTE: on linux, function reorder_volumes_and_get_selection call GLCanvas3D::reload_scene(refresh_immediately = false)
2103 // which discard m_volume pointer and set it to nullptr also selection is cleared so gizmo is automaticaly closed
2104 auto &mng = m_parent.get_gizmos_manager();
2105 if (mng.get_current_type() != GLGizmosManager::Svg)
2106 mng.open_gizmo(GLGizmosManager::Svg);
2107 // TODO: select volume back - Ask @Sasa
2108 }
2109}
#define L_CONTEXT(s, context)
Definition DesignOffer.hpp:17
ObjectList * obj_list()
Definition GUI_App.cpp:9699
Plater * plater()
Definition GUI_App.cpp:9709
static void pop_radio_style()
Definition ImGuiWrapper.cpp:2950
static void push_radio_style(const float scale)
Definition ImGuiWrapper.cpp:2938
wxDataViewItemArray reorder_volumes_and_get_selection(int obj_idx, std::function< bool(const ModelVolume *)> add_to_selection=nullptr)
Definition GUI_ObjectList.cpp:6986
int get_selected_obj_idx() const
Definition GUI_ObjectList.cpp:727
void select_item(const wxDataViewItem &item)
Definition GUI_ObjectList.cpp:5269
static PrinterTechnology printer_technology()
Definition GUI_Factories.cpp:60
static ObjectList * obj_list()
Definition GUI_Factories.cpp:405
static Plater * plater()
Definition GUI_Factories.cpp:400
@ ObjectList
Definition Shortcuts.hpp:21
@ Plater
Definition Shortcuts.hpp:21
@ GizmoAction
Definition UndoRedo.hpp:36
@ comSimple
Definition Config.hpp:222
ModelVolumeType
Definition Model.hpp:355
@ PARAMETER_MODIFIER
Definition Model.hpp:359
@ MODEL_PART
Definition Model.hpp:357
@ NEGATIVE_VOLUME
Definition Model.hpp:358
@ ptSLA
Definition Config.hpp:233
#define _u8L_CONTEXT(s, ctx)
Definition I18N.hpp:16

References _u8L, _u8L_CONTEXT, Slic3r::comSimple, Slic3r::UndoRedo::GizmoAction, L_CONTEXT, m_gui_cfg, Slic3r::GUI::GLGizmoBase::m_imgui, Slic3r::GUI::GLGizmoBase::m_parent, m_volume, Slic3r::MODEL_PART, Slic3r::NEGATIVE_VOLUME, Slic3r::GUI::GUI_App::obj_list(), Slic3r::GUI::obj_list(), Slic3r::PARAMETER_MODIFIER, Slic3r::GUI::GUI_App::plater(), Slic3r::GUI::plater(), Slic3r::GUI::ImGuiWrapper::pop_radio_style(), Slic3r::GUI::printer_technology(), process(), Slic3r::ptSLA, Slic3r::GUI::ImGuiWrapper::push_radio_style(), and Slic3r::GUI::GLGizmosManager::Svg.

Referenced by draw_window().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ draw_preview()

void GLGizmoSVG::draw_preview ( )
private
1410 {
1411 // init texture when not initialized yet.
1412 // drag&drop is out of rendering scope so texture must be created on this place
1413 if (m_texture.id == 0) {
1414 const ExPolygonsWithIds &shapes = m_volume->emboss_shape->shapes_with_ids;
1415 init_texture(m_texture, shapes, m_gui_cfg->texture_max_size_px, m_shape_warnings);
1416 }
1417
1418 //::draw(m_volume_shape.shapes_with_ids, m_gui_cfg->texture_max_size_px);
1419
1420 if (m_texture.id != 0) {
1421 ImTextureID id = (void *) static_cast<intptr_t>(m_texture.id);
1422 ImVec2 s(m_texture.width, m_texture.height);
1423
1424 std::optional<float> spacing;
1425 // is texture over full height?
1426 if (m_texture.height != m_gui_cfg->texture_max_size_px) {
1427 spacing = (m_gui_cfg->texture_max_size_px - m_texture.height) / 2.f;
1428 ImGui::SetCursorPosY(ImGui::GetCursorPosY() + *spacing);
1429 }
1430 // is texture over full width?
1431 unsigned window_width = static_cast<unsigned>(
1432 ImGui::GetWindowSize().x - 2*ImGui::GetStyle().WindowPadding.x);
1433 if (window_width > m_texture.width){
1434 float space = (window_width - m_texture.width) / 2.f;
1435 ImGui::SetCursorPosX(ImGui::GetCursorPosX() + space);
1436 }
1437
1438 ImGui::Image(id, s);
1439 //if(ImGui::IsItemHovered()){
1440 // const EmbossShape &es = *m_volume->emboss_shape;
1441 // size_t count_of_shapes = get_shapes_count(*es.svg_file.image);
1442 // size_t count_of_expolygons = 0;
1443 // size_t count_of_points = 0;
1444 // for (const auto &shape : es.shapes_with_ids) {
1445 // for (const ExPolygon &expoly : shape.expoly){
1446 // ++count_of_expolygons;
1447 // count_of_points += count_points(expoly);
1448 // }
1449 // }
1450 // // Do not translate it is only for debug
1451 // std::string tooltip = GUI::format("%1% shapes, which create %2% polygons with %3% line segments",
1452 // count_of_shapes, count_of_expolygons, count_of_points);
1453 // ImGui::SetTooltip("%s", tooltip.c_str());
1454 //}
1455
1456 if (spacing.has_value())
1457 ImGui::SetCursorPosY(ImGui::GetCursorPosY() + *spacing);
1458 }
1459}
std::vector< ExPolygonsWithId > ExPolygonsWithIds
Definition EmbossShape.hpp:60

References m_gui_cfg, m_shape_warnings, m_texture, and m_volume.

Referenced by draw_window().

Here is the caller graph for this function:

◆ draw_rotation()

void GLGizmoSVG::draw_rotation ( )
private
1925{
1926 ImGui::AlignTextToFramePadding();
1927 ImVec4 text_color = m_angle.has_value() ? ImGuiWrapper::COL_MODIFIED : ImGui::GetStyleColorVec4(ImGuiCol_Text); // ORCA use modified color on text
1928 ImGuiWrapper::text_colored(text_color, m_gui_cfg->translations.rotation);
1929 ImGui::SameLine(m_gui_cfg->input_offset);
1930 ImGui::SetNextItemWidth(m_gui_cfg->input_width);
1931
1932 // slider for Clockwise angle in degress
1933 // stored angle is optional CCW and in radians
1934 // Convert stored value to degress
1935 // minus create clockwise roation from CCW
1936 float angle = m_angle.value_or(0.f);
1937 float angle_deg = static_cast<float>(-angle * 180 / M_PI);
1938 if (m_imgui->slider_float("##angle", &angle_deg, limits.angle.min, limits.angle.max, u8"%.2f °", 1.f, false, _L("Rotate text Clockwise."))){
1939 // convert back to radians and CCW
1940 double angle_rad = -angle_deg * M_PI / 180.0;
1941 Geometry::to_range_pi_pi(angle_rad);
1942
1943 double diff_angle = angle_rad - angle;
1944
1945 do_local_z_rotate(m_parent.get_selection(), diff_angle);
1946
1947 // calc angle after rotation
1948 m_angle = calc_angle(m_parent.get_selection());
1949
1950 // recalculate for surface cut
1951 if (m_volume->emboss_shape->projection.use_surface)
1952 process();
1953 }
1954 bool is_stop_sliding = m_imgui->get_last_slider_status().deactivated_after_edit;
1955
1956 // Reset button
1957 bool is_reseted = false;
1958 if (m_angle.has_value()) {
1959 if (reset_button(m_icons)) {
1960 do_local_z_rotate(m_parent.get_selection(), -(*m_angle));
1961 m_angle.reset();
1962
1963 // recalculate for surface cut
1964 if (m_volume->emboss_shape->projection.use_surface)
1965 process();
1966
1967 is_reseted = true;
1968 } else if (ImGui::IsItemHovered())
1969 m_imgui->tooltip(_u8L("Reset rotation"), m_gui_cfg->max_tooltip_width);
1970 }
1971
1972 // Apply rotation on model (backend)
1973 if (is_stop_sliding || is_reseted)
1974 m_parent.do_rotate(rotation_snapshot_name);
1975
1976 // Keep up - lock button icon
1977 if (!m_volume->is_the_only_one_part()) {
1978 ImGui::SameLine(m_gui_cfg->lock_offset);
1979 const IconManager::Icon &icon = get_icon(m_icons, m_keep_up ? IconType::lock : IconType::unlock, IconState::activable);
1980 const IconManager::Icon &icon_hover = get_icon(m_icons, m_keep_up ? IconType::lock : IconType::unlock, IconState::hovered);
1981 if (button(icon, icon_hover, icon))
1982 m_keep_up = !m_keep_up;
1983 if (ImGui::IsItemHovered())
1984 m_imgui->tooltip(_u8L("Lock/unlock rotation angle when dragging above the surface."), m_gui_cfg->max_tooltip_width);
1985 }
1986}
#define M_PI
Definition ExtrusionSimulator.cpp:31
void do_local_z_rotate(Selection &selection, double relative_angle)
Rotation around z Axis(emboss direction).
Definition SurfaceDrag.cpp:406
bool button(const IconManager::Icon &activ, const IconManager::Icon &hover, const IconManager::Icon &disable, bool disabled)
Use icon as button with 3 states activ hover and disabled.
Definition IconManager.cpp:418
void to_range_pi_pi(T &angle)
Definition Geometry.hpp:331
double angle(const Eigen::MatrixBase< Derived > &v1, const Eigen::MatrixBase< Derived2 > &v2)
Definition Point.hpp:138
@ unlock
Definition GLGizmoEmboss.cpp:211
@ lock
Definition GLGizmoEmboss.cpp:209

References _L, _u8L, anonymous_namespace{GLGizmoEmboss.cpp}::activable, Slic3r::angle(), Slic3r::GUI::button(), Slic3r::GUI::calc_angle(), Slic3r::GUI::ImGuiWrapper::COL_MODIFIED, Slic3r::GUI::do_local_z_rotate(), anonymous_namespace{GLGizmoEmboss.cpp}::hovered, anonymous_namespace{GLGizmoEmboss.cpp}::lock, m_angle, m_gui_cfg, m_icons, Slic3r::GUI::GLGizmoBase::m_imgui, m_keep_up, Slic3r::GUI::GLGizmoBase::m_parent, M_PI, m_volume, process(), text_color(), Slic3r::GUI::ImGuiWrapper::text_colored(), Slic3r::Geometry::to_range_pi_pi(), and anonymous_namespace{GLGizmoEmboss.cpp}::unlock.

Referenced by draw_window().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ draw_size()

void GLGizmoSVG::draw_size ( )
private
1707{
1708 ImGui::AlignTextToFramePadding();
1709 bool can_reset = m_scale_width.has_value() || m_scale_height.has_value();
1710 ImVec4 text_color = can_reset ? ImGuiWrapper::COL_MODIFIED : ImGui::GetStyleColorVec4(ImGuiCol_Text); // ORCA use modified color on text
1711 ImGuiWrapper::text_colored(text_color, m_gui_cfg->translations.size);
1712 if (ImGui::IsItemHovered()){
1713 size_t count_points = 0;
1714 for (const auto &s : m_volume_shape.shapes_with_ids)
1716 // TRN: The placeholder contains a number.
1717 m_imgui->tooltip(GUI::format(_L("Scale also changes amount of curve samples (%1%)"), count_points), m_gui_cfg->max_tooltip_width);
1718 }
1719
1720 bool use_inch = wxGetApp().app_config->get_bool("use_inches");
1721
1722 Point size = m_shape_bb.size();
1723 double width = size.x() * m_volume_shape.scale * m_scale_width.value_or(1.f);
1724 if (use_inch) width *= GizmoObjectManipulation::mm_to_in;
1725 double height = size.y() * m_volume_shape.scale * m_scale_height.value_or(1.f);
1727
1728 const auto is_valid_scale_ratio = [limit = &limits.relative_scale_ratio](double ratio) {
1729 if (std::fabs(ratio - 1.) < limit->min)
1730 return false; // too small ratio --> without effect
1731
1732 if (ratio > limit->max)
1733 return false;
1734
1735 if (ratio < 1e-4)
1736 return false; // negative scale is not allowed
1737
1738 return true;
1739 };
1740
1741 std::optional<Vec3d> new_relative_scale;
1742 bool make_snap = false;
1743
1744 if (m_keep_ratio) {
1745 std::stringstream ss;
1746 ss << std::setprecision(2) << std::fixed << width << " x " << height << " " << (use_inch ? _L_CONTEXT("in", "inches") : _L("mm"));
1747
1748 ImGui::SameLine(m_gui_cfg->input_offset);
1749 ImGui::SetNextItemWidth(m_gui_cfg->input_width);
1750
1751 const MinMax<float> &minmax = use_inch ? limits.ui_size_in : limits.ui_size;
1752 // convert to float for slider
1753 float width_f = static_cast<float>(width);
1754 if (m_imgui->slider_float("##width_size_slider", &width_f, minmax.min, minmax.max, ss.str().c_str(), 1.f, false)) {
1755 double width_ratio = width_f / width;
1756 if (is_valid_scale_ratio(width_ratio)) {
1757 m_scale_width = m_scale_width.value_or(1.f) * width_ratio;
1758 m_scale_height = m_scale_height.value_or(1.f) * width_ratio;
1759 new_relative_scale = Vec3d(width_ratio, width_ratio, 1.);
1760 }
1761 }
1762 if (m_imgui->get_last_slider_status().deactivated_after_edit)
1763 make_snap = true; // only last change of slider make snap
1764 } else {
1765 ImGuiInputTextFlags flags = 0;
1766
1767 float space = m_gui_cfg->icon_width / 2;
1768 float input_width = m_gui_cfg->input_width / 2 - space / 2;
1769 float second_offset = m_gui_cfg->input_offset + input_width + space;
1770
1771 const char *size_format = (use_inch) ? "%.2f in" : "%.1f mm";
1772 double step = -1.0;
1773 double fast_step = -1.0;
1774
1775 ImGui::SameLine(m_gui_cfg->input_offset);
1776 ImGui::SetNextItemWidth(input_width);
1777 double prev_width = width;
1778 if (ImGui::InputDouble("##width", &width, step, fast_step, size_format, flags)) {
1779 double width_ratio = width / prev_width;
1780 if (is_valid_scale_ratio(width_ratio)) {
1781 m_scale_width = m_scale_width.value_or(1.f) * width_ratio;
1782 new_relative_scale = Vec3d(width_ratio, 1., 1.);
1783 make_snap = true;
1784 }
1785 }
1786 if (ImGui::IsItemHovered())
1787 m_imgui->tooltip(_u8L("Width of SVG."), m_gui_cfg->max_tooltip_width);
1788
1789 ImGui::SameLine(second_offset);
1790 ImGui::SetNextItemWidth(input_width);
1791 double prev_height = height;
1792 if (ImGui::InputDouble("##height", &height, step, fast_step, size_format, flags)) {
1793 double height_ratio = height / prev_height;
1794 if (is_valid_scale_ratio(height_ratio)) {
1795 m_scale_height = m_scale_height.value_or(1.f) * height_ratio;
1796 new_relative_scale = Vec3d(1., height_ratio, 1.);
1797 make_snap = true;
1798 }
1799 }
1800 if (ImGui::IsItemHovered())
1801 m_imgui->tooltip(_u8L("Height of SVG."), m_gui_cfg->max_tooltip_width);
1802 }
1803
1804 // Lock on ratio m_keep_ratio
1805 ImGui::SameLine(m_gui_cfg->lock_offset);
1807 const IconManager::Icon &icon_hover = get_icon(m_icons, m_keep_ratio ? IconType::lock : IconType::unlock, IconState::hovered);
1808 if (button(icon, icon_hover, icon))
1810 if (ImGui::IsItemHovered())
1811 m_imgui->tooltip(_u8L("Lock/unlock the aspect ratio of the SVG."), m_gui_cfg->max_tooltip_width);
1812
1813
1814 // reset button
1815 //bool can_reset = m_scale_width.has_value() || m_scale_height.has_value(); // ORCA update variable above if condition change
1816 if (can_reset) {
1817 if (reset_button(m_icons)) {
1818 new_relative_scale = Vec3d(1./m_scale_width.value_or(1.f), 1./m_scale_height.value_or(1.f), 1.);
1819 make_snap = true;
1820 } else if (ImGui::IsItemHovered())
1821 m_imgui->tooltip(_u8L("Reset scale"), m_gui_cfg->max_tooltip_width);
1822 }
1823
1824 if (new_relative_scale.has_value()){
1825 Selection &selection = m_parent.get_selection();
1826 selection.setup_cache();
1827
1828 auto selection_scale_fnc = [&selection, rel_scale = *new_relative_scale]() {
1829 selection.scale(rel_scale, get_drag_transformation_type(selection));
1830 };
1831 selection_transform(selection, selection_scale_fnc);
1832
1833 std::string snap_name; // Empty mean do not store on undo/redo stack
1834 m_parent.do_scale(snap_name);
1835 wxGetApp().obj_manipul()->set_dirty();
1836 // should be the almost same
1838
1839 const NSVGimage *img = m_volume_shape.svg_file->image.get();
1840 assert(img != NULL);
1841 if (img != NULL){
1842 NSVGLineParams params{get_tesselation_tolerance(get_scale_for_tolerance())};
1843 m_volume_shape.shapes_with_ids = create_shape_with_ids(*img, params);
1844 m_volume_shape.final_shape = {}; // reset cache for final shape
1845 if (!make_snap) // Be carefull: Last change may be without change of scale
1846 process(false);
1847 }
1848 }
1849
1850 if (make_snap)
1851 process(); // make undo/redo snap-shot
1852}
BoundingBox m_shape_bb
Definition GLGizmoSVG.hpp:194
void calculate_scale()
Definition GLGizmoSVG.cpp:1272
bool m_keep_ratio
Definition GLGizmoSVG.hpp:177
void scale(const Vec3d &scale, TransformationType transformation_type)
Definition Selection.cpp:1475
Kernel::Point_3 Point
Definition MeshRepair.cpp:81
coord_t width(const BoundingBox &box)
Definition Arrange.cpp:1184
coord_t height(const BoundingBox &box)
Definition Arrange.cpp:1185
T min
Definition Point.hpp:736
T max
Definition Point.hpp:736
ExPolygonsWithIds create_shape_with_ids(const NSVGimage &image, const NSVGLineParams &param)
Convert .svg opened by nanoSvg to shapes stored in expolygons with ids.
Definition NSVGUtils.cpp:38
size_t count_points(const ExPolygons &expolys)
Definition ExPolygon.hpp:95
#define _L_CONTEXT(s, ctx)
Definition I18N.hpp:15

References _L, _L_CONTEXT, _u8L, anonymous_namespace{GLGizmoEmboss.cpp}::activable, Slic3r::GUI::button(), calculate_scale(), Slic3r::GUI::ImGuiWrapper::COL_MODIFIED, Slic3r::count_points(), Slic3r::create_shape_with_ids(), Slic3r::GUI::format(), Slic3r::GUI::get_drag_transformation_type(), get_scale_for_tolerance(), anonymous_namespace{GLGizmoEmboss.cpp}::hovered, anonymous_namespace{GLGizmoEmboss.cpp}::lock, m_gui_cfg, m_icons, Slic3r::GUI::GLGizmoBase::m_imgui, m_keep_ratio, Slic3r::GUI::GLGizmoBase::m_parent, m_scale_height, m_scale_width, m_shape_bb, m_volume_shape, Slic3r::MinMax< T >::max, Slic3r::MinMax< T >::min, Slic3r::GUI::GizmoObjectManipulation::mm_to_in, process(), Slic3r::GUI::Selection::scale(), Slic3r::GUI::selection_transform(), Slic3r::GUI::Selection::setup_cache(), text_color(), Slic3r::GUI::ImGuiWrapper::text_colored(), and anonymous_namespace{GLGizmoEmboss.cpp}::unlock.

Referenced by draw_window().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ draw_use_surface()

void GLGizmoSVG::draw_use_surface ( )
private
1855{
1856 bool can_use_surface = (m_volume->emboss_shape->projection.use_surface)? true : // already used surface must have option to uncheck
1857 !m_volume->is_the_only_one_part();
1858 m_imgui->disabled_begin(!can_use_surface);
1859 ScopeGuard sc([imgui = m_imgui]() { imgui->disabled_end(); });
1860
1861 ImGui::AlignTextToFramePadding();
1862 ImGuiWrapper::text(m_gui_cfg->translations.use_surface);
1863 ImGui::SameLine(m_gui_cfg->input_offset);
1864
1865 if (m_imgui->bbl_checkbox("##useSurface", m_volume_shape.projection.use_surface))
1866 process();
1867}

References m_gui_cfg, Slic3r::GUI::GLGizmoBase::m_imgui, m_volume, m_volume_shape, process(), and Slic3r::GUI::ImGuiWrapper::text().

Referenced by draw_window().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ draw_window()

void GLGizmoSVG::draw_window ( )
private
1348{
1349 assert(m_volume != nullptr);
1350 assert(m_volume_id.valid());
1351 if (m_volume == nullptr ||
1352 m_volume_id.invalid()) {
1353 ImGui::Text("%s", _u8L("Not valid state please report reproduction steps on GitHub").c_str());
1354 return;
1355 }
1356
1357 assert(m_volume->emboss_shape.has_value());
1358 if (!m_volume->emboss_shape.has_value()) {
1359 ImGui::Text("%s", _u8L("No embossed file").c_str());
1360 return;
1361 }
1362
1363 assert(m_volume->emboss_shape->svg_file.has_value());
1364 if (!m_volume->emboss_shape->svg_file.has_value()){
1365 ImGui::Text("%s", _u8L("Missing SVG file in embossed shape").c_str());
1366 return;
1367 }
1368
1369 assert(m_volume->emboss_shape->svg_file->file_data != nullptr);
1370 if (m_volume->emboss_shape->svg_file->file_data == nullptr){
1371 ImGui::Text("%s", _u8L("Missing data of SVG file").c_str());
1372 return;
1373 }
1374
1375 draw_preview();
1376 draw_filename();
1377
1378 // Is SVG baked?
1379 if (m_volume == nullptr) return;
1380
1381 ImGui::Separator();
1382
1383 ImGui::Indent(m_gui_cfg->icon_width);
1384 draw_depth();
1385 draw_size();
1387
1388 draw_distance();
1389 draw_rotation();
1392
1393 ImGui::Unindent(m_gui_cfg->icon_width);
1394
1395 if (!m_volume->is_the_only_one_part()) {
1396 ImGui::Separator();
1398 }
1399}
void draw_distance()
Definition GLGizmoSVG.cpp:1869
void draw_mirroring()
Definition GLGizmoSVG.cpp:1988
void draw_face_the_camera()
Definition GLGizmoSVG.cpp:1401
void draw_size()
Definition GLGizmoSVG.cpp:1706
ObjectID m_volume_id
Definition GLGizmoSVG.hpp:156
void draw_depth()
Definition GLGizmoSVG.cpp:1667
void draw_use_surface()
Definition GLGizmoSVG.cpp:1854
void draw_filename()
Definition GLGizmoSVG.cpp:1461
void draw_model_type()
Definition GLGizmoSVG.cpp:2029
void draw_preview()
Definition GLGizmoSVG.cpp:1410
void draw_rotation()
Definition GLGizmoSVG.cpp:1924

References _u8L, draw_depth(), draw_distance(), draw_face_the_camera(), draw_filename(), draw_mirroring(), draw_model_type(), draw_preview(), draw_rotation(), draw_size(), draw_use_surface(), m_gui_cfg, m_volume, and m_volume_id.

Referenced by on_render_input_window().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ format()

std::string Slic3r::GUI::GLGizmoBase::format ( float value,
unsigned int decimals ) const
protectedinherited

◆ get_action_snapshot_name()

std::string GLGizmoSVG::get_action_snapshot_name ( ) const
overrideprotectedvirtual

Reimplemented from Slic3r::GUI::GLGizmoBase.

385{ return _u8L("SVG actions"); }

References _u8L.

◆ get_count()

int Slic3r::GUI::GLGizmoBase::get_count ( )
inlineinherited
224{ return ++count; }
int count
Definition GLGizmoBase.hpp:294

References count.

◆ get_gizmo_entering_text()

std::string GLGizmoSVG::get_gizmo_entering_text ( ) const
overrideprotectedvirtual

Reimplemented from Slic3r::GUI::GLGizmoBase.

383{ return _u8L("Enter SVG gizmo"); }

References _u8L.

◆ get_gizmo_leaving_text()

std::string GLGizmoSVG::get_gizmo_leaving_text ( ) const
overrideprotectedvirtual

Reimplemented from Slic3r::GUI::GLGizmoBase.

384{ return _u8L("Leave SVG gizmo"); }

References _u8L.

◆ get_gizmo_name()

std::string Slic3r::GUI::GLGizmoBase::get_gizmo_name ( )
inlineinherited
225{ return on_get_name(); }
virtual std::string on_get_name() const =0

References on_get_name().

Here is the call graph for this function:

◆ get_hover_id()

int Slic3r::GUI::GLGizmoBase::get_hover_id ( ) const
inlineinherited
206{ return m_hover_id; }
int m_hover_id
Definition GLGizmoBase.hpp:150

References m_hover_id.

Referenced by Slic3r::GUI::GLCanvas3D::_scene_cache_key(), Slic3r::GUI::GLGizmosManager::grabber_contains_mouse(), Slic3r::GUI::GLGizmoBrimEars::on_mouse(), Slic3r::GUI::GLGizmoCut3D::on_mouse(), Slic3r::GUI::GLGizmoMeshBoolean::on_mouse(), and Slic3r::GUI::GLGizmoPainterBase::on_mouse().

Here is the caller graph for this function:

◆ get_icon_filename()

const std::string & Slic3r::GUI::GLGizmoBase::get_icon_filename ( ) const
inlineinherited
180{ return m_icon_filename; }
std::string m_icon_filename
Definition GLGizmoBase.hpp:148

References m_icon_filename.

◆ get_name()

std::string Slic3r::GUI::GLGizmoBase::get_name ( bool include_shortcut = true) const
inherited
545{
546 const std::string name = on_get_name();
547 return include_shortcut && m_shortcut.has_value() ? wxGetApp().shortcuts().with_key(name, *m_shortcut) : name;
548}
std::optional< Shortcut > m_shortcut
Definition GLGizmoBase.hpp:147

References m_shortcut, and on_get_name().

Referenced by Slic3r::GUI::GLGizmoAssembly::on_render_input_window(), Slic3r::GUI::GLGizmoBrimEars::on_render_input_window(), Slic3r::GUI::GLGizmoCut3D::on_render_input_window(), Slic3r::GUI::GLGizmoEmboss::on_render_input_window(), Slic3r::GUI::GLGizmoFdmSupports::on_render_input_window(), Slic3r::GUI::GLGizmoFuzzySkin::on_render_input_window(), Slic3r::GUI::GLGizmoMeasure::on_render_input_window(), Slic3r::GUI::GLGizmoMmuSegmentation::on_render_input_window(), Slic3r::GUI::GLGizmoSeam::on_render_input_window(), Slic3r::GUI::GLGizmoTextureDisplacement::on_render_input_window(), and Slic3r::GUI::GLGizmosManager::update_hover_state().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_requirements()

CommonGizmosDataID Slic3r::GUI::GLGizmoBase::get_requirements ( ) const
inlineinherited
186{ return on_get_requirements(); }
virtual CommonGizmosDataID on_get_requirements() const
Definition GLGizmoBase.hpp:248

References on_get_requirements().

Here is the call graph for this function:

◆ get_scale_for_tolerance()

float GLGizmoSVG::get_scale_for_tolerance ( )
private
1310 {
1311 return std::max(m_scale_width.value_or(1.f), m_scale_height.value_or(1.f)); }

References m_scale_height, and m_scale_width.

Referenced by draw_filename(), draw_size(), and set_volume_by_selection().

Here is the caller graph for this function:

◆ get_sprite_id()

unsigned int Slic3r::GUI::GLGizmoBase::get_sprite_id ( ) const
inlineinherited
204{ return m_sprite_id; }
unsigned int m_sprite_id
Definition GLGizmoBase.hpp:149

References m_sprite_id.

Referenced by Slic3r::GUI::GLGizmosManager::do_render_overlay().

Here is the caller graph for this function:

◆ get_state()

EState Slic3r::GUI::GLGizmoBase::get_state ( ) const
inlineinherited

◆ get_tooltip()

virtual std::string Slic3r::GUI::GLGizmoBase::get_tooltip ( ) const
inlinevirtualinherited

Mouse tooltip text.

Returns
Text to be visible in mouse tooltip

Reimplemented in Slic3r::GUI::GLGizmoCut3D, Slic3r::GUI::GLGizmoMove3D, Slic3r::GUI::GLGizmoRotate3D, Slic3r::GUI::GLGizmoRotate, and Slic3r::GUI::GLGizmoScale3D.

222{ return ""; }

Referenced by Slic3r::GUI::GLGizmosManager::get_tooltip().

Here is the caller graph for this function:

◆ GizmoImguiBegin()

◆ GizmoImguiEnd()

◆ GizmoImguiSetNextWIndowPos() [1/2]

void Slic3r::GUI::GLGizmoBase::GizmoImguiSetNextWIndowPos ( float & x,
float y,
float w,
float h,
int flag,
float pivot_x = 0.0f,
float pivot_y = 0.0f )
protectedinherited
384{
385 if (abs(w) > 0.01f) {
386 if (x + w > m_parent.get_canvas_size().get_width()) {
387 if (w > m_parent.get_canvas_size().get_width()) {
388 x = 0;
389 } else {
390 x = m_parent.get_canvas_size().get_width() - w;
391 }
392 }
393 }
394
395 m_imgui->set_next_window_pos(x, y, flag, pivot_x, pivot_y);
396}

References m_imgui, and m_parent.

◆ GizmoImguiSetNextWIndowPos() [2/2]

void Slic3r::GUI::GLGizmoBase::GizmoImguiSetNextWIndowPos ( float & x,
float y,
int flag,
float pivot_x = 0.0f,
float pivot_y = 0.0f )
protectedinherited

◆ init()

bool Slic3r::GUI::GLGizmoBase::init ( )
inlineinherited
168{ return on_init(); }
virtual bool on_init()=0

References on_init().

Here is the call graph for this function:

◆ is_activable()

bool Slic3r::GUI::GLGizmoBase::is_activable ( ) const
inlineinherited
184{ return on_is_activable(); }
virtual bool on_is_activable() const
Definition GLGizmoBase.hpp:246

References on_is_activable().

Referenced by Slic3r::GUI::GLGizmosManager::activate_gizmo(), Slic3r::GUI::GLGizmosManager::do_render_overlay(), Slic3r::GUI::GLGizmoEmboss::init_create(), and Slic3r::GUI::GLGizmosManager::update_hover_state().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_dragging()

bool Slic3r::GUI::GLGizmoBase::is_dragging ( ) const
inlineinherited
209{ return m_dragging; }

References m_dragging.

Referenced by Slic3r::GUI::GLGizmoCut3D::gizmo_event(), Slic3r::GUI::GLGizmoEmboss::on_mouse_for_translate(), and Slic3r::GUI::GLGizmoSVG::on_mouse_for_translate().

Here is the caller graph for this function:

◆ is_in_editing_mode()

virtual bool Slic3r::GUI::GLGizmoBase::is_in_editing_mode ( ) const
inlinevirtualinherited

Reimplemented in Slic3r::GUI::GLGizmoCut3D.

235{ return false; }

Referenced by Slic3r::GUI::GLGizmosManager::on_key().

Here is the caller graph for this function:

◆ is_selectable()

bool Slic3r::GUI::GLGizmoBase::is_selectable ( ) const
inlineinherited
185{ return on_is_selectable(); }
virtual bool on_is_selectable() const
Definition GLGizmoBase.hpp:247

References on_is_selectable().

Here is the call graph for this function:

◆ is_selection_rectangle_dragging()

virtual bool Slic3r::GUI::GLGizmoBase::is_selection_rectangle_dragging ( ) const
inlinevirtualinherited

Reimplemented in Slic3r::GUI::GLGizmoBrimEars, and Slic3r::GUI::GLGizmoCut3D.

236{ return false; }

◆ is_svg()

bool GLGizmoSVG::is_svg ( const ModelVolume & volume)
static

Check whether volume has emboss data.

Parameters
volumePointer to volume
Returns
True when constain emboss data otherwise False
265 {
266 return volume.emboss_shape.has_value() && volume.emboss_shape->svg_file.has_value();
267}

References Slic3r::ModelVolume::emboss_shape.

Referenced by set_volume_by_selection().

Here is the caller graph for this function:

◆ is_svg_object()

bool GLGizmoSVG::is_svg_object ( const ModelVolume & volume)
static

Check whether volume is object containing only emboss volume.

Parameters
volumePointer to volume
Returns
True when object otherwise False
269 {
270 if (!volume.emboss_shape.has_value()) return false;
271 if (volume.type() != ModelVolumeType::MODEL_PART) return false;
272 for (const ModelVolume *v : volume.get_object()->volumes) {
273 if (v->id() == volume.id()) continue;
274 if (v->type() == ModelVolumeType::MODEL_PART) return false;
275 }
276 return true;
277}
ModelVolumePtrs volumes
Definition Model.hpp:393
ModelObject * get_object() const
Definition Model.hpp:1022
ModelVolumeType type() const
Definition Model.hpp:1023
ObjectID id() const
Definition ObjectID.hpp:69

References Slic3r::ModelVolume::emboss_shape, Slic3r::ModelVolume::get_object(), Slic3r::ObjectBase::id(), Slic3r::MODEL_PART, Slic3r::ModelVolume::type(), and Slic3r::ModelObject::volumes.

Here is the call graph for this function:

◆ load()

void Slic3r::GUI::GLGizmoBase::load ( cereal::BinaryInputArchive & ar)
inlineinherited
170{ m_state = On; on_load(ar); }
virtual void on_load(cereal::BinaryInputArchive &ar)
Definition GLGizmoBase.hpp:241

References m_state, On, and on_load().

Here is the call graph for this function:

◆ load_render_colors()

void Slic3r::GUI::GLGizmoBase::load_render_colors ( )
staticinherited
93{
99}
@ RenderCol_Grabber_Y
Definition GUI_Colors.hpp:27
@ RenderCol_Flatten_Plane
Definition GUI_Colors.hpp:29
@ RenderCol_Grabber_X
Definition GUI_Colors.hpp:26
@ RenderCol_Grabber_Z
Definition GUI_Colors.hpp:28
@ RenderCol_Flatten_Plane_Hover
Definition GUI_Colors.hpp:30
static ColorRGBA FLATTEN_COLOR
Definition GLGizmoBase.hpp:63
static std::array< ColorRGBA, 3 > AXES_COLOR
Definition GLGizmoBase.hpp:60
static ColorRGBA FLATTEN_HOVER_COLOR
Definition GLGizmoBase.hpp:64
static ImVec4 to_ImVec4(const ColorRGB &color)
Definition ImGuiWrapper.cpp:1053
static ImVec4 colors[RenderCol_Count]
Definition GUI_Colors.hpp:40

References AXES_COLOR, Slic3r::RenderColor::colors, FLATTEN_COLOR, FLATTEN_HOVER_COLOR, RenderCol_Flatten_Plane, RenderCol_Flatten_Plane_Hover, RenderCol_Grabber_X, RenderCol_Grabber_Y, RenderCol_Grabber_Z, and Slic3r::GUI::ImGuiWrapper::to_ImVec4().

Referenced by Slic3r::GUI::GLCanvas3D::init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ on_change_color_mode()

virtual void Slic3r::GUI::GLGizmoBase::on_change_color_mode ( bool is_dark)
inlinevirtualinherited
static bool is_dark()
Definition TextureImportDialog.cpp:85
bool m_is_dark_mode
Definition GLGizmoBase.hpp:157

References is_dark(), and m_is_dark_mode.

Here is the call graph for this function:

◆ on_disable_grabber()

void Slic3r::GUI::GLGizmoSVG::on_disable_grabber ( unsigned int id)
inlineoverrideprotectedvirtual

Reimplemented from Slic3r::GUI::GLGizmoBase.

100{ m_rotate_gizmo.disable_grabber(); }

References m_rotate_gizmo.

◆ on_dragging()

void GLGizmoSVG::on_dragging ( const UpdateData & data)
overrideprotectedvirtual

Reimplemented from Slic3r::GUI::GLGizmoBase.

596{ m_rotate_gizmo.dragging(data); }

References m_rotate_gizmo.

◆ on_enable_grabber()

void Slic3r::GUI::GLGizmoSVG::on_enable_grabber ( unsigned int id)
inlineoverrideprotectedvirtual

Reimplemented from Slic3r::GUI::GLGizmoBase.

99{ m_rotate_gizmo.enable_grabber(); }

References m_rotate_gizmo.

◆ on_get_name()

std::string GLGizmoSVG::on_get_name ( ) const
overrideprotectedvirtual

Implements Slic3r::GUI::GLGizmoBase.

397{ return _u8L("SVG"); }

References _u8L.

Referenced by on_render_input_window().

Here is the caller graph for this function:

◆ on_get_requirements()

virtual CommonGizmosDataID Slic3r::GUI::GLGizmoBase::on_get_requirements ( ) const
inlineprotectedvirtualinherited

Reimplemented in Slic3r::GUI::GLGizmoBrimEars, Slic3r::GUI::GLGizmoCut3D, Slic3r::GUI::GLGizmoFlatten, Slic3r::GUI::GLGizmoMeshBoolean, Slic3r::GUI::GLGizmoPainterBase, and Slic3r::GUI::GLGizmoSimplify.

248{ return CommonGizmosDataID(0); }
CommonGizmosDataID
Definition GLGizmosCommon.hpp:72

Referenced by get_requirements().

Here is the caller graph for this function:

◆ on_init()

bool GLGizmoSVG::on_init ( )
overrideprotectedvirtual

Implements Slic3r::GUI::GLGizmoBase.

388{
389 m_rotate_gizmo.init();
390 ColorRGBA gray_color(.6f, .6f, .6f, .3f);
391 m_rotate_gizmo.set_highlight_color(gray_color);
392 // Set rotation gizmo upwardrotate
393 m_rotate_gizmo.set_angle(PI / 2);
394 return true;
395}
static constexpr double PI
Definition libslic3r.h:81

References m_rotate_gizmo, and PI.

◆ on_is_activable()

bool Slic3r::GUI::GLGizmoSVG::on_is_activable ( ) const
inlineoverrideprotectedvirtual

Reimplemented from Slic3r::GUI::GLGizmoBase.

94{ return true; }

◆ on_is_selectable()

bool Slic3r::GUI::GLGizmoSVG::on_is_selectable ( ) const
inlineoverrideprotectedvirtual

Reimplemented from Slic3r::GUI::GLGizmoBase.

95{ return false; }

◆ on_load()

virtual void Slic3r::GUI::GLGizmoBase::on_load ( cereal::BinaryInputArchive & ar)
inlineprotectedvirtualinherited

Reimplemented in Slic3r::GUI::GLGizmoBrimEars, Slic3r::GUI::GLGizmoCut3D, Slic3r::GUI::GLGizmoMeshBoolean, and Slic3r::GUI::GLGizmoPainterBase.

241{}

Referenced by load().

Here is the caller graph for this function:

◆ on_mouse()

bool GLGizmoSVG::on_mouse ( const wxMouseEvent & mouse_event)
overrideprotectedvirtual

Rotate by text on dragging rotate grabers.

Parameters
mouse_eventInformation about mouse
Returns
Propagete normaly return false.

Reimplemented from Slic3r::GUI::GLGizmoBase.

370{
371 // not selected volume
372 if (m_volume == nullptr ||
373 get_model_volume(m_volume_id, m_parent.get_selection().get_model()->objects) == nullptr ||
374 !m_volume->emboss_shape.has_value()) return false;
375
376 if (on_mouse_for_rotation(mouse_event)) return true;
377 if (on_mouse_for_translate(mouse_event)) return true;
378
379 return false;
380}
bool on_mouse_for_translate(const wxMouseEvent &mouse_event)
Definition GLGizmoSVG.cpp:292
bool on_mouse_for_rotation(const wxMouseEvent &mouse_event)
Definition GLGizmoSVG.cpp:279

References Slic3r::GUI::get_model_volume(), Slic3r::GUI::GLGizmoBase::m_parent, m_volume, m_volume_id, on_mouse_for_rotation(), on_mouse_for_translate(), and Slic3r::GUI::wxMouseEvent.

Here is the call graph for this function:

◆ on_mouse_for_rotation()

bool GLGizmoSVG::on_mouse_for_rotation ( const wxMouseEvent & mouse_event)
private
280{
281 if (mouse_event.Moving()) return false;
282
283 bool used = use_grabbers(mouse_event);
284 if (!m_dragging) return used;
285
286 if (mouse_event.Dragging())
288
289 return used;
290}
bool use_grabbers(const wxMouseEvent &mouse_event)
function which Set up m_dragging and call functions on_start_dragging / on_dragging / on_stop_draggin...
Definition GLGizmoBase.cpp:444
std::optional< float > m_rotate_start_angle
Definition GLGizmoSVG.hpp:167
void dragging_rotate_gizmo(double gizmo_angle, std::optional< float > &current_angle, std::optional< float > &start_angle, Selection &selection)
On dragging rotate gizmo func Transform GLVolume from selection.
Definition SurfaceDrag.cpp:457

References Slic3r::GUI::dragging_rotate_gizmo(), m_angle, Slic3r::GUI::GLGizmoBase::m_dragging, Slic3r::GUI::GLGizmoBase::m_parent, m_rotate_gizmo, m_rotate_start_angle, Slic3r::GUI::GLGizmoBase::use_grabbers(), and Slic3r::GUI::wxMouseEvent.

Referenced by on_mouse().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ on_mouse_for_translate()

bool GLGizmoSVG::on_mouse_for_translate ( const wxMouseEvent & mouse_event)
private
293{
294 // exist selected volume?
295 if (m_volume == nullptr)
296 return false;
297
298 auto up_limit = m_keep_up ? std::optional<double>(UP_LIMIT) : std::optional<double>{};
299 const Camera &camera = wxGetApp().plater()->get_camera();
300
301 bool was_dragging = m_surface_drag.has_value();
302 bool res = on_mouse_surface_drag(mouse_event, camera, m_surface_drag, m_parent, m_raycast_manager, up_limit);
303 bool is_dragging = m_surface_drag.has_value();
304
305 // End with surface dragging?
306 if (was_dragging && !is_dragging) {
307 // Update surface by new position
308 if (m_volume->emboss_shape->projection.use_surface)
309 process();
310
311 // TODO: Remove it when it will be stable
312 // Distance should not change during dragging
313 const GLVolume *gl_volume = m_parent.get_selection().get_first_volume();
314 m_distance = calc_distance(*gl_volume, m_raycast_manager, m_parent);
315
316 // Show correct value of height & depth inside of inputs
317 calculate_scale();
318 }
319
320 // Start with dragging
321 else if (!was_dragging && is_dragging) {
322 // Cancel job to prevent interuption of dragging (duplicit result)
323 if (m_job_cancel != nullptr)
324 m_job_cancel->store(true);
325 }
326
327 // during drag
328 else if (was_dragging && is_dragging) {
329 // update scale of selected volume --> should be approx the same
330 calculate_scale();
331
332 // Recalculate angle for GUI
333 if (!m_keep_up)
334 m_angle = calc_angle(m_parent.get_selection());
335 }
336 return res;
337}
Definition 3DScene.hpp:90
bool on_mouse_surface_drag(const wxMouseEvent &mouse_event, const Camera &camera, std::optional< SurfaceDrag > &surface_drag, GLCanvas3D &canvas, RaycastManager &raycast_manager, const std::optional< double > &up_limit)
Mouse event handler, when move(drag&drop) volume over model surface NOTE: Dragged volume has to be se...
Definition SurfaceDrag.cpp:100
std::optional< float > calc_distance(const GLVolume &gl_volume, RaycastManager &raycaster, GLCanvas3D &canvas)
Calculate distance by ray to surface of object in emboss direction.
Definition SurfaceDrag.cpp:198
bool process(std::exception_ptr &eptr)
Definition EmbossJob.cpp:1427
Definition Camera.hpp:26

References Slic3r::GUI::calc_angle(), Slic3r::GUI::calc_distance(), calculate_scale(), Slic3r::GUI::GLGizmoBase::is_dragging(), m_angle, m_distance, m_job_cancel, m_keep_up, Slic3r::GUI::GLGizmoBase::m_parent, m_raycast_manager, m_surface_drag, m_volume, Slic3r::GUI::on_mouse_surface_drag(), process(), Slic3r::GUI::UP_LIMIT, and Slic3r::GUI::wxMouseEvent.

Referenced by on_mouse().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ on_register_raycasters_for_picking()

void GLGizmoSVG::on_register_raycasters_for_picking ( )
overrideprotectedvirtual

Reimplemented from Slic3r::GUI::GLGizmoBase.

417 {
418 m_rotate_gizmo.register_raycasters_for_picking();
419}

References m_rotate_gizmo.

◆ on_render()

void GLGizmoSVG::on_render ( )
overrideprotectedvirtual

Implements Slic3r::GUI::GLGizmoBase.

399 {
400 if (const Selection &selection = m_parent.get_selection();
401 selection.volumes_count() != 1 || // only one selected volume
402 m_volume == nullptr || // already selected volume in gizmo
403 get_model_volume(m_volume_id, selection.get_model()->objects) == nullptr) // still exist model
404 return;
405
406 bool is_surface_dragging = m_surface_drag.has_value();
407 bool is_parent_dragging = m_parent.is_mouse_dragging();
408 // Do NOT render rotation grabbers when dragging object
409 bool is_rotate_by_grabbers = m_dragging;
410 if (is_rotate_by_grabbers ||
411 (!is_surface_dragging && !is_parent_dragging)) {
413 m_rotate_gizmo.render();
414 }
415}
#define glsafe(cmd)
Definition OpenGLUtils.hpp:25
std::optional< SurfaceDrag > m_surface_drag
Definition GLGizmoSVG.hpp:180
#define GL_DEPTH_BUFFER_BIT
Definition gl.h:558
#define glClear
Definition gl.h:3357

References Slic3r::GUI::get_model_volume(), GL_DEPTH_BUFFER_BIT, glClear, glsafe, Slic3r::GUI::GLGizmoBase::m_dragging, Slic3r::GUI::GLGizmoBase::m_parent, m_rotate_gizmo, m_surface_drag, m_volume, and m_volume_id.

Here is the call graph for this function:

◆ on_render_input_window()

void GLGizmoSVG::on_render_input_window ( float x,
float y,
float bottom_limit )
overrideprotectedvirtual

Reimplemented from Slic3r::GUI::GLGizmoBase.

483{
485
486 double screen_scale = wxDisplay(wxGetApp().plater()).GetScaleFactor();
487
488 // Orca
490 ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(4.0, 5.0) * screen_scale);
491 ImGui::PushStyleVar(ImGuiStyleVar_ScrollbarSize, 4.0f * screen_scale);
492
493 // Configuration creation
494 if (m_gui_cfg == nullptr || // Exist configuration - first run
495 m_gui_cfg->screen_scale != screen_scale || // change of DPI
496 m_gui_cfg->dark_mode != m_is_dark_mode // change of dark mode
497 ) {
498 // Create cache for gui offsets
499 ::GuiCfg cfg = create_gui_configuration();
500 cfg.screen_scale = screen_scale;
501 cfg.dark_mode = m_is_dark_mode;
502
503 GuiCfg gui_cfg{std::move(cfg)};
504 m_gui_cfg = std::make_unique<const GuiCfg>(std::move(gui_cfg));
505
506 m_icons = init_icons(m_icon_manager, *m_gui_cfg); // need regeneration when change resolution(move between monitors)
507 }
508
509 // Draw origin position of text during dragging
510 if (m_surface_drag.has_value()) {
511 ImVec2 mouse_pos = ImGui::GetMousePos();
512 ImVec2 center(
513 mouse_pos.x + m_surface_drag->mouse_offset.x(),
514 mouse_pos.y + m_surface_drag->mouse_offset.y());
515 ImU32 color = ImGui::GetColorU32(
516 m_surface_drag->exist_hit ?
517 ImVec4(1.f, 1.f, 1.f, .75f) : // transparent white
518 ImVec4(1.f, .3f, .3f, .75f)
519 ); // Warning color
520 const float radius = 16.f;
522 }
523
524 static float last_y = 0.0f;
525 static float last_h = 0.0f;
526
527 // adjust window position to avoid overlap the view toolbar
528 const float win_h = ImGui::GetWindowHeight();
529 y = std::min(y, bottom_limit - win_h);
530 GizmoImguiSetNextWIndowPos(x, y, ImGuiCond_Always, 0.0f, 0.0f);
531 if (last_h != win_h || last_y != y) {
532 // ask canvas for another frame to render the window in the correct position
533 m_imgui->set_requires_extra_frame();
534 if (last_h != win_h)
535 last_h = win_h;
536 if (last_y != y)
537 last_y = y;
538 }
539
540 GizmoImguiBegin(on_get_name(), ImGuiWindowFlags_NoMove | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoTitleBar);
541
542 draw_window();
543
545
546 // Orca
547 ImGui::PopStyleVar(2);
549}
void GizmoImguiEnd()
Definition GLGizmoBase.cpp:372
bool GizmoImguiBegin(const std::string &name, int flags)
Definition GLGizmoBase.cpp:367
void draw_window()
Definition GLGizmoSVG.cpp:1347
IconManager m_icon_manager
Definition GLGizmoSVG.hpp:198
std::string on_get_name() const override
Definition GLGizmoSVG.cpp:397
static void push_toolbar_style(const float scale)
Definition ImGuiWrapper.cpp:2705
static void pop_toolbar_style()
Definition ImGuiWrapper.cpp:2757
static void draw_cross_hair(const ImVec2 &position, float radius=16.f, ImU32 color=ImGui::GetColorU32(ImVec4(1.f, 1.f, 1.f,.75f)), int num_segments=0, float thickness=4.f)
Draw symbol of cross hair.
Definition ImGuiWrapper.cpp:2587
void center(ExPolygonsWithIds &e)
Definition Emboss.cpp:1382
GuiCfg create_gui_configuration()
Definition GLGizmoEmboss.cpp:3798
IconManager::VIcons init_icons(IconManager &mng, const GuiCfg &cfg)
Definition GLGizmoSVG.cpp:425
Definition GLGizmoSVG.cpp:232

References Slic3r::center(), Slic3r::GUI::ImGuiWrapper::draw_cross_hair(), draw_window(), Slic3r::GUI::GLGizmoBase::GizmoImguiBegin(), Slic3r::GUI::GLGizmoBase::GizmoImguiEnd(), Slic3r::GUI::GLGizmoBase::GizmoImguiSetNextWIndowPos(), m_gui_cfg, m_icon_manager, m_icons, Slic3r::GUI::GLGizmoBase::m_imgui, Slic3r::GUI::GLGizmoBase::m_is_dark_mode, Slic3r::GUI::GLGizmoBase::m_parent, m_surface_drag, on_get_name(), Slic3r::GUI::plater(), Slic3r::GUI::ImGuiWrapper::pop_toolbar_style(), Slic3r::GUI::ImGuiWrapper::push_toolbar_style(), and set_volume_by_selection().

Here is the call graph for this function:

◆ on_save()

virtual void Slic3r::GUI::GLGizmoBase::on_save ( cereal::BinaryOutputArchive & ar) const
inlineprotectedvirtualinherited

Reimplemented in Slic3r::GUI::GLGizmoBrimEars, Slic3r::GUI::GLGizmoCut3D, Slic3r::GUI::GLGizmoMeshBoolean, and Slic3r::GUI::GLGizmoPainterBase.

242{}

Referenced by save().

Here is the caller graph for this function:

◆ on_set_hover_id()

void Slic3r::GUI::GLGizmoSVG::on_set_hover_id ( )
inlineoverrideprotectedvirtual

◆ on_set_state()

void GLGizmoSVG::on_set_state ( )
overrideprotectedvirtual

Reimplemented from Slic3r::GUI::GLGizmoBase.

552{
553 // enable / disable bed from picking
554 // Rotation gizmo must work through bed
555 m_parent.set_raycaster_gizmos_on_top(GLGizmoBase::m_state == GLGizmoBase::On);
556
558
559 // Closing gizmo. e.g. selecting another one
561 reset_volume();
563 // Try(when exist) set text configuration by volume
565 }
566}

References Slic3r::GUI::GLGizmoBase::m_parent, m_rotate_gizmo, Slic3r::GUI::GLGizmoBase::m_state, Slic3r::GUI::GLGizmoBase::Off, Slic3r::GUI::GLGizmoBase::On, reset_volume(), and set_volume_by_selection().

Here is the call graph for this function:

◆ on_start_dragging()

void GLGizmoSVG::on_start_dragging ( )
overrideprotectedvirtual

Reimplemented from Slic3r::GUI::GLGizmoBase.

574{ m_rotate_gizmo.start_dragging(); }

References m_rotate_gizmo.

◆ on_stop_dragging()

void GLGizmoSVG::on_stop_dragging ( )
overrideprotectedvirtual

Reimplemented from Slic3r::GUI::GLGizmoBase.

576{
577 m_rotate_gizmo.stop_dragging();
578
579 // TODO: when start second rotatiton previous rotation rotate draggers
580 // This is fast fix for second try to rotate
581 // When fixing, move grabber above text (not on side)
582 m_rotate_gizmo.set_angle(PI/2);
583
584 // apply rotation
585 // TRN This is an item label in the undo-redo stack.
586 m_parent.do_rotate(rotation_snapshot_name);
587 m_rotate_start_angle.reset();
589
590 // recalculate for surface cut
591 if (m_volume != nullptr &&
592 m_volume->emboss_shape.has_value() &&
593 m_volume->emboss_shape->projection.use_surface)
594 process();
595}

References Slic3r::GUI::GLGizmoBase::m_parent, m_rotate_gizmo, m_rotate_start_angle, m_volume, PI, process(), and volume_transformation_changed().

Here is the call graph for this function:

◆ on_unregister_raycasters_for_picking()

void GLGizmoSVG::on_unregister_raycasters_for_picking ( )
overrideprotectedvirtual

Reimplemented from Slic3r::GUI::GLGizmoBase.

420 {
421 m_rotate_gizmo.unregister_raycasters_for_picking();
422}

References m_rotate_gizmo.

◆ process()

bool GLGizmoSVG::process ( bool make_snapshot = true)
private
1313 {
1314 // no volume is selected -> selection from right panel
1315 assert(m_volume != nullptr);
1316 if (m_volume == nullptr)
1317 return false;
1318
1319 assert(m_volume->emboss_shape.has_value());
1320 if (!m_volume->emboss_shape.has_value())
1321 return false;
1322
1323 // Cancel previous Job, when it is in process
1324 // worker.cancel(); --> Use less in this case I want cancel only previous EmbossJob no other jobs
1325 // Cancel only EmbossUpdateJob no others
1326 if (m_job_cancel != nullptr)
1327 m_job_cancel->store(true);
1328 // create new shared ptr to cancel new job
1329 m_job_cancel = std::make_shared<std::atomic<bool>>(false);
1330
1331 EmbossShape shape = m_volume_shape; // copy
1332 auto base = std::make_unique<DataBase>(m_volume->name, m_job_cancel, std::move(shape));
1333 base->is_outside = m_volume->type() == ModelVolumeType::MODEL_PART;
1334 DataUpdate data{std::move(base), m_volume_id, make_snapshot};
1335 return start_update_volume(std::move(data), *m_volume, m_parent.get_selection(), m_raycast_manager);
1336}
bool start_update_volume(DataUpdate &&data, const ModelVolume &volume, const Selection &selection, RaycastManager &raycaster)
Start job for update embossed volume.
Definition EmbossJob.cpp:671

References m_job_cancel, Slic3r::GUI::GLGizmoBase::m_parent, m_raycast_manager, m_volume, m_volume_id, m_volume_shape, Slic3r::MODEL_PART, and Slic3r::GUI::Emboss::start_update_volume().

Referenced by draw_depth(), draw_filename(), draw_mirroring(), draw_model_type(), draw_rotation(), draw_size(), draw_use_surface(), on_mouse_for_translate(), on_stop_dragging(), and volume_transformation_changed().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ register_grabbers_for_picking()

void Slic3r::GUI::GLGizmoBase::register_grabbers_for_picking ( )
protectedinherited
399{
400 for (size_t i = 0; i < m_grabbers.size(); ++i) {
401 m_grabbers[i].register_raycasters_for_picking((m_group_id >= 0) ? m_group_id : i);
402 }
403}
int m_group_id
Definition GLGizmoBase.hpp:145

References m_grabbers, and m_group_id.

Referenced by register_raycasters_for_picking().

Here is the caller graph for this function:

◆ register_raycasters_for_picking()

void Slic3r::GUI::GLGizmoBase::register_raycasters_for_picking ( )
inlineinherited
void register_grabbers_for_picking()
Definition GLGizmoBase.cpp:398
virtual void on_register_raycasters_for_picking()
Definition GLGizmoBase.hpp:267

References on_register_raycasters_for_picking(), and register_grabbers_for_picking().

Referenced by Slic3r::GUI::GLGizmosManager::activate_gizmo(), and Slic3r::GUI::GLCanvas3D::reload_scene().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ render()

void Slic3r::GUI::GLGizmoBase::render ( )
inlineinherited
214{ on_render(); }
virtual void on_render()=0

References on_render().

Here is the call graph for this function:

◆ render_combo()

bool Slic3r::GUI::GLGizmoBase::render_combo ( const std::string & label,
const std::vector< std::string > & lines,
int & selection_idx,
float label_width,
float item_width )
protectedinherited
227{
229 ImGui::AlignTextToFramePadding();
230 m_imgui->text(label);
231 ImGui::SameLine(label_width);
232 ImGui::PushItemWidth(item_width);
233
234 size_t selection_out = selection_idx;
235
236 const char *selected_str = (selection_idx >= 0 && selection_idx < int(lines.size())) ? lines[selection_idx].c_str() : "";
237 if (ImGui::BBLBeginCombo(("##" + label).c_str(), selected_str, 0)) {
238 for (size_t line_idx = 0; line_idx < lines.size(); ++line_idx) {
239 ImGui::PushID(int(line_idx));
240 if (ImGui::Selectable("", line_idx == selection_idx)) selection_out = line_idx;
241
242 ImGui::SameLine();
243 ImGui::Text("%s", lines[line_idx].c_str());
244 ImGui::PopID();
245 }
246
247 ImGui::EndCombo();
248 }
249
250 bool is_changed = selection_idx != selection_out;
251 selection_idx = selection_out;
252
253 //if (is_changed) update_connector_shape();
255
256 return is_changed;
257}

References m_imgui, m_parent, Slic3r::GUI::ImGuiWrapper::pop_combo_style(), and Slic3r::GUI::ImGuiWrapper::push_combo_style().

Referenced by Slic3r::GUI::GLGizmoAssembly::render_assembly_mode_combo(), and Slic3r::GUI::GLGizmoCut3D::render_connectors_input_window().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ render_cross_mark()

void Slic3r::GUI::GLGizmoBase::render_cross_mark ( const Vec3f & target,
bool is_single = false )
protectedinherited
260{
261 const float half_length = 4.0f;
262
263 // ORCA: OpenGL Core Profile
264#if !SLIC3R_OPENGL_ES
265 if (!OpenGLManager::get_gl_info().is_core_profile())
266 glsafe(::glLineWidth(2.0f));
267#endif // !SLIC3R_OPENGL_ES
268
269 auto render_line = [](const Vec3f& p1, const Vec3f& p2, const ColorRGBA& color) {
270 GLModel::Geometry init_data;
272 init_data.color = color;
273 init_data.reserve_vertices(2);
274 init_data.reserve_indices(2);
275
276 // vertices
277 init_data.add_vertex(p1);
278 init_data.add_vertex(p2);
279
280 // indices
281 init_data.add_line(0, 1);
282
283 GLModel model;
284 model.init_from(std::move(init_data));
285 model.render();
286 };
287
288 // draw line for x axis
289 if (!is_single) {
290 render_line(
291 {target(0) - half_length, target(1), target(2)},
292 {target(0) + half_length, target(1), target(2)},
293 ColorRGBA::X()); // ORCA match axis colors
294 }
295 else {
296 render_line(
297 {target(0), target(1), target(2)},
298 {target(0) + half_length, target(1), target(2)},
299 ColorRGBA::X()); // ORCA match axis colors
300 }
301 // draw line for y axis
302 if (!is_single) {
303 render_line(
304 {target(0), target(1) - half_length, target(2)},
305 {target(0), target(1) + half_length, target(2)},
306 ColorRGBA::Y()); // ORCA match axis colors
307 } else {
308 render_line(
309 {target(0), target(1), target(2)},
310 {target(0), target(1) + half_length, target(2)},
311 ColorRGBA::Y()); // ORCA match axis colors
312 }
313 // draw line for z axis
314 if (!is_single) {
315 render_line(
316 {target(0), target(1), target(2) - half_length},
317 {target(0), target(1), target(2) + half_length},
318 ColorRGBA::Z()); // ORCA match axis colors
319 } else {
320 render_line(
321 {target(0), target(1), target(2)},
322 {target(0), target(1), target(2) + half_length},
323 ColorRGBA::Z()); // ORCA match axis colors
324 }
325}
static const ColorRGBA Y()
Definition Color.hpp:146
static const ColorRGBA X()
Definition Color.hpp:145
static const ColorRGBA Z()
Definition Color.hpp:147
static const GLInfo & get_gl_info()
Definition OpenGLManager.hpp:106
#define glLineWidth
Definition gl.h:4215
Eigen::Matrix< float, 3, 1, Eigen::DontAlign > Vec3f
Definition Point.hpp:65

References Slic3r::GUI::GLModel::Geometry::add_line(), Slic3r::GUI::GLModel::Geometry::add_vertex(), Slic3r::GUI::GLModel::Geometry::color, Slic3r::GUI::GLModel::Geometry::format, Slic3r::GUI::OpenGLManager::get_gl_info(), glLineWidth, glsafe, Slic3r::GUI::GLModel::init_from(), Slic3r::GUI::GLModel::Geometry::Lines, Slic3r::GUI::GLModel::Geometry::P3, Slic3r::GUI::GLModel::render(), Slic3r::GUI::GLModel::Geometry::reserve_indices(), Slic3r::GUI::GLModel::Geometry::reserve_vertices(), Slic3r::ColorRGBA::X(), Slic3r::ColorRGBA::Y(), and Slic3r::ColorRGBA::Z().

Referenced by Slic3r::GUI::GLGizmoMove3D::on_render().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ render_follows_cursor()

virtual bool Slic3r::GUI::GLGizmoBase::render_follows_cursor ( ) const
inlinevirtualinherited

Reimplemented in Slic3r::GUI::GLGizmoBrimEars, Slic3r::GUI::GLGizmoMeasure, and Slic3r::GUI::GLGizmoPainterBase.

189{ return false; }

Referenced by Slic3r::GUI::GLCanvas3D::_is_scene_cacheable().

Here is the caller graph for this function:

◆ render_grabbers() [1/3]

void Slic3r::GUI::GLGizmoBase::render_grabbers ( const BoundingBoxf3 & box) const
protectedinherited
413{
414#if ENABLE_FIXED_GRABBER
416#else
417 render_grabbers((float)((box.size().x() + box.size().y() + box.size().z()) / 3.0));
418#endif
419}
void render_grabbers(const BoundingBoxf3 &box) const
Definition GLGizmoBase.cpp:412
static const float FixedGrabberSize
Definition GLGizmoBase.hpp:90

References Slic3r::GUI::GLGizmoBase::Grabber::FixedGrabberSize, render_grabbers(), and Slic3r::BoundingBox3Base< PointType >::size().

Referenced by Slic3r::GUI::GLGizmoMove3D::on_render(), Slic3r::GUI::GLGizmoScale3D::on_render(), Slic3r::GUI::GLGizmoRotate::render_grabber(), render_grabbers(), and render_grabbers().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ render_grabbers() [2/3]

void Slic3r::GUI::GLGizmoBase::render_grabbers ( float size) const
protectedinherited
422{
423 render_grabbers(0, m_grabbers.size() - 1, size, false);
424}

References m_grabbers, and render_grabbers().

Here is the call graph for this function:

◆ render_grabbers() [3/3]

void Slic3r::GUI::GLGizmoBase::render_grabbers ( size_t first,
size_t last,
float size,
bool force_hover ) const
protectedinherited
427{
428 GLShaderProgram* shader = wxGetApp().get_shader("gouraud_light");
429 if (shader == nullptr)
430 return;
431 shader->start_using();
432 shader->set_uniform("emission_factor", 0.1f);
434 for (size_t i = first; i <= last; ++i) {
435 if (m_grabbers[i].enabled)
436 m_grabbers[i].render(force_hover ? true : m_hover_id == (int)i, size);
437 }
439 shader->stop_using();
440}
#define glEnable
Definition gl.h:3667
#define GL_CULL_FACE
Definition gl.h:500
#define glDisable
Definition gl.h:3607

References GL_CULL_FACE, glDisable, glEnable, glsafe, m_grabbers, m_hover_id, Slic3r::GLShaderProgram::set_uniform(), Slic3r::GLShaderProgram::start_using(), and Slic3r::GLShaderProgram::stop_using().

Here is the call graph for this function:

◆ render_input_window()

void Slic3r::GUI::GLGizmoBase::render_input_window ( float x,
float y,
float bottom_limit )
inherited
529{
530 on_render_input_window(x, y, bottom_limit);
532 // imgui windows that don't have an initial size needs to be processed once to get one
533 // and are not rendered in the first frame
534 // so, we forces to render another frame the first time the imgui window is shown
535 // https://github.com/ocornut/imgui/issues/2949
536 m_parent.set_as_dirty();
537 m_parent.request_extra_frame();
539 }
540}
virtual void on_render_input_window(float x, float y, float bottom_limit)
Definition GLGizmoBase.hpp:258
bool m_first_input_window_render
Definition GLGizmoBase.hpp:154

References m_first_input_window_render, m_parent, and on_render_input_window().

Here is the call graph for this function:

◆ reset_volume()

void GLGizmoSVG::reset_volume ( )
private
1259{
1260 if (m_volume == nullptr)
1261 return; // already reseted
1262
1263 m_volume = nullptr;
1264 m_volume_id.id = 0;
1265 m_volume_shape.shapes_with_ids.clear();
1266 m_filename_preview.clear();
1267 m_shape_warnings.clear();
1268 // delete texture after finish imgui draw
1269 wxGetApp().plater()->CallAfter([&texture = m_texture]() { delete_texture(texture); });
1270}
void delete_texture(Texture &texture)
Definition GLGizmoSVG.cpp:1251

References m_filename_preview, m_shape_warnings, m_texture, m_volume, m_volume_id, and m_volume_shape.

Referenced by close(), on_set_state(), and set_volume_by_selection().

Here is the caller graph for this function:

◆ save()

void Slic3r::GUI::GLGizmoBase::save ( cereal::BinaryOutputArchive & ar) const
inlineinherited
171{ on_save(ar); }
virtual void on_save(cereal::BinaryOutputArchive &ar) const
Definition GLGizmoBase.hpp:242

References on_save().

Here is the call graph for this function:

◆ set_common_data_pool()

void Slic3r::GUI::GLGizmoBase::set_common_data_pool ( CommonGizmosDataPool * ptr)
inlineinherited
193{ m_c = ptr; }
CommonGizmosDataPool * m_c
Definition GLGizmoBase.hpp:155

References m_c.

◆ set_dirty()

void Slic3r::GUI::GLGizmoBase::set_dirty ( )
protectedinherited
524 {
525 m_dirty = true;
526}
bool m_dirty
Definition GLGizmoBase.hpp:293

References m_dirty.

Referenced by Slic3r::GUI::GLGizmoCut3D::process_cut_line(), and Slic3r::GUI::GLGizmoSimplify::request_rerender().

Here is the caller graph for this function:

◆ set_hover_id()

void Slic3r::GUI::GLGizmoBase::set_hover_id ( int id)
inherited
348{
349 // do not change hover id during dragging
350 assert(!m_dragging);
351
352 // allow empty grabbers when not using grabbers but use hover_id - flatten, rotate
353// if (!m_grabbers.empty() && id >= (int) m_grabbers.size())
354// return;
355
356 m_hover_id = id;
358}
virtual void on_set_hover_id()
Definition GLGizmoBase.hpp:245

References m_dragging, m_hover_id, and on_set_hover_id().

Referenced by Slic3r::GUI::GLGizmoRotate3D::on_set_hover_id().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_icon_filename()

void Slic3r::GUI::GLGizmoBase::set_icon_filename ( const std::string & filename)
inherited
343 {
344 m_icon_filename = filename;
345}

References m_icon_filename.

◆ set_state()

void Slic3r::GUI::GLGizmoBase::set_state ( EState state)
inlineinherited
176{ m_state = state; on_set_state(); }
virtual void on_set_state()
Definition GLGizmoBase.hpp:244

References m_state, and on_set_state().

Referenced by Slic3r::GUI::GLGizmosManager::activate_gizmo().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_volume_by_selection()

void GLGizmoSVG::set_volume_by_selection ( )
private
1188{
1189 const Selection &selection = m_parent.get_selection();
1190 const GLVolume *gl_volume = get_selected_gl_volume(selection);
1191 if (gl_volume == nullptr)
1192 return reset_volume();
1193
1194 const ModelObjectPtrs &objects = selection.get_model()->objects;
1195 ModelVolume *volume =get_model_volume(*gl_volume, objects);
1196 if (volume == nullptr)
1197 return reset_volume();
1198
1199 // is same volume as actual selected?
1200 if (volume->id() == m_volume_id)
1201 return;
1202
1203 // Do not use focused input value when switch volume(it must swith value)
1204 if (m_volume != nullptr &&
1205 m_volume != volume) // when update volume it changed id BUT not pointer
1207
1208 // is valid svg volume?
1209 if (!is_svg(*volume))
1210 return reset_volume();
1211
1212 // cancel previous job
1213 if (m_job_cancel != nullptr) {
1214 m_job_cancel->store(true);
1215 m_job_cancel = nullptr;
1216 }
1217
1218 // calculate scale for height and depth inside of scaled object instance
1219 calculate_scale(); // must be before calculation of tesselation
1220
1221 // checking that exist is inside of function "is_svg"
1222 EmbossShape &es = *volume->emboss_shape;
1223 EmbossShape::SvgFile &svg_file = *es.svg_file;
1224 if (svg_file.image == nullptr) {
1225 if (init_image(svg_file) == nullptr)
1226 return reset_volume();
1227 }
1228 assert(svg_file.image != nullptr);
1229 assert(svg_file.image.get() != nullptr);
1230 const NSVGimage &image = *svg_file.image;
1231 ExPolygonsWithIds &shape_ids = es.shapes_with_ids;
1232 if (shape_ids.empty()) {
1233 NSVGLineParams params{get_tesselation_tolerance(get_scale_for_tolerance())};
1234 shape_ids = create_shape_with_ids(image, params);
1235 }
1236
1237 reset_volume(); // clear cached data
1238
1239 m_volume = volume;
1240 m_volume_id = volume->id();
1241 m_volume_shape = es; // copy
1243
1244 // Calculate current angle of up vector
1245 m_angle = calc_angle(selection);
1247
1248 m_shape_bb = get_extents(m_volume_shape.shapes_with_ids);
1249}
static bool is_svg(const ModelVolume &volume)
Check whether volume has emboss data.
Definition GLGizmoSVG.cpp:265
static void left_inputs()
Use ImGui internals to unactivate (lose focus) in input. When input is activ it can't change value by...
Definition ImGuiWrapper.cpp:2423
GLVolume * get_selected_gl_volume(const GLCanvas3D &canvas)
Definition GLCanvas3D.cpp:13003
BoundingBox get_extents(const ExPolygonsWithIds &e)
Definition Emboss.cpp:1374
std::vector< ModelObject * > ModelObjectPtrs
Definition CutUtils.hpp:13
NSVGimage * init_image(EmbossShape::SvgFile &svg_file)
Definition NSVGUtils.cpp:133
std::shared_ptr< NSVGimage > image
Definition EmbossShape.hpp:101

References Slic3r::GUI::calc_angle(), Slic3r::GUI::calc_distance(), calculate_scale(), Slic3r::create_shape_with_ids(), Slic3r::ModelVolume::emboss_shape, Slic3r::get_extents(), Slic3r::GUI::Selection::get_model(), Slic3r::GUI::get_model_volume(), get_scale_for_tolerance(), Slic3r::GUI::get_selected_gl_volume(), Slic3r::ObjectBase::id(), Slic3r::EmbossShape::SvgFile::image, Slic3r::init_image(), is_svg(), Slic3r::GUI::ImGuiWrapper::left_inputs(), m_angle, m_distance, m_job_cancel, Slic3r::GUI::GLGizmoBase::m_parent, m_raycast_manager, m_shape_bb, m_shape_warnings, m_volume, m_volume_id, m_volume_shape, Slic3r::Model::objects, reset_volume(), Slic3r::EmbossShape::shapes_with_ids, and Slic3r::EmbossShape::svg_file.

Referenced by data_changed(), on_render_input_window(), and on_set_state().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ shortcut()

std::optional< Shortcut > Slic3r::GUI::GLGizmoBase::shortcut ( ) const
inlineinherited
178{ return m_shortcut; }

References m_shortcut.

Referenced by Slic3r::GUI::GLGizmoFdmSupports::on_tool_shortcut(), Slic3r::GUI::GLGizmoMmuSegmentation::on_tool_shortcut(), Slic3r::GUI::GLGizmoPainterBase::on_tool_shortcut(), and Slic3r::GUI::GLGizmoSeam::on_tool_shortcut().

Here is the caller graph for this function:

◆ unregister_grabbers_for_picking()

void Slic3r::GUI::GLGizmoBase::unregister_grabbers_for_picking ( )
protectedinherited
406{
407 for (size_t i = 0; i < m_grabbers.size(); ++i) {
408 m_grabbers[i].unregister_raycasters_for_picking();
409 }
410}

References m_grabbers.

Referenced by unregister_raycasters_for_picking().

Here is the caller graph for this function:

◆ unregister_raycasters_for_picking()

void Slic3r::GUI::GLGizmoBase::unregister_raycasters_for_picking ( )
inlineinherited
virtual void on_unregister_raycasters_for_picking()
Definition GLGizmoBase.hpp:268
void unregister_grabbers_for_picking()
Definition GLGizmoBase.cpp:405

References on_unregister_raycasters_for_picking(), and unregister_grabbers_for_picking().

Referenced by Slic3r::GUI::GLGizmosManager::activate_gizmo(), and Slic3r::GUI::GLCanvas3D::reload_scene().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_items_state()

bool Slic3r::GUI::GLGizmoBase::update_items_state ( )
inherited
361{
362 bool res = m_dirty;
363 m_dirty = false;
364 return res;
365}

References m_dirty.

◆ update_render_colors()

void Slic3r::GUI::GLGizmoBase::update_render_colors ( )
staticinherited

References AXES_COLOR, Slic3r::RenderColor::colors, FLATTEN_COLOR, FLATTEN_HOVER_COLOR, Slic3r::GUI::ImGuiWrapper::from_ImVec4(), RenderCol_Flatten_Plane, RenderCol_Flatten_Plane_Hover, RenderCol_Grabber_X, RenderCol_Grabber_Y, and RenderCol_Grabber_Z.

Referenced by Slic3r::GUI::GLCanvas3D::_render_style_editor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ use_grabbers()

bool Slic3r::GUI::GLGizmoBase::use_grabbers ( const wxMouseEvent & mouse_event)
protectedinherited

function which Set up m_dragging and call functions on_start_dragging / on_dragging / on_stop_dragging

Parameters
mouse_eventKeep information about mouse click
Returns
same as on_mouse
444 {
445 bool is_dragging_finished = false;
446 if (mouse_event.Moving()) {
447 // it should not happen but for sure
448 assert(!m_dragging);
449 if (m_dragging) is_dragging_finished = true;
450 else return false;
451 }
452
453 if (mouse_event.LeftDown()) {
454 Selection &selection = m_parent.get_selection();
455 if (!selection.is_empty() && m_hover_id != -1 /* &&
456 (m_grabbers.empty() || m_hover_id < static_cast<int>(m_grabbers.size()))*/) {
457 selection.setup_cache();
458
459 m_dragging = true;
460 for (auto &grabber : m_grabbers) grabber.dragging = false;
461// if (!m_grabbers.empty() && m_hover_id < int(m_grabbers.size()))
462// m_grabbers[m_hover_id].dragging = true;
463
465
466 // Let the plater know that the dragging started
467 m_parent.post_event(SimpleEvent(EVT_GLCANVAS_MOUSE_DRAGGING_STARTED));
468 m_parent.set_as_dirty();
469 return true;
470 }
471 } else if (m_dragging) {
472 // when mouse cursor leave window than finish actual dragging operation
473 bool is_leaving = mouse_event.Leaving() && !m_parent.has_mouse_capture(); // ORCA keep tracking mouse position while drag active and cursor not in window bounds
474 if (mouse_event.Dragging()) {
475 Point mouse_coord(mouse_event.GetX(), mouse_event.GetY());
476 auto ray = m_parent.mouse_ray(mouse_coord);
477 UpdateData data(ray, mouse_coord);
478
479 on_dragging(data);
480
481 wxGetApp().obj_manipul()->set_dirty();
482 m_parent.set_as_dirty();
483 return true;
484 }
485 else if (mouse_event.LeftUp() || is_leaving || is_dragging_finished) {
486 do_stop_dragging(is_leaving);
487 return true;
488 }
489 }
490 return false;
491}
virtual void on_dragging(const UpdateData &data)
Definition GLGizmoBase.hpp:255
virtual void on_start_dragging()
Definition GLGizmoBase.hpp:253
void do_stop_dragging(bool perform_mouse_cleanup)
Definition GLGizmoBase.cpp:493
Definition GLGizmoBase.hpp:133

References do_stop_dragging(), Slic3r::GUI::Selection::is_empty(), m_dragging, m_grabbers, m_hover_id, m_parent, on_dragging(), on_start_dragging(), Slic3r::GUI::Selection::setup_cache(), and Slic3r::GUI::wxMouseEvent.

Referenced by Slic3r::GUI::GLGizmoBrimEars::on_mouse(), Slic3r::GUI::GLGizmoCut3D::on_mouse(), Slic3r::GUI::GLGizmoMove3D::on_mouse(), Slic3r::GUI::GLGizmoRotate3D::on_mouse(), Slic3r::GUI::GLGizmoRotate::on_mouse(), Slic3r::GUI::GLGizmoScale3D::on_mouse(), Slic3r::GUI::GLGizmoEmboss::on_mouse_for_rotation(), and Slic3r::GUI::GLGizmoSVG::on_mouse_for_rotation().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ volume_transformation_changed()

void GLGizmoSVG::volume_transformation_changed ( )
private
340{
341 if (m_volume == nullptr ||
342 !m_volume->emboss_shape.has_value()) {
343 assert(false);
344 return;
345 }
346
347 if (!m_keep_up) {
348 // update current style
349 m_angle = calc_angle(m_parent.get_selection());
350 } else {
351 // angle should be the same
352 assert(is_approx(m_angle, calc_angle(m_parent.get_selection())));
353 }
354
355 // Update surface by new position
356 if (m_volume->emboss_shape->projection.use_surface) {
357 process();
358 } else {
359 // inform slicing process that model changed
360 // SLA supports, processing
361 // ensure on bed
362 wxGetApp().plater()->changed_object(*m_volume->get_object());
363 }
364
365 // Show correct value of height & depth inside of inputs
367}

References Slic3r::GUI::calc_angle(), calculate_scale(), Slic3r::is_approx(), m_angle, m_keep_up, Slic3r::GUI::GLGizmoBase::m_parent, m_volume, and process().

Referenced by draw_face_the_camera(), draw_mirroring(), and on_stop_dragging().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ wants_enter_leave_snapshots()

bool GLGizmoSVG::wants_enter_leave_snapshots ( ) const
overrideprotectedvirtual

Reimplemented from Slic3r::GUI::GLGizmoBase.

382{ return true; }

Member Data Documentation

◆ AXES_COLOR

◆ AXES_HOVER_COLOR

std::array< ColorRGBA, 3 > Slic3r::GUI::GLGizmoBase::AXES_HOVER_COLOR
staticinherited
Initial value:
= {{
{ColorRGBA::X().r() * 1.2f, ColorRGBA::X().g() * 1.4f, ColorRGBA::X().b() * 1.4f, 1.0f},
{ColorRGBA::Y().r() * 1.2f, ColorRGBA::Y().g() * 1.2f, ColorRGBA::Y().b() * 1.2f, 1.0f},
{ColorRGBA::Z().r() * 1.2f, ColorRGBA::Z().g() * 1.2f, ColorRGBA::Z().b() * 1.2f, 1.0f},
}}
float b() const
Definition Color.hpp:107
float r() const
Definition Color.hpp:105
float g() const
Definition Color.hpp:106

Referenced by Slic3r::GUI::GLGizmoMove3D::on_render(), Slic3r::GUI::GLGizmoRotate::on_render(), and Slic3r::GUI::GLGizmoScale3D::update_grabbers_data().

◆ BASE_ID

const unsigned int Slic3r::GUI::GLGizmoBase::BASE_ID = 255 * 255 * 254
staticinherited

◆ CONSTRAINED_COLOR

ColorRGBA Slic3r::GUI::GLGizmoBase::CONSTRAINED_COLOR = {0.5f, 0.5f, 0.5f, 1.0f}
staticinherited

◆ count

◆ DEFAULT_BASE_COLOR

ColorRGBA Slic3r::GUI::GLGizmoBase::DEFAULT_BASE_COLOR = { 0.625f, 0.625f, 0.625f, 1.0f }
staticinherited

◆ DEFAULT_DRAG_COLOR

ColorRGBA Slic3r::GUI::GLGizmoBase::DEFAULT_DRAG_COLOR = { 1.0f, 1.0f, 1.0f, 1.0f }
staticinherited

◆ DEFAULT_HIGHLIGHT_COLOR

ColorRGBA Slic3r::GUI::GLGizmoBase::DEFAULT_HIGHLIGHT_COLOR = {1.0f, 0.38f, 0.0f, 1.0f}
staticinherited

◆ FLATTEN_COLOR

ColorRGBA Slic3r::GUI::GLGizmoBase::FLATTEN_COLOR = {0.96f, 0.93f, 0.93f, 0.5f}
staticinherited

◆ FLATTEN_HOVER_COLOR

ColorRGBA Slic3r::GUI::GLGizmoBase::FLATTEN_HOVER_COLOR = {1.0f, 1.0f, 1.0f, 0.75f}
staticinherited

◆ GRABBER_ELEMENTS_MAX_COUNT

const unsigned int Slic3r::GUI::GLGizmoBase::GRABBER_ELEMENTS_MAX_COUNT = 7
staticinherited

◆ GRABBER_HOVER_COL

ColorRGBA Slic3r::GUI::GLGizmoBase::GRABBER_HOVER_COL = {0.863f, 0.125f, 0.063f, 1.0f}
staticinherited

◆ GRABBER_NORMAL_COL

ColorRGBA Slic3r::GUI::GLGizmoBase::GRABBER_NORMAL_COL = {1.0f, 1.0f, 1.0f, 1.0f}
staticinherited

◆ GRABBER_UNIFORM_COL

ColorRGBA Slic3r::GUI::GLGizmoBase::GRABBER_UNIFORM_COL = {0, 1.0, 1.0, 1.0f}
staticinherited

◆ GRABBER_UNIFORM_HOVER_COL

ColorRGBA Slic3r::GUI::GLGizmoBase::GRABBER_UNIFORM_HOVER_COL = {0, 0.7, 0.7, 1.0f}
staticinherited

◆ INV_ZOOM

◆ last_input_window_width

float Slic3r::GUI::GLGizmoBase::last_input_window_width = 0
protectedinherited

◆ m_angle

std::optional<float> Slic3r::GUI::GLGizmoSVG::m_angle
private

◆ m_c

CommonGizmosDataPool* Slic3r::GUI::GLGizmoBase::m_c { nullptr }
protectedinherited
155{ nullptr };

Referenced by Slic3r::GUI::GLGizmoTextureDisplacement::apply_projection_frame(), Slic3r::GUI::GLGizmoTextureDisplacement::bake(), Slic3r::GUI::GLGizmoTextureDisplacement::capture_view_projection(), Slic3r::GUI::GLGizmoCut3D::check_and_update_connectors_state(), Slic3r::GUI::GLGizmoBrimEars::data_changed(), Slic3r::GUI::GLGizmoCut3D::data_changed(), Slic3r::GUI::GLGizmoMmuSegmentation::data_changed(), Slic3r::GUI::GLGizmoPainterBase::data_changed(), Slic3r::GUI::GLGizmoCut3D::dragging_connector(), Slic3r::GUI::GLGizmoMeshBoolean::generate_new_volume(), Slic3r::GUI::GLGizmoPainterBase::get_clipping_plane_data(), Slic3r::GUI::GLGizmoPainterBase::get_clipping_plane_in_volume_coordinates(), Slic3r::GUI::GLGizmoBrimEars::get_config_options(), Slic3r::GUI::GLGizmoPainterBase::get_projected_height_range(), Slic3r::GUI::GLGizmoPainterBase::get_projected_mouse_positions(), Slic3r::GUI::GLGizmoFdmSupports::get_selection_support_threshold_angle(), Slic3r::GUI::GLGizmoBrimEars::gizmo_event(), Slic3r::GUI::GLGizmoCut3D::gizmo_event(), Slic3r::GUI::GLGizmoMeshBoolean::gizmo_event(), Slic3r::GUI::GLGizmoPainterBase::gizmo_event(), Slic3r::GUI::GLGizmoCut3D::has_valid_contour(), Slic3r::GUI::GLGizmoSimplify::init_model(), Slic3r::GUI::GLGizmoMmuSegmentation::init_model_triangle_selectors(), Slic3r::GUI::GLGizmoFdmSupports::init_print_instance(), Slic3r::GUI::GLGizmoBrimEars::is_mesh_point_clipped(), Slic3r::GUI::GLGizmoPainterBase::is_mesh_point_clipped(), Slic3r::GUI::GLGizmoCut3D::is_outside_of_cut_contour(), Slic3r::GUI::GLGizmoFlatten::is_plane_update_necessary(), Slic3r::GUI::GLGizmoPainterBase::mesh_trafo_matrices(), Slic3r::GUI::GLGizmoFdmSupports::need_regenerate_support_volumes(), Slic3r::GUI::GLGizmoMeshBoolean::on_get_requirements(), Slic3r::GUI::GLGizmoMeshBoolean::on_load(), Slic3r::GUI::GLGizmoTextureDisplacement::on_mouse_adjust_texture(), Slic3r::GUI::GLGizmoCut3D::on_register_raycasters_for_picking(), Slic3r::GUI::GLGizmoBrimEars::on_render(), Slic3r::GUI::GLGizmoMeshBoolean::on_render(), Slic3r::GUI::GLGizmoBrimEars::on_render_input_window(), Slic3r::GUI::GLGizmoCut3D::on_render_input_window(), Slic3r::GUI::GLGizmoFdmSupports::on_render_input_window(), Slic3r::GUI::GLGizmoFuzzySkin::on_render_input_window(), Slic3r::GUI::GLGizmoMmuSegmentation::on_render_input_window(), Slic3r::GUI::GLGizmoSeam::on_render_input_window(), Slic3r::GUI::GLGizmoTextureDisplacement::on_render_input_window(), Slic3r::GUI::GLGizmoCut3D::on_set_state(), Slic3r::GUI::GLGizmoFdmSupports::on_set_state(), Slic3r::GUI::GLGizmoMmuSegmentation::on_set_state(), Slic3r::GUI::GLGizmoSeam::on_set_state(), Slic3r::GUI::GLGizmoTextureDisplacement::preview_part(), Slic3r::GUI::GLGizmoCut3D::process_contours(), Slic3r::GUI::GLGizmoCut3D::process_selection_rectangle(), Slic3r::GUI::GLGizmoCut3D::put_connectors_on_cut_plane(), Slic3r::GUI::GLGizmoTextureDisplacement::queue_prepare(), Slic3r::GUI::GLGizmoBrimEars::reload_cache(), Slic3r::GUI::GLGizmoMmuSegmentation::remap_filament_assignments(), Slic3r::GUI::GLGizmoTextureDisplacement::render_adjust_texture_gizmo(), Slic3r::GUI::GLGizmoCut3D::render_clipper_cut(), Slic3r::GUI::GLGizmoCut3D::render_connectors(), Slic3r::GUI::GLGizmoCut3D::render_debug_input_window(), Slic3r::GUI::GLGizmoPainterBase::render_follows_cursor(), Slic3r::GUI::GLGizmoTextureDisplacement::render_island_overlay(), Slic3r::GUI::GLGizmoTextureDisplacement::render_paint_overlay(), Slic3r::GUI::GLGizmoTextureDisplacement::render_painted_colors(), Slic3r::GUI::GLGizmoFdmSupports::render_painter_gizmo(), Slic3r::GUI::GLGizmoFuzzySkin::render_painter_gizmo(), Slic3r::GUI::GLGizmoMmuSegmentation::render_painter_gizmo(), Slic3r::GUI::GLGizmoSeam::render_painter_gizmo(), Slic3r::GUI::GLGizmoTextureDisplacement::render_painter_gizmo(), Slic3r::GUI::GLGizmoBrimEars::render_points(), Slic3r::GUI::GLGizmoTextureDisplacement::render_preview_mesh(), Slic3r::GUI::GLGizmoTextureDisplacement::render_seam_overlay(), Slic3r::GUI::GLGizmoTextureDisplacement::render_shaded_preview_mesh(), Slic3r::GUI::GLGizmoTextureDisplacement::render_subdivide_preview(), Slic3r::GUI::GLGizmoPainterBase::render_triangles(), Slic3r::GUI::GLGizmoTextureDisplacement::render_uvcheck_mesh(), Slic3r::GUI::GLGizmoTextureDisplacement::render_wireframe_overlay(), Slic3r::GUI::GLGizmoCut3D::reset_connectors(), Slic3r::GUI::GLGizmoFdmSupports::run_thread(), Slic3r::GUI::GLGizmoTextureDisplacement::seam_edge_at(), Slic3r::GUI::GLGizmoTextureDisplacement::seam_vertex_at(), Slic3r::GUI::GLGizmoFdmSupports::select_facets_by_angle(), Slic3r::GUI::GLGizmoTextureDisplacement::select_visible_faces(), Slic3r::GUI::GLGizmoTextureDisplacement::select_whole_model(), Slic3r::GUI::GLGizmoBrimEars::set_brim_data(), set_common_data_pool(), Slic3r::GUI::GLGizmoCut3D::set_connectors_editing(), Slic3r::GUI::GLGizmoTextureDisplacement::shaded_preview_ready(), Slic3r::GUI::GLGizmoTextureDisplacement::smooth_model(), Slic3r::GUI::GLGizmoTextureDisplacement::subdivide_model(), Slic3r::GUI::GLGizmoTextureDisplacement::swap_layer_slots(), Slic3r::GUI::GLGizmoCut3D::switch_to_mode(), Slic3r::GUI::GLGizmoTextureDisplacement::texture_parts(), Slic3r::GUI::GLGizmoTextureDisplacement::texture_volume(), Slic3r::GUI::GLGizmoTextureDisplacement::texture_volume_raycaster_index(), Slic3r::GUI::GLGizmoCut3D::unproject_on_cut_plane(), Slic3r::GUI::GLGizmoBrimEars::unproject_on_mesh(), Slic3r::GUI::GLGizmoBrimEars::unproject_on_mesh2(), Slic3r::GUI::GLGizmoCut3D::update_bb(), Slic3r::GUI::GLGizmoCut3D::update_clipper(), Slic3r::GUI::GLGizmoFdmSupports::update_from_model_object(), Slic3r::GUI::GLGizmoFuzzySkin::update_from_model_object(), Slic3r::GUI::GLGizmoSeam::update_from_model_object(), Slic3r::GUI::GLGizmoTextureDisplacement::update_from_model_object(), Slic3r::GUI::GLGizmoBrimEars::update_model_object(), Slic3r::GUI::GLGizmoFdmSupports::update_model_object(), Slic3r::GUI::GLGizmoFuzzySkin::update_model_object(), Slic3r::GUI::GLGizmoMmuSegmentation::update_model_object(), Slic3r::GUI::GLGizmoSeam::update_model_object(), Slic3r::GUI::GLGizmoTextureDisplacement::update_model_object(), Slic3r::GUI::GLGizmoFlatten::update_planes(), Slic3r::GUI::GLGizmoPainterBase::update_raycast_cache(), and Slic3r::GUI::GLGizmoCut3D::update_raycasters_for_picking_transform().

◆ m_dirty

bool Slic3r::GUI::GLGizmoBase::m_dirty { false }
privateinherited
293{ false };

Referenced by set_dirty(), and update_items_state().

◆ m_distance

std::optional<float> Slic3r::GUI::GLGizmoSVG::m_distance
private

◆ m_dragging

◆ m_filename_preview

std::string Slic3r::GUI::GLGizmoSVG::m_filename_preview
private

Referenced by draw_filename(), and reset_volume().

◆ m_first_input_window_render

bool Slic3r::GUI::GLGizmoBase::m_first_input_window_render { true }
protectedinherited
154{ true };

Referenced by render_input_window().

◆ m_grabbers

◆ m_group_id

int Slic3r::GUI::GLGizmoBase::m_group_id
protectedinherited

◆ m_gui_cfg

◆ m_hover_id

int Slic3r::GUI::GLGizmoBase::m_hover_id { -1 }
protectedinherited
150{ -1 };

Referenced by Slic3r::GUI::GLGizmoScale3D::calc_ratio(), Slic3r::GUI::GLGizmoScale3D::do_scale_along_axis(), Slic3r::GUI::GLGizmoScale3D::do_scale_uniform(), Slic3r::GUI::GLGizmoCut3D::dragging_connector(), Slic3r::GUI::GLGizmoCut3D::dragging_grabber_move(), Slic3r::GUI::GLGizmoCut3D::dragging_grabber_rotation(), get_hover_id(), Slic3r::GUI::GLGizmoCut3D::get_tooltip(), Slic3r::GUI::GLGizmoMove3D::get_tooltip(), Slic3r::GUI::GLGizmoRotate::get_tooltip(), Slic3r::GUI::GLGizmoScale3D::get_tooltip(), Slic3r::GUI::GLGizmoBrimEars::gizmo_event(), Slic3r::GUI::GLGizmoCut3D::gizmo_event(), Slic3r::GUI::GLGizmoCut3D::is_selection_changed(), Slic3r::GUI::GLGizmoBrimEars::on_dragging(), Slic3r::GUI::GLGizmoCut3D::on_dragging(), Slic3r::GUI::GLGizmoMove3D::on_dragging(), Slic3r::GUI::GLGizmoRotate3D::on_dragging(), Slic3r::GUI::GLGizmoScale3D::on_dragging(), Slic3r::GUI::GLGizmoCut3D::on_mouse(), Slic3r::GUI::GLGizmoFlatten::on_mouse(), Slic3r::GUI::GLGizmoMeasure::on_mouse(), Slic3r::GUI::GLGizmoFlatten::on_render(), Slic3r::GUI::GLGizmoMeasure::on_render(), Slic3r::GUI::GLGizmoMove3D::on_render(), Slic3r::GUI::GLGizmoRotate3D::on_render(), Slic3r::GUI::GLGizmoRotate::on_render(), Slic3r::GUI::GLGizmoScale3D::on_render(), Slic3r::GUI::GLGizmoBrimEars::on_set_hover_id(), Slic3r::GUI::GLGizmoEmboss::on_set_hover_id(), Slic3r::GUI::GLGizmoRotate3D::on_set_hover_id(), Slic3r::GUI::GLGizmoSVG::on_set_hover_id(), Slic3r::GUI::GLGizmoMeasure::on_set_state(), Slic3r::GUI::GLGizmoBrimEars::on_start_dragging(), Slic3r::GUI::GLGizmoCut3D::on_start_dragging(), Slic3r::GUI::GLGizmoMove3D::on_start_dragging(), Slic3r::GUI::GLGizmoRotate3D::on_start_dragging(), Slic3r::GUI::GLGizmoScale3D::on_start_dragging(), Slic3r::GUI::GLGizmoBrimEars::on_stop_dragging(), Slic3r::GUI::GLGizmoCut3D::on_stop_dragging(), Slic3r::GUI::GLGizmoRotate3D::on_stop_dragging(), Slic3r::GUI::GLGizmoCut3D::render_connectors(), Slic3r::GUI::GLGizmoCut3D::render_cut_plane_grabbers(), Slic3r::GUI::GLGizmoCut3D::render_flip_plane_button(), render_grabbers(), Slic3r::GUI::GLGizmoBrimEars::render_points(), set_hover_id(), Slic3r::GUI::GLGizmoMeasure::show_selection_ui(), Slic3r::GUI::GLGizmoScale3D::update_grabbers_data(), and use_grabbers().

◆ M_ICON_FILENAME

const std::string GLGizmoSVG::M_ICON_FILENAME = "cut.svg"
staticprivate

Referenced by GLGizmoSVG().

◆ m_icon_filename

std::string Slic3r::GUI::GLGizmoBase::m_icon_filename
protectedinherited

◆ m_icon_manager

IconManager Slic3r::GUI::GLGizmoSVG::m_icon_manager
private

Referenced by on_render_input_window().

◆ m_icons

◆ m_imgui

ImGuiWrapper* Slic3r::GUI::GLGizmoBase::m_imgui
protectedinherited

Referenced by GLGizmoBase(), Slic3r::GUI::GLGizmoEmboss::GLGizmoEmboss(), Slic3r::GUI::GLGizmoCut3D::add_horizontal_scaled_interval(), Slic3r::GUI::GLGizmoCut3D::add_vertical_scaled_interval(), Slic3r::GUI::GLGizmoSimplify::create_gui_cfg(), Slic3r::GUI::GLGizmoEmboss::draw_advanced(), Slic3r::GUI::GLGizmoEmboss::draw_bold_button(), Slic3r::GUI::GLGizmoEmboss::draw_delete_style_button(), Slic3r::GUI::GLGizmoSVG::draw_depth(), Slic3r::GUI::GLGizmoSVG::draw_distance(), Slic3r::GUI::GLGizmoSVG::draw_filename(), Slic3r::GUI::GLGizmoEmboss::draw_font_list(), Slic3r::GUI::GLGizmoEmboss::draw_font_list_line(), Slic3r::GUI::GLGizmoEmboss::draw_italic_button(), Slic3r::GUI::GLGizmoSVG::draw_mirroring(), Slic3r::GUI::GLGizmoEmboss::draw_model_type(), Slic3r::GUI::GLGizmoSVG::draw_model_type(), Slic3r::GUI::GLGizmoSVG::draw_rotation(), Slic3r::GUI::GLGizmoSVG::draw_size(), Slic3r::GUI::GLGizmoEmboss::draw_style_add_button(), Slic3r::GUI::GLGizmoEmboss::draw_style_list(), Slic3r::GUI::GLGizmoEmboss::draw_style_rename_button(), Slic3r::GUI::GLGizmoEmboss::draw_style_rename_popup(), Slic3r::GUI::GLGizmoEmboss::draw_style_save_as_popup(), Slic3r::GUI::GLGizmoEmboss::draw_style_save_button(), Slic3r::GUI::GLGizmoEmboss::draw_text_input(), Slic3r::GUI::GLGizmoSVG::draw_use_surface(), Slic3r::GUI::GLGizmoEmboss::draw_window(), GizmoImguiBegin(), GizmoImguiEnd(), GizmoImguiSetNextWIndowPos(), Slic3r::GUI::GLGizmoCut3D::init_input_window_data(), Slic3r::GUI::GLGizmoMeasure::on_mouse(), Slic3r::GUI::GLGizmoAssembly::on_render_input_window(), Slic3r::GUI::GLGizmoBrimEars::on_render_input_window(), Slic3r::GUI::GLGizmoEmboss::on_render_input_window(), Slic3r::GUI::GLGizmoFdmSupports::on_render_input_window(), Slic3r::GUI::GLGizmoFuzzySkin::on_render_input_window(), Slic3r::GUI::GLGizmoMeasure::on_render_input_window(), Slic3r::GUI::GLGizmoMeshBoolean::on_render_input_window(), Slic3r::GUI::GLGizmoMmuSegmentation::on_render_input_window(), Slic3r::GUI::GLGizmoMove3D::on_render_input_window(), Slic3r::GUI::GLGizmoRotate3D::on_render_input_window(), Slic3r::GUI::GLGizmoScale3D::on_render_input_window(), Slic3r::GUI::GLGizmoSeam::on_render_input_window(), Slic3r::GUI::GLGizmoSimplify::on_render_input_window(), Slic3r::GUI::GLGizmoSVG::on_render_input_window(), Slic3r::GUI::GLGizmoTextureDisplacement::on_render_input_window(), Slic3r::GUI::GLGizmoTextureDisplacement::panel_tooltip(), Slic3r::GUI::GLGizmoCut3D::render_angle_input(), Slic3r::GUI::GLGizmoCut3D::render_build_size(), Slic3r::GUI::GLGizmoCut3D::render_color_marker(), render_combo(), Slic3r::GUI::GLGizmoCut3D::render_connectors_input_window(), Slic3r::GUI::GLGizmoCut3D::render_cut_mode_combo(), Slic3r::GUI::GLGizmoCut3D::render_cut_plane_input_window(), Slic3r::GUI::GLGizmoCut3D::render_debug_input_window(), Slic3r::GUI::GLGizmoTextureDisplacement::render_debug_stage_panel(), Slic3r::GUI::GLGizmoMeasure::render_dimensioning(), Slic3r::GUI::GLGizmoCut3D::render_double_input(), Slic3r::GUI::GLGizmoMmuSegmentation::render_filament_remap_ui(), Slic3r::GUI::GLGizmoCut3D::render_flip_plane_button(), Slic3r::GUI::GLGizmoCut3D::render_groove_float_input(), Slic3r::GUI::GLGizmoCut3D::render_groove_int_input(), Slic3r::GUI::GLGizmoCut3D::render_groove_two_float_input(), Slic3r::GUI::GLGizmoTextureDisplacement::render_image_adjust_window(), Slic3r::GUI::GLGizmoAssembly::render_input_window_warning(), Slic3r::GUI::GLGizmoCut3D::render_input_window_warning(), Slic3r::GUI::GLGizmoCut3D::render_move_center_input(), Slic3r::GUI::GLGizmoCut3D::render_reset_button(), Slic3r::GUI::GLGizmoCut3D::render_slider_input(), Slic3r::GUI::GLGizmoCut3D::render_slider_two_input(), Slic3r::GUI::GLGizmoCut3D::render_snap_specific_input(), Slic3r::GUI::GLGizmoTextureDisplacement::render_texture_library_popup(), Slic3r::GUI::GLGizmoTextureDisplacement::render_tip_media(), Slic3r::GUI::GLGizmoCut3D::render_tooltip_button(), Slic3r::GUI::GLGizmoFdmSupports::render_tooltip_button(), Slic3r::GUI::GLGizmoFuzzySkin::render_tooltip_button(), Slic3r::GUI::GLGizmoMmuSegmentation::render_tooltip_button(), Slic3r::GUI::GLGizmoPainterBase::render_triangles(), Slic3r::GUI::GLGizmoEmboss::rev_checkbox(), Slic3r::GUI::GLGizmoEmboss::rev_input(), Slic3r::GUI::GLGizmoEmboss::rev_slider(), Slic3r::GUI::GLGizmoEmboss::rev_slider(), Slic3r::GUI::GLGizmoEmboss::rev_slider(), Slic3r::GUI::GLGizmoEmboss::revertible(), Slic3r::GUI::GLGizmoMeasure::show_distance_xyz_ui(), Slic3r::GUI::GLGizmoMeasure::show_face_face_assembly_common(), Slic3r::GUI::GLGizmoMeasure::show_face_face_assembly_senior(), and Slic3r::GUI::GLGizmoMeasure::show_selection_ui().

◆ m_is_dark_mode

◆ m_job_cancel

std::shared_ptr<std::atomic<bool> > Slic3r::GUI::GLGizmoSVG::m_job_cancel = nullptr
private

◆ m_keep_ratio

bool Slic3r::GUI::GLGizmoSVG::m_keep_ratio = true
private

Referenced by draw_size().

◆ m_keep_up

bool Slic3r::GUI::GLGizmoSVG::m_keep_up = true
private

◆ m_parent

GLCanvas3D& Slic3r::GUI::GLGizmoBase::m_parent
protectedinherited

Referenced by GLGizmoBase(), Slic3r::GUI::GLGizmoCut3D::add_connector(), Slic3r::GUI::GLGizmoTextureDisplacement::add_texture_layer(), Slic3r::GUI::GLGizmoCut3D::apply_color_clip_plane_colors(), Slic3r::GUI::GLGizmoTextureDisplacement::apply_projection_frame(), Slic3r::GUI::GLGizmoSimplify::apply_simplify(), Slic3r::GUI::GLGizmoTextureDisplacement::apply_view_mode(), Slic3r::GUI::GLGizmoBrimEars::auto_generate(), Slic3r::GUI::GLGizmoTextureDisplacement::bake(), Slic3r::GUI::GLGizmoCut3D::bounding_box(), Slic3r::GUI::GLGizmoPainterBase::bounding_box(), Slic3r::GUI::GLGizmoEmboss::calculate_scale(), Slic3r::GUI::GLGizmoSVG::calculate_scale(), Slic3r::GUI::GLGizmoTextureDisplacement::capture_view_projection(), Slic3r::GUI::GLGizmoMove3D::change_cs_by_selection(), Slic3r::GUI::GLGizmoScale3D::change_cs_by_selection(), Slic3r::GUI::GLGizmoEmboss::close(), Slic3r::GUI::GLGizmoSimplify::close(), Slic3r::GUI::GLGizmoSVG::close(), Slic3r::GUI::GLGizmoTextureDisplacement::close_image_adjust(), Slic3r::GUI::GLGizmoEmboss::create_volume(), Slic3r::GUI::GLGizmoEmboss::create_volume(), Slic3r::GUI::GLGizmoSVG::create_volume(), Slic3r::GUI::GLGizmoSVG::create_volume(), Slic3r::GUI::GLGizmoSVG::create_volume(), Slic3r::GUI::GLGizmoSVG::create_volume(), Slic3r::GUI::GLGizmoFlatten::data_changed(), Slic3r::GUI::GLGizmoMeasure::data_changed(), Slic3r::GUI::GLGizmoMove3D::data_changed(), Slic3r::GUI::GLGizmoPainterBase::data_changed(), Slic3r::GUI::GLGizmoRotate3D::data_changed(), Slic3r::GUI::GLGizmoScale3D::data_changed(), Slic3r::GUI::GLGizmoCut3D::delete_selected_connectors(), Slic3r::GUI::GLGizmoEmboss::do_mirror(), do_stop_dragging(), Slic3r::GUI::GLGizmoEmboss::draw_advanced(), Slic3r::GUI::GLGizmoSVG::draw_distance(), Slic3r::GUI::GLGizmoSVG::draw_face_the_camera(), Slic3r::GUI::GLGizmoSVG::draw_filename(), Slic3r::GUI::GLGizmoSVG::draw_mirroring(), Slic3r::GUI::GLGizmoEmboss::draw_model_type(), Slic3r::GUI::GLGizmoSVG::draw_model_type(), Slic3r::GUI::GLGizmoSVG::draw_rotation(), Slic3r::GUI::GLGizmoSVG::draw_size(), Slic3r::GUI::GLGizmoEmboss::draw_style_list(), Slic3r::GUI::GLGizmoEmboss::draw_window(), Slic3r::GUI::GLGizmoTextureDisplacement::ease_wheel_scroll(), Slic3r::GUI::GLGizmoBrimEars::find_single(), Slic3r::GUI::GLGizmoBrimEars::first_layer_slicer(), Slic3r::GUI::GLGizmoMeshBoolean::generate_new_volume(), Slic3r::GUI::GLGizmoPainterBase::get_projected_height_range(), Slic3r::GUI::GLGizmoMove3D::get_tooltip(), Slic3r::GUI::GLGizmoScale3D::get_tooltip(), Slic3r::GUI::GLGizmoBrimEars::gizmo_event(), Slic3r::GUI::GLGizmoMeasure::gizmo_event(), Slic3r::GUI::GLGizmoMeshBoolean::gizmo_event(), Slic3r::GUI::GLGizmoPainterBase::gizmo_event(), GizmoImguiSetNextWIndowPos(), Slic3r::GUI::GLGizmoCut3D::has_valid_groove(), Slic3r::GUI::GLGizmoSimplify::init_model(), Slic3r::GUI::GLGizmoMeasure::init_plane_glmodel(), Slic3r::GUI::GLGizmoFdmSupports::init_print_instance(), Slic3r::GUI::GLGizmoPainterBase::mesh_trafo_matrices(), Slic3r::GUI::GLGizmoTextureDisplacement::move_texture_layer(), Slic3r::GUI::GLGizmoMove3D::on_dragging(), Slic3r::GUI::GLGizmoAssembly::on_is_activable(), Slic3r::GUI::GLGizmoBrimEars::on_is_activable(), Slic3r::GUI::GLGizmoCut3D::on_is_activable(), Slic3r::GUI::GLGizmoFlatten::on_is_activable(), Slic3r::GUI::GLGizmoMeasure::on_is_activable(), Slic3r::GUI::GLGizmoMeshBoolean::on_is_activable(), Slic3r::GUI::GLGizmoMmuSegmentation::on_is_activable(), Slic3r::GUI::GLGizmoMove3D::on_is_activable(), Slic3r::GUI::GLGizmoPainterBase::on_is_activable(), Slic3r::GUI::GLGizmoRotate3D::on_is_activable(), Slic3r::GUI::GLGizmoScale3D::on_is_activable(), Slic3r::GUI::GLGizmoSimplify::on_is_activable(), Slic3r::GUI::GLGizmoTextureDisplacement::on_is_activable(), Slic3r::GUI::GLGizmoTextureDisplacement::on_island_edited(), Slic3r::GUI::GLGizmoCut3D::on_load(), Slic3r::GUI::GLGizmoBrimEars::on_mouse(), Slic3r::GUI::GLGizmoCut3D::on_mouse(), Slic3r::GUI::GLGizmoEmboss::on_mouse(), Slic3r::GUI::GLGizmoFlatten::on_mouse(), Slic3r::GUI::GLGizmoMeasure::on_mouse(), Slic3r::GUI::GLGizmoPainterBase::on_mouse(), Slic3r::GUI::GLGizmoRotate3D::on_mouse(), Slic3r::GUI::GLGizmoScale3D::on_mouse(), Slic3r::GUI::GLGizmoSVG::on_mouse(), Slic3r::GUI::GLGizmoTextureDisplacement::on_mouse_adjust_texture(), Slic3r::GUI::GLGizmoEmboss::on_mouse_change_selection(), Slic3r::GUI::GLGizmoEmboss::on_mouse_for_rotation(), Slic3r::GUI::GLGizmoSVG::on_mouse_for_rotation(), Slic3r::GUI::GLGizmoEmboss::on_mouse_for_translate(), Slic3r::GUI::GLGizmoSVG::on_mouse_for_translate(), Slic3r::GUI::GLGizmoTextureDisplacement::on_mouse_seam(), Slic3r::GUI::GLGizmoFdmSupports::on_opening(), Slic3r::GUI::GLGizmoCut3D::on_register_raycasters_for_picking(), Slic3r::GUI::GLGizmoFlatten::on_register_raycasters_for_picking(), Slic3r::GUI::GLGizmoMove3D::on_register_raycasters_for_picking(), Slic3r::GUI::GLGizmoRotate3D::on_register_raycasters_for_picking(), Slic3r::GUI::GLGizmoScale3D::on_register_raycasters_for_picking(), Slic3r::GUI::GLGizmoBrimEars::on_render(), Slic3r::GUI::GLGizmoCut3D::on_render(), Slic3r::GUI::GLGizmoEmboss::on_render(), Slic3r::GUI::GLGizmoFlatten::on_render(), Slic3r::GUI::GLGizmoMeasure::on_render(), Slic3r::GUI::GLGizmoMeshBoolean::on_render(), Slic3r::GUI::GLGizmoMove3D::on_render(), Slic3r::GUI::GLGizmoRotate::on_render(), Slic3r::GUI::GLGizmoSimplify::on_render(), Slic3r::GUI::GLGizmoSVG::on_render(), Slic3r::GUI::GLGizmoAssembly::on_render_input_window(), Slic3r::GUI::GLGizmoBrimEars::on_render_input_window(), Slic3r::GUI::GLGizmoCut3D::on_render_input_window(), Slic3r::GUI::GLGizmoEmboss::on_render_input_window(), Slic3r::GUI::GLGizmoFdmSupports::on_render_input_window(), Slic3r::GUI::GLGizmoFuzzySkin::on_render_input_window(), Slic3r::GUI::GLGizmoMeasure::on_render_input_window(), Slic3r::GUI::GLGizmoMeshBoolean::on_render_input_window(), Slic3r::GUI::GLGizmoMmuSegmentation::on_render_input_window(), Slic3r::GUI::GLGizmoSeam::on_render_input_window(), Slic3r::GUI::GLGizmoSimplify::on_render_input_window(), Slic3r::GUI::GLGizmoSVG::on_render_input_window(), Slic3r::GUI::GLGizmoTextureDisplacement::on_render_input_window(), Slic3r::GUI::GLGizmoCut3D::on_set_state(), Slic3r::GUI::GLGizmoEmboss::on_set_state(), Slic3r::GUI::GLGizmoMeasure::on_set_state(), Slic3r::GUI::GLGizmoMmuSegmentation::on_set_state(), Slic3r::GUI::GLGizmoPainterBase::on_set_state(), Slic3r::GUI::GLGizmoSimplify::on_set_state(), Slic3r::GUI::GLGizmoSVG::on_set_state(), Slic3r::GUI::GLGizmoEmboss::on_shortcut_key(), Slic3r::GUI::GLGizmoFdmSupports::on_shutdown(), Slic3r::GUI::GLGizmoFuzzySkin::on_shutdown(), Slic3r::GUI::GLGizmoMmuSegmentation::on_shutdown(), Slic3r::GUI::GLGizmoSeam::on_shutdown(), Slic3r::GUI::GLGizmoTextureDisplacement::on_shutdown(), Slic3r::GUI::GLGizmoMove3D::on_start_dragging(), Slic3r::GUI::GLGizmoRotate::on_start_dragging(), Slic3r::GUI::GLGizmoEmboss::on_stop_dragging(), Slic3r::GUI::GLGizmoMove3D::on_stop_dragging(), Slic3r::GUI::GLGizmoRotate3D::on_stop_dragging(), Slic3r::GUI::GLGizmoScale3D::on_stop_dragging(), Slic3r::GUI::GLGizmoSVG::on_stop_dragging(), Slic3r::GUI::GLGizmoBrimEars::on_unregister_raycasters_for_picking(), Slic3r::GUI::GLGizmoCut3D::on_unregister_raycasters_for_picking(), Slic3r::GUI::GLGizmoFlatten::on_unregister_raycasters_for_picking(), Slic3r::GUI::GLGizmoMove3D::on_unregister_raycasters_for_picking(), Slic3r::GUI::GLGizmoRotate3D::on_unregister_raycasters_for_picking(), Slic3r::GUI::GLGizmoScale3D::on_unregister_raycasters_for_picking(), Slic3r::GUI::GLGizmoTextureDisplacement::on_uv_command(), Slic3r::GUI::GLGizmoTextureDisplacement::panel_tooltip(), Slic3r::GUI::GLGizmoCut3D::perform_cut(), Slic3r::GUI::GLGizmoEmboss::process(), Slic3r::GUI::GLGizmoSVG::process(), Slic3r::GUI::GLGizmoCut3D::process_contours(), Slic3r::GUI::GLGizmoCut3D::process_cut_line(), Slic3r::GUI::GLGizmoTextureDisplacement::queue_prepare(), Slic3r::GUI::GLGizmoTextureDisplacement::queue_preview_job(), Slic3r::GUI::GLGizmoBrimEars::register_single_mesh_pick(), Slic3r::GUI::GLGizmoMeasure::register_single_mesh_pick(), Slic3r::GUI::GLGizmoEmboss::reinit_text_lines(), Slic3r::GUI::GLGizmoMmuSegmentation::remap_filament_assignments(), Slic3r::GUI::GLGizmoTextureDisplacement::remove_texture_layer(), Slic3r::GUI::GLGizmoTextureDisplacement::render_adjust_texture_gizmo(), Slic3r::GUI::GLGizmoMove3D::render_align_preview(), Slic3r::GUI::GLGizmoAssembly::render_assembly_mode_combo(), render_combo(), Slic3r::GUI::GLGizmoCut3D::render_connectors_input_window(), Slic3r::GUI::GLGizmoPainterBase::render_cursor(), Slic3r::GUI::GLGizmoPainterBase::render_cursor_circle(), Slic3r::GUI::GLGizmoPainterBase::render_cursor_height_range(), Slic3r::GUI::GLGizmoCut3D::render_cut_mode_combo(), Slic3r::GUI::GLGizmoCut3D::render_cut_plane_input_window(), Slic3r::GUI::GLGizmoMeasure::render_dimensioning(), Slic3r::GUI::GLGizmoMeasure::render_follows_cursor(), Slic3r::GUI::GLGizmoPainterBase::render_follows_cursor(), Slic3r::GUI::GLGizmoTextureDisplacement::render_image_adjust_window(), render_input_window(), Slic3r::GUI::GLGizmoTextureDisplacement::render_island_overlay(), Slic3r::GUI::GLGizmoTextureDisplacement::render_paint_overlay(), Slic3r::GUI::GLGizmoTextureDisplacement::render_painted_colors(), Slic3r::GUI::GLGizmoFdmSupports::render_painter_gizmo(), Slic3r::GUI::GLGizmoFuzzySkin::render_painter_gizmo(), Slic3r::GUI::GLGizmoMmuSegmentation::render_painter_gizmo(), Slic3r::GUI::GLGizmoSeam::render_painter_gizmo(), Slic3r::GUI::GLGizmoTextureDisplacement::render_painter_gizmo(), Slic3r::GUI::GLGizmoTextureDisplacement::render_preview_mesh(), Slic3r::GUI::GLGizmoTextureDisplacement::render_seam_overlay(), Slic3r::GUI::GLGizmoTextureDisplacement::render_shaded_preview_mesh(), Slic3r::GUI::GLGizmoTextureDisplacement::render_subdivide_preview(), Slic3r::GUI::GLGizmoTextureDisplacement::render_texture_library_popup(), Slic3r::GUI::GLGizmoTextureDisplacement::render_tip_media(), Slic3r::GUI::GLGizmoCut3D::render_tooltip_button(), Slic3r::GUI::GLGizmoFdmSupports::render_tooltip_button(), Slic3r::GUI::GLGizmoFuzzySkin::render_tooltip_button(), Slic3r::GUI::GLGizmoMmuSegmentation::render_tooltip_button(), Slic3r::GUI::GLGizmoPainterBase::render_triangles(), Slic3r::GUI::GLGizmoTextureDisplacement::render_uvcheck_mesh(), Slic3r::GUI::GLGizmoTextureDisplacement::render_wireframe_overlay(), Slic3r::GUI::GLGizmoSimplify::request_rerender(), Slic3r::GUI::GLGizmoCut3D::reset_cut_plane(), Slic3r::GUI::GLGizmoEmboss::reset_to_default_style(), Slic3r::GUI::GLGizmoTextureDisplacement::run_stage_debug(), Slic3r::GUI::GLGizmoFdmSupports::run_thread(), Slic3r::GUI::GLGizmoTextureDisplacement::run_uv_command(), Slic3r::GUI::GLGizmoTextureDisplacement::seam_edge_at(), Slic3r::GUI::GLGizmoTextureDisplacement::seam_vertex_at(), Slic3r::GUI::GLGizmoFdmSupports::select_facets_by_angle(), Slic3r::GUI::GLGizmoTextureDisplacement::select_visible_faces(), Slic3r::GUI::GLGizmoTextureDisplacement::select_whole_model(), Slic3r::GUI::GLGizmoCut3D::set_connectors_editing(), Slic3r::GUI::GLGizmoMeasure::set_distance(), Slic3r::GUI::GLGizmoTextureDisplacement::set_layer_texture(), Slic3r::GUI::GLGizmoMeasure::set_parallel_distance(), Slic3r::GUI::GLGizmoMeasure::set_to_around_center_of_faces(), Slic3r::GUI::GLGizmoMeasure::set_to_parallel(), Slic3r::GUI::GLGizmoMeasure::set_to_reverse_rotation(), Slic3r::GUI::GLGizmoEmboss::set_volume_by_selection(), Slic3r::GUI::GLGizmoSVG::set_volume_by_selection(), Slic3r::GUI::GLGizmoCut3D::set_volumes_picking_state(), Slic3r::GUI::GLGizmoTextureDisplacement::show_debug_stage(), Slic3r::GUI::GLGizmoTextureDisplacement::show_projector(), Slic3r::GUI::GLGizmoTextureDisplacement::smooth_model(), Slic3r::GUI::GLGizmoTextureDisplacement::subdivide_model(), Slic3r::GUI::GLGizmoCut3D::toggle_model_objects_visibility(), Slic3r::GUI::GLGizmoCut3D::transformed_bounding_box(), Slic3r::GUI::GLGizmoBrimEars::unproject_on_mesh(), Slic3r::GUI::GLGizmoCut3D::update_bb(), Slic3r::GUI::GLGizmoBrimEars::update_cache_radius(), Slic3r::GUI::GLGizmoCut3D::update_clipper(), Slic3r::GUI::GLGizmoPainterBase::update_contours(), Slic3r::GUI::GLGizmoScale3D::update_grabbers_data(), Slic3r::GUI::GLGizmoTextureDisplacement::update_image_adjust_preview(), Slic3r::GUI::GLGizmoBrimEars::update_model_object(), Slic3r::GUI::GLGizmoFdmSupports::update_model_object(), Slic3r::GUI::GLGizmoFuzzySkin::update_model_object(), Slic3r::GUI::GLGizmoMmuSegmentation::update_model_object(), Slic3r::GUI::GLGizmoSeam::update_model_object(), Slic3r::GUI::GLGizmoTextureDisplacement::update_model_object(), Slic3r::GUI::GLGizmoPainterBase::update_raycast_cache(), Slic3r::GUI::GLGizmoBrimEars::update_raycasters(), use_grabbers(), Slic3r::GUI::GLGizmoEmboss::volume_transformation_changed(), Slic3r::GUI::GLGizmoSVG::volume_transformation_changed(), and Slic3r::GUI::GLGizmoEmboss::volume_transformation_changing().

◆ m_raycast_manager

◆ m_rotate_gizmo

◆ m_rotate_start_angle

std::optional<float> Slic3r::GUI::GLGizmoSVG::m_rotate_start_angle
private

◆ m_scale_depth

std::optional<float> Slic3r::GUI::GLGizmoSVG::m_scale_depth
private

Referenced by calculate_scale(), and draw_depth().

◆ m_scale_height

std::optional<float> Slic3r::GUI::GLGizmoSVG::m_scale_height
private

◆ m_scale_width

std::optional<float> Slic3r::GUI::GLGizmoSVG::m_scale_width
private

◆ m_shape_bb

BoundingBox Slic3r::GUI::GLGizmoSVG::m_shape_bb
private

◆ m_shape_warnings

std::vector<std::string> Slic3r::GUI::GLGizmoSVG::m_shape_warnings
private

◆ m_shortcut

◆ m_sprite_id

unsigned int Slic3r::GUI::GLGizmoBase::m_sprite_id
protectedinherited

Referenced by GLGizmoBase(), and get_sprite_id().

◆ m_state

◆ m_surface_drag

std::optional<SurfaceDrag> Slic3r::GUI::GLGizmoSVG::m_surface_drag
private

◆ m_texture

Texture Slic3r::GUI::GLGizmoSVG::m_texture
private

◆ m_volume

◆ m_volume_id

ObjectID Slic3r::GUI::GLGizmoSVG::m_volume_id
private

◆ m_volume_shape


The documentation for this class was generated from the following files:
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/Gizmos/GLGizmoSVG.hpp
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/Gizmos/GLGizmoSVG.cpp