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

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

Inheritance diagram for Slic3r::GUI::GLGizmosManager:
Collaboration diagram for Slic3r::GUI::GLGizmosManager:

Classes

struct  Layout

Public Types

enum  EType : unsigned char {
  Move , Rotate , Scale , Flatten ,
  Cut , MeshBoolean , FdmSupports , Seam ,
  FuzzySkin , MmSegmentation , TextureDisplacement , Emboss ,
  Svg , Measure , Assembly , Simplify ,
  BrimEars , Undefined
}
enum  MENU_ICON_NAME {
  IC_TOOLBAR_RESET = 0 , IC_TOOLBAR_RESET_HOVER , IC_TOOLBAR_RESET_ZERO , IC_TOOLBAR_RESET_ZERO_HOVER ,
  IC_TOOLBAR_TOOLTIP , IC_TOOLBAR_WIKI_GUIDE , IC_TOOLBAR_VIDEO_GUIDE , IC_NAME_COUNT ,
  IC_CANVAS_MENU , IC_CANVAS_MENU_HOVER , IC_CANVAS_MENU_DARK , IC_CANVAS_MENU_DARK_HOVER ,
  IC_CANVAS_ZOOM , IC_CANVAS_ZOOM_HOVER , IC_CANVAS_ZOOM_DARK , IC_CANVAS_ZOOM_DARK_HOVER ,
  IC_CANVAS_SECTION , IC_CANVAS_SECTION_HOVER , IC_CANVAS_SECTION_DARK , IC_CANVAS_SECTION_DARK_HOVER ,
  IC_CANVAS_SECTION_ACTIVE , IC_CANVAS_SECTION_ACTIVE_HOVER , IC_CANVAS_SECTION_ACTIVE_DARK , IC_CANVAS_SECTION_ACTIVE_DARK_HOVER ,
  IC_ALIGN_X_MIN , IC_ALIGN_X_CENTER , IC_ALIGN_X_MAX , IC_ALIGN_Y_MIN ,
  IC_ALIGN_Y_CENTER , IC_ALIGN_Y_MAX , IC_ALIGN_Z_MIN , IC_ALIGN_Z_CENTER ,
  IC_ALIGN_Z_MAX , IC_DISTRIBUTE_X , IC_DISTRIBUTE_Y , IC_DISTRIBUTE_Z ,
  IC_ALIGN_X_MIN_DARK , IC_ALIGN_X_CENTER_DARK , IC_ALIGN_X_MAX_DARK , IC_ALIGN_Y_MIN_DARK ,
  IC_ALIGN_Y_CENTER_DARK , IC_ALIGN_Y_MAX_DARK , IC_ALIGN_Z_MIN_DARK , IC_ALIGN_Z_CENTER_DARK ,
  IC_ALIGN_Z_MAX_DARK , IC_DISTRIBUTE_X_DARK , IC_DISTRIBUTE_Y_DARK , IC_DISTRIBUTE_Z_DARK
}
using Timestamp = uint64_t

Public Member Functions

 GLGizmosManager (GLCanvas3D &parent)
void switch_gizmos_icon_filename ()
bool init ()
bool init_icon_textures ()
float get_layout_scale ()
bool init_arrow (const std::string &filename)
template<class Archive>
void load (Archive &ar)
template<class Archive>
void save (Archive &ar) const
bool is_enabled () const
void set_enabled (bool enable)
void set_icon_dirty ()
void set_overlay_icon_size (float size)
void set_overlay_scale (float scale)
void refresh_on_off_state ()
void reset_all_states ()
bool open_gizmo (EType type)
bool check_gizmos_closed_except (EType) const
void set_hover_id (int id)
void update_data ()
 Distribute information about different data into active gizmo Should be called when selection changed.
void update_section_view ()
EType get_current_type () const
GLGizmoBase * get_current () const
GLGizmoBase * get_gizmo (GLGizmosManager::EType type) const
EType get_gizmo_from_name (const std::string &gizmo_name) const
bool is_running () const
bool open_gizmo_by_shortcut (Shortcut shortcut)
bool on_delete_key ()
bool is_dragging () const
void * get_icon_texture_id (MENU_ICON_NAME icon)
void * get_icon_texture_id (MENU_ICON_NAME icon) const
bool is_paint_gizmo ()
bool is_allow_select_all ()
bool is_allow_multi_select_parts_or_objects () const
std::optional< ClippingPlane > get_clipping_plane () const
bool wants_reslice_supports_on_undo () const
bool is_in_editing_mode (bool error_notification=false) const
bool is_hiding_instances () const
void on_change_color_mode (bool is_dark)
void render_current_gizmo () const
void render_painter_gizmo ()
void render_overlay ()
void render_overlay_input_window ()
size_t get_overlay_state_hash () const
void render_arrow (const GLCanvas3D &parent, EType highlighted_type) const
std::string get_tooltip () const
bool on_mouse (const wxMouseEvent &mouse_event)
bool on_mouse_wheel (const wxMouseEvent &evt)
bool on_char (wxKeyEvent &evt)
bool on_key (wxKeyEvent &evt)
void update_after_undo_redo (const UndoRedo::Snapshot &snapshot)
int get_selectable_icons_cnt () const
void set_highlight (EType gizmo, bool highlight_shown)
bool get_highlight_state () const
float get_scaled_total_height () const
float get_scaled_total_width () const
GizmoObjectManipulation & get_object_manipulation ()
bool get_uniform_scaling () const
ObjectID id () const
virtual Timestamp timestamp () const

Static Public Attributes

static const float Default_Icons_Size = 64

Protected Member Functions

void set_new_unique_id ()
void set_invalid_id ()
void copy_id (const ObjectBase &rhs)
virtual void assign_new_unique_ids_recursive ()

Private Member Functions

std::vector< size_t > get_selectable_idxs () const
EType get_gizmo_from_mouse (const Vec2d &mouse_pos) const
bool activate_gizmo (EType type)
void on_set_color_timer (wxTimerEvent &evt)
bool gizmos_toolbar_on_mouse (const wxMouseEvent &mouse_event)
 Process mouse event on gizmo toolbar.
bool gizmo_event (SLAGizmoEventType action, const Vec2d &mouse_position=Vec2d::Zero(), bool shift_down=false, bool alt_down=false, bool control_down=false)
void render_background (float left, float top, float right, float bottom, float border_w, float border_h) const
void do_render_overlay (bool draw_icons) const
bool generate_icons_texture ()
void update_hover_state (const EType &type)
bool grabber_contains_mouse () const
template<class Archive>
void serialize (Archive &ar)

Static Private Member Functions

static ObjectID generate_new_id ()
template<class Archive>
static void load_and_construct (Archive &ar, cereal::construct< ObjectBase > &construct)

Private Attributes

GLCanvas3D & m_parent
bool m_enabled
std::vector< std::unique_ptr< GLGizmoBase > > m_gizmos
GLTexture m_icons_texture
bool m_icons_texture_dirty
BackgroundTexture m_background_texture
GLTexture m_arrow_texture
Layout m_layout
EType m_current
EType m_hover
std::pair< EType, bool > m_highlight
GizmoObjectManipulation m_object_manipulation
std::string m_tooltip
bool m_serializing
std::unique_ptr< CommonGizmosDataPool > m_common_gizmos_data
wxTimer m_timer_set_color
int m_pending_color_shortcut_tens = 0
bool m_is_dark = false
bool m_restore_realistic_view_after_paint = false
ObjectID m_id

Static Private Attributes

static std::map< int, void * > icon_list = {}
static size_t s_last_id = 0

Detailed Description

Member Typedef Documentation

◆ Timestamp

using Slic3r::ObjectBase::Timestamp = uint64_t
inherited

Member Enumeration Documentation

◆ EType

Enumerator
Move 
Rotate 
Scale 
Flatten 
Cut 
MeshBoolean 
FdmSupports 
Seam 
FuzzySkin 
MmSegmentation 
TextureDisplacement 
Emboss 
Svg 
Measure 
Assembly 
Simplify 
BrimEars 
Undefined 
86 {
87 // Order must match index in m_gizmos!
88 Move,
89 Rotate,
90 Scale,
91 Flatten,
92 Cut,
95 Seam,
99 Emboss,
100 Svg,
101 Measure,
102 Assembly,
103 Simplify,
104 BrimEars,
105 //SlaSupports,
106 // BBS
107 //FaceRecognition,
108 //Hollow,
109 Undefined,
110 };
@ MeshBoolean
Definition GLGizmosManager.hpp:93
@ Emboss
Definition GLGizmosManager.hpp:99
@ Move
Definition GLGizmosManager.hpp:88
@ BrimEars
Definition GLGizmosManager.hpp:104
@ Flatten
Definition GLGizmosManager.hpp:91
@ MmSegmentation
Definition GLGizmosManager.hpp:97
@ Measure
Definition GLGizmosManager.hpp:101
@ FuzzySkin
Definition GLGizmosManager.hpp:96
@ Seam
Definition GLGizmosManager.hpp:95
@ Undefined
Definition GLGizmosManager.hpp:109
@ TextureDisplacement
Definition GLGizmosManager.hpp:98
@ Scale
Definition GLGizmosManager.hpp:90
@ Svg
Definition GLGizmosManager.hpp:100
@ Rotate
Definition GLGizmosManager.hpp:89
@ Assembly
Definition GLGizmosManager.hpp:102
@ Cut
Definition GLGizmosManager.hpp:92
@ Simplify
Definition GLGizmosManager.hpp:103
@ FdmSupports
Definition GLGizmosManager.hpp:94

◆ MENU_ICON_NAME

Enumerator
IC_TOOLBAR_RESET 
IC_TOOLBAR_RESET_HOVER 
IC_TOOLBAR_RESET_ZERO 
IC_TOOLBAR_RESET_ZERO_HOVER 
IC_TOOLBAR_TOOLTIP 
IC_TOOLBAR_WIKI_GUIDE 
IC_TOOLBAR_VIDEO_GUIDE 
IC_NAME_COUNT 
IC_CANVAS_MENU 
IC_CANVAS_MENU_HOVER 
IC_CANVAS_MENU_DARK 
IC_CANVAS_MENU_DARK_HOVER 
IC_CANVAS_ZOOM 
IC_CANVAS_ZOOM_HOVER 
IC_CANVAS_ZOOM_DARK 
IC_CANVAS_ZOOM_DARK_HOVER 
IC_CANVAS_SECTION 
IC_CANVAS_SECTION_HOVER 
IC_CANVAS_SECTION_DARK 
IC_CANVAS_SECTION_DARK_HOVER 
IC_CANVAS_SECTION_ACTIVE 
IC_CANVAS_SECTION_ACTIVE_HOVER 
IC_CANVAS_SECTION_ACTIVE_DARK 
IC_CANVAS_SECTION_ACTIVE_DARK_HOVER 
IC_ALIGN_X_MIN 
IC_ALIGN_X_CENTER 
IC_ALIGN_X_MAX 
IC_ALIGN_Y_MIN 
IC_ALIGN_Y_CENTER 
IC_ALIGN_Y_MAX 
IC_ALIGN_Z_MIN 
IC_ALIGN_Z_CENTER 
IC_ALIGN_Z_MAX 
IC_DISTRIBUTE_X 
IC_DISTRIBUTE_Y 
IC_DISTRIBUTE_Z 
IC_ALIGN_X_MIN_DARK 
IC_ALIGN_X_CENTER_DARK 
IC_ALIGN_X_MAX_DARK 
IC_ALIGN_Y_MIN_DARK 
IC_ALIGN_Y_CENTER_DARK 
IC_ALIGN_Y_MAX_DARK 
IC_ALIGN_Z_MIN_DARK 
IC_ALIGN_Z_CENTER_DARK 
IC_ALIGN_Z_MAX_DARK 
IC_DISTRIBUTE_X_DARK 
IC_DISTRIBUTE_Y_DARK 
IC_DISTRIBUTE_Z_DARK 
179 {
228 };
@ IC_CANVAS_SECTION_ACTIVE
Definition GLGizmosManager.hpp:200
@ IC_ALIGN_Z_CENTER
Definition GLGizmosManager.hpp:211
@ IC_CANVAS_SECTION_DARK_HOVER
Definition GLGizmosManager.hpp:199
@ IC_CANVAS_MENU_DARK_HOVER
Definition GLGizmosManager.hpp:191
@ IC_DISTRIBUTE_Y
Definition GLGizmosManager.hpp:214
@ IC_NAME_COUNT
Definition GLGizmosManager.hpp:187
@ IC_ALIGN_Y_MAX
Definition GLGizmosManager.hpp:209
@ IC_TOOLBAR_VIDEO_GUIDE
Definition GLGizmosManager.hpp:186
@ IC_TOOLBAR_RESET
Definition GLGizmosManager.hpp:180
@ IC_ALIGN_X_CENTER_DARK
Definition GLGizmosManager.hpp:217
@ IC_ALIGN_X_CENTER
Definition GLGizmosManager.hpp:205
@ IC_ALIGN_Y_MAX_DARK
Definition GLGizmosManager.hpp:221
@ IC_CANVAS_SECTION_ACTIVE_DARK
Definition GLGizmosManager.hpp:202
@ IC_DISTRIBUTE_X
Definition GLGizmosManager.hpp:213
@ IC_DISTRIBUTE_X_DARK
Definition GLGizmosManager.hpp:225
@ IC_CANVAS_ZOOM_DARK
Definition GLGizmosManager.hpp:194
@ IC_TOOLBAR_RESET_ZERO_HOVER
Definition GLGizmosManager.hpp:183
@ IC_DISTRIBUTE_Z
Definition GLGizmosManager.hpp:215
@ IC_ALIGN_X_MAX
Definition GLGizmosManager.hpp:206
@ IC_ALIGN_X_MIN
Definition GLGizmosManager.hpp:204
@ IC_DISTRIBUTE_Y_DARK
Definition GLGizmosManager.hpp:226
@ IC_TOOLBAR_TOOLTIP
Definition GLGizmosManager.hpp:184
@ IC_CANVAS_MENU
Definition GLGizmosManager.hpp:188
@ IC_TOOLBAR_WIKI_GUIDE
Definition GLGizmosManager.hpp:185
@ IC_CANVAS_MENU_DARK
Definition GLGizmosManager.hpp:190
@ IC_CANVAS_SECTION_ACTIVE_HOVER
Definition GLGizmosManager.hpp:201
@ IC_TOOLBAR_RESET_HOVER
Definition GLGizmosManager.hpp:181
@ IC_ALIGN_Y_MIN
Definition GLGizmosManager.hpp:207
@ IC_ALIGN_Z_MIN_DARK
Definition GLGizmosManager.hpp:222
@ IC_ALIGN_Y_CENTER_DARK
Definition GLGizmosManager.hpp:220
@ IC_CANVAS_SECTION_HOVER
Definition GLGizmosManager.hpp:197
@ IC_ALIGN_Z_MAX_DARK
Definition GLGizmosManager.hpp:224
@ IC_ALIGN_Z_MAX
Definition GLGizmosManager.hpp:212
@ IC_CANVAS_SECTION_DARK
Definition GLGizmosManager.hpp:198
@ IC_TOOLBAR_RESET_ZERO
Definition GLGizmosManager.hpp:182
@ IC_CANVAS_ZOOM_HOVER
Definition GLGizmosManager.hpp:193
@ IC_CANVAS_SECTION_ACTIVE_DARK_HOVER
Definition GLGizmosManager.hpp:203
@ IC_CANVAS_MENU_HOVER
Definition GLGizmosManager.hpp:189
@ IC_DISTRIBUTE_Z_DARK
Definition GLGizmosManager.hpp:227
@ IC_ALIGN_X_MIN_DARK
Definition GLGizmosManager.hpp:216
@ IC_CANVAS_ZOOM
Definition GLGizmosManager.hpp:192
@ IC_CANVAS_ZOOM_DARK_HOVER
Definition GLGizmosManager.hpp:195
@ IC_ALIGN_X_MAX_DARK
Definition GLGizmosManager.hpp:218
@ IC_ALIGN_Z_MIN
Definition GLGizmosManager.hpp:210
@ IC_CANVAS_SECTION
Definition GLGizmosManager.hpp:196
@ IC_ALIGN_Y_MIN_DARK
Definition GLGizmosManager.hpp:219
@ IC_ALIGN_Y_CENTER
Definition GLGizmosManager.hpp:208
@ IC_ALIGN_Z_CENTER_DARK
Definition GLGizmosManager.hpp:223

Constructor & Destructor Documentation

◆ GLGizmosManager()

Slic3r::GUI::GLGizmosManager::GLGizmosManager ( GLCanvas3D & parent)
explicit
77 : m_parent(parent)
78 , m_enabled(false)
82 , m_tooltip("")
83 , m_serializing(false)
84 //BBS: GUI refactor: add object manipulation in gizmo
85 , m_object_manipulation(parent)
86{
88}
GLCanvas3D & m_parent
Definition GLGizmosManager.hpp:133
bool m_icons_texture_dirty
Definition GLGizmosManager.hpp:137
bool m_enabled
Definition GLGizmosManager.hpp:134
EType m_hover
Definition GLGizmosManager.hpp:142
GizmoObjectManipulation m_object_manipulation
Definition GLGizmosManager.hpp:146
wxTimer m_timer_set_color
Definition GLGizmosManager.hpp:158
std::string m_tooltip
Definition GLGizmosManager.hpp:153
bool m_serializing
Definition GLGizmosManager.hpp:154
void on_set_color_timer(wxTimerEvent &evt)
Definition GLGizmosManager.cpp:1140
EType m_current
Definition GLGizmosManager.hpp:141

References m_current, m_enabled, m_hover, m_icons_texture_dirty, m_object_manipulation, m_parent, m_serializing, m_timer_set_color, m_tooltip, on_set_color_timer(), and Undefined.

Here is the call graph for this function:

Member Function Documentation

◆ activate_gizmo()

bool Slic3r::GUI::GLGizmosManager::activate_gizmo ( EType type)
private
1461{
1462 // already activated
1463 if (m_current == type)
1464 return true;
1465
1466 if (m_gizmos.empty())
1467 return false;
1468
1469 if (m_current != Undefined) {
1470 // clean up previous gizmo
1471 GLGizmoBase &old_gizmo = *m_gizmos[m_current];
1472 old_gizmo.set_state(GLGizmoBase::Off);
1473 if (old_gizmo.get_state() != GLGizmoBase::Off)
1474 return false; // gizmo refused to be turned off, do nothing.
1475
1476 old_gizmo.unregister_raycasters_for_picking();
1477
1478 if (!m_serializing && old_gizmo.wants_enter_leave_snapshots())
1479 Plater::TakeSnapshot
1480 snapshot(wxGetApp().plater(),
1481 old_gizmo.get_gizmo_leaving_text(),
1483 }
1484
1485 if (type == Undefined) {
1486 // it is deactivation of gizmo
1487 if (m_restore_realistic_view_after_paint && wxGetApp().app_config != nullptr) {
1488 wxGetApp().app_config->set_bool(SETTING_OPENGL_REALISTIC_MODE, true);
1489 wxGetApp().app_config->save();
1491 }
1493 return true;
1494 }
1495
1496 // set up new gizmo
1497 GLGizmoBase& new_gizmo = *m_gizmos[type];
1498 if (!new_gizmo.is_activable()) return false;
1499
1500 if (type == Seam || type == FdmSupports || type == FuzzySkin) {
1501 if (wxGetApp().app_config != nullptr && wxGetApp().app_config->get_bool(SETTING_OPENGL_REALISTIC_MODE)) {
1503 wxGetApp().app_config->set_bool(SETTING_OPENGL_REALISTIC_MODE, false);
1504 wxGetApp().app_config->save();
1505 }
1506 } else {
1508 }
1509
1510 if (!m_serializing && new_gizmo.wants_enter_leave_snapshots())
1511 Plater::TakeSnapshot snapshot(wxGetApp().plater(),
1512 new_gizmo.get_gizmo_entering_text(),
1514
1515 m_current = type;
1516 new_gizmo.set_state(GLGizmoBase::On);
1517 if (new_gizmo.get_state() != GLGizmoBase::On) {
1519 return false; // gizmo refused to be turned on.
1520 }
1521
1522 new_gizmo.register_raycasters_for_picking();
1523
1524 // sucessful activation of gizmo
1525 return true;
1526}
#define SETTING_OPENGL_REALISTIC_MODE
Definition AppConfig.hpp:41
@ On
Definition GLGizmoBase.hpp:128
@ Off
Definition GLGizmoBase.hpp:127
bool m_restore_realistic_view_after_paint
Definition GLGizmosManager.hpp:167
std::vector< std::unique_ptr< GLGizmoBase > > m_gizmos
Definition GLGizmosManager.hpp:135
static Plater * plater()
Definition GUI_Factories.cpp:400
@ EnteringGizmo
Definition UndoRedo.hpp:42
@ LeavingGizmoWithAction
Definition UndoRedo.hpp:48

References Slic3r::UndoRedo::EnteringGizmo, FdmSupports, FuzzySkin, Slic3r::GUI::GLGizmoBase::get_gizmo_entering_text(), Slic3r::GUI::GLGizmoBase::get_gizmo_leaving_text(), Slic3r::GUI::GLGizmoBase::get_state(), Slic3r::GUI::GLGizmoBase::is_activable(), Slic3r::UndoRedo::LeavingGizmoWithAction, m_current, m_gizmos, m_restore_realistic_view_after_paint, m_serializing, Slic3r::GUI::GLGizmoBase::Off, Slic3r::GUI::GLGizmoBase::On, Slic3r::GUI::plater(), Slic3r::GUI::GLGizmoBase::register_raycasters_for_picking(), Seam, Slic3r::GUI::GLGizmoBase::set_state(), SETTING_OPENGL_REALISTIC_MODE, Undefined, Slic3r::GUI::GLGizmoBase::unregister_raycasters_for_picking(), and Slic3r::GUI::GLGizmoBase::wants_enter_leave_snapshots().

Referenced by load(), open_gizmo(), refresh_on_off_state(), and reset_all_states().

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

◆ assign_new_unique_ids_recursive()

virtual void Slic3r::ObjectBase::assign_new_unique_ids_recursive ( )
inlineprotectedvirtualinherited

Reimplemented in Slic3r::Model, Slic3r::ModelObject, and Slic3r::ModelVolume.

95{ this->set_new_unique_id(); }
void set_new_unique_id()
Definition ObjectID.hpp:89

References set_new_unique_id().

Here is the call graph for this function:

◆ check_gizmos_closed_except()

bool Slic3r::GUI::GLGizmosManager::check_gizmos_closed_except ( EType type) const
481{
482 if (get_current_type() != type && get_current_type() != Undefined) {
483 wxGetApp().plater()->get_notification_manager()->push_notification(
486 _u8L("Error: Please close all toolbar menus first"));
487 return false;
488 }
489 return true;
490}
EType get_current_type() const
Definition GLGizmosManager.hpp:299
@ PrintInfoNotificationLevel
Definition NotificationManager.hpp:218
@ CustomSupportsAndSeamRemovedAfterRepair
Definition NotificationManager.hpp:122
#define _u8L(s)
Definition I18N.hpp:11

References _u8L, Slic3r::GUI::CustomSupportsAndSeamRemovedAfterRepair, get_current_type(), Slic3r::GUI::NotificationManager::PrintInfoNotificationLevel, and Undefined.

Referenced by Slic3r::GUI::ObjectList::simplify().

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

◆ copy_id()

void Slic3r::ObjectBase::copy_id ( const ObjectBase & rhs)
inlineprotectedinherited
92{ m_id = rhs.id(); }
ObjectID m_id
Definition ObjectID.hpp:98

References ObjectBase(), id(), and m_id.

Referenced by Slic3r::CutObjectBase::copy().

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

◆ do_render_overlay()

void Slic3r::GUI::GLGizmosManager::do_render_overlay ( bool draw_icons) const
private
1269{
1270 const std::vector<size_t> selectable_idxs = get_selectable_idxs();
1271 if (selectable_idxs.empty())
1272 return;
1273
1274 const Size cnv_size = m_parent.get_canvas_size();
1275 const float cnv_w = (float)cnv_size.get_width();
1276 const float cnv_h = (float)cnv_size.get_height();
1277
1278 if (cnv_w == 0 || cnv_h == 0)
1279 return;
1280
1281 const float inv_cnv_w = 1.0f / cnv_w;
1282 const float inv_cnv_h = 1.0f / cnv_h;
1283
1284 const float height = 2.0f * get_scaled_total_height() * inv_cnv_h;
1285 const float width = 2.0f * get_scaled_total_width() * inv_cnv_w;
1286 const float border_h = 2.0f * m_layout.scaled_border() * inv_cnv_h;
1287 const float border_w = 2.0f * m_layout.scaled_border() * inv_cnv_w;
1288
1289 float top_x;
1290 if (m_parent.get_canvas_type() == GLCanvas3D::CanvasAssembleView) {
1291 top_x = m_parent.get_assembly_paint_toolbar_width() * inv_cnv_w;
1292 }
1293 else {
1294 //BBS: GUI refactor: GLToolbar&&Gizmo adjust
1295 float main_toolbar_width = (float)m_parent.get_main_toolbar_width();
1296 float separator_width = (float)m_parent.get_separator_toolbar_width();
1297 //float space_width = GLGizmosManager::Default_Icons_Size * wxGetApp().toolbar_icon_scale();
1298 //float zoomed_top_x = 0.5f *(cnv_w + main_toolbar_width - 2 * space_width - width) * inv_zoom;
1299
1300 int main_toolbar_left = -cnv_w + m_parent.get_main_toolbar_offset() * 2;
1301 //float zoomed_top_x = 0.5f *(main_toolbar_width + collapse_width - width - assemble_view_width) * inv_zoom;
1302 top_x = main_toolbar_left + main_toolbar_width * 2 + separator_width;
1303 top_x = top_x * inv_cnv_w;
1304 }
1305 float top_y = 1.0f;
1306
1307 if (draw_icons)
1308 render_background(top_x, top_y, top_x + width, top_y - height, border_w, border_h);
1309
1310 top_x += border_w;
1311 top_y -= border_h;
1312
1313 const float icons_size_x = 2.0f * m_layout.scaled_icons_size() * inv_cnv_w;
1314 const float icons_size_y = 2.0f * m_layout.scaled_icons_size() * inv_cnv_h;
1315 //BBS: GUI refactor: GLToolbar&&Gizmo adjust
1316 const float stride_x = 2.0f * m_layout.scaled_stride_x() * inv_cnv_w;
1317
1318 const unsigned int icons_texture_id = m_icons_texture.get_id();
1319 const int tex_width = m_icons_texture.get_width();
1320 const int tex_height = m_icons_texture.get_height();
1321
1322 if (icons_texture_id == 0 || tex_width <= 1 || tex_height <= 1)
1323 return;
1324
1325 const float du = (float)(tex_width - 1) / (6.0f * (float)tex_width); // 6 is the number of possible states if the icons
1326 const float dv = (float)(tex_height - 1) / (float)(m_gizmos.size() * tex_height);
1327
1328 // tiles in the texture are spaced by 1 pixel
1329 const float u_offset = 1.0f / (float)tex_width;
1330 const float v_offset = 1.0f / (float)tex_height;
1331
1332 bool is_render_current = false;
1333
1334 for (size_t idx : selectable_idxs) {
1335 GLGizmoBase* gizmo = m_gizmos[idx].get();
1336 const unsigned int sprite_id = gizmo->get_sprite_id();
1337 // higlighted state needs to be decided first so its highlighting in every other state
1338 const int icon_idx = (m_highlight.first == idx ? (m_highlight.second ? 4 : 5) : (m_current == idx) ? 2 : ((m_hover == idx) ? 1 : (gizmo->is_activable()? 0 : 3)));
1339
1340 const float u_left = u_offset + icon_idx * du;
1341 const float u_right = u_left + du - u_offset;
1342 const float v_top = v_offset + sprite_id * dv;
1343 const float v_bottom = v_top + dv - v_offset;
1344
1345 if (draw_icons)
1346 GLTexture::render_sub_texture(icons_texture_id, top_x, top_x + icons_size_x, top_y - icons_size_y, top_y, { { u_left, v_bottom }, { u_right, v_bottom }, { u_right, v_top }, { u_left, v_top } });
1347 if (idx == m_current
1348 // Orca: Show Svg dialog at the same place as emboss gizmo
1349 || (m_current == Svg && idx == Emboss)) {
1350 //BBS: GUI refactor: GLToolbar&&Gizmo adjust
1351 //render_input_window uses a different coordination(imgui)
1352 //1. no need to scale by camera zoom, set {0,0} at left-up corner for imgui
1353 //gizmo->render_input_window(width, 0.5f * cnv_h - zoomed_top_y * zoom, toolbar_top);
1354 if (!draw_icons)
1355 m_gizmos[m_current]->render_input_window(0.5 * cnv_w + 0.5f * top_x * cnv_w, get_scaled_total_height(), cnv_h);
1356
1357 is_render_current = true;
1358 }
1359 top_x += stride_x;
1360 }
1361
1362 // BBS simplify gizmo is not a selected gizmo and need to render input window
1363 if (!draw_icons && !is_render_current && m_current != Undefined) {
1364 m_gizmos[m_current]->render_input_window(0.5 * cnv_w + 0.5f * top_x * cnv_w, get_scaled_total_height(), cnv_h);
1365 }
1366}
@ CanvasAssembleView
Definition GLCanvas3D.hpp:628
Layout m_layout
Definition GLGizmosManager.hpp:140
void render_background(float left, float top, float right, float bottom, float border_w, float border_h) const
Definition GLGizmosManager.cpp:1162
float get_scaled_total_height() const
Definition GLGizmosManager.cpp:1368
GLTexture m_icons_texture
Definition GLGizmosManager.hpp:136
float get_scaled_total_width() const
Definition GLGizmosManager.cpp:1378
std::pair< EType, bool > m_highlight
Definition GLGizmosManager.hpp:143
std::vector< size_t > get_selectable_idxs() const
Definition GLGizmosManager.cpp:90
static void render_sub_texture(unsigned int tex_id, float left, float right, float bottom, float top, const Quad_UVs &uvs)
Definition GLTexture.cpp:715
coord_t width(const BoundingBox &box)
Definition Arrange.cpp:1184
coord_t height(const BoundingBox &box)
Definition Arrange.cpp:1185

References Slic3r::GUI::GLCanvas3D::CanvasAssembleView, Emboss, Slic3r::GUI::Size::get_height(), get_scaled_total_height(), get_scaled_total_width(), get_selectable_idxs(), Slic3r::GUI::GLGizmoBase::get_sprite_id(), Slic3r::GUI::Size::get_width(), Slic3r::GUI::GLGizmoBase::is_activable(), m_current, m_gizmos, m_highlight, m_hover, m_icons_texture, m_layout, m_parent, render_background(), Slic3r::GUI::GLTexture::render_sub_texture(), Svg, and Undefined.

Referenced by render_overlay(), and render_overlay_input_window().

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

◆ generate_icons_texture()

bool Slic3r::GUI::GLGizmosManager::generate_icons_texture ( )
private
1412{
1413 std::string path = resources_dir() + "/images/";
1414 std::vector<std::string> filenames;
1415 for (size_t idx=0; idx<m_gizmos.size(); ++idx)
1416 {
1417 auto &gizmo = m_gizmos[idx];
1418 if (gizmo != nullptr)
1419 {
1420 const std::string& icon_filename = gizmo->get_icon_filename();
1421 if (!icon_filename.empty())
1422 filenames.push_back(path + icon_filename);
1423 }
1424 }
1425
1426 std::vector<std::pair<int, bool>> states;
1427 states.push_back(std::make_pair(1, false)); // Activable
1428 states.push_back(std::make_pair(0, false)); // Hovered
1429 states.push_back(std::make_pair(0, true)); // Selected
1430 states.push_back(std::make_pair(2, false)); // Disabled
1431 states.push_back(std::make_pair(0, false)); // HighlightedShown
1432 states.push_back(std::make_pair(2, false)); // HighlightedHidden
1433
1434 unsigned int sprite_size_px = (unsigned int)m_layout.scaled_icons_size();
1435// // force even size
1436// if (sprite_size_px % 2 != 0)
1437// sprite_size_px += 1;
1438
1439 bool res = m_icons_texture.load_from_svg_files_as_sprites_array(filenames, states, sprite_size_px, false);
1440 if (res)
1441 m_icons_texture_dirty = false;
1442
1443 return res;
1444}
const std::string & resources_dir()
Definition utils.cpp:296

References m_gizmos, m_icons_texture, m_icons_texture_dirty, m_layout, and Slic3r::resources_dir().

Referenced by render_overlay().

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

◆ generate_new_id()

ObjectID Slic3r::ObjectBase::generate_new_id ( )
inlinestaticprivateinherited
100{ return ObjectID(++ s_last_id); }
static size_t s_last_id
Definition ObjectID.hpp:101

References s_last_id.

Referenced by ObjectBase(), and set_new_unique_id().

Here is the caller graph for this function:

◆ get_clipping_plane()

std::optional< ClippingPlane > Slic3r::GUI::GLGizmosManager::get_clipping_plane ( ) const
647{
648 if (! m_common_gizmos_data || ! m_common_gizmos_data->object_clipper())
649 return std::nullopt;
650 else if (m_common_gizmos_data->object_clipper()->get_position() == 0.)
652 else {
653 const ClippingPlane& clp = *m_common_gizmos_data->object_clipper()->get_clipping_plane();
654 return ClippingPlane(-clp.get_normal(), clp.get_data()[3]);
655 }
656}
static ClippingPlane ClipsNothing()
Definition MeshUtils.hpp:73
std::unique_ptr< CommonGizmosDataPool > m_common_gizmos_data
Definition GLGizmosManager.hpp:155

References Slic3r::GUI::ClippingPlane::ClipsNothing(), Slic3r::GUI::ClippingPlane::get_data(), Slic3r::GUI::ClippingPlane::get_normal(), and m_common_gizmos_data.

Here is the call graph for this function:

◆ get_current()

GLGizmoBase * Slic3r::GUI::GLGizmosManager::get_current ( ) const
1389{
1390 return ((m_current == Undefined) || m_gizmos.empty()) ? nullptr : m_gizmos[m_current].get();
1391}

References m_current, m_gizmos, and Undefined.

Referenced by Slic3r::GUI::GLCanvas3D::_render_objects(), get_tooltip(), grabber_contains_mouse(), is_in_editing_mode(), on_key(), on_set_color_timer(), render_painter_gizmo(), Slic3r::GUI::Plater::priv::take_snapshot(), and update_data().

Here is the caller graph for this function:

◆ get_current_type()

◆ get_gizmo()

GLGizmoBase * Slic3r::GUI::GLGizmosManager::get_gizmo ( GLGizmosManager::EType type) const
1394{
1395 return ((type == Undefined) || m_gizmos.empty()) ? nullptr : m_gizmos[type].get();
1396}

References m_gizmos, and Undefined.

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

Here is the caller graph for this function:

◆ get_gizmo_from_mouse()

GLGizmosManager::EType Slic3r::GUI::GLGizmosManager::get_gizmo_from_mouse ( const Vec2d & mouse_pos) const
private
113{
114 if (! m_enabled)
115 return Undefined;
116
117 float icons_size = m_layout.scaled_icons_size();
118 float border = m_layout.scaled_border();
119
120 //BBS: GUI refactor: GLToolbar&&Gizmo adjust
121 //float space_width = GLGizmosManager::Default_Icons_Size * wxGetApp().toolbar_icon_scale();;
122 float top_x;
123 if (m_parent.get_canvas_type() == GLCanvas3D::CanvasAssembleView) {
124 const float cnv_w = (float)m_parent.get_canvas_size().get_width();
125
126 top_x = 0.5f * cnv_w + 0.5f * (m_parent.get_assembly_paint_toolbar_width());
127 } else {
128 const float separator_width = m_parent.get_separator_toolbar_width();
129
130 top_x = m_parent.get_main_toolbar_offset();
131 top_x += m_parent.get_main_toolbar_width() + separator_width / 2 + border;
132 }
133 float top_y = 0;
134 float stride_x = m_layout.scaled_stride_x();
135
136 // is mouse vertically in the area?
137 //if ((border <= (float)mouse_pos(0) && ((float)mouse_pos(0) <= border + icons_size))) {
138 if (((top_y + border) <= (float)mouse_pos(1)) && ((float)mouse_pos(1) <= (top_y + border + icons_size))) {
139 // which icon is it on?
140 int from_left = (float) mouse_pos(0) - top_x < 0 ? -1 : (int) ((float) mouse_pos(0) - top_x) / stride_x;
141 if (from_left < 0)
142 return Undefined;
143 // is it really on the icon or already past the border?
144 if ((float)mouse_pos(0) <= top_x + from_left * stride_x + icons_size) {
145 std::vector<size_t> selectable = get_selectable_idxs();
146 if (from_left < selectable.size())
147 return static_cast<EType>(selectable[from_left]);
148 }
149 }
150 return Undefined;
151}
EType
Definition GLGizmosManager.hpp:86
static bool selectable(const char *label, bool selected, ImGuiSelectableFlags flags=0, const ImVec2 &size_arg=ImVec2(0, 0), bool *out_hovered=nullptr)
Definition ImGuiWrapper.cpp:1484

References Slic3r::GUI::GLCanvas3D::CanvasAssembleView, get_selectable_idxs(), m_enabled, m_layout, m_parent, Slic3r::GUI::selectable(), and Undefined.

Referenced by gizmos_toolbar_on_mouse().

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

◆ get_gizmo_from_name()

GLGizmosManager::EType Slic3r::GUI::GLGizmosManager::get_gizmo_from_name ( const std::string & gizmo_name) const
1399{
1400 std::vector<size_t> selectable_idxs = get_selectable_idxs();
1401 for (size_t idx = 0; idx < selectable_idxs.size(); ++idx)
1402 {
1403 std::string filename = m_gizmos[selectable_idxs[idx]]->get_icon_filename();
1404 filename = filename.substr(0, filename.find_first_of('.'));
1405 if (filename == gizmo_name)
1406 return (GLGizmosManager::EType)selectable_idxs[idx];
1407 }
1409}

References get_selectable_idxs(), m_gizmos, and Undefined.

Here is the call graph for this function:

◆ get_highlight_state()

bool Slic3r::GUI::GLGizmosManager::get_highlight_state ( ) const
inline
360{ return m_highlight.second; }

References m_highlight.

◆ get_icon_texture_id() [1/2]

void * Slic3r::GUI::GLGizmosManager::get_icon_texture_id ( MENU_ICON_NAME icon)
inline
313 {
314 if (icon_list.find((int)icon) != icon_list.end())
315 return icon_list[icon];
316 else
317 return nullptr;
318 }
static std::map< int, void * > icon_list
Definition GLGizmosManager.hpp:164

References icon_list.

Referenced by Slic3r::GUI::GLGizmoUtils::render_tooltip_button(), Slic3r::GUI::GLGizmoUtils::render_video_guide_button(), and Slic3r::GUI::GLGizmoUtils::render_wiki_guide_button().

Here is the caller graph for this function:

◆ get_icon_texture_id() [2/2]

void * Slic3r::GUI::GLGizmosManager::get_icon_texture_id ( MENU_ICON_NAME icon) const
inline
319 {
320 if (icon_list.find((int)icon) != icon_list.end())
321 return icon_list.at(icon);
322 else
323 return nullptr;
324 }

References icon_list.

◆ get_layout_scale()

float Slic3r::GUI::GLGizmosManager::get_layout_scale ( )
399{
400 return m_layout.scale;
401}

References m_layout.

◆ get_object_manipulation()

GizmoObjectManipulation & Slic3r::GUI::GLGizmosManager::get_object_manipulation ( )
inline
365{ return m_object_manipulation; }

References m_object_manipulation.

◆ get_overlay_state_hash()

size_t Slic3r::GUI::GLGizmosManager::get_overlay_state_hash ( ) const
712{
713 size_t hash = 0;
714 boost::hash_combine(hash, m_enabled);
715 boost::hash_combine(hash, (int)m_hover);
716 boost::hash_combine(hash, (int)m_current);
717 boost::hash_combine(hash, (int)m_highlight.first);
718 boost::hash_combine(hash, m_highlight.second);
719 return hash;
720}

References m_current, m_enabled, m_highlight, and m_hover.

◆ get_scaled_total_height()

float Slic3r::GUI::GLGizmosManager::get_scaled_total_height ( ) const
1369{
1370//BBS: GUI refactor: to support top layout
1371#if BBS_TOOLBAR_ON_TOP
1372 return 2.0f * m_layout.scaled_border() + m_layout.scaled_icons_size();
1373#else
1374 return m_layout.scale * (2.0f * m_layout.border + (float)get_selectable_idxs().size() * m_layout.stride_y() - m_layout.gap_y);
1375#endif
1376}

References get_selectable_idxs(), and m_layout.

Referenced by do_render_overlay(), and render_arrow().

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

◆ get_scaled_total_width()

float Slic3r::GUI::GLGizmosManager::get_scaled_total_width ( ) const
1379{
1380//BBS: GUI refactor: to support top layout
1381#if BBS_TOOLBAR_ON_TOP
1382 return m_layout.scale * (2.0f * m_layout.border + (float)get_selectable_idxs().size() * m_layout.stride_x() - m_layout.gap_x);
1383#else
1384 return 2.0f * m_layout.scaled_border() + m_layout.scaled_icons_size();
1385#endif
1386}

References get_selectable_idxs(), and m_layout.

Referenced by do_render_overlay().

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

◆ get_selectable_icons_cnt()

int Slic3r::GUI::GLGizmosManager::get_selectable_icons_cnt ( ) const
inline
356{ return get_selectable_idxs().size(); }

References get_selectable_idxs().

Here is the call graph for this function:

◆ get_selectable_idxs()

std::vector< size_t > Slic3r::GUI::GLGizmosManager::get_selectable_idxs ( ) const
private
91{
92 std::vector<size_t> out;
93 out.reserve(m_gizmos.size());
94 if (m_parent.get_canvas_type() == GLCanvas3D::CanvasAssembleView) {
95 for (size_t i = 0; i < m_gizmos.size(); ++i)
96 if (m_gizmos[i]->get_sprite_id() == (unsigned int) Move ||
97 m_gizmos[i]->get_sprite_id() == (unsigned int) Rotate ||
98 m_gizmos[i]->get_sprite_id() == (unsigned int) Measure ||
99 m_gizmos[i]->get_sprite_id() == (unsigned int) Assembly ||
100 m_gizmos[i]->get_sprite_id() == (unsigned int) MmSegmentation)
101 out.push_back(i);
102 }
103 else {
104 for (size_t i = 0; i < m_gizmos.size(); ++i)
105 if (m_gizmos[i]->is_selectable())
106 out.push_back(i);
107 }
108 return out;
109}

References Assembly, Slic3r::GUI::GLCanvas3D::CanvasAssembleView, m_gizmos, m_parent, Measure, MmSegmentation, Move, and Rotate.

Referenced by do_render_overlay(), get_gizmo_from_mouse(), get_gizmo_from_name(), get_scaled_total_height(), get_scaled_total_width(), get_selectable_icons_cnt(), and render_arrow().

Here is the caller graph for this function:

◆ get_tooltip()

std::string Slic3r::GUI::GLGizmosManager::get_tooltip ( ) const
723{
724 if (!m_tooltip.empty())
725 return m_tooltip;
726
727 const GLGizmoBase* curr = get_current();
728 return (curr != nullptr) ? curr->get_tooltip() : "";
729}
GLGizmoBase * get_current() const
Definition GLGizmosManager.cpp:1388

References get_current(), Slic3r::GUI::GLGizmoBase::get_tooltip(), and m_tooltip.

Here is the call graph for this function:

◆ get_uniform_scaling()

bool Slic3r::GUI::GLGizmosManager::get_uniform_scaling ( ) const
inline
366{ return m_object_manipulation.get_uniform_scaling();}

References m_object_manipulation.

◆ gizmo_event()

bool Slic3r::GUI::GLGizmosManager::gizmo_event ( SLAGizmoEventType action,
const Vec2d & mouse_position = Vec2d::Zero(),
bool shift_down = false,
bool alt_down = false,
bool control_down = false )
private
589{
590 if (!m_enabled || m_gizmos.empty())
591 return false;
592
593 /*if (m_current == SlaSupports)
594 return dynamic_cast<GLGizmoSlaSupports*>(m_gizmos[SlaSupports].get())->gizmo_event(action, mouse_position, shift_down, alt_down, control_down);
595 else if (m_current == Hollow)
596 return dynamic_cast<GLGizmoHollow*>(m_gizmos[Hollow].get())->gizmo_event(action, mouse_position, shift_down, alt_down, control_down);
597 else*/ if (m_current == FdmSupports)
598 return dynamic_cast<GLGizmoFdmSupports*>(m_gizmos[FdmSupports].get())->gizmo_event(action, mouse_position, shift_down, alt_down, control_down);
599 else if (m_current == Seam)
600 return dynamic_cast<GLGizmoSeam*>(m_gizmos[Seam].get())->gizmo_event(action, mouse_position, shift_down, alt_down, control_down);
601 else if (m_current == MmSegmentation)
602 return dynamic_cast<GLGizmoMmuSegmentation*>(m_gizmos[MmSegmentation].get())->gizmo_event(action, mouse_position, shift_down, alt_down, control_down);
603 else if (m_current == Measure)
604 return dynamic_cast<GLGizmoMeasure *>(m_gizmos[Measure].get())->gizmo_event(action, mouse_position, shift_down, alt_down, control_down);
605 else if (m_current == Assembly)
606 return dynamic_cast<GLGizmoAssembly *>(m_gizmos[Assembly].get())->gizmo_event(action, mouse_position, shift_down, alt_down, control_down);
607 else if (m_current == Cut)
608 return dynamic_cast<GLGizmoCut3D*>(m_gizmos[Cut].get())->gizmo_event(action, mouse_position, shift_down, alt_down, control_down);
609 else if (m_current == FuzzySkin)
610 return dynamic_cast<GLGizmoFuzzySkin*>(m_gizmos[FuzzySkin].get())->gizmo_event(action, mouse_position, shift_down, alt_down, control_down);
611 else if (m_current == TextureDisplacement)
612 return dynamic_cast<GLGizmoTextureDisplacement*>(m_gizmos[TextureDisplacement].get())->gizmo_event(action, mouse_position, shift_down, alt_down, control_down);
613 else if (m_current == MeshBoolean)
614 return dynamic_cast<GLGizmoMeshBoolean*>(m_gizmos[MeshBoolean].get())->gizmo_event(action, mouse_position, shift_down, alt_down, control_down);
615 else if (m_current == BrimEars)
616 return dynamic_cast<GLGizmoBrimEars*>(m_gizmos[BrimEars].get())->gizmo_event(action, mouse_position, shift_down, alt_down, control_down);
617 else
618 return false;
619}

References Assembly, BrimEars, Cut, FdmSupports, FuzzySkin, Slic3r::GUI::GLGizmoBrimEars::gizmo_event(), Slic3r::GUI::GLGizmoCut3D::gizmo_event(), Slic3r::GUI::GLGizmoMeasure::gizmo_event(), Slic3r::GUI::GLGizmoMeshBoolean::gizmo_event(), Slic3r::GUI::GLGizmoPainterBase::gizmo_event(), m_current, m_enabled, m_gizmos, Measure, MeshBoolean, MmSegmentation, Seam, and TextureDisplacement.

Referenced by on_char(), on_delete_key(), on_key(), and on_mouse_wheel().

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

◆ gizmos_toolbar_on_mouse()

bool Slic3r::GUI::GLGizmosManager::gizmos_toolbar_on_mouse ( const wxMouseEvent & mouse_event)
private

Process mouse event on gizmo toolbar.

Parameters
mouse_eventEvent descriptor
Returns
TRUE when take responsibility for event otherwise FALSE. On true, event should not be process by others. On false, event should be process by others.
751 {
752 assert(m_enabled);
753 // keep information about events to process
754 struct MouseCapture
755 {
756 bool left = false;
757 bool middle = false;
758 bool right = false;
759 bool exist_tooltip = false;
760 MouseCapture() = default;
761 bool any() const { return left || middle || right; }
762 void reset() {
763 left = false;
764 middle = false;
765 right = false;
766 }
767 };
768 static MouseCapture mc;
769
770 // wxCoord == int --> wx/types.h
771 Vec2i32 mouse_coord(mouse_event.GetX(), mouse_event.GetY());
772 Vec2d mouse_pos = mouse_coord.cast<double>();
773
774 EType gizmo = get_gizmo_from_mouse(mouse_pos);
775 bool selected_gizmo = gizmo != Undefined;
776
777 // fast reaction on move mouse
778 if (mouse_event.Moving()) {
779 assert(!mc.any());
780 if (selected_gizmo) {
781 mc.exist_tooltip = true;
782 update_hover_state(gizmo);
783 // at this moment is enebled to process mouse move under gizmo
784 // tools bar e.g. Do not interupt dragging.
785 return false;
786 } else if (mc.exist_tooltip) {
787 // first move out of gizmo tool bar - unselect tooltip
788 mc.exist_tooltip = false;
790 return false;
791 }
792 return false;
793 }
794
795 if (selected_gizmo) {
796 // mouse is above toolbar
797 if (mouse_event.LeftDown() || mouse_event.LeftDClick()) {
798 mc.left = true;
799 if (gizmo == Emboss) {
800 GLGizmoBase *gizmo_emboss = m_gizmos[Emboss].get();
801 dynamic_cast<GLGizmoEmboss *>(gizmo_emboss)->on_shortcut_key();
802 } else {
803 open_gizmo(gizmo);
804 }
805 return true;
806 }
807 else if (mouse_event.RightDown()) {
808 mc.right = true;
809 return true;
810 }
811 else if (mouse_event.MiddleDown()) {
812 mc.middle = true;
813 return true;
814 }
815 }
816
817 if (mc.any()) {
818 // Check if exist release of event started above toolbar?
819 if (mouse_event.Dragging()) {
820 if (!selected_gizmo && mc.exist_tooltip) {
821 // dragging out of gizmo let tooltip disapear
822 mc.exist_tooltip = false;
824 }
825 // draging start on toolbar so no propagation into scene
826 return true;
827 }
828 else if (mc.left && mouse_event.LeftUp()) {
829 mc.left = false;
830 return true;
831 }
832 else if (mc.right && mouse_event.RightUp()) {
833 mc.right = false;
834 return true;
835 }
836 else if (mc.middle && mouse_event.MiddleUp()) {
837 mc.middle = false;
838 return true;
839 }
840
841 // event out of window is not porocessed
842 // left down on gizmo -> keep down -> move out of window -> release left
843 if (mouse_event.Leaving()) mc.reset();
844 }
845 return false;
846}
void update_hover_state(const EType &type)
Definition GLGizmosManager.cpp:1446
EType get_gizmo_from_mouse(const Vec2d &mouse_pos) const
Definition GLGizmosManager.cpp:112
bool open_gizmo(EType type)
Definition GLGizmosManager.cpp:458
Eigen::Matrix< int32_t, 2, 1, Eigen::DontAlign > Vec2i32
Definition Point.hpp:57
Eigen::Matrix< double, 2, 1, Eigen::DontAlign > Vec2d
Definition Point.hpp:67
@ right
Definition MarchingSquares.hpp:190
@ left
Definition MarchingSquares.hpp:188

References Emboss, get_gizmo_from_mouse(), m_enabled, m_gizmos, open_gizmo(), Undefined, update_hover_state(), and Slic3r::GUI::wxMouseEvent.

Referenced by on_mouse().

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

◆ grabber_contains_mouse()

bool Slic3r::GUI::GLGizmosManager::grabber_contains_mouse ( ) const
private
1530{
1531 if (!m_enabled)
1532 return false;
1533
1534 GLGizmoBase* curr = get_current();
1535 return (curr != nullptr) ? (curr->get_hover_id() != -1) : false;
1536}

References get_current(), Slic3r::GUI::GLGizmoBase::get_hover_id(), and m_enabled.

Here is the call graph for this function:

◆ id()

ObjectID Slic3r::ObjectBase::id ( ) const
inlineinherited
69{ return m_id; }

References m_id.

Referenced by Slic3r::CutObjectBase::CutObjectBase(), Slic3r::Model::Model(), Slic3r::ModelInstance::ModelInstance(), Slic3r::ModelMaterial::ModelMaterial(), Slic3r::ModelObject::ModelObject(), Slic3r::ModelObject::ModelObject(), Slic3r::ModelObject::ModelObject(), Slic3r::ModelObject::ModelObject(), Slic3r::ModelObject::ModelObject(), Slic3r::ModelVolume::ModelVolume(), Slic3r::ModelVolume::ModelVolume(), Slic3r::ModelVolume::ModelVolume(), Slic3r::ModelVolume::ModelVolume(), Slic3r::ModelVolume::ModelVolume(), Slic3r::ModelVolume::ModelVolume(), ObjectBase(), Slic3r::PrintBase::SlicingStatus::SlicingStatus(), Slic3r::PrintBase::SlicingStatus::SlicingStatus(), Slic3r::_BBS_3MF_Exporter::_add_cut_information_file_to_archive(), Slic3r::_BBS_3MF_Exporter::_add_model_config_file_to_archive(), Slic3r::_BBS_3MF_Exporter::_add_slice_info_config_file_to_archive(), Slic3r::GUI::Plater::priv::actualize_slicing_warnings(), Slic3r::ModelObjectStatusDB::add(), Slic3r::ModelObjectStatusDB::add_if_new(), Slic3r::Model::add_object(), Slic3r::append_and_translate(), Slic3r::SLAPrint::apply(), Slic3r::GUI::calc_distance(), Slic3r::GUI::calc_surface_offset(), Slic3r::check_model_ids_equal(), Slic3r::check_model_ids_validity(), Slic3r::GUI::GLGizmoTextureDisplacement::close_image_adjust(), Slic3r::Model::collect_reusable_objects(), Slic3r::ModelObject::convert_units(), copy_id(), Slic3r::PrintObjectStatusDB::count(), anonymous_namespace{RaycastManager.cpp}::create_key(), Slic3r::GUI::create_meshes(), anonymous_namespace{EmbossJob.cpp}::create_volume(), Slic3r::GUI::Emboss::create_volume_sources(), Slic3r::GUI::GLGizmoPainterBase::data_changed(), Slic3r::GCode::do_export(), Slic3r::GUI::PartPlate::duplicate_all_instance(), Slic3r::GUI::PartPlateList::duplicate_plate(), Slic3r::GUI::PartPlate::estimate_wipe_tower_footprint(), Slic3r::Print::export_cached_data(), Slic3r::GUI::Plater::export_stl(), Slic3r::find_volume_extents(), Slic3r::PreciseSeam::detail::fragment_location(), Slic3r::GUI::Plater::priv::generate_first_layer_bbox(), Slic3r::ModelObjectStatusDB::get(), Slic3r::Model::get_backup_path(), Slic3r::GUI::GLCanvas3D::get_empty_cells(), Slic3r::ModelInstance::get_labeled_id(), Slic3r::GUI::get_model_volume(), Slic3r::PrintObjectStatusDB::get_range(), Slic3r::GUI::get_selected_volume(), Slic3r::GUI::get_volume(), Slic3r::CutObjectBase::has_same_id(), Slic3r::UndoRedo::StackImpl::immutable_object_id_impl(), Slic3r::GUI::GLGizmoFdmSupports::init_print_instance(), Slic3r::CutObjectBase::is_equal(), Slic3r::GUI::GLGizmoSVG::is_svg_object(), Slic3r::ModelVolume::is_the_only_one_part(), Slic3r::GUI::IMSlider::IsNewPrint(), Slic3r::ModelObject::load(), load_and_construct(), Slic3r::Print::load_cached_data(), Slic3r::GLVolumeCollection::load_object_auxiliary(), Slic3r::GLVolumeCollection::load_object_volume(), Slic3r::GUI::GCodeViewer::load_shells(), Slic3r::UndoRedo::StackImpl::load_snapshot(), Slic3r::GUI::GLCanvas3D::CenterOfMass::model_markers(), Slic3r::model_property_changed(), Slic3r::model_volume_list_changed(), Slic3r::model_volume_list_copy_configs(), Slic3r::ModelConfigObject::object_id_and_timestamp_match(), Slic3r::ObjectWithTimestamp::object_id_and_timestamp_match(), Slic3r::GUI::GLGizmoEmboss::on_mouse_change_selection(), Slic3r::GUI::GLGizmoSimplify::on_render_input_window(), Slic3r::GUI::GLGizmoTextureDisplacement::open_image_adjust(), Slic3r::CutObjectBase::operator<(), Slic3r::Model::operator=(), Slic3r::ModelObject::operator=(), Slic3r::ModelObject::operator=(), Slic3r::CutObjectBase::operator==(), Slic3r::outer_inner_brim_area(), Slic3r::GUI::GLGizmoTextureDisplacement::painted_area_mm2(), Slic3r::GUI::GLGizmoCut3D::perform_cut(), anonymous_namespace{GLGizmoEmboss.cpp}::prepare_volumes_to_slice(), Slic3r::GUI::GLGizmoTextureDisplacement::preview_part(), Slic3r::GCode::process_layer(), Slic3r::GUI::NotificationManager::push_slicing_warning_notification(), Slic3r::GUI::GLGizmoTextureDisplacement::queue_preview_job(), Slic3r::GUI::queue_texture_displacement_debug(), Slic3r::GUI::GLGizmoEmboss::re_emboss(), Slic3r::GUI::GLGizmoTextureDisplacement::rebuild_other_paint_overlay(), Slic3r::GUI::GLGizmoTextureDisplacement::rebuild_painted_colors(), Slic3r::GUI::GLCanvas3D::reload_scene(), Slic3r::_BBS_Backup_Manager::remove_backup(), Slic3r::Model::remove_backup_path_if_exist(), Slic3r::GUI::GLGizmoTextureDisplacement::render_image_adjust_window(), Slic3r::CLI::run(), Slic3r::GUI::GLCanvas3D::LayersEditing::select_object(), Slic3r::ModelMaterial::serialize(), Slic3r::Model::set_backup_path(), Slic3r::GUI::GLGizmoBrimEars::set_brim_data(), Slic3r::GUI::PartPlate::set_hover_id(), Slic3r::GUI::GLGizmoEmboss::set_volume_by_selection(), Slic3r::GUI::GLGizmoSVG::set_volume_by_selection(), Slic3r::sla_instances(), Slic3r::slices_to_regions(), Slic3r::ModelObject::split(), anonymous_namespace{EmbossJob.cpp}::start_create_volume_on_surface_job(), anonymous_namespace{SurfaceDrag.cpp}::start_dragging(), Slic3r::GUI::Emboss::start_update_volume(), Slic3r::UndoRedo::StackImpl::take_snapshot(), Slic3r::GUI::texture_displacement_bake_volume(), Slic3r::GUI::GLGizmoPainterBase::update_contours(), anonymous_namespace{EmbossJob.cpp}::update_name_in_list(), Slic3r::GUI::ObjectList::update_name_in_model(), Slic3r::GUI::update_object_cut_id(), Slic3r::GUI::GLGizmoTextureDisplacement::v2_recommendation(), Slic3r::verify_update_print_object_regions(), wipe_tower_instance_id, and wipe_tower_object_id.

◆ init()

bool Slic3r::GUI::GLGizmosManager::init ( )
222{
223 if (!m_gizmos.empty())
224 return true;
226
227 m_background_texture.metadata.filename = m_is_dark ? "toolbar_background_dark.png" : "toolbar_background.png";
228 m_background_texture.metadata.left = 16;
229 m_background_texture.metadata.top = 16;
230 m_background_texture.metadata.right = 16;
231 m_background_texture.metadata.bottom = 16;
232
233 if (!m_background_texture.metadata.filename.empty())
234 {
235 if (!m_background_texture.texture.load_from_file(resources_dir() + "/images/" + m_background_texture.metadata.filename, false, GLTexture::SingleThreaded, false))
236 return false;
237 }
238
239 // Order of gizmos in the vector must match order in EType!
240 //BBS: GUI refactor: add obj manipulation
241 m_gizmos.clear();
242 unsigned int sprite_id = 0;
243 m_gizmos.emplace_back(new GLGizmoMove3D(m_parent, m_is_dark ? "toolbar_move_dark.svg" : "toolbar_move.svg", EType::Move, &m_object_manipulation));
244 m_gizmos.emplace_back(new GLGizmoRotate3D(m_parent, m_is_dark ? "toolbar_rotate_dark.svg" : "toolbar_rotate.svg", EType::Rotate, &m_object_manipulation));
245 m_gizmos.emplace_back(new GLGizmoScale3D(m_parent, m_is_dark ? "toolbar_scale_dark.svg" : "toolbar_scale.svg", EType::Scale, &m_object_manipulation));
246 m_gizmos.emplace_back(new GLGizmoFlatten(m_parent, m_is_dark ? "toolbar_flatten_dark.svg" : "toolbar_flatten.svg", EType::Flatten));
247 m_gizmos.emplace_back(new GLGizmoCut3D(m_parent, m_is_dark ? "toolbar_cut_dark.svg" : "toolbar_cut.svg", EType::Cut));
248 m_gizmos.emplace_back(new GLGizmoMeshBoolean(m_parent, m_is_dark ? "toolbar_meshboolean_dark.svg" : "toolbar_meshboolean.svg", EType::MeshBoolean));
249 m_gizmos.emplace_back(new GLGizmoFdmSupports(m_parent, m_is_dark ? "toolbar_support_dark.svg" : "toolbar_support.svg", EType::FdmSupports));
250 m_gizmos.emplace_back(new GLGizmoSeam(m_parent, m_is_dark ? "toolbar_seam_dark.svg" : "toolbar_seam.svg", EType::Seam));
251 m_gizmos.emplace_back(new GLGizmoFuzzySkin(m_parent, m_is_dark ? "toolbar_fuzzy_skin_paint_dark.svg" : "toolbar_fuzzy_skin_paint.svg", EType::FuzzySkin));
252 m_gizmos.emplace_back(new GLGizmoMmuSegmentation(m_parent, m_is_dark ? "mmu_segmentation_dark.svg" : "mmu_segmentation.svg", EType::MmSegmentation));
253 // One shared icon (no dedicated dark variant yet); it recolours acceptably in both themes.
254 m_gizmos.emplace_back(new GLGizmoTextureDisplacement(m_parent, "toolbar_texture_displacement.svg", EType::TextureDisplacement));
255 m_gizmos.emplace_back(new GLGizmoEmboss(m_parent, m_is_dark ? "toolbar_text_dark.svg" : "toolbar_text.svg", EType::Emboss));
256 m_gizmos.emplace_back(new GLGizmoSVG(m_parent));
257 m_gizmos.emplace_back(new GLGizmoMeasure(m_parent, m_is_dark ? "toolbar_measure_dark.svg" : "toolbar_measure.svg", EType::Measure));
258 m_gizmos.emplace_back(new GLGizmoAssembly(m_parent, m_is_dark ? "toolbar_assembly_dark.svg" : "toolbar_assembly.svg", EType::Assembly));
259 m_gizmos.emplace_back(new GLGizmoSimplify(m_parent, "reduce_triangles.svg", EType::Simplify));
260 m_gizmos.emplace_back(new GLGizmoBrimEars(m_parent, m_is_dark ? "toolbar_brimears_dark.svg" : "toolbar_brimears.svg", EType::BrimEars));
261 //m_gizmos.emplace_back(new GLGizmoSlaSupports(m_parent, "sla_supports.svg", sprite_id++));
262 //m_gizmos.emplace_back(new GLGizmoFaceDetector(m_parent, "face recognition.svg", sprite_id++));
263 //m_gizmos.emplace_back(new GLGizmoHollow(m_parent, "hollow.svg", sprite_id++));
264
265 m_common_gizmos_data.reset(new CommonGizmosDataPool(&m_parent));
266
267 for (auto& gizmo : m_gizmos) {
268 if (! gizmo->init()) {
269 m_gizmos.clear();
270 return false;
271 }
272 gizmo->set_common_data_pool(m_common_gizmos_data.get());
273 gizmo->on_change_color_mode(m_is_dark);
274 }
275
278 m_highlight = std::pair<EType, bool>(Undefined, false);
279
280 return true;
281}
bool m_is_dark
Definition GLGizmosManager.hpp:166
BackgroundTexture m_background_texture
Definition GLGizmosManager.hpp:138
bool init_icon_textures()
Definition GLGizmosManager.cpp:283
@ SingleThreaded
Definition GLTexture.hpp:73

References Assembly, BrimEars, Cut, Emboss, FdmSupports, Flatten, FuzzySkin, init_icon_textures(), m_background_texture, m_common_gizmos_data, m_current, m_gizmos, m_highlight, m_hover, m_is_dark, m_object_manipulation, m_parent, Measure, MeshBoolean, MmSegmentation, Move, Slic3r::resources_dir(), Rotate, Scale, Seam, Simplify, Slic3r::GUI::GLTexture::SingleThreaded, TextureDisplacement, and Undefined.

Here is the call graph for this function:

◆ init_arrow()

bool Slic3r::GUI::GLGizmosManager::init_arrow ( const std::string & filename)
404{
405 if (m_arrow_texture.get_id() != 0)
406 return true;
407
408 const std::string path = resources_dir() + "/images/";
409 return (!filename.empty()) ? m_arrow_texture.load_from_svg_file(path + filename, false, false, false, 1000) : false;
410}
GLTexture m_arrow_texture
Definition GLGizmosManager.hpp:139

References m_arrow_texture, and Slic3r::resources_dir().

Here is the call graph for this function:

◆ init_icon_textures()

bool Slic3r::GUI::GLGizmosManager::init_icon_textures ( )
284{
285 if (icon_list.size() > 0) {
286 return true;
287 }
288 ImTextureID texture_id;
289
290 icon_list.clear();
291 if (IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/toolbar_reset.svg", 16, 16, texture_id))
292 icon_list.insert(std::make_pair((int)IC_TOOLBAR_RESET, texture_id));
293 else
294 return false;
295
296 if (IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/toolbar_reset_hover.svg", 16, 16, texture_id))
297 icon_list.insert(std::make_pair((int)IC_TOOLBAR_RESET_HOVER, texture_id));
298 else
299 return false;
300
301 if (IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/toolbar_reset_zero.svg", 16, 16, texture_id))
302 icon_list.insert(std::make_pair((int) IC_TOOLBAR_RESET_ZERO, texture_id));
303 else
304 return false;
305
306 if (IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/toolbar_reset_zero_hover.svg", 16, 16, texture_id))
307 icon_list.insert(std::make_pair((int) IC_TOOLBAR_RESET_ZERO_HOVER, texture_id));
308 else
309 return false;
310
311 if (IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/toolbar_tooltip.svg", 15, 15, texture_id)) // ORCA: Use same resolution with gizmos to prevent blur on icon
312 icon_list.insert(std::make_pair((int)IC_TOOLBAR_TOOLTIP, texture_id));
313 else
314 return false;
315
316 if (IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/toolbar_wiki.svg", 15, 15, texture_id))
317 icon_list.insert(std::make_pair((int)IC_TOOLBAR_WIKI_GUIDE, texture_id));
318 else
319 return false;
320
321 if (IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/toolbar_video_guide.svg", 15, 15, texture_id))
322 icon_list.insert(std::make_pair((int)IC_TOOLBAR_VIDEO_GUIDE, texture_id));
323 else
324 return false;
325
326 if (IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/canvas_menu.svg", 72, 72, texture_id))
327 icon_list.insert(std::make_pair((int) IC_CANVAS_MENU, texture_id));
328 else
329 return false;
330
331 if (IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/canvas_menu_hover.svg", 72, 72, texture_id))
332 icon_list.insert(std::make_pair((int) IC_CANVAS_MENU_HOVER, texture_id));
333 else
334 return false;
335
336 if (IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/canvas_menu_dark.svg", 72, 72, texture_id))
337 icon_list.insert(std::make_pair((int) IC_CANVAS_MENU_DARK, texture_id));
338 else
339 return false;
340
341 if (IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/canvas_menu_dark_hover.svg", 72, 72, texture_id))
342 icon_list.insert(std::make_pair((int) IC_CANVAS_MENU_DARK_HOVER, texture_id));
343 else
344 return false;
345
346 if (IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/canvas_zoom.svg", 72, 72, texture_id))
347 icon_list.insert(std::make_pair((int) IC_CANVAS_ZOOM, texture_id));
348 else
349 return false;
350
351 if (IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/canvas_zoom_hover.svg", 72, 72, texture_id))
352 icon_list.insert(std::make_pair((int) IC_CANVAS_ZOOM_HOVER, texture_id));
353 else
354 return false;
355
356 if (IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/canvas_zoom_dark.svg", 72, 72, texture_id))
357 icon_list.insert(std::make_pair((int) IC_CANVAS_ZOOM_DARK, texture_id));
358 else
359 return false;
360
361 if (IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/canvas_zoom_dark_hover.svg", 72, 72, texture_id))
362 icon_list.insert(std::make_pair((int) IC_CANVAS_ZOOM_DARK_HOVER, texture_id));
363 else
364 return false;
365
366 for (const auto& [icon, name] : std::initializer_list<std::pair<MENU_ICON_NAME, const char*>>{
367 { IC_CANVAS_SECTION, "canvas_section" }, { IC_CANVAS_SECTION_HOVER, "canvas_section_hover" },
368 { IC_CANVAS_SECTION_DARK, "canvas_section_dark" }, { IC_CANVAS_SECTION_DARK_HOVER, "canvas_section_dark_hover" },
369 { IC_CANVAS_SECTION_ACTIVE, "canvas_section_active" }, { IC_CANVAS_SECTION_ACTIVE_HOVER, "canvas_section_active_hover" },
370 { IC_CANVAS_SECTION_ACTIVE_DARK, "canvas_section_active_dark" }, { IC_CANVAS_SECTION_ACTIVE_DARK_HOVER, "canvas_section_active_dark_hover" } }) {
371 if (!IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/" + name + ".svg", 72, 72, texture_id))
372 return false;
373 icon_list.insert(std::make_pair((int) icon, texture_id));
374 }
375
376 for (const auto& [icon, name] : std::initializer_list<std::pair<MENU_ICON_NAME, const char*>>{
377 { IC_ALIGN_X_MIN , "align_x_min" }, { IC_ALIGN_X_MIN_DARK , "align_x_min_dark" },
378 { IC_ALIGN_X_CENTER, "align_x_center" }, { IC_ALIGN_X_CENTER_DARK, "align_x_center_dark" },
379 { IC_ALIGN_X_MAX , "align_x_max" }, { IC_ALIGN_X_MAX_DARK , "align_x_max_dark" },
380 { IC_ALIGN_Y_MIN , "align_y_min" }, { IC_ALIGN_Y_MIN_DARK , "align_y_min_dark" },
381 { IC_ALIGN_Y_CENTER, "align_y_center" }, { IC_ALIGN_Y_CENTER_DARK, "align_y_center_dark" },
382 { IC_ALIGN_Y_MAX , "align_y_max" }, { IC_ALIGN_Y_MAX_DARK , "align_y_max_dark" },
383 { IC_ALIGN_Z_MIN , "align_z_min" }, { IC_ALIGN_Z_MIN_DARK , "align_z_min_dark" },
384 { IC_ALIGN_Z_CENTER, "align_z_center" }, { IC_ALIGN_Z_CENTER_DARK, "align_z_center_dark" },
385 { IC_ALIGN_Z_MAX , "align_z_max" }, { IC_ALIGN_Z_MAX_DARK , "align_z_max_dark" },
386 { IC_DISTRIBUTE_X , "distribute_x" }, { IC_DISTRIBUTE_X_DARK , "distribute_x_dark" },
387 { IC_DISTRIBUTE_Y , "distribute_y" }, { IC_DISTRIBUTE_Y_DARK , "distribute_y_dark" },
388 { IC_DISTRIBUTE_Z , "distribute_z" }, { IC_DISTRIBUTE_Z_DARK , "distribute_z_dark" }
389 }) {
390 if (!IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/" + name + ".svg", 16, 16, texture_id))
391 return false;
392 icon_list.insert(std::make_pair((int) icon, texture_id));
393 }
394
395 return true;
396}
static bool load_from_svg_file(const std::string &filename, unsigned width, unsigned height, ImTextureID &texture_id)
Definition ImGuiWrapper.cpp:3655

References IC_ALIGN_X_CENTER, IC_ALIGN_X_CENTER_DARK, IC_ALIGN_X_MAX, IC_ALIGN_X_MAX_DARK, IC_ALIGN_X_MIN, IC_ALIGN_X_MIN_DARK, IC_ALIGN_Y_CENTER, IC_ALIGN_Y_CENTER_DARK, IC_ALIGN_Y_MAX, IC_ALIGN_Y_MAX_DARK, IC_ALIGN_Y_MIN, IC_ALIGN_Y_MIN_DARK, IC_ALIGN_Z_CENTER, IC_ALIGN_Z_CENTER_DARK, IC_ALIGN_Z_MAX, IC_ALIGN_Z_MAX_DARK, IC_ALIGN_Z_MIN, IC_ALIGN_Z_MIN_DARK, IC_CANVAS_MENU, IC_CANVAS_MENU_DARK, IC_CANVAS_MENU_DARK_HOVER, IC_CANVAS_MENU_HOVER, IC_CANVAS_SECTION, IC_CANVAS_SECTION_ACTIVE, IC_CANVAS_SECTION_ACTIVE_DARK, IC_CANVAS_SECTION_ACTIVE_DARK_HOVER, IC_CANVAS_SECTION_ACTIVE_HOVER, IC_CANVAS_SECTION_DARK, IC_CANVAS_SECTION_DARK_HOVER, IC_CANVAS_SECTION_HOVER, IC_CANVAS_ZOOM, IC_CANVAS_ZOOM_DARK, IC_CANVAS_ZOOM_DARK_HOVER, IC_CANVAS_ZOOM_HOVER, IC_DISTRIBUTE_X, IC_DISTRIBUTE_X_DARK, IC_DISTRIBUTE_Y, IC_DISTRIBUTE_Y_DARK, IC_DISTRIBUTE_Z, IC_DISTRIBUTE_Z_DARK, IC_TOOLBAR_RESET, IC_TOOLBAR_RESET_HOVER, IC_TOOLBAR_RESET_ZERO, IC_TOOLBAR_RESET_ZERO_HOVER, IC_TOOLBAR_TOOLTIP, IC_TOOLBAR_VIDEO_GUIDE, IC_TOOLBAR_WIKI_GUIDE, icon_list, Slic3r::GUI::IMTexture::load_from_svg_file(), and Slic3r::resources_dir().

Referenced by init().

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

◆ is_allow_multi_select_parts_or_objects()

bool Slic3r::GUI::GLGizmosManager::is_allow_multi_select_parts_or_objects ( ) const
642{
644}

References m_current, Move, and Undefined.

◆ is_allow_select_all()

bool Slic3r::GUI::GLGizmosManager::is_allow_select_all ( )
630 {
634 return true;
635 }
636 return false;
637}

References m_current, Move, Rotate, Scale, and Undefined.

◆ is_dragging()

bool Slic3r::GUI::GLGizmosManager::is_dragging ( ) const
580{
581 if (! m_enabled || m_current == Undefined)
582 return false;
583
584 return m_gizmos[m_current]->is_dragging();
585}

References m_current, m_enabled, m_gizmos, and Undefined.

◆ is_enabled()

bool Slic3r::GUI::GLGizmosManager::is_enabled ( ) const
inline
277{ return m_enabled; }

References m_enabled.

◆ is_hiding_instances()

bool Slic3r::GUI::GLGizmosManager::is_hiding_instances ( ) const
1554{
1555 return (m_common_gizmos_data
1556 && m_common_gizmos_data->instances_hider()
1557 && m_common_gizmos_data->instances_hider()->is_valid());
1558}

References m_common_gizmos_data.

◆ is_in_editing_mode()

bool Slic3r::GUI::GLGizmosManager::is_in_editing_mode ( bool error_notification = false) const
1540{
1541 /*if (m_current == SlaSupports && dynamic_cast<GLGizmoSlaSupports*>(get_current())->is_in_editing_mode()) {
1542 return true;
1543 } else*/ if (m_current == BrimEars) {
1544 dynamic_cast<GLGizmoBrimEars *>(get_current())->update_model_object();
1545 return false;
1546 } else {
1547 return false;
1548 }
1549
1550}

References BrimEars, get_current(), and m_current.

Here is the call graph for this function:

◆ is_paint_gizmo()

bool Slic3r::GUI::GLGizmosManager::is_paint_gizmo ( )

◆ is_running()

bool Slic3r::GUI::GLGizmosManager::is_running ( ) const
539{
540 if (!m_enabled)
541 return false;
542
543 //GLGizmoBase* curr = get_current();
544 //return (curr != nullptr) ? (curr->get_state() == GLGizmoBase::On) : false;
545 return m_current != Undefined;
546}

References m_current, m_enabled, and Undefined.

Referenced by Slic3r::GUI::Plater::priv::set_current_panel().

Here is the caller graph for this function:

◆ load()

template<class Archive>
void Slic3r::GUI::GLGizmosManager::load ( Archive & ar)
inline
244 {
245 if (!m_enabled)
246 return;
247
248 m_serializing = true;
249
250 // Following is needed to know which to be turn on, but not actually modify
251 // m_current prematurely, so activate_gizmo is not confused.
252 EType old_current = m_current;
253 ar(m_current);
254 EType new_current = m_current;
255 m_current = old_current;
256
257 // activate_gizmo call sets m_current and calls set_state for the gizmo
258 // it does nothing in case the gizmo is already activated
259 // it can safely be called for Undefined gizmo
260 activate_gizmo(new_current);
261 if (m_current != Undefined)
262 m_gizmos[m_current]->load(ar);
263 }
bool activate_gizmo(EType type)
Definition GLGizmosManager.cpp:1460

References activate_gizmo(), m_current, m_enabled, m_gizmos, m_serializing, and Undefined.

Here is the call graph for this function:

◆ load_and_construct()

template<class Archive>
void Slic3r::ObjectBase::load_and_construct ( Archive & ar,
cereal::construct< ObjectBase > & construct )
inlinestaticprivateinherited
109{ ObjectID id; ar(id); construct(id); }
ObjectID id() const
Definition ObjectID.hpp:69

References id().

Here is the call graph for this function:

◆ on_change_color_mode()

void Slic3r::GUI::GLGizmosManager::on_change_color_mode ( bool is_dark)
665 {
667}
static bool is_dark()
Definition TextureImportDialog.cpp:85

References is_dark(), and m_is_dark.

Here is the call graph for this function:

◆ on_char()

bool Slic3r::GUI::GLGizmosManager::on_char ( wxKeyEvent & evt)
871{
872 // see include/wx/defs.h enum wxKeyCode
873 int keyCode = evt.GetKeyCode();
874 int ctrlMask = wxMOD_CONTROL;
875
876 bool processed = false;
877
878 if ((evt.GetModifiers() & ctrlMask) != 0) {
879 switch (keyCode)
880 {
881#ifdef __APPLE__
882 case 'a':
883 case 'A':
884#else /* __APPLE__ */
885 case WXK_CONTROL_A:
886#endif /* __APPLE__ */
887 {
889 //if ((m_current == SlaSupports || m_current == Hollow) && gizmo_event(SLAGizmoEventType::SelectAll))
890 // processed = true;
891
892 break;
893 }
894 }
895 }
896 else if (!evt.HasModifiers()) {
897 switch (keyCode)
898 {
899 // key ESC
900 case WXK_ESCAPE:
901 {
902 if (m_current != Undefined) {
904 // do nothing
905 } else
906 //if ((m_current != SlaSupports) || !gizmo_event(SLAGizmoEventType::DiscardChanges))
908
909 processed = true;
910 }
911 break;
912 }
913 //case WXK_RETURN:
914 //{
915 // if ((m_current == SlaSupports) && gizmo_event(SLAGizmoEventType::ApplyChanges))
916 // processed = true;
917
918 // break;
919 //}
920
921 //case 'r' :
922 //case 'R' :
923 //{
924 //if ((m_current == SlaSupports || m_current == Hollow || m_current == FdmSupports || m_current == Seam || m_current == MmSegmentation || m_current == FuzzySkin) && gizmo_event(SLAGizmoEventType::ResetClippingPlane))
925 // processed = true;
926
927 //break;
928 //}
929
930
931 //case 'A':
932 //case 'a':
933 //{
934 // if (m_current == SlaSupports)
935 // {
936 // gizmo_event(SLAGizmoEventType::AutomaticGeneration);
937 // // set as processed no matter what's returned by gizmo_event() to avoid the calling canvas to process 'A' as arrange
938 // processed = true;
939 // }
940 // break;
941 //}
942 //case 'M':
943 //case 'm':
944 //{
945 // if ((m_current == SlaSupports) && gizmo_event(SLAGizmoEventType::ManualEditing))
946 // processed = true;
947
948 // break;
949 //}
950 //case 'F':
951 //case 'f':
952 //{
953 /* if (m_current == Scale)
954 {
955 if (!is_dragging())
956 wxGetApp().plater()->scale_selection_to_fit_print_volume();
957
958 processed = true;
959 }*/
960
961 //break;
962 //}
963 // BBS: Skip all keys when in gizmo. This is necessary for 3D text tool.
964 default:
965 {
966 //if (is_running() && m_current == EType::Text) {
967 // processed = true;
968 //}
969 break;
970 }
971 }
972 }
973
974 if (processed)
975 m_parent.set_as_dirty();
976
977 return processed;
978}
void reset_all_states()
Definition GLGizmosManager.cpp:440
bool gizmo_event(SLAGizmoEventType action, const Vec2d &mouse_position=Vec2d::Zero(), bool shift_down=false, bool alt_down=false, bool control_down=false)
Definition GLGizmosManager.cpp:588
@ Escape
Definition GLGizmosCommon.hpp:41

References Assembly, Slic3r::GUI::Escape, gizmo_event(), m_current, m_parent, Measure, reset_all_states(), and Undefined.

Here is the call graph for this function:

◆ on_delete_key()

bool Slic3r::GUI::GLGizmosManager::on_delete_key ( )
572{
573 const bool processed = (m_current == Cut || m_current == Measure || m_current == Assembly) && gizmo_event(SLAGizmoEventType::Delete);
574 if (processed)
575 m_parent.set_as_dirty();
576 return processed;
577}
@ Delete
Definition GLGizmosCommon.hpp:34

References Assembly, Cut, Slic3r::GUI::Delete, gizmo_event(), m_current, m_parent, and Measure.

Here is the call graph for this function:

◆ on_key()

bool Slic3r::GUI::GLGizmosManager::on_key ( wxKeyEvent & evt)
981{
982 int keyCode = evt.GetKeyCode();
983 bool processed = false;
984
985 if (evt.GetEventType() == wxEVT_KEY_UP)
986 {
987 if (/*m_current == SlaSupports || m_current == Hollow ||*/ m_current == BrimEars)
988 {
989 bool is_editing = true;
990 bool is_rectangle_dragging = false;
991
992 /*if (m_current == SlaSupports) {
993 GLGizmoSlaSupports* gizmo = dynamic_cast<GLGizmoSlaSupports*>(get_current());
994 is_editing = gizmo->is_in_editing_mode();
995 is_rectangle_dragging = gizmo->is_selection_rectangle_dragging();
996 } else*/ if (m_current == BrimEars) {
997 GLGizmoBrimEars* gizmo = dynamic_cast<GLGizmoBrimEars*>(get_current());
998 is_rectangle_dragging = gizmo->is_selection_rectangle_dragging();
999 }
1000 /*else {
1001 GLGizmoHollow* gizmo = dynamic_cast<GLGizmoHollow*>(get_current());
1002 is_rectangle_dragging = gizmo->is_selection_rectangle_dragging();
1003 }*/
1004
1005 if (keyCode == WXK_SHIFT)
1006 {
1007 // shift has been just released - SLA gizmo might want to close rectangular selection.
1008 if (gizmo_event(SLAGizmoEventType::ShiftUp) || (is_editing && is_rectangle_dragging))
1009 processed = true;
1010 }
1011 else if (keyCode == WXK_ALT)
1012 {
1013 // alt has been just released - SLA gizmo might want to close rectangular selection.
1014 if (gizmo_event(SLAGizmoEventType::AltUp) || (is_editing && is_rectangle_dragging))
1015 processed = true;
1016 }
1017 else if (keyCode == WXK_CONTROL) {
1019 }
1020 }
1021 // BBS
1022 if (m_current == MmSegmentation && keyCode > '0' && keyCode <= '9') {
1023 // capture number key
1024 processed = true;
1025 }
1026 if (m_current == Measure || m_current == Assembly) {
1027 if (keyCode == WXK_CONTROL)
1028 gizmo_event(SLAGizmoEventType::CtrlUp, Vec2d::Zero(), evt.ShiftDown(), evt.AltDown(), evt.CmdDown());
1029 else if (keyCode == WXK_SHIFT)
1030 gizmo_event(SLAGizmoEventType::ShiftUp, Vec2d::Zero(), evt.ShiftDown(), evt.AltDown(), evt.CmdDown());
1031 }
1032// if (processed)
1033// m_parent.set_cursor(GLCanvas3D::Standard);
1034 }
1035 else if (evt.GetEventType() == wxEVT_KEY_DOWN)
1036 {
1037 /*if ((m_current == SlaSupports) && ((keyCode == WXK_SHIFT) || (keyCode == WXK_ALT))
1038 && dynamic_cast<GLGizmoSlaSupports*>(get_current())->is_in_editing_mode())
1039 {
1040// m_parent.set_cursor(GLCanvas3D::Cross);
1041 processed = true;
1042 }
1043 else*/ if ((m_current == BrimEars) && ((keyCode == WXK_SHIFT) || (keyCode == WXK_ALT)))
1044 {
1045 processed = true;
1046 }
1047 else if (m_current == Cut)
1048 {
1049 auto do_move = [this, &processed](double delta_z) {
1050 GLGizmoCut3D* cut = dynamic_cast<GLGizmoCut3D*>(get_current());
1051 cut->shift_cut(delta_z);
1052 processed = true;
1053 };
1054
1055 switch (keyCode)
1056 {
1057 case WXK_NUMPAD_UP: case WXK_UP: { do_move(1.0); break; }
1058 case WXK_NUMPAD_DOWN: case WXK_DOWN: { do_move(-1.0); break; }
1059 case WXK_SHIFT : case WXK_ALT: {
1060 processed = get_current()->is_in_editing_mode();
1061 }
1062 default: { break; }
1063 }
1064 }
1065 else if (m_current == Simplify && keyCode == WXK_ESCAPE) {
1066 GLGizmoSimplify *simplify = dynamic_cast<GLGizmoSimplify *>(get_current());
1067 if (simplify != nullptr)
1068 processed = simplify->on_esc_key_down();
1069 }
1070 // BBS
1071 else if (m_current == MmSegmentation) {
1072 GLGizmoMmuSegmentation* mmu_seg = dynamic_cast<GLGizmoMmuSegmentation*>(get_current());
1073 if (mmu_seg != nullptr) {
1074 if (keyCode >= WXK_NUMPAD0 && keyCode <= WXK_NUMPAD9) {
1075 keyCode = keyCode- WXK_NUMPAD0+'0';
1076 }
1077 if (keyCode >= '0' && keyCode <= '9') {
1078 // The paint palette reaches EXTRUDERS_LIMIT slots (mixed-color filaments take
1079 // ordinary slots too), so any leading digit that can start a valid two-digit
1080 // number waits briefly for a second one.
1081 const int digit = keyCode - '0';
1082 const int shortcut_max = int(GLGizmoMmuSegmentation::EXTRUDERS_LIMIT);
1083 auto can_start_two_digit = [](int d) { return d > 0 && d * 10 <= shortcut_max; };
1084 auto select = [mmu_seg](int number) { return number > 0 && mmu_seg->on_number_key_down(number); };
1085
1086 if (m_timer_set_color.IsRunning() && m_pending_color_shortcut_tens > 0) {
1087 const int two_digit = m_pending_color_shortcut_tens * 10 + digit;
1088 const int pending = m_pending_color_shortcut_tens;
1090 m_timer_set_color.Stop();
1091 if (two_digit <= shortcut_max) {
1092 processed = select(two_digit);
1093 } else {
1094 // Out of range: commit the pending digit, then treat this one as new input.
1095 processed = select(pending);
1096 if (can_start_two_digit(digit)) {
1098 m_timer_set_color.StartOnce(500);
1099 processed = true;
1100 } else {
1101 processed = select(digit) || processed;
1102 }
1103 }
1104 }
1105 else if (can_start_two_digit(digit)) {
1107 m_timer_set_color.StartOnce(500);
1108 processed = true;
1109 }
1110 else {
1111 processed = select(digit);
1112 }
1113 }
1114 }
1115 }
1116 else if (m_current == Measure || m_current == Assembly) {
1117 if (keyCode == WXK_CONTROL)
1118 gizmo_event(SLAGizmoEventType::CtrlDown, Vec2d::Zero(), evt.ShiftDown(), evt.AltDown(), evt.CmdDown());
1119 else if (keyCode == WXK_SHIFT)
1120 gizmo_event(SLAGizmoEventType::ShiftDown, Vec2d::Zero(), evt.ShiftDown(), evt.AltDown(), evt.CmdDown());
1121 }
1122
1123 if (!processed) {
1124 if (auto painter = dynamic_cast<GLGizmoPainterBase*>(get_current()); painter != nullptr) {
1125 const std::optional<Shortcut> shortcut = wxGetApp().shortcuts().lookup(ShortcutContext::Painting, KeyChord::from_event(evt));
1126 processed = shortcut.has_value() && painter->on_tool_shortcut(*shortcut);
1127 if (processed)
1128 // force extra frame to automatically update window size
1129 wxGetApp().imgui()->set_requires_extra_frame();
1130 }
1131 }
1132 }
1133
1134 if (processed)
1135 m_parent.set_as_dirty();
1136
1137 return processed;
1138}
virtual bool is_in_editing_mode() const
Definition GLGizmoBase.hpp:235
static const constexpr size_t EXTRUDERS_LIMIT
Definition GLGizmoMmuSegmentation.hpp:91
int m_pending_color_shortcut_tens
Definition GLGizmosManager.hpp:160
void simplify(Polygon &thiss, const int64_t smallest_line_segment_squared, const int64_t allowed_error_distance_squared)
Definition WallToolPaths.cpp:107
@ CtrlDown
Definition GLGizmosCommon.hpp:36
@ ShiftUp
Definition GLGizmosCommon.hpp:39
@ CtrlUp
Definition GLGizmosCommon.hpp:37
@ ShiftDown
Definition GLGizmosCommon.hpp:38
@ AltUp
Definition GLGizmosCommon.hpp:40
@ Painting
Definition Shortcuts.hpp:21
static KeyChord from_event(const wxKeyEvent &evt)
Definition KeyChord.cpp:343

References Slic3r::GUI::AltUp, Assembly, BrimEars, Slic3r::GUI::CtrlDown, Slic3r::GUI::CtrlUp, Cut, Slic3r::GUI::GLGizmoMmuSegmentation::EXTRUDERS_LIMIT, Slic3r::GUI::KeyChord::from_event(), get_current(), gizmo_event(), Slic3r::GUI::GLGizmoBase::is_in_editing_mode(), Slic3r::GUI::GLGizmoBrimEars::is_selection_rectangle_dragging(), m_current, m_parent, m_pending_color_shortcut_tens, m_timer_set_color, Measure, MmSegmentation, Slic3r::GUI::GLGizmoMmuSegmentation::on_number_key_down(), Slic3r::GUI::Painting, Slic3r::GUI::GLGizmoCut3D::shift_cut(), Slic3r::GUI::ShiftDown, Slic3r::GUI::ShiftUp, and Simplify.

Here is the call graph for this function:

◆ on_mouse()

bool Slic3r::GUI::GLGizmosManager::on_mouse ( const wxMouseEvent & mouse_event)
849{
850 if (!m_enabled) return false;
851
852 // tool bar wants to use event?
853 if (gizmos_toolbar_on_mouse(mouse_event)) return true;
854
855 // current gizmo wants to use event?
856 if (m_current != Undefined &&
857 // check if gizmo override method could be slower than simple call virtual function
858 // &m_gizmos[m_current]->on_mouse != &GLGizmoBase::on_mouse &&
859 m_gizmos[m_current]->on_mouse(mouse_event))
860 return true;
861
862 if (mouse_event.RightUp() && m_current != EType::Undefined && !m_parent.is_mouse_dragging()) {
863 // Prevent default right context menu in gizmos
864 return true;
865 }
866
867 return false;
868}
bool on_mouse(const wxMouseEvent &mouse_event)
Definition GLGizmosManager.cpp:848
bool gizmos_toolbar_on_mouse(const wxMouseEvent &mouse_event)
Process mouse event on gizmo toolbar.
Definition GLGizmosManager.cpp:751

References gizmos_toolbar_on_mouse(), m_current, m_enabled, m_gizmos, m_parent, on_mouse(), Undefined, 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_wheel()

bool Slic3r::GUI::GLGizmosManager::on_mouse_wheel ( const wxMouseEvent & evt)
732{
733 bool processed = false;
734
735 if (/*m_current == SlaSupports || m_current == Hollow ||*/ m_current == FdmSupports || m_current == Seam || m_current == MmSegmentation || m_current == FuzzySkin || m_current == BrimEars) {
736 float rot = (float)evt.GetWheelRotation() / (float)evt.GetWheelDelta();
737 if (gizmo_event((rot > 0.f ? SLAGizmoEventType::MouseWheelUp : SLAGizmoEventType::MouseWheelDown), Vec2d::Zero(), evt.ShiftDown(), evt.AltDown()
738 // BBS
739#ifdef __WXOSX_MAC__
740 , evt.RawControlDown()
741#else
742 , evt.ControlDown()
743#endif
744 ))
745 processed = true;
746 }
747
748 return processed;
749}
@ MouseWheelUp
Definition GLGizmosCommon.hpp:46
@ MouseWheelDown
Definition GLGizmosCommon.hpp:47

References BrimEars, FdmSupports, FuzzySkin, gizmo_event(), m_current, MmSegmentation, Slic3r::GUI::MouseWheelDown, Slic3r::GUI::MouseWheelUp, Seam, and Slic3r::GUI::wxMouseEvent.

Here is the call graph for this function:

◆ on_set_color_timer()

void Slic3r::GUI::GLGizmosManager::on_set_color_timer ( wxTimerEvent & evt)
private
1141{
1142 // No second digit arrived in time: commit the pending leading digit on its own.
1144 GLGizmoMmuSegmentation* mmu_seg = dynamic_cast<GLGizmoMmuSegmentation*>(get_current());
1145 if (mmu_seg != nullptr) {
1146 mmu_seg->on_number_key_down(m_pending_color_shortcut_tens);
1147 m_parent.set_as_dirty();
1148 }
1149 }
1151}

References get_current(), m_current, m_parent, m_pending_color_shortcut_tens, MmSegmentation, and Slic3r::GUI::GLGizmoMmuSegmentation::on_number_key_down().

Referenced by GLGizmosManager().

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

◆ open_gizmo()

bool Slic3r::GUI::GLGizmosManager::open_gizmo ( EType type)
459{
460 if (m_gizmos.empty())
461 return false;
462
463 int idx = static_cast<int>(type);
464
465 // re-open same type cause closing
466 if (m_current == type) type = Undefined;
467
468 if (m_gizmos[idx]->is_activable() && activate_gizmo(type)) {
469 // remove update data into gizmo itself
470 update_data();
471#ifdef __WXOSX__
472 m_parent.post_event(SimpleEvent(wxEVT_PAINT));
473#endif
474 return true;
475 }
476 return false;
477}
void update_data()
Distribute information about different data into active gizmo Should be called when selection changed...
Definition GLGizmosManager.cpp:515

References activate_gizmo(), m_current, m_gizmos, m_parent, Undefined, and update_data().

Referenced by Slic3r::GUI::MenuFactory::append_menu_item_edit_svg(), Slic3r::GUI::MenuFactory::append_menu_item_edit_text(), Slic3r::GUI::GLGizmoSimplify::close(), anonymous_namespace{EmbossJob.cpp}::create_volume(), anonymous_namespace{EmbossJob.cpp}::CreateObjectJob::finalize(), gizmos_toolbar_on_mouse(), Slic3r::GUI::ObjectList::list_manipulation(), Slic3r::GUI::ObjectList::OnEditingStarted(), open_gizmo_by_shortcut(), Slic3r::GUI::ObjectList::part_selection_changed(), reset_all_states(), and Slic3r::GUI::ObjectList::simplify().

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

◆ open_gizmo_by_shortcut()

bool Slic3r::GUI::GLGizmosManager::open_gizmo_by_shortcut ( Shortcut shortcut)
549{
550 if (!m_enabled || m_gizmos.empty())
551 return false;
552
553 // The text tool opens without a selection because it creates its own object.
554 if (GLGizmoBase* gizmo_emboss = m_gizmos[Emboss].get(); gizmo_emboss->shortcut() == shortcut) {
555 dynamic_cast<GLGizmoEmboss *>(gizmo_emboss)->on_shortcut_key();
556 return true;
557 }
558
559 if (m_parent.get_selection().is_empty())
560 return false;
561
562 auto it = std::find_if(m_gizmos.begin(), m_gizmos.end(), [shortcut](const std::unique_ptr<GLGizmoBase> &gizmo) {
563 return gizmo->is_activable() && gizmo->shortcut() == shortcut;
564 });
565 if (it == m_gizmos.end())
566 return false;
567
568 return open_gizmo(EType(it - m_gizmos.begin()));
569}
id get(id object, const void *key)
Definition MacIME.mm:22

References Emboss, m_enabled, m_gizmos, m_parent, and open_gizmo().

Here is the call graph for this function:

◆ refresh_on_off_state()

void Slic3r::GUI::GLGizmosManager::refresh_on_off_state ( )
431{
432 if (m_serializing || m_current == Undefined || m_gizmos.empty())
433 return;
434
435 // FS: Why update data after Undefined gizmo activation?
436 if (!m_gizmos[m_current]->is_activable() && activate_gizmo(Undefined))
437 update_data();
438}

References activate_gizmo(), m_current, m_gizmos, m_serializing, Undefined, and update_data().

Here is the call graph for this function:

◆ render_arrow()

void Slic3r::GUI::GLGizmosManager::render_arrow ( const GLCanvas3D & parent,
EType highlighted_type ) const
1226{
1227 const std::vector<size_t> selectable_idxs = get_selectable_idxs();
1228 if (selectable_idxs.empty())
1229 return;
1230 float cnv_w = (float)m_parent.get_canvas_size().get_width();
1231 float inv_zoom = (float)wxGetApp().plater()->get_camera().get_inv_zoom();
1233 float zoomed_border = m_layout.scaled_border() * inv_zoom;
1234 float zoomed_top_x = (-0.5f * cnv_w) * inv_zoom;
1235 float zoomed_top_y = (0.5f * height) * inv_zoom;
1236 zoomed_top_x += zoomed_border;
1237 zoomed_top_y -= zoomed_border;
1238 float icons_size = m_layout.scaled_icons_size();
1239 float zoomed_icons_size = icons_size * inv_zoom;
1240 float zoomed_stride_y = m_layout.scaled_stride_y() * inv_zoom;
1241 for (size_t idx : selectable_idxs)
1242 {
1243 if (idx == highlighted_type) {
1244 int tex_width = m_icons_texture.get_width();
1245 int tex_height = m_icons_texture.get_height();
1246 unsigned int tex_id = m_arrow_texture.get_id();
1247 float inv_tex_width = (tex_width != 0.0f) ? 1.0f / tex_width : 0.0f;
1248 float inv_tex_height = (tex_height != 0.0f) ? 1.0f / tex_height : 0.0f;
1249
1250 const float left_uv = 0.0f;
1251 const float right_uv = 1.0f;
1252 const float top_uv = 1.0f;
1253 const float bottom_uv = 0.0f;
1254
1255 float arrow_sides_ratio = (float)m_arrow_texture.get_height() / (float)m_arrow_texture.get_width();
1256
1257 GLTexture::render_sub_texture(tex_id, zoomed_top_x + zoomed_icons_size * 1.2f, zoomed_top_x + zoomed_icons_size * 1.2f + zoomed_icons_size * 2.2f * arrow_sides_ratio, zoomed_top_y - zoomed_icons_size * 1.6f , zoomed_top_y + zoomed_icons_size * 0.6f, { { left_uv, bottom_uv }, { left_uv, top_uv }, { right_uv, top_uv }, { right_uv, bottom_uv } });
1258 break;
1259 }
1260 zoomed_top_y -= zoomed_stride_y;
1261 }
1262}

References get_scaled_total_height(), get_selectable_idxs(), m_arrow_texture, m_icons_texture, m_layout, m_parent, and Slic3r::GUI::GLTexture::render_sub_texture().

Here is the call graph for this function:

◆ render_background()

void Slic3r::GUI::GLGizmosManager::render_background ( float left,
float top,
float right,
float bottom,
float border_w,
float border_h ) const
private
1163{
1164 const unsigned int tex_id = m_background_texture.texture.get_id();
1165 const float tex_width = float(m_background_texture.texture.get_width());
1166 const float tex_height = float(m_background_texture.texture.get_height());
1167 if (tex_id != 0 && tex_width > 0 && tex_height > 0) {
1168 //BBS: GUI refactor: remove the corners of gizmo
1169 const float inv_tex_width = 1.0f / tex_width;
1170 const float inv_tex_height = 1.0f / tex_height;
1171
1172 const float internal_left_uv = float(m_background_texture.metadata.left) * inv_tex_width;
1173 const float internal_right_uv = 1.0f - float(m_background_texture.metadata.right) * inv_tex_width;
1174 const float internal_top_uv = 1.0f - float(m_background_texture.metadata.top) * inv_tex_height;
1175 const float internal_bottom_uv = float(m_background_texture.metadata.bottom) * inv_tex_height;
1176
1177 GLTexture::render_sub_texture(tex_id, left, right, bottom, top, { { internal_left_uv, internal_bottom_uv }, { internal_right_uv, internal_bottom_uv }, { internal_right_uv, internal_top_uv }, { internal_left_uv, internal_top_uv } });
1178
1179 /*
1180 const float internal_left = left + border_w;
1181 const float internal_right = right - border_w;
1182 const float internal_top = top - border_h;
1183 const float internal_bottom = bottom + border_h;
1184
1185 // float left_uv = 0.0f;
1186 const float right_uv = 1.0f;
1187 const float top_uv = 1.0f;
1188 const float bottom_uv = 0.0f;
1189
1190 const float internal_left_uv = float(m_background_texture.metadata.left) * inv_tex_width;
1191 const float internal_right_uv = 1.0f - float(m_background_texture.metadata.right) * inv_tex_width;
1192 const float internal_top_uv = 1.0f - float(m_background_texture.metadata.top) * inv_tex_height;
1193 const float internal_bottom_uv = float(m_background_texture.metadata.bottom) * inv_tex_height;
1194
1195 // top-left corner
1196 GLTexture::render_sub_texture(tex_id, left, internal_left, internal_top, top, { { internal_left_uv, internal_bottom_uv }, { internal_right_uv, internal_bottom_uv }, { internal_right_uv, internal_top_uv }, { internal_left_uv, internal_top_uv } });
1197
1198 // top edge
1199 GLTexture::render_sub_texture(tex_id, internal_left, internal_right, internal_top, top, { { internal_left_uv, internal_top_uv }, { internal_right_uv, internal_top_uv }, { internal_right_uv, top_uv }, { internal_left_uv, top_uv } });
1200
1201 // top-right corner
1202 GLTexture::render_sub_texture(tex_id, internal_right, right, internal_top, top, { { internal_right_uv, internal_top_uv }, { right_uv, internal_top_uv }, { right_uv, top_uv }, { internal_right_uv, top_uv } });
1203
1204 // center-left edge
1205 GLTexture::render_sub_texture(tex_id, left, internal_left, internal_bottom, internal_top, { { internal_left_uv, internal_bottom_uv }, { internal_right_uv, internal_bottom_uv }, { internal_right_uv, internal_top_uv }, { internal_left_uv, internal_top_uv } });
1206
1207 // center
1208 GLTexture::render_sub_texture(tex_id, internal_left, internal_right, internal_bottom, internal_top, { { internal_left_uv, internal_bottom_uv }, { internal_right_uv, internal_bottom_uv }, { internal_right_uv, internal_top_uv }, { internal_left_uv, internal_top_uv } });
1209
1210 // center-right edge
1211 GLTexture::render_sub_texture(tex_id, internal_right, right, internal_bottom, internal_top, { { internal_right_uv, internal_bottom_uv }, { right_uv, internal_bottom_uv }, { right_uv, internal_top_uv }, { internal_right_uv, internal_top_uv } });
1212
1213 // bottom-left corner
1214 GLTexture::render_sub_texture(tex_id, left, internal_left, bottom, internal_bottom, { { internal_left_uv, internal_bottom_uv }, { internal_right_uv, internal_bottom_uv }, { internal_right_uv, internal_top_uv }, { internal_left_uv, internal_top_uv } });
1215
1216 // bottom edge
1217 GLTexture::render_sub_texture(tex_id, internal_left, internal_right, bottom, internal_bottom, { { internal_left_uv, bottom_uv }, { internal_right_uv, bottom_uv }, { internal_right_uv, internal_bottom_uv }, { internal_left_uv, internal_bottom_uv } });
1218
1219 // bottom-right corner
1220 GLTexture::render_sub_texture(tex_id, internal_right, right, bottom, internal_bottom, { { internal_right_uv, bottom_uv }, { right_uv, bottom_uv }, { right_uv, internal_bottom_uv }, { internal_right_uv, internal_bottom_uv } });
1221 */
1222 }
1223}

References m_background_texture, and Slic3r::GUI::GLTexture::render_sub_texture().

Referenced by do_render_overlay().

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

◆ render_current_gizmo()

void Slic3r::GUI::GLGizmosManager::render_current_gizmo ( ) const
670{
671 if (!m_enabled || m_current == Undefined)
672 return;
673
674 m_gizmos[m_current]->render();
675}

References m_current, m_enabled, m_gizmos, and Undefined.

◆ render_overlay()

void Slic3r::GUI::GLGizmosManager::render_overlay ( )
692{
693 if (!m_enabled)
694 return;
695
698
699 do_render_overlay(true);
700}
bool generate_icons_texture()
Definition GLGizmosManager.cpp:1411
void do_render_overlay(bool draw_icons) const
Definition GLGizmosManager.cpp:1268

References do_render_overlay(), generate_icons_texture(), m_enabled, and m_icons_texture_dirty.

Here is the call graph for this function:

◆ render_overlay_input_window()

void Slic3r::GUI::GLGizmosManager::render_overlay_input_window ( )
704{
705 if (!m_enabled)
706 return;
707
708 do_render_overlay(false);
709}

References do_render_overlay(), and m_enabled.

Here is the call graph for this function:

◆ render_painter_gizmo()

void Slic3r::GUI::GLGizmosManager::render_painter_gizmo ( )
678{
679 // This function shall only be called when current gizmo is
680 // derived from GLGizmoPainterBase.
681
682 if (!m_enabled || m_current == Undefined)
683 return;
684
685 auto *gizmo = dynamic_cast<GLGizmoPainterBase*>(get_current());
686 assert(gizmo); // check the precondition
687 gizmo->render_painter_gizmo();
688}

References get_current(), m_current, m_enabled, and Undefined.

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

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

◆ reset_all_states()

void Slic3r::GUI::GLGizmosManager::reset_all_states ( )
441{
442 // The restore/new-project event can run before deferred OpenGL resource
443 // loading has populated the gizmo list. There is nothing to reset until
444 // initialization completes.
445 if (! m_enabled || m_serializing || m_gizmos.empty())
446 return;
447
448 const EType current = get_current_type();
449 if (current != Undefined)
450 // close any open gizmo
451 open_gizmo(current);
452
454 // Orca: do not clear hover state, as Emboss gizmo can be used without selection
455 //m_hover = Undefined;
456}

References activate_gizmo(), get_current_type(), m_enabled, m_gizmos, m_serializing, open_gizmo(), and Undefined.

Referenced by Slic3r::GUI::ObjectList::del_info_item(), Slic3r::GUI::ObjectList::list_manipulation(), on_char(), Slic3r::GUI::ObjectList::OnEditingStarted(), and Slic3r::GUI::Plater::priv::set_current_panel().

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

◆ save()

template<class Archive>
void Slic3r::GUI::GLGizmosManager::save ( Archive & ar) const
inline
267 {
268 if (!m_enabled)
269 return;
270
271 ar(m_current);
272
273 if (m_current != Undefined && !m_gizmos.empty())
274 m_gizmos[m_current]->save(ar);
275 }

References m_current, m_enabled, m_gizmos, and Undefined.

◆ serialize()

template<class Archive>
void Slic3r::ObjectBase::serialize ( Archive & ar)
inlineprivateinherited
108{ ar(m_id); }

References m_id.

◆ set_enabled()

void Slic3r::GUI::GLGizmosManager::set_enabled ( bool enable)
inline
278{ m_enabled = enable; }

References m_enabled.

◆ set_highlight()

void Slic3r::GUI::GLGizmosManager::set_highlight ( EType gizmo,
bool highlight_shown )
inline
359{ m_highlight = std::pair<EType, bool>(gizmo, highlight_shown); }

References m_highlight.

◆ set_hover_id()

void Slic3r::GUI::GLGizmosManager::set_hover_id ( int id)
493{
494 // Measure and assembly handles hover by itself
495 if (m_current == EType::Measure || m_current == EType::Assembly) { return; }
496 if (!m_enabled || m_current == Undefined)
497 return;
498
499 m_gizmos[m_current]->set_hover_id(id);
500}

References Assembly, m_current, m_enabled, m_gizmos, Measure, and Undefined.

◆ set_icon_dirty()

void Slic3r::GUI::GLGizmosManager::set_icon_dirty ( )
inline
280{ m_icons_texture_dirty = true; }

References m_icons_texture_dirty.

◆ set_invalid_id()

void Slic3r::ObjectBase::set_invalid_id ( )
inlineprotectedinherited
90{ m_id = 0; }

References m_id.

Referenced by Slic3r::CutObjectBase::invalidate().

Here is the caller graph for this function:

◆ set_new_unique_id()

void Slic3r::ObjectBase::set_new_unique_id ( )
inlineprotectedinherited
89{ m_id = generate_new_id(); }
static ObjectID generate_new_id()
Definition ObjectID.hpp:100

References generate_new_id(), and m_id.

Referenced by Slic3r::ModelVolume::ModelVolume(), Slic3r::Model::assign_new_unique_ids_recursive(), Slic3r::ModelVolume::assign_new_unique_ids_recursive(), assign_new_unique_ids_recursive(), Slic3r::CutObjectBase::init(), Slic3r::ModelMaterial::set_new_unique_id(), Slic3r::ModelObject::set_new_unique_id(), and Slic3r::ModelVolume::set_new_unique_id().

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

◆ set_overlay_icon_size()

void Slic3r::GUI::GLGizmosManager::set_overlay_icon_size ( float size)
413{
414 if (m_layout.icons_size != size)
415 {
416 m_layout.icons_size = size;
418 }
419}

References m_icons_texture_dirty, and m_layout.

◆ set_overlay_scale()

void Slic3r::GUI::GLGizmosManager::set_overlay_scale ( float scale)
422{
423 if (m_layout.scale != scale)
424 {
425 m_layout.scale = scale;
427 }
428}
int scale(const int val)
Definition WipeTowerDialog.cpp:58

References m_icons_texture_dirty, m_layout, and scale().

Here is the call graph for this function:

◆ switch_gizmos_icon_filename()

void Slic3r::GUI::GLGizmosManager::switch_gizmos_icon_filename ( )
154{
155 m_background_texture.metadata.filename = m_is_dark ? "toolbar_background_dark.png" : "toolbar_background.png";
156 m_background_texture.metadata.left = 16;
157 m_background_texture.metadata.top = 16;
158 m_background_texture.metadata.right = 16;
159 m_background_texture.metadata.bottom = 16;
160 if (!m_background_texture.metadata.filename.empty())
161 m_background_texture.texture.load_from_file(resources_dir() + "/images/" + m_background_texture.metadata.filename, false, GLTexture::SingleThreaded, false);
162
163 for (auto& gizmo : m_gizmos) {
164 gizmo->on_change_color_mode(m_is_dark);
165 switch (gizmo->get_sprite_id())
166 {
167 case(EType::Move):
168 gizmo->set_icon_filename(m_is_dark ? "toolbar_move_dark.svg" : "toolbar_move.svg");
169 break;
170 case(EType::Rotate):
171 gizmo->set_icon_filename(m_is_dark ? "toolbar_rotate_dark.svg" : "toolbar_rotate.svg");
172 break;
173 case(EType::Scale):
174 gizmo->set_icon_filename(m_is_dark ? "toolbar_scale_dark.svg" : "toolbar_scale.svg");
175 break;
176 case(EType::Flatten):
177 gizmo->set_icon_filename(m_is_dark ? "toolbar_flatten_dark.svg" : "toolbar_flatten.svg");
178 break;
179 case(EType::Cut):
180 gizmo->set_icon_filename(m_is_dark ? "toolbar_cut_dark.svg" : "toolbar_cut.svg");
181 break;
182 case(EType::FdmSupports):
183 gizmo->set_icon_filename(m_is_dark ? "toolbar_support_dark.svg" : "toolbar_support.svg");
184 break;
185 case(EType::Seam):
186 gizmo->set_icon_filename(m_is_dark ? "toolbar_seam_dark.svg" : "toolbar_seam.svg");
187 break;
188 case(EType::Emboss):
189 gizmo->set_icon_filename(m_is_dark ? "toolbar_text_dark.svg" : "toolbar_text.svg");
190 break;
192 gizmo->set_icon_filename(m_is_dark ? "mmu_segmentation_dark.svg" : "mmu_segmentation.svg");
193 break;
194 case(EType::FuzzySkin):
195 gizmo->set_icon_filename(m_is_dark ? "toolbar_fuzzy_skin_paint_dark.svg" : "toolbar_fuzzy_skin_paint.svg");
196 break;
198 // One shared icon in both themes (no dedicated dark variant yet) - but it must still be
199 // *this* gizmo's icon. Handing it the fuzzy-skin one here quietly replaced the icon set at
200 // construction, so the toolbar ended up showing two identical fuzzy-skin buttons after any
201 // light/dark switch.
202 gizmo->set_icon_filename("toolbar_texture_displacement.svg");
203 break;
204 case(EType::MeshBoolean):
205 gizmo->set_icon_filename(m_is_dark ? "toolbar_meshboolean_dark.svg" : "toolbar_meshboolean.svg");
206 break;
207 case (EType::Measure):
208 gizmo->set_icon_filename(m_is_dark ? "toolbar_measure_dark.svg" : "toolbar_measure.svg");
209 break;
210 case (EType::Assembly):
211 gizmo->set_icon_filename(m_is_dark ? "toolbar_assembly_dark.svg" : "toolbar_assembly.svg");
212 break;
213 case (EType::BrimEars):
214 gizmo->set_icon_filename(m_is_dark ? "toolbar_brimears_dark.svg" : "toolbar_brimears.svg");
215 break;
216 }
217
218 }
219}

References Assembly, BrimEars, Cut, Emboss, FdmSupports, Flatten, FuzzySkin, m_background_texture, m_gizmos, m_is_dark, Measure, MeshBoolean, MmSegmentation, Move, Slic3r::resources_dir(), Rotate, Scale, Seam, Slic3r::GUI::GLTexture::SingleThreaded, and TextureDisplacement.

Here is the call graph for this function:

◆ timestamp()

virtual Timestamp Slic3r::ObjectBase::timestamp ( ) const
inlinevirtualinherited

Reimplemented in Slic3r::ModelConfigObject, and Slic3r::ObjectWithTimestamp.

74{ return 0; }

◆ update_after_undo_redo()

void Slic3r::GUI::GLGizmosManager::update_after_undo_redo ( const UndoRedo::Snapshot & snapshot)
1154{
1155 update_data();
1156 m_serializing = false;
1157 // if (m_current == SlaSupports
1158 // && snapshot.snapshot_data.flags & UndoRedo::SnapshotData::RECALCULATE_SLA_SUPPORTS)
1159 // dynamic_cast<GLGizmoSlaSupports*>(m_gizmos[SlaSupports].get())->reslice_SLA_supports(true);
1160}

References m_serializing, and update_data().

Referenced by Slic3r::GUI::Plater::priv::update_after_undo_redo().

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

◆ update_data()

void Slic3r::GUI::GLGizmosManager::update_data ( )

Distribute information about different data into active gizmo Should be called when selection changed.

516{
517 if (!m_enabled) return;
518
519 const Selection& selection = m_parent.get_selection();
520
523 ? get_current()->get_requirements()
524 : CommonGizmosDataID(0));
526 if (m_current != Undefined) m_gizmos[m_current]->data_changed(m_serializing);
527
528 // Orca: hack: Fix issue that flatten gizmo faces not updated after reload from disk
529 if (m_current != Flatten && !m_gizmos.empty()) m_gizmos[Flatten]->data_changed(m_serializing);
530
531 //BBS: GUI refactor: add object manipulation in gizmo
532 if (!selection.is_empty()) {
533 m_object_manipulation.update_ui_from_settings();
534 m_object_manipulation.UpdateAndShow(true);
535 }
536}
void update_section_view()
Definition GLGizmosManager.cpp:502
@ Selection
Definition Shortcuts.hpp:72
CommonGizmosDataID
Definition GLGizmosCommon.hpp:72

References Flatten, get_current(), Slic3r::GUI::Selection::is_empty(), m_common_gizmos_data, m_current, m_enabled, m_gizmos, m_object_manipulation, m_parent, m_serializing, Undefined, and update_section_view().

Referenced by open_gizmo(), refresh_on_off_state(), Slic3r::GUI::GizmoObjectManipulation::set_coordinates_type(), Slic3r::GUI::Plater::priv::set_current_panel(), and update_after_undo_redo().

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

◆ update_hover_state()

void Slic3r::GUI::GLGizmosManager::update_hover_state ( const EType & type)
private
1447{
1448 assert(m_enabled);
1449 if (type == Undefined) {
1451 m_tooltip.clear();
1452 return;
1453 }
1454
1455 const GLGizmoBase &hovered_gizmo = *m_gizmos[type];
1456 m_hover = hovered_gizmo.is_activable() ? type : Undefined;
1457 m_tooltip = hovered_gizmo.get_name();
1458}

References Slic3r::GUI::GLGizmoBase::get_name(), Slic3r::GUI::GLGizmoBase::is_activable(), m_enabled, m_gizmos, m_hover, m_tooltip, and Undefined.

Referenced by gizmos_toolbar_on_mouse().

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

◆ update_section_view()

void Slic3r::GUI::GLGizmosManager::update_section_view ( )
503{
505 return;
506
507 CommonGizmosDataObjects::ObjectClipper* clipper = m_common_gizmos_data ? m_common_gizmos_data->object_clipper() : nullptr;
508 if (clipper == nullptr)
509 return;
510
511 // Brim ears always cut horizontally.
512 clipper->set_position_by_ratio(m_parent.get_section_view_ratio(), m_current == BrimEars ? Vec3d::UnitZ() : m_parent.get_section_view_normal());
513}

References BrimEars, FdmSupports, FuzzySkin, m_common_gizmos_data, m_current, m_parent, MmSegmentation, Seam, and Slic3r::GUI::CommonGizmosDataObjects::ObjectClipper::set_position_by_ratio().

Referenced by update_data().

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

◆ wants_reslice_supports_on_undo()

bool Slic3r::GUI::GLGizmosManager::wants_reslice_supports_on_undo ( ) const
659{
660 return false;
661 // return (m_current == SlaSupports
662 // && dynamic_cast<const GLGizmoSlaSupports*>(m_gizmos.at(SlaSupports).get())->has_backend_supports());
663}

Referenced by Slic3r::GUI::Plater::priv::undo_redo_to().

Here is the caller graph for this function:

Member Data Documentation

◆ Default_Icons_Size

const float Slic3r::GUI::GLGizmosManager::Default_Icons_Size = 64
static

◆ icon_list

std::map< int, void * > Slic3r::GUI::GLGizmosManager::icon_list = {}
staticprivate

◆ m_arrow_texture

GLTexture Slic3r::GUI::GLGizmosManager::m_arrow_texture
private

Referenced by init_arrow(), and render_arrow().

◆ m_background_texture

BackgroundTexture Slic3r::GUI::GLGizmosManager::m_background_texture
private

◆ m_common_gizmos_data

std::unique_ptr<CommonGizmosDataPool> Slic3r::GUI::GLGizmosManager::m_common_gizmos_data
private

◆ m_current

◆ m_enabled

◆ m_gizmos

◆ m_highlight

std::pair<EType, bool> Slic3r::GUI::GLGizmosManager::m_highlight
private

◆ m_hover

EType Slic3r::GUI::GLGizmosManager::m_hover
private

◆ m_icons_texture

GLTexture Slic3r::GUI::GLGizmosManager::m_icons_texture
private

◆ m_icons_texture_dirty

bool Slic3r::GUI::GLGizmosManager::m_icons_texture_dirty
private

◆ m_id

ObjectID Slic3r::ObjectBase::m_id
privateinherited

◆ m_is_dark

bool Slic3r::GUI::GLGizmosManager::m_is_dark = false
private

◆ m_layout

◆ m_object_manipulation

GizmoObjectManipulation Slic3r::GUI::GLGizmosManager::m_object_manipulation
private

◆ m_parent

◆ m_pending_color_shortcut_tens

int Slic3r::GUI::GLGizmosManager::m_pending_color_shortcut_tens = 0
private

Referenced by on_key(), and on_set_color_timer().

◆ m_restore_realistic_view_after_paint

bool Slic3r::GUI::GLGizmosManager::m_restore_realistic_view_after_paint = false
private

Referenced by activate_gizmo().

◆ m_serializing

bool Slic3r::GUI::GLGizmosManager::m_serializing
private

◆ m_timer_set_color

wxTimer Slic3r::GUI::GLGizmosManager::m_timer_set_color
private

Referenced by GLGizmosManager(), and on_key().

◆ m_tooltip

std::string Slic3r::GUI::GLGizmosManager::m_tooltip
private

◆ s_last_id

size_t Slic3r::ObjectBase::s_last_id = 0
staticprivateinherited

Referenced by generate_new_id().


The documentation for this class was generated from the following files: