Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
Slic3r::GUI Namespace Reference

Namespaces

namespace  anonymous_namespace{Downloader.cpp}
 
namespace  anonymous_namespace{DownloaderFileGet.cpp}
 
namespace  anonymous_namespace{HintNotification.cpp}
 
namespace  anonymous_namespace{NotificationManager.cpp}
 
namespace  CommonGizmosDataObjects
 
namespace  Config
 
namespace  DownloaderUtils
 
namespace  Emboss
 
namespace  GUI_Descriptions
 
namespace  I18N
 
namespace  MessageHandlerInternal
 
namespace  search_for_drives_internal
 

Classes

class  AboutDialog
 
class  AboutDialogLogo
 
class  AppUpdateAvailableDialog
 
class  AppUpdateDownloadDialog
 
class  ArchiveViewCtrl
 
class  ArchiveViewModel
 
class  ArchiveViewNode
 
class  ArrangeJob
 
struct  ArrayEvent
 
struct  BackgroundTexture
 
class  Bed3D
 
class  Bed_2D
 
struct  BedShape
 
class  BedShapeDialog
 
class  BedShapePanel
 
class  BitmapCache
 
class  BitmapComboBox
 
struct  BlockingWait
 
class  BoostThreadWorker
 
struct  Bundle
 
struct  BundleMap
 
class  Busy
 
class  BusyCursored
 
struct  Camera
 
class  CameraUtils
 Help divide camera data and camera functions This utility work with camera data by static funtions. More...
 
class  CancellableJob
 
class  CheckBox
 
class  CheckboxFileDialog
 
class  Choice
 
class  ClippingPlane
 
class  ColourPicker
 
class  CommonGizmosDataBase
 
class  CommonGizmosDataPool
 
class  ConfigGUITypeError
 
class  ConfigManipulation
 
class  ConfigOptionsGroup
 
class  ConfigSnapshotDialog
 
class  ConfigWizard
 
class  ConfigWizardIndex
 
struct  ConfigWizardPage
 
class  CoordAxes
 
class  CopyrightsDialog
 
class  CreateFontImageJob
 Create image for face name. More...
 
struct  CursorSetterRAII
 
struct  DataList
 
class  DiamTextCtrl
 
class  DiffModel
 
class  DiffPresetDialog
 
class  DiffViewCtrl
 
class  Download
 
class  Downloader
 
class  DPIAware
 
struct  DpiChangedEvent
 
struct  DriveData
 
class  EmbossStylesSerializable
 For store/load font list to/from AppConfig. More...
 
class  ErrorDialog
 
struct  Event
 
class  EventGuard
 
class  ExtruderSequenceDialog
 
class  Field
 
class  FileArchiveDialog
 
class  FileGet
 
struct  FileWildcards
 
class  FillBedJob
 
struct  FontImageData
 Keep data for rasterization of text by font face. More...
 
class  FreqChangedParams
 
class  FullCompareDialog
 
class  GalleryDialog
 
class  GalleryDropTarget
 
class  GCodeViewer
 
class  GizmoHighlighterTimerEvent
 
class  GLCanvas3D
 
class  GLGizmoBase
 
class  GLGizmoCut3D
 
class  GLGizmoEmboss
 
class  GLGizmoFdmSupports
 
class  GLGizmoFlatten
 
class  GLGizmoHollow
 
class  GLGizmoMeasure
 
class  GLGizmoMmuSegmentation
 
class  GLGizmoMove3D
 
class  GLGizmoPainterBase
 
class  GLGizmoRotate
 
class  GLGizmoRotate3D
 
class  GLGizmoScale3D
 
class  GLGizmoSeam
 
class  GLGizmoSimplify
 
class  GLGizmoSlaBase
 
class  GLGizmoSlaSupports
 
class  GLGizmosManager
 
class  GLMmSegmentationGizmo3DScene
 
class  GLModel
 
class  GLSelectionRectangle
 
class  GLTexture
 
class  GLToolbar
 
class  GLToolbarItem
 
class  GUI_App
 
struct  GUI_InitParams
 
class  Highlighter
 
class  HighlighterForWx
 
struct  HintData
 
class  HintDatabase
 
class  IconManager
 Keep texture with icons for UI Manage texture live -> create and destruct texture by live of icon shared pointers. More...
 
class  ImGuiWrapper
 
class  InfoDialog
 
struct  InfoItemAtributes
 
struct  ItemForDelete
 
class  Job
 
class  KBShortcutsDialog
 
class  KeyAutoRepeatFilter
 
class  LayerRangeEditor
 
class  Line
 Represents option lines. More...
 
class  LoadProjectsDialog
 
class  MainFrame
 
class  ManipulationEditor
 
struct  Materials
 
class  MenuFactory
 
class  MeshClipper
 
struct  MeshErrorsInfo
 
class  MeshRaycaster
 
class  MessageDialog
 
class  ModelNode
 
class  ModePaletteComboBox
 
class  Mouse3DController
 
class  MsgDataIncompatible
 
class  MsgDataLegacy
 
struct  MsgDialog
 
class  MsgNoAppUpdates
 
class  MsgNoUpdates
 
class  MsgUpdateConfig
 
class  MsgUpdateForced
 
class  MsgUpdateSlic3r
 
class  NotificationManager
 
class  NotificationProgressIndicator
 
class  ObjectDataViewModel
 
class  ObjectDataViewModelNode
 
class  ObjectInfo
 
class  ObjectLayers
 
class  ObjectList
 
class  ObjectManipulation
 
class  ObjectSettings
 
class  OG_CustomCtrl
 
class  OG_Settings
 
class  ogStaticText
 
class  OpenGLManager
 
struct  OpenGLVersions
 
struct  Option
 std::function<wxWindow*(wxWindow*)>; More...
 
class  OptionsGroup
 
class  OtherInstanceMessageHandler
 
class  Page
 
struct  PageBedShape
 
struct  PageBuildVolume
 
struct  PageCustom
 
struct  PageDiameters
 
struct  PageDownloader
 
struct  PageFirmware
 
struct  PageMaterials
 
struct  PageMode
 
struct  PagePrinters
 
struct  PageReloadFromDisk
 
struct  PageTemperatures
 
struct  PageUpdate
 
struct  PageVendors
 
struct  PageWelcome
 
class  PhysicalPrinterDialog
 
struct  PickingModel
 
class  Plater
 
class  PlaterAfterLoadAutoArrange
 
class  PlaterDropTarget
 
class  PlaterPresetComboBox
 
class  PlaterWorker
 
class  PointCtrl
 
class  PreferencesDialog
 
class  PresetComboBox
 
class  PresetForPrinter
 
struct  PresetTab
 
class  Preview
 
struct  PrinterPicker
 
struct  PrinterPickerEvent
 
class  PrintHostQueueDialog
 
class  PrintHostSendDialog
 
struct  ProfilePrintData
 
class  ProjectDirtyStateManager
 
class  ProjectDropDialog
 
struct  PtrWrapper
 
class  RaycastManager
 Cast rays from camera to scene Used for find hit point on model volume under mouse cursor. More...
 
class  Rect
 
class  RemovableDriveManager
 
class  RenderTimerEvent
 
class  RetinaHelper
 
class  RichMessageDialog
 
class  RotoptimizeJob
 
class  SavePresetDialog
 
class  SceneRaycaster
 
class  SceneRaycasterItem
 
class  Selection
 
class  SendSystemInfoDialog
 
class  SendSystemInfoProgressDialog
 
class  SettingsDialog
 
struct  SettingsFactory
 
class  ShowJsonDialog
 
class  Sidebar
 
struct  SimpleEvent
 
class  Size
 
class  SlaGizmoHelpDialog
 
class  SLAImportDialog
 
class  SLAImportJob
 
class  SLAImportJobView
 
class  SlicedInfo
 
class  SliderCtrl
 
class  SpinCtrl
 
class  SpinCtrlDouble
 
class  SplashScreen
 
class  StaticLine
 
class  StaticText
 
class  SubstitutionManager
 
class  SuppressBackgroundProcessingUpdate
 
struct  SurfaceDrag
 
class  SysInfoDialog
 
class  Tab
 
class  TabFilament
 
class  TabPresetComboBox
 
class  TabPrint
 
class  TabPrinter
 
class  TabSLAMaterial
 
class  TabSLAPrint
 
class  TaskTimer
 
class  TextCtrl
 
class  ThreadSafeQueueSPSC
 
class  ToolbarHighlighterTimerEvent
 
class  TransformationType
 
class  TransformHelper
 
class  TranslationProcessor
 
class  TriangleSelectorGUI
 
class  TriangleSelectorMmGui
 
class  UIBuildCanceled
 
class  UIThreadWorker
 
class  UndoValueUIManager
 
class  UnsavedChangesDialog
 
class  View3D
 
class  WarningDialog
 
class  WindowMetrics
 
class  WipeTower
 
class  Worker
 
class  WxFontUtils
 

Typedefs

using ConfigOptionsGroupShp = std::shared_ptr< ConfigOptionsGroup >
 
using ConfigOptionsGroupWkp = std::weak_ptr< ConfigOptionsGroup >
 
typedef std::function< bool(const VendorProfile::PrinterModel &)> ModelFilter
 
typedef DataList< wxListBox, std::string > StringList
 
typedef DataList< wxCheckListBox, std::string > PresetList
 
typedef std::map< std::string, std::pair< PagePrinters *, PagePrinters * > > Pages3rdparty
 
typedef std::map< std::string, std::set< std::string > > PresetAliases
 
using choice_ctrl = wxComboBox
 
using t_field = std::unique_ptr< Field >
 
using t_kill_focus = std::function< void(const std::string &)>
 
using t_change = std::function< void(const t_config_option_key &, const boost::any &)>
 
using t_back_to_init = std::function< void(const std::string &)>
 
using Vec2dEvent = Event< Vec2d >
 
using RBtnEvent = Event< std::pair< Vec2d, bool > >
 
template<size_t N>
using Vec2dsEvent = ArrayEvent< Vec2d, N >
 
using Vec3dEvent = Event< Vec3d >
 
template<size_t N>
using Vec3dsEvent = ArrayEvent< Vec3d, N >
 
using HeightProfileSmoothEvent = Event< HeightProfileSmoothingParams >
 
typedef std::map< std::string, std::vector< std::pair< std::string, std::string > > > FullSettingsHierarchy
 
typedef double coordf_t
 
typedef std::pair< coordf_t, coordf_tt_layer_height_range
 
typedef DPIAware< wxFrame > DPIFrame
 
typedef DPIAware< wxDialog > DPIDialog
 
using LoadFromOtherInstanceEvent = Event< std::vector< boost::filesystem::path > >
 
using StartDownloadOtherInstanceEvent = Event< std::vector< std::string > >
 
using InstanceGoToFrontEvent = SimpleEvent
 
using EjectDriveNotificationClickedEvent = SimpleEvent
 
using ExportGcodeNotificationClickedEvent = SimpleEvent
 
using PresetUpdateAvailableClickedEvent = SimpleEvent
 
using CancelFn = std::function< void()>
 
using widget_t = std::function< wxSizer *(wxWindow *)>
 Widget type describes a function object that returns a wxWindow (our widget) and accepts a wxWidget (parent window).
 
using t_option = std::unique_ptr< Option >
 
using column_t = std::function< wxWindow *(wxWindow *parent, const Line &)>
 
using t_optionfield_map = std::map< t_config_option_key, t_field >
 
using t_opt_map = std::map< std::string, std::pair< std::string, int > >
 
using t_optgroups = std::vector< std::shared_ptr< ConfigOptionsGroup > >
 
using RemovableDriveEjectEvent = Event< std::pair< DriveData, bool > >
 
using RemovableDrivesChangedEvent = SimpleEvent
 
using PageShp = std::shared_ptr< Page >
 
using ModelNodePtrArray = std::vector< std::unique_ptr< ModelNode > >
 

Enumerations

enum  {
  WRAP_WIDTH = 500 , MODEL_MIN_WRAP = 150 , DIALOG_MARGIN = 15 , INDEX_MARGIN = 40 ,
  BTN_SPACING = 10 , INDENT_SPACING = 30 , VERTICAL_SPACING = 10 , MAX_COLS = 4 ,
  ROW_SPACING = 75
}
 
enum  Technology { T_FFF = 0x1 , T_SLA = 0x2 , T_ANY = ~0 }
 
enum  BundleLocation { IN_VENDOR , IN_ARCHIVE , IN_RESOURCES }
 
enum  DownloadState {
  DownloadPending = 0 , DownloadOngoing , DownloadStopped , DownloadDone ,
  DownloadError , DownloadPaused , DownloadStateUnknown
}
 
enum  DownloaderUserAction { DownloadUserCanceled , DownloadUserPaused , DownloadUserContinued , DownloadUserOpenedFolder }
 
enum class  PainterGizmoType { FDM_SUPPORTS , SEAM , MMU_SEGMENTATION }
 
enum class  SLAGizmoEventType : unsigned char {
  LeftDown = 1 , LeftUp , RightDown , Dragging ,
  Delete , SelectAll , ShiftUp , AltUp ,
  ApplyChanges , DiscardChanges , AutomaticGeneration , ManualEditing ,
  MouseWheelUp , MouseWheelDown , ResetClippingPlane , LeftDown = 1 ,
  LeftUp , RightDown , RightUp , Dragging ,
  Delete , SelectAll , CtrlDown , CtrlUp ,
  ShiftDown , ShiftUp , AltUp , Escape ,
  ApplyChanges , DiscardChanges , AutomaticGeneration , ManualEditing ,
  MouseWheelUp , MouseWheelDown , ResetClippingPlane , Moving
}
 
enum class  SLAGizmoEventType : unsigned char {
  LeftDown = 1 , LeftUp , RightDown , Dragging ,
  Delete , SelectAll , ShiftUp , AltUp ,
  ApplyChanges , DiscardChanges , AutomaticGeneration , ManualEditing ,
  MouseWheelUp , MouseWheelDown , ResetClippingPlane , LeftDown = 1 ,
  LeftUp , RightDown , RightUp , Dragging ,
  Delete , SelectAll , CtrlDown , CtrlUp ,
  ShiftDown , ShiftUp , AltUp , Escape ,
  ApplyChanges , DiscardChanges , AutomaticGeneration , ManualEditing ,
  MouseWheelUp , MouseWheelDown , ResetClippingPlane , Moving
}
 
enum class  CommonGizmosDataID {
  None = 0 , SelectionInfo = 1 << 0 , InstancesHider = 1 << 1 , Raycaster = 1 << 3 ,
  ObjectClipper = 1 << 4 , SupportsClipper = 1 << 5
}
 
enum  FileType {
  FT_STL , FT_OBJ , FT_OBJECT , FT_STEP ,
  FT_AMF , FT_3MF , FT_GCODE , FT_MODEL ,
  FT_PROJECT , FT_FONTS , FT_GALLERY , FT_INI ,
  FT_SVG , FT_TEX , FT_SL1 , FT_ZIP ,
  FT_SIZE
}
 
enum  ConfigMenuIDs {
  ConfigMenuWizard , ConfigMenuSnapshots , ConfigMenuTakeSnapshot , ConfigMenuUpdateConf ,
  ConfigMenuUpdateApp , ConfigMenuDesktopIntegration , ConfigMenuPreferences , ConfigMenuModeSimple ,
  ConfigMenuModeAdvanced , ConfigMenuModeExpert , ConfigMenuLanguage , ConfigMenuFlashFirmware ,
  ConfigMenuCnt
}
 
enum class  ECoordinatesType : unsigned char { World , Instance , Local }
 
enum  EditorType { etUndef = 0 , etMinZ = 1 , etMaxZ = 2 , etLayerHeight = 4 }
 
enum  { DPI_DEFAULT = 96 }
 
enum class  ERescaleTarget { Mainframe , SettingsDialog }
 
enum  QuickSlice {
  qsUndef = 0 , qsReslice = 1 , qsSaveAs = 2 , qsExportSVG = 4 ,
  qsExportPNG = 8
}
 
enum class  NotificationType {
  CustomNotification , ExportFinished , Mouse3dDisconnected , NewAppAvailable ,
  NewAlphaAvailable , NewBetaAvailable , NoNewReleaseAvailable , PresetUpdateAvailable ,
  ValidateError , ValidateWarning , SlicingError , SlicingWarning ,
  PlaterError , PlaterWarning , ProgressBar , PrintHostUpload ,
  AppDownload , SlicingProgress , EmptyColorChangeCode , CustomSupportsAndSeamRemovedAfterRepair ,
  EmptyAutoColorChange , SignDetected , QuitSLAManualMode , DesktopIntegrationSuccess ,
  DesktopIntegrationFail , UndoDesktopIntegrationSuccess , UndoDesktopIntegrationFail , MmSegmentationExceededExtrudersLimit ,
  DidYouKnowHint , UpdatedItemsInfo , ProgressIndicator , SimplifySuggestion ,
  UnknownFont , NetfabbFinished , ExportOngoing , URLDownload ,
  URLNotRegistered
}
 
enum  ItemType {
  itUndef = 0 , itObject = 1 , itVolume = 2 , itInstanceRoot = 4 ,
  itInstance = 8 , itSettings = 16 , itLayerRoot = 32 , itLayer = 64 ,
  itInfo = 128
}
 
enum  ColumnNumber { colName = 0 , colPrint , colExtruder , colEditing }
 
enum  PrintIndicator { piUndef = 0 , piPrintable , piUnprintable }
 
enum class  InfoItemType {
  Undef , CustomSupports , CustomSeam , CutConnectors ,
  MmuSegmentation , Sinking , VariableLayerHeight
}
 
enum  SlicedInfoIdx {
  siFilament_g , siFilament_m , siFilament_mm3 , siMateril_unit ,
  siCost , siEstimatedTime , siWTNumbetOfToolchanges , siCount
}
 
enum class  ActionButtonType : int { abReslice , abExport , abSendGCode }
 
enum  ExportingStatus { NOT_EXPORTING , EXPORTING_TO_REMOVABLE , EXPORTING_TO_LOCAL }
 
enum  ActionButtons { TRANSFER = 1 , KEEP = 2 , SAVE = 4 , DONT_SAVE = 8 }
 
enum class  Action { Undef , Transfer , Discard , Save }
 
enum class  NewSlicerInstanceType { Slicer , GCodeViewer }
 

Functions

static std::string get_option_label (BedShape::Parameter param)
 
static wxBitmap wxImage_to_wxBitmap_with_alpha (wxImage &&image, float scale=1.0f)
 
static wxString format_reason (const Config::Snapshot::Reason reason)
 
static std::string get_color (wxColour colour)
 
static wxString generate_html_row (const Config::Snapshot &snapshot, bool row_even, bool snapshot_active, bool dark_mode)
 
static wxString generate_html_page (const Config::SnapshotDB &snapshot_db, const wxString &on_snapshot)
 
 wxDEFINE_EVENT (EVT_PRINTER_PICK, PrinterPickerEvent)
 
static void focus_event (wxFocusEvent &e, wxTextCtrl *ctrl, double def_value)
 
 wxDECLARE_EVENT (EVT_INDEX_PAGE, wxCommandEvent)
 
static std::set< std::string > get_new_added_presets (const std::map< std::string, std::string > &old_data, const std::map< std::string, std::string > &new_data)
 
static std::string get_first_added_preset (const std::map< std::string, std::string > &old_data, const std::map< std::string, std::string > &new_data)
 
 wxDEFINE_EVENT (EVT_INDEX_PAGE, wxCommandEvent)
 
 wxDEFINE_EVENT (EVT_DWNLDR_FILE_COMPLETE, wxCommandEvent)
 
 wxDEFINE_EVENT (EVT_DWNLDR_FILE_ERROR, wxCommandEvent)
 
 wxDEFINE_EVENT (EVT_DWNLDR_FILE_PROGRESS, wxCommandEvent)
 
 wxDEFINE_EVENT (EVT_DWNLDR_FILE_NAME_CHANGE, wxCommandEvent)
 
 wxDEFINE_EVENT (EVT_DWNLDR_FILE_PAUSED, wxCommandEvent)
 
 wxDEFINE_EVENT (EVT_DWNLDR_FILE_CANCELED, wxCommandEvent)
 
 wxDECLARE_EVENT (EVT_DWNLDR_FILE_COMPLETE, wxCommandEvent)
 
 wxDECLARE_EVENT (EVT_DWNLDR_FILE_PROGRESS, wxCommandEvent)
 
 wxDECLARE_EVENT (EVT_DWNLDR_FILE_ERROR, wxCommandEvent)
 
 wxDECLARE_EVENT (EVT_DWNLDR_FILE_NAME_CHANGE, wxCommandEvent)
 
 wxDECLARE_EVENT (EVT_DWNLDR_FILE_PAUSED, wxCommandEvent)
 
 wxDECLARE_EVENT (EVT_DWNLDR_FILE_CANCELED, wxCommandEvent)
 
wxString double_to_string (double const value, const int max_precision)
 
wxString get_thumbnails_string (const std::vector< Vec2d > &values)
 
static wxString na_value (bool for_spin_ctrl=false)
 
template<class T >
bool is_defined_input_value (wxWindow *win, const ConfigOptionType &type)
 
bool is_bad_field (const t_field &obj)
 Convenience function, accepts a const reference to t_field and checks to see whether or not both wx pointers are null.
 
bool is_window_field (const t_field &obj)
 Covenience function to determine whether this field is a valid window field.
 
bool is_sizer_field (const t_field &obj)
 Covenience function to determine whether this field is a valid sizer field.
 
template<typename... TArgs>
wxString format_wxstr (const char *fmt, TArgs &&... args)
 
template<typename... TArgs>
wxString format_wxstr (const std::string &fmt, TArgs &&... args)
 
template<typename... TArgs>
wxString format_wxstr (const wxString &fmt, TArgs &&... args)
 
template<typename... TArgs>
std::string format (const char *fmt, TArgs &&... args)
 
template<typename... TArgs>
std::string format (const std::string &fmt, TArgs &&... args)
 
template<typename... TArgs>
std::string format (const wxString &fmt, TArgs &&... args)
 
static void add_lock (wxImage &image, wxWindow *parent_win)
 
static void add_default_image (wxImageList *img_list, bool is_system, wxWindow *parent_win)
 
static fs::path get_dir (bool sys_dir)
 
static std::string get_dir_path (bool sys_dir)
 
static void generate_thumbnail_from_model (const std::string &filename)
 
static void show_warning (const wxString &title, const std::string &error_file_type)
 
static unsigned char buffer_id (EMoveType type)
 
static EMoveType buffer_type (unsigned char id)
 
static float round_to_bin (const float value)
 
static GLModel::Geometry its_make_line (Vec3f beg_pos, Vec3f end_pos)
 
static void init_from_circle (GLModel &model, double radius)
 – #ysFIXME those functions bodies are ported from GizmoRotation
 
static void init_from_scale (GLModel &model, double radius)
 
static void init_from_snap_radii (GLModel &model, double radius)
 
static void init_from_angle_arc (GLModel &model, double angle, double radius)
 
static double get_grabber_mean_size (const BoundingBoxf3 &bb)
 
static double get_half_size (double size)
 
static double get_dragging_half_size (double size)
 
void update_object_cut_id (CutObjectBase &cut_id, ModelObjectCutAttributes attributes, const int dowels_count)
 
void synchronize_model_after_cut (Model &model, const CutObjectBase &cut_id)
 
static std::string format_double (double value)
 
static std::string format_vec3 (const Vec3d &v)
 
static std::string surface_feature_type_as_string (Measure::SurfaceFeatureType type)
 
static std::string point_on_feature_type_as_string (Measure::SurfaceFeatureType type, int hover_id)
 
static std::string center_on_feature_type_as_string (Measure::SurfaceFeatureType type)
 
static GLModel::Geometry init_plane_data (const indexed_triangle_set &its, const std::vector< int > &triangle_indices)
 
static GLModel::Geometry init_torus_data (unsigned int primary_resolution, unsigned int secondary_resolution, const Vec3f &center, float radius, float thickness, const Vec3f &model_axis, const Transform3f &world_trafo)
 
static bool is_feature_with_center (const Measure::SurfaceFeature &feature)
 
static Vec3d get_feature_offset (const Measure::SurfaceFeature &feature)
 
static void add_row_to_table (std::function< void(void)> col_1=nullptr, std::function< void(void)> col_2=nullptr)
 
static void add_strings_row_to_table (ImGuiWrapper &imgui, const std::string &col_1, const ImVec4 &col_1_color, const std::string &col_2, const ImVec4 &col_2_color)
 
static void show_notification_extruders_limit_exceeded ()
 
static std::vector< ColorRGBAget_extruders_colors ()
 
static std::vector< std::string > get_extruders_names ()
 
static std::vector< int > get_extruder_id_for_volumes (const ModelObject &model_object)
 
static void render_extruders_combo (const std::string &label, const std::vector< std::string > &extruders, const std::vector< ColorRGBA > &extruders_colors, size_t &selection_idx)
 
static int constraint_id (int grabber_id)
 
static void call_after_if_active (std::function< void()> fn, GUI_App *app=&wxGetApp())
 
static std::set< ObjectIDget_volume_ids (const Selection &selection)
 
static ModelVolumeget_volume (const ObjectID &id, const Selection &selection)
 
static std::string create_volumes_name (const std::set< ObjectID > &ids, const Selection &selection)
 
static float get_cursor_height ()
 
 wxDEFINE_EVENT (EVT_GLCANVAS_SCHEDULE_BACKGROUND_PROCESS, SimpleEvent)
 
 wxDEFINE_EVENT (EVT_GLCANVAS_OBJECT_SELECT, SimpleEvent)
 
 wxDEFINE_EVENT (EVT_GLCANVAS_RIGHT_CLICK, RBtnEvent)
 
 wxDEFINE_EVENT (EVT_GLCANVAS_REMOVE_OBJECT, SimpleEvent)
 
 wxDEFINE_EVENT (EVT_GLCANVAS_ARRANGE, SimpleEvent)
 
 wxDEFINE_EVENT (EVT_GLCANVAS_SELECT_ALL, SimpleEvent)
 
 wxDEFINE_EVENT (EVT_GLCANVAS_QUESTION_MARK, SimpleEvent)
 
 wxDEFINE_EVENT (EVT_GLCANVAS_INCREASE_INSTANCES, Event< int >)
 
 wxDEFINE_EVENT (EVT_GLCANVAS_INSTANCE_MOVED, SimpleEvent)
 
 wxDEFINE_EVENT (EVT_GLCANVAS_INSTANCE_ROTATED, SimpleEvent)
 
 wxDEFINE_EVENT (EVT_GLCANVAS_RESET_SKEW, SimpleEvent)
 
 wxDEFINE_EVENT (EVT_GLCANVAS_INSTANCE_SCALED, SimpleEvent)
 
 wxDEFINE_EVENT (EVT_GLCANVAS_FORCE_UPDATE, SimpleEvent)
 
 wxDEFINE_EVENT (EVT_GLCANVAS_WIPETOWER_MOVED, Vec3dEvent)
 
 wxDEFINE_EVENT (EVT_GLCANVAS_WIPETOWER_ROTATED, Vec3dEvent)
 
 wxDEFINE_EVENT (EVT_GLCANVAS_ENABLE_ACTION_BUTTONS, Event< bool >)
 
 wxDEFINE_EVENT (EVT_GLCANVAS_UPDATE_GEOMETRY, Vec3dsEvent< 2 >)
 
 wxDEFINE_EVENT (EVT_GLCANVAS_MOUSE_DRAGGING_STARTED, SimpleEvent)
 
 wxDEFINE_EVENT (EVT_GLCANVAS_MOUSE_DRAGGING_FINISHED, SimpleEvent)
 
 wxDEFINE_EVENT (EVT_GLCANVAS_UPDATE_BED_SHAPE, SimpleEvent)
 
 wxDEFINE_EVENT (EVT_GLCANVAS_TAB, SimpleEvent)
 
 wxDEFINE_EVENT (EVT_GLCANVAS_RESETGIZMOS, SimpleEvent)
 
 wxDEFINE_EVENT (EVT_GLCANVAS_MOVE_SLIDERS, wxKeyEvent)
 
 wxDEFINE_EVENT (EVT_GLCANVAS_EDIT_COLOR_CHANGE, wxKeyEvent)
 
 wxDEFINE_EVENT (EVT_GLCANVAS_JUMP_TO, wxKeyEvent)
 
 wxDEFINE_EVENT (EVT_GLCANVAS_UNDO, SimpleEvent)
 
 wxDEFINE_EVENT (EVT_GLCANVAS_REDO, SimpleEvent)
 
 wxDEFINE_EVENT (EVT_GLCANVAS_COLLAPSE_SIDEBAR, SimpleEvent)
 
 wxDEFINE_EVENT (EVT_GLCANVAS_RESET_LAYER_HEIGHT_PROFILE, SimpleEvent)
 
 wxDEFINE_EVENT (EVT_GLCANVAS_ADAPTIVE_LAYER_HEIGHT_PROFILE, Event< float >)
 
 wxDEFINE_EVENT (EVT_GLCANVAS_SMOOTH_LAYER_HEIGHT_PROFILE, HeightProfileSmoothEvent)
 
 wxDEFINE_EVENT (EVT_GLCANVAS_RELOAD_FROM_DISK, SimpleEvent)
 
 wxDEFINE_EVENT (EVT_GLCANVAS_RENDER_TIMER, wxTimerEvent)
 
 wxDEFINE_EVENT (EVT_GLCANVAS_TOOLBAR_HIGHLIGHTER_TIMER, wxTimerEvent)
 
 wxDEFINE_EVENT (EVT_GLCANVAS_GIZMO_HIGHLIGHTER_TIMER, wxTimerEvent)
 
static std::vector< int > processed_objects_idxs (const Model &model, const SLAPrint &sla_print, const GLVolumePtrs &volumes)
 
static bool composite_id_match (const GLVolume::CompositeID &id1, const GLVolume::CompositeID &id2)
 
static bool object_contains_negative_volumes (const Model &model, int obj_id)
 
static bool object_has_sla_drain_holes (const Model &model, int obj_id)
 
static bool string_getter (const bool is_undo, int idx, const char **out_text)
 
static bool search_string_getter (int idx, const char **label, const char **tooltip)
 
const ModelVolumeget_model_volume (const GLVolume &v, const Model &model)
 
const ModelVolumeget_model_volume (const ObjectID &volume_id, const ModelObjectPtrs &objects)
 
ModelVolumeget_model_volume (const GLVolume &v, const ModelObject &object)
 
ModelVolumeget_model_volume (const GLVolume &v, const ModelObjectPtrs &objects)
 
GLVolumeget_first_hovered_gl_volume (const GLCanvas3D &canvas)
 
GLVolumeget_selected_gl_volume (const GLCanvas3D &canvas)
 
ModelObjectget_model_object (const GLVolume &gl_volume, const Model &model)
 
ModelObjectget_model_object (const GLVolume &gl_volume, const ModelObjectPtrs &objects)
 
ModelInstanceget_model_instance (const GLVolume &gl_volume, const Model &model)
 
ModelInstanceget_model_instance (const GLVolume &gl_volume, const ModelObjectPtrs &objects)
 
ModelInstanceget_model_instance (const GLVolume &gl_volume, const ModelObject &object)
 
 wxDECLARE_EVENT (EVT_GLCANVAS_OBJECT_SELECT, SimpleEvent)
 
 wxDECLARE_EVENT (EVT_GLCANVAS_SCHEDULE_BACKGROUND_PROCESS, SimpleEvent)
 
 wxDECLARE_EVENT (EVT_GLCANVAS_RIGHT_CLICK, RBtnEvent)
 
 wxDECLARE_EVENT (EVT_GLCANVAS_REMOVE_OBJECT, SimpleEvent)
 
 wxDECLARE_EVENT (EVT_GLCANVAS_ARRANGE, SimpleEvent)
 
 wxDECLARE_EVENT (EVT_GLCANVAS_SELECT_ALL, SimpleEvent)
 
 wxDECLARE_EVENT (EVT_GLCANVAS_QUESTION_MARK, SimpleEvent)
 
 wxDECLARE_EVENT (EVT_GLCANVAS_INCREASE_INSTANCES, Event< int >)
 
 wxDECLARE_EVENT (EVT_GLCANVAS_INSTANCE_MOVED, SimpleEvent)
 
 wxDECLARE_EVENT (EVT_GLCANVAS_FORCE_UPDATE, SimpleEvent)
 
 wxDECLARE_EVENT (EVT_GLCANVAS_WIPETOWER_MOVED, Vec3dEvent)
 
 wxDECLARE_EVENT (EVT_GLCANVAS_INSTANCE_ROTATED, SimpleEvent)
 
 wxDECLARE_EVENT (EVT_GLCANVAS_RESET_SKEW, SimpleEvent)
 
 wxDECLARE_EVENT (EVT_GLCANVAS_INSTANCE_SCALED, SimpleEvent)
 
 wxDECLARE_EVENT (EVT_GLCANVAS_WIPETOWER_ROTATED, Vec3dEvent)
 
 wxDECLARE_EVENT (EVT_GLCANVAS_ENABLE_ACTION_BUTTONS, Event< bool >)
 
 wxDECLARE_EVENT (EVT_GLCANVAS_UPDATE_GEOMETRY, Vec3dsEvent< 2 >)
 
 wxDECLARE_EVENT (EVT_GLCANVAS_MOUSE_DRAGGING_STARTED, SimpleEvent)
 
 wxDECLARE_EVENT (EVT_GLCANVAS_MOUSE_DRAGGING_FINISHED, SimpleEvent)
 
 wxDECLARE_EVENT (EVT_GLCANVAS_UPDATE_BED_SHAPE, SimpleEvent)
 
 wxDECLARE_EVENT (EVT_GLCANVAS_TAB, SimpleEvent)
 
 wxDECLARE_EVENT (EVT_GLCANVAS_RESETGIZMOS, SimpleEvent)
 
 wxDECLARE_EVENT (EVT_GLCANVAS_MOVE_SLIDERS, wxKeyEvent)
 
 wxDECLARE_EVENT (EVT_GLCANVAS_EDIT_COLOR_CHANGE, wxKeyEvent)
 
 wxDECLARE_EVENT (EVT_GLCANVAS_JUMP_TO, wxKeyEvent)
 
 wxDECLARE_EVENT (EVT_GLCANVAS_UNDO, SimpleEvent)
 
 wxDECLARE_EVENT (EVT_GLCANVAS_REDO, SimpleEvent)
 
 wxDECLARE_EVENT (EVT_GLCANVAS_COLLAPSE_SIDEBAR, SimpleEvent)
 
 wxDECLARE_EVENT (EVT_GLCANVAS_RESET_LAYER_HEIGHT_PROFILE, SimpleEvent)
 
 wxDECLARE_EVENT (EVT_GLCANVAS_ADAPTIVE_LAYER_HEIGHT_PROFILE, Event< float >)
 
 wxDECLARE_EVENT (EVT_GLCANVAS_SMOOTH_LAYER_HEIGHT_PROFILE, HeightProfileSmoothEvent)
 
 wxDECLARE_EVENT (EVT_GLCANVAS_RELOAD_FROM_DISK, SimpleEvent)
 
 wxDECLARE_EVENT (EVT_GLCANVAS_RENDER_TIMER, wxTimerEvent)
 
 wxDECLARE_EVENT (EVT_GLCANVAS_TOOLBAR_HIGHLIGHTER_TIMER, wxTimerEvent)
 
 wxDECLARE_EVENT (EVT_GLCANVAS_GIZMO_HIGHLIGHTER_TIMER, wxTimerEvent)
 
static GLenum get_primitive_mode (const GLModel::Geometry::Format &format)
 
static GLenum get_index_type (const GLModel::Geometry &data)
 
template<typename Fn >
bool all_vertices_inside (const GLModel::Geometry &geometry, Fn fn)
 
bool contains (const BuildVolume &volume, const GLModel &model, bool ignore_bottom)
 
GLModel::Geometry stilized_arrow (unsigned int resolution, float tip_radius, float tip_height, float stem_radius, float stem_height)
 
GLModel::Geometry circular_arrow (unsigned int resolution, float radius, float tip_height, float tip_width, float stem_width, float thickness)
 
GLModel::Geometry straight_arrow (float tip_width, float tip_height, float stem_width, float stem_height, float thickness)
 
GLModel::Geometry diamond (unsigned int resolution)
 
GLModel::Geometry smooth_sphere (unsigned int resolution, float radius)
 
GLModel::Geometry smooth_cylinder (unsigned int resolution, float radius, float height)
 
GLModel::Geometry smooth_torus (unsigned int primary_resolution, unsigned int secondary_resolution, float radius, float thickness)
 
static bool to_squared_power_of_two (const std::string &filename, int max_size_px, int &w, int &h)
 
 wxDEFINE_EVENT (EVT_GLTOOLBAR_ADD, SimpleEvent)
 
 wxDEFINE_EVENT (EVT_GLTOOLBAR_DELETE, SimpleEvent)
 
 wxDEFINE_EVENT (EVT_GLTOOLBAR_DELETE_ALL, SimpleEvent)
 
 wxDEFINE_EVENT (EVT_GLTOOLBAR_ARRANGE, SimpleEvent)
 
 wxDEFINE_EVENT (EVT_GLTOOLBAR_COPY, SimpleEvent)
 
 wxDEFINE_EVENT (EVT_GLTOOLBAR_PASTE, SimpleEvent)
 
 wxDEFINE_EVENT (EVT_GLTOOLBAR_MORE, SimpleEvent)
 
 wxDEFINE_EVENT (EVT_GLTOOLBAR_FEWER, SimpleEvent)
 
 wxDEFINE_EVENT (EVT_GLTOOLBAR_SPLIT_OBJECTS, SimpleEvent)
 
 wxDEFINE_EVENT (EVT_GLTOOLBAR_SPLIT_VOLUMES, SimpleEvent)
 
 wxDEFINE_EVENT (EVT_GLTOOLBAR_LAYERSEDITING, SimpleEvent)
 
 wxDEFINE_EVENT (EVT_GLVIEWTOOLBAR_3D, SimpleEvent)
 
 wxDEFINE_EVENT (EVT_GLVIEWTOOLBAR_PREVIEW, SimpleEvent)
 
 wxDECLARE_EVENT (EVT_GLTOOLBAR_ADD, SimpleEvent)
 
 wxDECLARE_EVENT (EVT_GLTOOLBAR_DELETE, SimpleEvent)
 
 wxDECLARE_EVENT (EVT_GLTOOLBAR_DELETE_ALL, SimpleEvent)
 
 wxDECLARE_EVENT (EVT_GLTOOLBAR_ARRANGE, SimpleEvent)
 
 wxDECLARE_EVENT (EVT_GLTOOLBAR_COPY, SimpleEvent)
 
 wxDECLARE_EVENT (EVT_GLTOOLBAR_PASTE, SimpleEvent)
 
 wxDECLARE_EVENT (EVT_GLTOOLBAR_MORE, SimpleEvent)
 
 wxDECLARE_EVENT (EVT_GLTOOLBAR_FEWER, SimpleEvent)
 
 wxDECLARE_EVENT (EVT_GLTOOLBAR_SPLIT_OBJECTS, SimpleEvent)
 
 wxDECLARE_EVENT (EVT_GLTOOLBAR_SPLIT_VOLUMES, SimpleEvent)
 
 wxDECLARE_EVENT (EVT_GLTOOLBAR_LAYERSEDITING, SimpleEvent)
 
 wxDECLARE_EVENT (EVT_GLVIEWTOOLBAR_3D, SimpleEvent)
 
 wxDECLARE_EVENT (EVT_GLVIEWTOOLBAR_PREVIEW, SimpleEvent)
 
void disable_screensaver ()
 
void enable_screensaver ()
 
bool debugged ()
 
void break_to_debugger ()
 
const std::string & shortkey_ctrl_prefix ()
 
const std::string & shortkey_alt_prefix ()
 
void change_opt_value (DynamicPrintConfig &config, const t_config_option_key &opt_key, const boost::any &value, int opt_index)
 
void show_error (wxWindow *parent, const wxString &message, bool monospaced_font)
 
void show_error (wxWindow *parent, const char *message, bool monospaced_font)
 
void show_error_id (int id, const std::string &message)
 
void show_info (wxWindow *parent, const wxString &message, const wxString &title)
 
void show_info (wxWindow *parent, const char *message, const char *title)
 
void warning_catcher (wxWindow *parent, const wxString &message)
 
static wxString bold (const wxString &str)
 
static wxString bold_string (const wxString &str)
 
static void add_config_substitutions (const ConfigSubstitutions &conf_substitutions, wxString &changes)
 
static wxString substitution_message (const wxString &changes)
 
void show_substitutions_info (const PresetsConfigSubstitutions &presets_config_substitutions)
 
void show_substitutions_info (const ConfigSubstitutions &config_substitutions, const std::string &filename)
 
void create_combochecklist (wxComboCtrl *comboCtrl, const std::string &text, const std::string &items)
 
unsigned int combochecklist_get_flags (wxComboCtrl *comboCtrl)
 
void combochecklist_set_flags (wxComboCtrl *comboCtrl, unsigned int flags)
 
AppConfigget_app_config ()
 
wxString from_u8 (const std::string &str)
 
std::string into_u8 (const wxString &str)
 
wxString from_path (const boost::filesystem::path &path)
 
boost::filesystem::path into_path (const wxString &str)
 
void about ()
 
void desktop_open_datadir_folder ()
 
void desktop_open_folder (const boost::filesystem::path &path)
 
void add_menus (wxMenuBar *menu, int event_preferences_changed, int event_language_change)
 
void show_error (wxWindow *parent, const std::string &message, bool monospaced_font=false)
 
void show_info (wxWindow *parent, const std::string &message, const std::string &title=std::string())
 
static wxString file_wildcards (const FileWildcards &data)
 
wxString file_wildcards (FileType file_type, const std::string &custom_extension)
 
wxString sla_wildcards (const char *formatid)
 
static std::string libslic3r_translate_callback (const char *s)
 
static void generic_exception_handle ()
 
static boost::optional< Semverparse_semver_from_ini (std::string path)
 
void fatal_error (wxWindow *parent)
 
static wxString dots ("…", wxConvUTF8)
 
static PrinterTechnology printer_technology ()
 
static int extruders_count ()
 
static bool is_improper_category (const std::string &category, const int extruders_cnt, const bool is_object_settings=true)
 
static Platerplater ()
 
static ObjectListobj_list ()
 
static ObjectDataViewModellist_model ()
 
static const Selectionget_selection ()
 
static void get_full_settings_hierarchy (FullSettingsHierarchy &settings_menu, const bool is_part)
 
static int GetSelectedChoices (wxArrayInt &selections, const wxString &message, const wxString &caption, const wxArrayString &choices)
 
static wxMenu * create_settings_popupmenu (wxMenu *parent_menu, const bool is_object_settings, wxDataViewItem item)
 
static void create_freq_settings_popupmenu (wxMenu *menu, const bool is_object_settings, wxDataViewItem item)
 
int GUI_Run (GUI_InitParams &params)
 
 wxDEFINE_EVENT (EVT_OBJ_LIST_OBJECT_SELECT, SimpleEvent)
 
static PrinterTechnology printer_technology ()
 
static const Selectionscene_selection ()
 
static DynamicPrintConfigprinter_config ()
 
static int extruders_count ()
 
static void take_snapshot (const wxString &snapshot_name)
 
static std::string get_warning_icon_name (const TriangleMeshStats &stats)
 
static wxString get_item_name (const std::string &name, const bool is_text_volume)
 
static TriangleMesh create_mesh (const std::string &type_name, const BoundingBoxf3 &bb)
 
static wxString extruder2str (int extruder)
 
static bool can_add_volumes_to_object (const ModelObject *object)
 
static void update_selection (wxDataViewItemArray &sels, ObjectList::SELECTION_MODE mode, ObjectDataViewModel *model)
 
static double get_min_layer_height (const int extruder_idx)
 
static double get_max_layer_height (const int extruder_idx)
 
 wxDECLARE_EVENT (EVT_OBJ_LIST_OBJECT_SELECT, SimpleEvent)
 
static double get_volume_min_z (const GLVolume &volume)
 
static choice_ctrlcreate_word_local_combo (wxWindow *parent)
 
void msw_rescale_word_local_combo (choice_ctrl *combo)
 
static void set_font_and_background_style (wxWindow *win, const wxFont &font)
 
static int find_close_layer_idx (const std::vector< double > &zs, double &z, double eps)
 
wxTopLevelWindow * find_toplevel_parent (wxWindow *window)
 
void on_window_geometry (wxTopLevelWindow *tlw, std::function< void()> callback)
 
 wxDEFINE_EVENT (EVT_DPI_CHANGED_SLICER, DpiChangedEvent)
 
int get_dpi_for_window (const wxWindow *window)
 
wxFont get_default_font_for_dpi (const wxWindow *window, int dpi)
 
bool check_dark_mode ()
 
std::ostream & operator<< (std::ostream &os, const WindowMetrics &metrics)
 
wxFont get_default_font (const wxWindow *window)
 
 wxDECLARE_EVENT (EVT_DPI_CHANGED_SLICER, DpiChangedEvent)
 
wxString L_str (const std::string &str)
 
void draw (const IconManager::Icon &icon, const ImVec2 &size=ImVec2(0, 0), const ImVec4 &tint_col=ImVec4(1, 1, 1, 1), const ImVec4 &border_col=ImVec4(0, 0, 0, 0))
 Draw imgui image with icon.
 
bool clickable (const IconManager::Icon &icon, const IconManager::Icon &icon_hover)
 Draw icon which change on hover.
 
bool button (const IconManager::Icon &activ, const IconManager::Icon &hover, const IconManager::Icon &disable, bool disabled=false)
 Use icon as button with 3 states activ hover and disabled.
 
static bool image_button_ex (ImGuiID id, ImTextureID texture_id, const ImVec2 &size, const ImVec2 &uv0, const ImVec2 &uv1, const ImVec2 &padding, const ImVec4 &bg_col, const ImVec4 &tint_col, ImGuiButtonFlags flags)
 
static void scroll_up ()
 
static void scroll_down ()
 
static void process_mouse_wheel (int &mouse_wheel)
 
static bool selectable (const char *label, bool selected, ImGuiSelectableFlags flags=0, const ImVec2 &size_arg=ImVec2(0, 0))
 
static void scroll_y (int hover_id)
 
static void process_key_down (ImGuiKey imgui_key, std::function< void()> f)
 
template<typename T , typename Func >
static bool input_optional (std::optional< T > &v, Func &f, std::function< bool(const T &)> is_default, const T &def_val)
 
 wxDEFINE_EVENT (EVT_LOAD_MODEL_OTHER_INSTANCE, LoadFromOtherInstanceEvent)
 
 wxDEFINE_EVENT (EVT_START_DOWNLOAD_OTHER_INSTANCE, StartDownloadOtherInstanceEvent)
 
 wxDEFINE_EVENT (EVT_INSTANCE_GO_TO_FRONT, InstanceGoToFrontEvent)
 
 wxDECLARE_EVENT (EVT_LOAD_MODEL_OTHER_INSTANCE, LoadFromOtherInstanceEvent)
 
 wxDECLARE_EVENT (EVT_START_DOWNLOAD_OTHER_INSTANCE, StartDownloadOtherInstanceEvent)
 
 wxDECLARE_EVENT (EVT_INSTANCE_GO_TO_FRONT, InstanceGoToFrontEvent)
 
static WipeTower get_wipe_tower (const Plater &plater)
 
static void update_arrangepoly_slaprint (arrangement::ArrangePolygon &ret, const SLAPrintObject &po, const ModelInstance &inst)
 
static coord_t brim_offset (const PrintObject &po, const ModelInstance &inst)
 
coord_t get_skirt_offset (const Plater *plater)
 
static std::string concat_strings (const std::set< std::string > &strings, const std::string &delim="\n")
 
std::optional< arrangement::ArrangePolygonget_wipe_tower_arrangepoly (const Plater &plater)
 
double bed_stride (const Plater *plater)
 
template<>
arrangement::ArrangePolygon get_arrange_poly (ModelInstance *inst, const Plater *plater)
 
arrangement::ArrangeParams get_arrange_params (Plater *p)
 
void assign_logical_beds (std::vector< arrangement::ArrangePolygon > &items, const arrangement::ArrangeBed &bed, double stride)
 
template<class T >
arrangement::ArrangePolygon get_arrange_poly (T obj, const Plater *plater)
 
template<>
arrangement::ArrangePolygon get_arrange_poly (ModelInstance *inst, const Plater *plater)
 
std::string get_readers_wildcard ()
 
template<class ProcessFn , class FinishFn , class = std::enable_if_t<IsProcessFn<ProcessFn>>, class = std::enable_if_t<IsFinishFn<FinishFn>>>
bool queue_job (Worker &w, ProcessFn fn, FinishFn finishfn)
 
template<class ProcessFn , class = std::enable_if_t<IsProcessFn<ProcessFn>>>
bool queue_job (Worker &w, ProcessFn fn)
 
bool queue_job (Worker &w, std::unique_ptr< Job > j)
 
template<class... Args>
bool replace_job (Worker &w, Args &&...args)
 
bool stop_current_job (Worker &w, unsigned timeout_ms=0)
 
bool stop_queue (Worker &w, unsigned timeout_ms=0)
 
static wxIcon main_frame_icon (GUI_App::EAppMode app_mode)
 
static wxMenu * generate_help_menu ()
 
static void add_common_view_menu_items (wxMenu *view_menu, MainFrame *mainFrame, std::function< bool(void)> can_change_view)
 
static double convert_input (int coord_byte_low, int coord_byte_high, double deadzone)
 
static void add_msg_content (wxWindow *parent, wxBoxSizer *content_sizer, wxString msg, bool monospaced_font=false, bool is_marked_msg=false)
 
wxString get_wraped_wxString (const wxString &in, size_t line_len)
 
 wxDEFINE_EVENT (EVT_EJECT_DRIVE_NOTIFICAION_CLICKED, EjectDriveNotificationClickedEvent)
 
 wxDEFINE_EVENT (EVT_EXPORT_GCODE_NOTIFICAION_CLICKED, ExportGcodeNotificationClickedEvent)
 
 wxDEFINE_EVENT (EVT_PRESET_UPDATE_AVAILABLE_CLICKED, PresetUpdateAvailableClickedEvent)
 
 wxDECLARE_EVENT (EVT_EJECT_DRIVE_NOTIFICAION_CLICKED, EjectDriveNotificationClickedEvent)
 
 wxDECLARE_EVENT (EVT_EXPORT_GCODE_NOTIFICAION_CLICKED, ExportGcodeNotificationClickedEvent)
 
 wxDECLARE_EVENT (EVT_PRESET_UPDATE_AVAILABLE_CLICKED, PresetUpdateAvailableClickedEvent)
 
 wxDEFINE_EVENT (wxCUSTOMEVT_LAST_VOLUME_IS_DELETED, wxCommandEvent)
 
wxBitmapBundle * find_bndl (const std::string &bmp_name)
 
static int get_root_idx (ObjectDataViewModelNode *parent_node, const ItemType root_type)
 
static bool append_root_node (ObjectDataViewModelNode *parent_node, ObjectDataViewModelNode **root_node, const ItemType root_type)
 
 WX_DEFINE_ARRAY_PTR (ObjectDataViewModelNode *, MyObjectTreeModelNodePtrArray)
 
 wxDECLARE_EVENT (wxCUSTOMEVT_LAST_VOLUME_IS_DELETED, wxCommandEvent)
 
static bool is_point_in_rect (const wxPoint &pt, const wxRect &rect)
 
static wxSize get_bitmap_size (const wxBitmapBundle *bmp, wxWindow *parent)
 
std::string gl_get_string_safe (GLenum param, const std::string &default_value)
 
static Semver parse_version_string (const std::string &version)
 
 wxDEFINE_EVENT (EVT_SCHEDULE_BACKGROUND_PROCESS, SimpleEvent)
 
 wxDEFINE_EVENT (EVT_SLICING_UPDATE, SlicingStatusEvent)
 
 wxDEFINE_EVENT (EVT_SLICING_COMPLETED, wxCommandEvent)
 
 wxDEFINE_EVENT (EVT_PROCESS_COMPLETED, SlicingProcessCompletedEvent)
 
 wxDEFINE_EVENT (EVT_EXPORT_BEGAN, wxCommandEvent)
 
static std::vector< std::pair< int, int > > reloadable_volumes (const Model &model, const Selection &selection)
 
static long GetNumberFromUser (const wxString &msg, const wxString &prompt, const wxString &title, long value, long min, long max, wxWindow *parent)
 
static void update_color (wxColourPickerCtrl *color_pckr, const wxColour &color)
 
static std::shared_ptr< ConfigOptionsGroupcreate_options_tab (const wxString &title, wxBookCtrlBase *tabs)
 
static void activate_options_tab (std::shared_ptr< ConfigOptionsGroup > optgroup)
 
static void append_bool_option (std::shared_ptr< ConfigOptionsGroup > optgroup, const std::string &opt_key, const std::string &label, const std::string &tooltip, bool def_val, ConfigOptionMode mode=comSimple)
 
template<typename EnumType >
static void append_enum_option (std::shared_ptr< ConfigOptionsGroup > optgroup, const std::string &opt_key, const std::string &label, const std::string &tooltip, const ConfigOption *def_val, std::initializer_list< std::pair< std::string_view, std::string_view > > enum_values, ConfigOptionMode mode=comSimple)
 
static void append_preferences_option_to_searcher (std::shared_ptr< ConfigOptionsGroup > optgroup, const std::string &opt_key, const wxString &label)
 
static std::string suffix (const Preset &preset)
 
static std::string suffix (Preset *preset)
 
static wxString get_preset_name_with_suffix (const Preset &preset)
 
static void run_wizard (ConfigWizard::StartPage sp)
 
 wxDEFINE_EVENT (EVT_PRINTHOST_PROGRESS, PrintHostQueueDialog::Event)
 
 wxDEFINE_EVENT (EVT_PRINTHOST_ERROR, PrintHostQueueDialog::Event)
 
 wxDEFINE_EVENT (EVT_PRINTHOST_CANCEL, PrintHostQueueDialog::Event)
 
 wxDEFINE_EVENT (EVT_PRINTHOST_INFO, PrintHostQueueDialog::Event)
 
 wxDECLARE_EVENT (EVT_PRINTHOST_PROGRESS, PrintHostQueueDialog::Event)
 
 wxDECLARE_EVENT (EVT_PRINTHOST_ERROR, PrintHostQueueDialog::Event)
 
 wxDECLARE_EVENT (EVT_PRINTHOST_CANCEL, PrintHostQueueDialog::Event)
 
 wxDECLARE_EVENT (EVT_PRINTHOST_INFO, PrintHostQueueDialog::Event)
 
 wxDEFINE_EVENT (EVT_REMOVABLE_DRIVE_EJECTED, RemovableDriveEjectEvent)
 
 wxDEFINE_EVENT (EVT_REMOVABLE_DRIVES_CHANGED, RemovableDrivesChangedEvent)
 
bool operator< (const DriveData &lhs, const DriveData &rhs)
 
bool operator> (const DriveData &lhs, const DriveData &rhs)
 
bool operator== (const DriveData &lhs, const DriveData &rhs)
 
 wxDECLARE_EVENT (EVT_REMOVABLE_DRIVE_EJECTED, RemovableDriveEjectEvent)
 
 wxDECLARE_EVENT (EVT_REMOVABLE_DRIVES_CHANGED, RemovableDrivesChangedEvent)
 
static ColorRGBA get_color (Axis axis)
 
static bool is_left_handed (const Transform3d::ConstLinearPart &m)
 
static bool is_left_handed (const Transform3d &m)
 
static bool is_rotation_xy_synchronized (const Vec3d &rot_xyz_from, const Vec3d &rot_xyz_to)
 
static bool is_rotation_xy_synchronized (const Transform3d::ConstLinearPart &trafo_from, const Transform3d::ConstLinearPart &trafo_to)
 
static bool is_rotation_xy_synchronized (const Transform3d &trafo_from, const Transform3d &trafo_to)
 
static void verify_instances_rotation_synchronized (const Model &model, const GLVolumePtrs &volumes)
 
ModelVolumeget_selected_volume (const Selection &selection)
 
const GLVolumeget_selected_gl_volume (const Selection &selection)
 
static bool should_dialog_be_shown ()
 
static void save_version ()
 
static std::map< std::string, std::string > parse_lscpu_etc (const std::string &name, char delimiter)
 
static std::string get_unique_id ()
 
static std::string generate_system_info_json ()
 
void show_send_system_info_dialog_if_needed ()
 
static std::optional< double > calc_scale (const Matrix3d &from, const Matrix3d &to, const Vec3d &dir)
 
bool on_mouse_surface_drag (const wxMouseEvent &mouse_event, const Camera &camera, std::optional< SurfaceDrag > &surface_drag, GLCanvas3D &canvas, RaycastManager &raycast_manager, std::optional< double > up_limit={})
 Mouse event handler, when move(drag&drop) volume over model surface NOTE: Dragged volume has to be selected. And also has to be hovered on start of dragging.
 
std::optional< Vec3dcalc_surface_offset (const Selection &selection, RaycastManager &raycast_manager)
 Calculate translation of volume onto surface of model.
 
Transform3d world_matrix_fixed (const GLVolume &gl_volume, const ModelObjectPtrs &objects)
 Get transformation to world.
 
Transform3d world_matrix_fixed (const Selection &selection)
 Get transformation to world.
 
std::string get_main_info (bool format_as_html)
 
std::string get_mem_info (bool format_as_html)
 
template<class T >
void add_correct_opts_to_options_list (const std::string &opt_key, std::map< std::string, int > &map, Tab *tab, const int &value)
 
static wxString support_combo_value_for_config (const DynamicPrintConfig &config, bool is_fff)
 
static wxString pad_combo_value_for_config (const DynamicPrintConfig &config)
 
static void validate_custom_gcode_cb (Tab *tab, const wxString &title, const t_config_option_key &opt_key, const boost::any &value)
 
static wxString get_info_klipper_string ()
 
static void add_options_into_line (ConfigOptionsGroupShp &optgroup, const std::vector< SamePair< std::string > > &prefixes, const std::string &optkey)
 
 wxDEFINE_EVENT (EVT_DIFF_DIALOG_TRANSFER, SimpleEvent)
 
 wxDEFINE_EVENT (EVT_DIFF_DIALOG_UPDATE_PRESETS, SimpleEvent)
 
static std::string get_icon_name (Preset::Type type, PrinterTechnology pt)
 
static std::string def_text_color ()
 
static void color_string (wxString &str, const std::string &color)
 
static void make_string_bold (wxString &str)
 
static void update_children (ModelNode *parent)
 
static void update_parents (ModelNode *node)
 
static void rescale_children (ModelNode *parent)
 
static std::string get_pure_opt_key (std::string opt_key)
 
static size_t get_id_from_opt_key (std::string opt_key)
 
static wxString get_full_label (std::string opt_key, const DynamicPrintConfig &config)
 
static wxString get_string_value (std::string opt_key, const DynamicPrintConfig &config)
 
static PresetCollectionget_preset_collection (Preset::Type type, PresetBundle *preset_bundle=nullptr)
 
static std::string get_selection (PresetComboBox *preset_combo)
 
 wxDECLARE_EVENT (EVT_DIFF_DIALOG_TRANSFER, SimpleEvent)
 
 wxDECLARE_EVENT (EVT_DIFF_DIALOG_UPDATE_PRESETS, SimpleEvent)
 
static const std::string CONFIG_UPDATE_WIKI_URL ("https://github.com/prusa3d/PrusaSlicer/wiki/Slic3r-PE-1.40-configuration-update")
 
bool mac_dark_mode ()
 
double mac_max_scaling_factor ()
 
static void start_new_slicer_or_gcodeviewer (const NewSlicerInstanceType instance_type, const std::vector< wxString > paths_to_open, bool single_instance, bool delete_after_load)
 
static void start_new_slicer_or_gcodeviewer (const NewSlicerInstanceType instance_type, const wxString *path_to_open, bool single_instance, bool delete_after_load)
 
void start_new_slicer (const wxString *path_to_open, bool single_instance, bool delete_after_load)
 
void start_new_slicer (const std::vector< wxString > &files, bool single_instance, bool delete_after_load)
 
void start_new_gcodeviewer (const wxString *path_to_open)
 
void start_new_gcodeviewer_open_file (wxWindow *parent)
 
RaycastManager::Meshes create_meshes (GLCanvas3D &canvas, const RaycastManager::AllowVolumes &condition)
 Use scene Raycasters and prepare data for actualize RaycasterManager.
 
std::optional< RaycastManager::Hitray_from_camera (const RaycastManager &raycaster, const Vec2d &mouse_pos, const Camera &camera, const RaycastManager::ISkip *skip)
 Unproject on mesh by Mesh raycasters.
 

Variables

static std::vector< std::pair< std::string, std::vector< std::string > > > MODE_PALETTES
 
static const std::unordered_map< std::string, std::pair< std::string, std::string > > legacy_preset_map
 
const size_t DOWNLOAD_MAX_CHUNK_SIZE = 10 * 1024 * 1024
 
const size_t DOWNLOAD_SIZE_LIMIT = 1024 * 1024 * 1024
 
static const ColorRGBA DEFAULT_BASE_COLOR = { 0.625f, 0.625f, 0.625f, 1.0f }
 
static const ColorRGBA DEFAULT_DRAG_COLOR = ColorRGBA::WHITE()
 
static const ColorRGBA DEFAULT_HIGHLIGHT_COLOR = ColorRGBA::ORANGE()
 
static const std::array< ColorRGBA, 3 > AXES_COLOR = {{ ColorRGBA::X(), ColorRGBA::Y(), ColorRGBA::Z() }}
 
static const ColorRGBA CONSTRAINED_COLOR = ColorRGBA::GRAY()
 
static const ColorRGBA GRABBER_COLOR = ColorRGBA::YELLOW()
 
static const ColorRGBA UPPER_PART_COLOR = ColorRGBA::CYAN()
 
static const ColorRGBA LOWER_PART_COLOR = ColorRGBA::MAGENTA()
 
static const ColorRGBA MODIFIER_COLOR = ColorRGBA(0.75f, 0.75f, 0.75f, 0.5f)
 
static const ColorRGBA PLAG_COLOR = ColorRGBA::YELLOW()
 
static const ColorRGBA DOWEL_COLOR = ColorRGBA::DARK_YELLOW()
 
static const ColorRGBA HOVERED_PLAG_COLOR = ColorRGBA::CYAN()
 
static const ColorRGBA HOVERED_DOWEL_COLOR = ColorRGBA(0.0f, 0.5f, 0.5f, 1.0f)
 
static const ColorRGBA SELECTED_PLAG_COLOR = ColorRGBA::GRAY()
 
static const ColorRGBA SELECTED_DOWEL_COLOR = ColorRGBA::DARK_GRAY()
 
static const ColorRGBA CONNECTOR_DEF_COLOR = ColorRGBA(1.0f, 1.0f, 1.0f, 0.5f)
 
static const ColorRGBA CONNECTOR_ERR_COLOR = ColorRGBA(1.0f, 0.3f, 0.3f, 0.5f)
 
static const ColorRGBA HOVERED_ERR_COLOR = ColorRGBA(1.0f, 0.3f, 0.3f, 1.0f)
 
const unsigned int AngleResolution = 64
 
const unsigned int ScaleStepsCount = 72
 
const float ScaleStepRad = 2.0f * float(PI) / ScaleStepsCount
 
const unsigned int ScaleLongEvery = 2
 
const float ScaleLongTooth = 0.1f
 
const unsigned int SnapRegionsCount = 8
 
const float UndefFloat = -999.f
 
const std::string UndefLabel = " "
 
static const Slic3r::ColorRGBA DEFAULT_PLANE_COLOR = { 0.9f, 0.9f, 0.9f, 0.5f }
 
static const Slic3r::ColorRGBA DEFAULT_HOVER_PLANE_COLOR = { 0.9f, 0.9f, 0.9f, 0.75f }
 
static const Slic3r::ColorRGBA SELECTED_1ST_COLOR = { 0.25f, 0.75f, 0.75f, 1.0f }
 
static const Slic3r::ColorRGBA SELECTED_2ND_COLOR = { 0.75f, 0.25f, 0.75f, 1.0f }
 
static const Slic3r::ColorRGBA NEUTRAL_COLOR = { 0.5f, 0.5f, 0.5f, 1.0f }
 
static const int POINT_ID = 100
 
static const int EDGE_ID = 200
 
static const int CIRCLE_ID = 300
 
static const int PLANE_ID = 400
 
static const int SEL_SPHERE_1_ID = 501
 
static const int SEL_SPHERE_2_ID = 502
 
static const float TRIANGLE_BASE = 10.0f
 
static const float TRIANGLE_HEIGHT = TRIANGLE_BASE * 1.618033f
 
static const std::string CTRL_STR
 
static const ColorRGBA DISABLED_COLOR = ColorRGBA::DARK_GRAY()
 
static const int VOLUME_RAYCASTERS_BASE_ID = (int)SceneRaycaster::EIdBase::Gizmo
 
static const FileWildcards file_wildcards_by_type [FT_SIZE]
 
static SettingsFactory::Bundle FREQ_SETTINGS_BUNDLE_FFF
 
static SettingsFactory::Bundle FREQ_SETTINGS_BUNDLE_SLA
 
static const constexpr std::array< std::pair< const char *, const char * >, 5 > ADD_VOLUME_MENU_ITEMS
 
static const constexpr std::array< std::pair< const char *, const char * >, 3 > TEXT_VOLUME_ICONS
 
static const wxString axes_color_text [] = { "#990000", "#009900", "#000099" }
 
static const wxString axes_color_back [] = { "#f5dcdc", "#dcf5dc", "#dcdcf5" }
 
static const char axes [] = { 'x', 'y', 'z' }
 
const std::string BOLD_MARKER_START = "<b>"
 
const std::string BOLD_MARKER_END = "</b>"
 
const std::string HYPERTEXT_MARKER_START = "<a>"
 
const std::string HYPERTEXT_MARKER_END = "</a>"
 
static const std::map< const wchar_t, std::string > font_icons
 
static const std::map< const wchar_t, std::string > font_icons_large
 
static const std::map< const wchar_t, std::string > font_icons_extra_large
 
static const constexpr double LOGICAL_BED_GAP = 1. / 5.
 
constexpr int ABORT_WAIT_MAX_MS = 10000
 
template<class Fn >
constexpr bool IsProcessFn = std::is_invocable_v<Fn, Job::Ctl&>
 
template<class Fn >
constexpr bool IsFinishFn = std::is_invocable_v<Fn, bool, std::exception_ptr&>
 
static const wxString sep = " - "
 
static const wxString sep_space = ""
 
BitmapCachem_bitmap_cache = nullptr
 
static constexpr char LayerRootIcon [] = "edit_layers_all"
 
static constexpr char LayerIcon [] = "edit_layers_some"
 
static constexpr char WarningIcon [] = "exclamation"
 
static constexpr char WarningManifoldIcon [] = "exclamation_manifold"
 
static constexpr char LockIcon [] = "cut_"
 
const std::map< InfoItemType, InfoItemAtributesINFO_ITEMS
 
static const std::set< std::string > options_without_field
 
static const char * CONFIG_KEY_PATH = "printhost_path"
 
static const char * CONFIG_KEY_GROUP = "printhost_group"
 
static const char * CONFIG_KEY_STORAGE = "printhost_storage"
 
constexpr auto BORDER_W = 10
 
static std::map< Preset::Type, std::string > TOP_LABELS
 
static const std::string SEND_SYSTEM_INFO_DOMAIN = "prusa3d.com"
 
static const std::string SEND_SYSTEM_INFO_URL = "https://files." + SEND_SYSTEM_INFO_DOMAIN + "/wp-json/v1/ps"
 
const std::vector< std::string > extruder_options
 
static const std::map< Preset::Type, std::string > type_icon_names
 
static std::string grey = "#808080"
 
static std::string orange = "#ed6b21"
 
static std::string none {"none"}
 
static const char * URL_CHANGELOG = "https://files.prusa3d.com/?latest=slicer-stable&lng=%1%"
 
static const char * URL_DOWNLOAD = "https://www.prusa3d.com/slicerweb&lng=%1%"
 
static const char * URL_DEV = "https://github.com/prusa3d/PrusaSlicer/releases/tag/version_%1%"
 

Class Documentation

◆ Slic3r::GUI::BackgroundTexture

struct Slic3r::GUI::BackgroundTexture
+ Collaboration diagram for Slic3r::GUI::BackgroundTexture:
Class Members
Metadata metadata
GLTexture texture

◆ Slic3r::GUI::BlockingWait

struct Slic3r::GUI::BlockingWait
+ Collaboration diagram for Slic3r::GUI::BlockingWait:
Class Members
atomic< bool > * pop_flag = nullptr
unsigned timeout_ms = 0

◆ Slic3r::GUI::FileWildcards

struct Slic3r::GUI::FileWildcards
+ Collaboration diagram for Slic3r::GUI::FileWildcards:
Class Members
vector< string_view > file_extensions
string_view title

◆ Slic3r::GUI::FontImageData

struct Slic3r::GUI::FontImageData

Keep data for rasterization of text by font face.

+ Collaboration diagram for Slic3r::GUI::FontImageData:
Class Members
shared_ptr< atomic< bool > > cancel = nullptr
unsigned int * count_opened_font_files = nullptr
wxFontEncoding encoding
wxString font_name
GLenum format = GL_ALPHA
unsigned char gray_level = 5
size_t index
shared_ptr< bool > is_created = nullptr
GLint level = 0
Vec2i size
string text
GLuint texture_id
GLenum type = GL_UNSIGNED_BYTE

◆ Slic3r::GUI::GUI_InitParams

struct Slic3r::GUI::GUI_InitParams
+ Collaboration diagram for Slic3r::GUI::GUI_InitParams:
Class Members
int argc
char ** argv
bool delete_after_load
string download_url
DynamicPrintConfig extra_config
vector< string > input_files
vector< string > load_configs
PresetsConfigSubstitutions preset_substitutions
bool start_as_gcodeviewer
bool start_downloader

◆ Slic3r::GUI::HintData

struct Slic3r::GUI::HintData
+ Collaboration diagram for Slic3r::GUI::HintData:
Class Members
function< void(void)> callback { nullptr }
string disabled_tags
string documentation_link
string enabled_tags
string follow_text
string hypertext
string id_string
bool runtime_disable
string text
bool was_displayed
size_t weight

◆ Slic3r::GUI::InfoItemAtributes

struct Slic3r::GUI::InfoItemAtributes
+ Collaboration diagram for Slic3r::GUI::InfoItemAtributes:
Class Members
string bmp_name
string name

◆ Slic3r::GUI::MeshErrorsInfo

struct Slic3r::GUI::MeshErrorsInfo
+ Collaboration diagram for Slic3r::GUI::MeshErrorsInfo:
Class Members
wxString tooltip
string warning_icon_name

◆ Slic3r::GUI::PresetTab

struct Slic3r::GUI::PresetTab
+ Collaboration diagram for Slic3r::GUI::PresetTab:
Class Members
string name
Tab * panel
PrinterTechnology technology

◆ Slic3r::GUI::SurfaceDrag

struct Slic3r::GUI::SurfaceDrag
+ Collaboration diagram for Slic3r::GUI::SurfaceDrag:
Class Members
AllowVolumes condition
bool exist_hit = true
GLVolume * gl_volume
Transform3d instance_inv
Vec2d mouse_offset
Vec2d mouse_offset_without_sla_shift
optional< float > start_angle
Transform3d world

Typedef Documentation

◆ CancelFn

using Slic3r::GUI::CancelFn = typedef std::function<void()>

◆ choice_ctrl

typedef wxComboBox Slic3r::GUI::choice_ctrl

◆ column_t

using Slic3r::GUI::column_t = typedef std::function<wxWindow*(wxWindow* parent, const Line&)>

◆ ConfigOptionsGroupShp

◆ ConfigOptionsGroupWkp

◆ coordf_t

typedef double Slic3r::GUI::coordf_t

◆ DPIDialog

typedef DPIAware<wxDialog> Slic3r::GUI::DPIDialog

◆ DPIFrame

typedef DPIAware<wxFrame> Slic3r::GUI::DPIFrame

◆ EjectDriveNotificationClickedEvent

◆ ExportGcodeNotificationClickedEvent

◆ FullSettingsHierarchy

typedef std::map< std::string, std::vector< std::pair<std::string, std::string> > > Slic3r::GUI::FullSettingsHierarchy

◆ HeightProfileSmoothEvent

◆ InstanceGoToFrontEvent

◆ LoadFromOtherInstanceEvent

using Slic3r::GUI::LoadFromOtherInstanceEvent = typedef Event<std::vector<boost::filesystem::path> >

◆ ModelFilter

◆ ModelNodePtrArray

using Slic3r::GUI::ModelNodePtrArray = typedef std::vector<std::unique_ptr<ModelNode> >

◆ Pages3rdparty

typedef std::map<std::string , std::pair<PagePrinters* , PagePrinters* > > Slic3r::GUI::Pages3rdparty

◆ PageShp

using Slic3r::GUI::PageShp = typedef std::shared_ptr<Page>

◆ PresetAliases

typedef std::map<std::string, std::set<std::string> > Slic3r::GUI::PresetAliases

◆ PresetList

typedef DataList<wxCheckListBox, std::string> Slic3r::GUI::PresetList

◆ PresetUpdateAvailableClickedEvent

◆ RBtnEvent

using Slic3r::GUI::RBtnEvent = typedef Event<std::pair<Vec2d, bool> >

◆ RemovableDriveEjectEvent

using Slic3r::GUI::RemovableDriveEjectEvent = typedef Event<std::pair<DriveData, bool> >

◆ RemovableDrivesChangedEvent

◆ StartDownloadOtherInstanceEvent

using Slic3r::GUI::StartDownloadOtherInstanceEvent = typedef Event<std::vector<std::string> >

◆ StringList

typedef DataList<wxListBox, std::string> Slic3r::GUI::StringList

◆ t_back_to_init

using Slic3r::GUI::t_back_to_init = typedef std::function<void(const std::string&)>

◆ t_change

using Slic3r::GUI::t_change = typedef std::function<void(const t_config_option_key&, const boost::any&)>

◆ t_field

using Slic3r::GUI::t_field = typedef std::unique_ptr<Field>

◆ t_kill_focus

using Slic3r::GUI::t_kill_focus = typedef std::function<void(const std::string&)>

◆ t_layer_height_range

◆ t_opt_map

using Slic3r::GUI::t_opt_map = typedef std::map< std::string, std::pair<std::string, int> >

◆ t_optgroups

using Slic3r::GUI::t_optgroups = typedef std::vector <std::shared_ptr<ConfigOptionsGroup> >

◆ t_option

using Slic3r::GUI::t_option = typedef std::unique_ptr<Option>

◆ t_optionfield_map

◆ Vec2dEvent

◆ Vec2dsEvent

template<size_t N>
using Slic3r::GUI::Vec2dsEvent = typedef ArrayEvent<Vec2d, N>

◆ Vec3dEvent

◆ Vec3dsEvent

template<size_t N>
using Slic3r::GUI::Vec3dsEvent = typedef ArrayEvent<Vec3d, N>

◆ widget_t

using Slic3r::GUI::widget_t = typedef std::function<wxSizer*(wxWindow*)>

Widget type describes a function object that returns a wxWindow (our widget) and accepts a wxWidget (parent window).

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
WRAP_WIDTH 
MODEL_MIN_WRAP 
DIALOG_MARGIN 
INDEX_MARGIN 
BTN_SPACING 
INDENT_SPACING 
VERTICAL_SPACING 
MAX_COLS 
ROW_SPACING 
36 {
37 WRAP_WIDTH = 500,
38 MODEL_MIN_WRAP = 150,
39
40 DIALOG_MARGIN = 15,
41 INDEX_MARGIN = 40,
42 BTN_SPACING = 10,
43 INDENT_SPACING = 30,
45
46 MAX_COLS = 4,
47 ROW_SPACING = 75,
48};
@ MODEL_MIN_WRAP
Definition ConfigWizard_private.hpp:38
@ BTN_SPACING
Definition ConfigWizard_private.hpp:42
@ ROW_SPACING
Definition ConfigWizard_private.hpp:47
@ MAX_COLS
Definition ConfigWizard_private.hpp:46
@ INDENT_SPACING
Definition ConfigWizard_private.hpp:43
@ DIALOG_MARGIN
Definition ConfigWizard_private.hpp:40
@ VERTICAL_SPACING
Definition ConfigWizard_private.hpp:44
@ INDEX_MARGIN
Definition ConfigWizard_private.hpp:41
@ WRAP_WIDTH
Definition ConfigWizard_private.hpp:37

◆ anonymous enum

anonymous enum
Enumerator
DPI_DEFAULT 
52{ DPI_DEFAULT = 96 };
@ DPI_DEFAULT
Definition GUI_Utils.hpp:52

◆ Action

enum class Slic3r::GUI::Action
strong
Enumerator
Undef 
Transfer 
Discard 
Save 
256 {
257 Undef,
258 Transfer,
259 Discard,
260 Save
261};
@ Undef
Definition CustomGCode.hpp:49

◆ ActionButtons

Enumerator
TRANSFER 
KEEP 
SAVE 
DONT_SAVE 
249 {
250 TRANSFER = 1,
251 KEEP = 2,
252 SAVE = 4,
253 DONT_SAVE = 8,
254};
@ KEEP
Definition UnsavedChangesDialog.hpp:251
@ DONT_SAVE
Definition UnsavedChangesDialog.hpp:253
@ SAVE
Definition UnsavedChangesDialog.hpp:252
@ TRANSFER
Definition UnsavedChangesDialog.hpp:250

◆ ActionButtonType

enum class Slic3r::GUI::ActionButtonType : int
strong
Enumerator
abReslice 
abExport 
abSendGCode 

◆ BundleLocation

Enumerator
IN_VENDOR 
IN_ARCHIVE 
IN_RESOURCES 
61 {
65};
@ IN_RESOURCES
Definition ConfigWizard_private.hpp:64
@ IN_VENDOR
Definition ConfigWizard_private.hpp:62
@ IN_ARCHIVE
Definition ConfigWizard_private.hpp:63

◆ ColumnNumber

Enumerator
colName 
colPrint 
colExtruder 
colEditing 
35{
36 colName = 0, // item name
37 colPrint , // printable property
38 colExtruder , // extruder selection
39 colEditing , // item editing
40};
@ colEditing
Definition ObjectDataViewModel.hpp:39
@ colExtruder
Definition ObjectDataViewModel.hpp:38
@ colName
Definition ObjectDataViewModel.hpp:36
@ colPrint
Definition ObjectDataViewModel.hpp:37

◆ CommonGizmosDataID

Enumerator
None 
SelectionInfo 
InstancesHider 
Raycaster 
ObjectClipper 
SupportsClipper 
64 {
65 None = 0,
66 SelectionInfo = 1 << 0,
67 InstancesHider = 1 << 1,
68 Raycaster = 1 << 3,
69 ObjectClipper = 1 << 4,
70 SupportsClipper = 1 << 5,
71
72};
Definition GLGizmosCommon.hpp:209

◆ ConfigMenuIDs

Enumerator
ConfigMenuWizard 
ConfigMenuSnapshots 
ConfigMenuTakeSnapshot 
ConfigMenuUpdateConf 
ConfigMenuUpdateApp 
ConfigMenuDesktopIntegration 
ConfigMenuPreferences 
ConfigMenuModeSimple 
ConfigMenuModeAdvanced 
ConfigMenuModeExpert 
ConfigMenuLanguage 
ConfigMenuFlashFirmware 
ConfigMenuCnt 
89 {
103};
@ ConfigMenuSnapshots
Definition GUI_App.hpp:91
@ ConfigMenuTakeSnapshot
Definition GUI_App.hpp:92
@ ConfigMenuModeSimple
Definition GUI_App.hpp:97
@ ConfigMenuModeAdvanced
Definition GUI_App.hpp:98
@ ConfigMenuCnt
Definition GUI_App.hpp:102
@ ConfigMenuUpdateConf
Definition GUI_App.hpp:93
@ ConfigMenuDesktopIntegration
Definition GUI_App.hpp:95
@ ConfigMenuModeExpert
Definition GUI_App.hpp:99
@ ConfigMenuFlashFirmware
Definition GUI_App.hpp:101
@ ConfigMenuPreferences
Definition GUI_App.hpp:96
@ ConfigMenuUpdateApp
Definition GUI_App.hpp:94
@ ConfigMenuWizard
Definition GUI_App.hpp:90
@ ConfigMenuLanguage
Definition GUI_App.hpp:100

◆ DownloaderUserAction

Enumerator
DownloadUserCanceled 
DownloadUserPaused 
DownloadUserContinued 
DownloadUserOpenedFolder 
25{
30};
@ DownloadUserContinued
Definition Downloader.hpp:28
@ DownloadUserCanceled
Definition Downloader.hpp:26
@ DownloadUserPaused
Definition Downloader.hpp:27
@ DownloadUserOpenedFolder
Definition Downloader.hpp:29

◆ DownloadState

Enumerator
DownloadPending 
DownloadOngoing 
DownloadStopped 
DownloadDone 
DownloadError 
DownloadPaused 
DownloadStateUnknown 
14{
22};
@ DownloadDone
Definition Downloader.hpp:18
@ DownloadStopped
Definition Downloader.hpp:17
@ DownloadOngoing
Definition Downloader.hpp:16
@ DownloadStateUnknown
Definition Downloader.hpp:21
@ DownloadPaused
Definition Downloader.hpp:20
@ DownloadError
Definition Downloader.hpp:19
@ DownloadPending
Definition Downloader.hpp:15

◆ ECoordinatesType

enum class Slic3r::GUI::ECoordinatesType : unsigned char
strong
Enumerator
World 
Instance 
Local 

◆ EditorType

Enumerator
etUndef 
etMinZ 
etMaxZ 
etLayerHeight 
25{
26 etUndef = 0,
27 etMinZ = 1,
28 etMaxZ = 2,
29 etLayerHeight = 4,
30};
@ etMaxZ
Definition GUI_ObjectLayers.hpp:28
@ etMinZ
Definition GUI_ObjectLayers.hpp:27
@ etUndef
Definition GUI_ObjectLayers.hpp:26
@ etLayerHeight
Definition GUI_ObjectLayers.hpp:29

◆ ERescaleTarget

enum class Slic3r::GUI::ERescaleTarget
strong
Enumerator
Mainframe 
SettingsDialog 
62{
65};
Definition MainFrame.hpp:58

◆ ExportingStatus

Enumerator
NOT_EXPORTING 
EXPORTING_TO_REMOVABLE 
EXPORTING_TO_LOCAL 
1636 {
1640};
@ EXPORTING_TO_REMOVABLE
Definition Plater.cpp:1638
@ EXPORTING_TO_LOCAL
Definition Plater.cpp:1639
@ NOT_EXPORTING
Definition Plater.cpp:1637

◆ FileType

Enumerator
FT_STL 
FT_OBJ 
FT_OBJECT 
FT_STEP 
FT_AMF 
FT_3MF 
FT_GCODE 
FT_MODEL 
FT_PROJECT 
FT_FONTS 
FT_GALLERY 
FT_INI 
FT_SVG 
FT_TEX 
FT_SL1 
FT_ZIP 
FT_SIZE 
56{
57 FT_STL,
58 FT_OBJ,
60 FT_STEP,
61 FT_AMF,
62 FT_3MF,
68
69 FT_INI,
70 FT_SVG,
71
72 FT_TEX,
73
74 FT_SL1,
75
76 FT_ZIP,
77
78 FT_SIZE,
79};
@ FT_ZIP
Definition GUI_App.hpp:76
@ FT_PROJECT
Definition GUI_App.hpp:65
@ FT_GALLERY
Definition GUI_App.hpp:67
@ FT_MODEL
Definition GUI_App.hpp:64
@ FT_OBJECT
Definition GUI_App.hpp:59
@ FT_FONTS
Definition GUI_App.hpp:66
@ FT_TEX
Definition GUI_App.hpp:72
@ FT_SL1
Definition GUI_App.hpp:74
@ FT_STEP
Definition GUI_App.hpp:60
@ FT_3MF
Definition GUI_App.hpp:62
@ FT_INI
Definition GUI_App.hpp:69
@ FT_STL
Definition GUI_App.hpp:57
@ FT_AMF
Definition GUI_App.hpp:61
@ FT_SVG
Definition GUI_App.hpp:70
@ FT_SIZE
Definition GUI_App.hpp:78
@ FT_OBJ
Definition GUI_App.hpp:58
@ FT_GCODE
Definition GUI_App.hpp:63

◆ InfoItemType

enum class Slic3r::GUI::InfoItemType
strong
Enumerator
Undef 
CustomSupports 
CustomSeam 
CutConnectors 
MmuSegmentation 
Sinking 
VariableLayerHeight 

◆ ItemType

Enumerator
itUndef 
itObject 
itVolume 
itInstanceRoot 
itInstance 
itSettings 
itLayerRoot 
itLayer 
itInfo 
22 {
23 itUndef = 0,
24 itObject = 1,
25 itVolume = 2,
27 itInstance = 8,
28 itSettings = 16,
29 itLayerRoot = 32,
30 itLayer = 64,
31 itInfo = 128
32};
@ itInfo
Definition ObjectDataViewModel.hpp:31
@ itObject
Definition ObjectDataViewModel.hpp:24
@ itUndef
Definition ObjectDataViewModel.hpp:23
@ itSettings
Definition ObjectDataViewModel.hpp:28
@ itLayer
Definition ObjectDataViewModel.hpp:30
@ itInstanceRoot
Definition ObjectDataViewModel.hpp:26
@ itInstance
Definition ObjectDataViewModel.hpp:27
@ itLayerRoot
Definition ObjectDataViewModel.hpp:29
@ itVolume
Definition ObjectDataViewModel.hpp:25

◆ NewSlicerInstanceType

Enumerator
Slicer 
GCodeViewer 
29 {
30 Slicer,
32};
Definition GCodeViewer.hpp:24

◆ NotificationType

enum class Slic3r::GUI::NotificationType
strong
Enumerator
CustomNotification 
ExportFinished 
Mouse3dDisconnected 
NewAppAvailable 
NewAlphaAvailable 
NewBetaAvailable 
NoNewReleaseAvailable 
PresetUpdateAvailable 
ValidateError 
ValidateWarning 
SlicingError 
SlicingWarning 
PlaterError 
PlaterWarning 
ProgressBar 
PrintHostUpload 
AppDownload 
SlicingProgress 
EmptyColorChangeCode 
CustomSupportsAndSeamRemovedAfterRepair 
EmptyAutoColorChange 
SignDetected 
QuitSLAManualMode 
DesktopIntegrationSuccess 
DesktopIntegrationFail 
UndoDesktopIntegrationSuccess 
UndoDesktopIntegrationFail 
MmSegmentationExceededExtrudersLimit 
DidYouKnowHint 
UpdatedItemsInfo 
ProgressIndicator 
SimplifySuggestion 
UnknownFont 
NetfabbFinished 
ExportOngoing 
URLDownload 
URLNotRegistered 
39{
41// SlicingNotPossible,
42 // Notification on end of export to a removable media, with hyperling to eject the external media.
43 // Obsolete by ExportFinished
44// ExportToRemovableFinished,
45 // Notification on end of export, with hyperling to see folder and eject if export was to external media.
46 // Own subclass.
48 // Works on OSX only.
49 //FIXME Do we want to have it on Linux and Windows? Is it possible to get the Disconnect event on Windows?
51// Mouse3dConnected,
52// NewPresetsAviable,
53 // Notification on the start of PrusaSlicer, when a new PrusaSlicer version is published.
54 // Contains a hyperlink to open a web browser pointing to the PrusaSlicer download location.
56 // Like NewAppAvailable but with text and link for alpha / bet release
60 // Notification on the start of PrusaSlicer, when updates of system profiles are detected.
61 // Contains a hyperlink to execute installation of the new system profiles.
63// LoadingFailed,
64 // Errors emmited by Print::validate
65 // difference from Slicing error is that they disappear not grey out at update_background_process
67 // Notification emitted by Print::validate
69 // Slicing error produced by BackgroundSlicingProcess::validate() or by the BackgroundSlicingProcess background
70 // thread thowing a SlicingError exception.
72 // Slicing warnings, issued by the slicing process.
73 // Slicing warnings are registered for a particular Print milestone or a PrintObject and its milestone.
75 // Object partially outside the print volume. Cannot slice.
77 // Object fully outside the print volume, or extrusion outside the print volume. Slicing is not disabled.
79 // Progress bar instead of text.
80 ProgressBar,
81 // Progress bar with info from Print Host Upload Queue dialog.
83 // Progress bar of download next version app.
85 // Progress bar with cancel button, cannot be closed
86 // On end of slicing and G-code processing (the full G-code preview is available),
87 // contains a hyperlink to export the G-code to a removable media or hdd.
89 // Notification, when Color Change G-code is empty and user try to add color change on DoubleSlider.
91 // Notification that custom supports/seams were deleted after mesh repair.
93 // Notification that auto adding of color changes is impossible
95 // Notification about detected sign
97 // Notification telling user to quit SLA supports manual editing
99 // Desktop integration basic info
104 // Notification that a printer has more extruders than are supported by MM Gizmo/segmentation.
106 // Did you know Notification appearing on startup with arrows to change hint
108 // Shows when ObjectList::update_info_items finds information that should be stressed to the user
109 // Might contain logo taken from gizmos
111 // Progress bar notification with methods to replace ProgressIndicator class.
113 // Give user advice to simplify object with big amount of triangles
114 // Contains ObjectID for closing when object is deleted
116 // Change of text will change font to similar one on.
118 // information about netfabb is finished repairing model (blocking proccess)
120 // Short meesage to fill space between start and finish of export
122 // Progressbar of download from prusaslicer:// url
124 // MacOS specific - PS comes forward even when downloader is not allowed
126};
Generic progress indication interface.
Definition ProgressIndicator.hpp:12
Definition PrintHost.hpp:31

◆ PainterGizmoType

enum class Slic3r::GUI::PainterGizmoType
strong
Enumerator
FDM_SUPPORTS 
SEAM 
MMU_SEGMENTATION 

◆ PrintIndicator

Enumerator
piUndef 
piPrintable 
piUnprintable 
43{
44 piUndef = 0, // no print indicator
45 piPrintable , // printable
46 piUnprintable , // unprintable
47};
@ piUnprintable
Definition ObjectDataViewModel.hpp:46
@ piPrintable
Definition ObjectDataViewModel.hpp:45
@ piUndef
Definition ObjectDataViewModel.hpp:44

◆ QuickSlice

Enumerator
qsUndef 
qsReslice 
qsSaveAs 
qsExportSVG 
qsExportPNG 
39{
40 qsUndef = 0,
41 qsReslice = 1,
42 qsSaveAs = 2,
43 qsExportSVG = 4,
44 qsExportPNG = 8
45};
@ qsExportSVG
Definition MainFrame.hpp:43
@ qsExportPNG
Definition MainFrame.hpp:44
@ qsReslice
Definition MainFrame.hpp:41
@ qsSaveAs
Definition MainFrame.hpp:42
@ qsUndef
Definition MainFrame.hpp:40

◆ SLAGizmoEventType [1/2]

enum class Slic3r::GUI::SLAGizmoEventType : unsigned char
strong
Enumerator
LeftDown 
LeftUp 
RightDown 
Dragging 
Delete 
SelectAll 
ShiftUp 
AltUp 
ApplyChanges 
DiscardChanges 
AutomaticGeneration 
ManualEditing 
MouseWheelUp 
MouseWheelDown 
ResetClippingPlane 
LeftDown 
LeftUp 
RightDown 
RightUp 
Dragging 
Delete 
SelectAll 
CtrlDown 
CtrlUp 
ShiftDown 
ShiftUp 
AltUp 
Escape 
ApplyChanges 
DiscardChanges 
AutomaticGeneration 
ManualEditing 
MouseWheelUp 
MouseWheelDown 
ResetClippingPlane 
Moving 

◆ SLAGizmoEventType [2/2]

enum class Slic3r::GUI::SLAGizmoEventType : unsigned char
strong
Enumerator
LeftDown 
LeftUp 
RightDown 
Dragging 
Delete 
SelectAll 
ShiftUp 
AltUp 
ApplyChanges 
DiscardChanges 
AutomaticGeneration 
ManualEditing 
MouseWheelUp 
MouseWheelDown 
ResetClippingPlane 
LeftDown 
LeftUp 
RightDown 
RightUp 
Dragging 
Delete 
SelectAll 
CtrlDown 
CtrlUp 
ShiftDown 
ShiftUp 
AltUp 
Escape 
ApplyChanges 
DiscardChanges 
AutomaticGeneration 
ManualEditing 
MouseWheelUp 
MouseWheelDown 
ResetClippingPlane 
Moving 

◆ SlicedInfoIdx

Enumerator
siFilament_g 
siFilament_m 
siFilament_mm3 
siMateril_unit 
siCost 
siEstimatedTime 
siWTNumbetOfToolchanges 
siCount 
266{
271 siCost,
274
275 siCount
276};
@ siFilament_g
Definition Plater.cpp:267
@ siFilament_mm3
Definition Plater.cpp:269
@ siMateril_unit
Definition Plater.cpp:270
@ siCost
Definition Plater.cpp:271
@ siCount
Definition Plater.cpp:275
@ siFilament_m
Definition Plater.cpp:268
@ siWTNumbetOfToolchanges
Definition Plater.cpp:273
@ siEstimatedTime
Definition Plater.cpp:272

◆ Technology

Enumerator
T_FFF 
T_SLA 
T_ANY 
54 {
55 // Bitflag equivalent of PrinterTechnology
56 T_FFF = 0x1,
57 T_SLA = 0x2,
58 T_ANY = ~0,
59};
@ T_SLA
Definition ConfigWizard_private.hpp:57
@ T_FFF
Definition ConfigWizard_private.hpp:56
@ T_ANY
Definition ConfigWizard_private.hpp:58

Function Documentation

◆ about()

void Slic3r::GUI::about ( )
463{
464 AboutDialog dlg;
465 dlg.ShowModal();
466}
Definition AboutDialog.hpp:58

Referenced by generate_help_menu().

+ Here is the caller graph for this function:

◆ activate_options_tab()

static void Slic3r::GUI::activate_options_tab ( std::shared_ptr< ConfigOptionsGroup optgroup)
static
140{
141 optgroup->activate([](){}, wxALIGN_RIGHT);
142 optgroup->update_visibility(comSimple);
143 wxBoxSizer* sizer = static_cast<wxBoxSizer*>(static_cast<wxPanel*>(optgroup->parent())->GetSizer());
144 sizer->Add(optgroup->sizer, 0, wxEXPAND | wxALL, 10);
145
146 // apply sercher
147 wxGetApp().sidebar().get_searcher().append_preferences_options(optgroup->get_lines());
148}

References Slic3r::comSimple.

Referenced by Slic3r::GUI::PreferencesDialog::build().

+ Here is the caller graph for this function:

◆ add_common_view_menu_items()

static void Slic3r::GUI::add_common_view_menu_items ( wxMenu *  view_menu,
MainFrame mainFrame,
std::function< bool(void)>  can_change_view 
)
static
1196{
1197 // The camera control accelerators are captured by GLCanvas3D::on_char().
1198 append_menu_item(view_menu, wxID_ANY, _L("Iso") + sep + "&0", _L("Iso View"), [mainFrame](wxCommandEvent&) { mainFrame->select_view("iso"); },
1199 "", nullptr, [can_change_view]() { return can_change_view(); }, mainFrame);
1200 view_menu->AppendSeparator();
1201 //TRN Main menu: View->Top
1202 append_menu_item(view_menu, wxID_ANY, _L("Top") + sep + "&1", _L("Top View"), [mainFrame](wxCommandEvent&) { mainFrame->select_view("top"); },
1203 "", nullptr, [can_change_view]() { return can_change_view(); }, mainFrame);
1204 //TRN Main menu: View->Bottom
1205 append_menu_item(view_menu, wxID_ANY, _L("Bottom") + sep + "&2", _L("Bottom View"), [mainFrame](wxCommandEvent&) { mainFrame->select_view("bottom"); },
1206 "", nullptr, [can_change_view]() { return can_change_view(); }, mainFrame);
1207 append_menu_item(view_menu, wxID_ANY, _L("Front") + sep + "&3", _L("Front View"), [mainFrame](wxCommandEvent&) { mainFrame->select_view("front"); },
1208 "", nullptr, [can_change_view]() { return can_change_view(); }, mainFrame);
1209 append_menu_item(view_menu, wxID_ANY, _L("Rear") + sep + "&4", _L("Rear View"), [mainFrame](wxCommandEvent&) { mainFrame->select_view("rear"); },
1210 "", nullptr, [can_change_view]() { return can_change_view(); }, mainFrame);
1211 append_menu_item(view_menu, wxID_ANY, _L("Left") + sep + "&5", _L("Left View"), [mainFrame](wxCommandEvent&) { mainFrame->select_view("left"); },
1212 "", nullptr, [can_change_view]() { return can_change_view(); }, mainFrame);
1213 append_menu_item(view_menu, wxID_ANY, _L("Right") + sep + "&6", _L("Right View"), [mainFrame](wxCommandEvent&) { mainFrame->select_view("right"); },
1214 "", nullptr, [can_change_view]() { return can_change_view(); }, mainFrame);
1215}
void select_view(const std::string &direction)
Definition MainFrame.cpp:2123
#define _L(s)
Definition I18N.hpp:3
wxMenuItem * append_menu_item(wxMenu *menu, int id, const wxString &string, const wxString &description, std::function< void(wxCommandEvent &event)> cb, wxBitmapBundle *icon, wxEvtHandler *event_handler, std::function< bool()> const cb_condition, wxWindow *parent, int insert_pos)
Definition wxExtensions.cpp:55

References _L, append_menu_item(), Slic3r::GUI::MainFrame::can_change_view(), Slic3r::GUI::MainFrame::select_view(), and sep.

Referenced by Slic3r::GUI::MainFrame::init_menubar_as_editor(), and Slic3r::GUI::MainFrame::init_menubar_as_gcodeviewer().

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

◆ add_config_substitutions()

static void Slic3r::GUI::add_config_substitutions ( const ConfigSubstitutions conf_substitutions,
wxString &  changes 
)
static
273{
274 changes += "<table>";
275 for (const ConfigSubstitution& conf_substitution : conf_substitutions) {
276 wxString new_val;
277 const ConfigOptionDef* def = conf_substitution.opt_def;
278 if (!def)
279 continue;
280 switch (def->type) {
281 case coEnum:
282 {
283 auto opt = def->enum_def->enum_to_index(conf_substitution.new_value->getInt());
284 new_val = opt.has_value() ?
285 wxString("\"") + def->enum_def->value(*opt) + "\"" + " (" +
286 _(from_u8(def->enum_def->label(*opt))) + ")" :
287 _L("Undefined");
288 break;
289 }
290 case coBool:
291 new_val = conf_substitution.new_value->getBool() ? "true" : "false";
292 break;
293 case coBools:
294 if (conf_substitution.new_value->nullable())
295 for (const char v : static_cast<const ConfigOptionBoolsNullable*>(conf_substitution.new_value.get())->values)
296 new_val += std::string(v == ConfigOptionBoolsNullable::nil_value() ? "nil" : v ? "true" : "false") + ", ";
297 else
298 for (const char v : static_cast<const ConfigOptionBools*>(conf_substitution.new_value.get())->values)
299 new_val += std::string(v ? "true" : "false") + ", ";
300 if (! new_val.empty())
301 new_val.erase(new_val.begin() + new_val.size() - 2, new_val.end());
302 break;
303 default:
304 assert(false);
305 }
306
307 changes += format_wxstr("<tr><td><b>\"%1%\" (%2%)</b></td><td>: ", def->opt_key, _(def->label)) +
308 format_wxstr(_L("%1% was substituted with %2%"), bold_string(conf_substitution.old_value), bold(new_val)) +
309 "</td></tr>";
310 }
311 changes += "</table>";
312}
Definition Config.hpp:1388
Definition Config.hpp:1797
Slic3r::clonable_ptr< ConfigOptionEnumDef > enum_def
Definition Config.hpp:1959
t_config_option_key opt_key
Definition Config.hpp:1820
ConfigOptionType type
Definition Config.hpp:1822
std::string label
Definition Config.hpp:1914
TOKEN * string(char *text)
Definition config.c:233
#define const
Definition getopt.c:38
#define _(msgid)
Definition getopt.c:87
wxString from_u8(const std::string &str)
Definition GUI.cpp:437
@ coBools
Definition Config.hpp:192
@ coEnum
Definition Config.hpp:194
@ coBool
Definition Config.hpp:190
Definition Config.hpp:240
STL namespace.

References _, _L, bold(), bold_string(), Slic3r::coBool, Slic3r::coBools, Slic3r::coEnum, Slic3r::ConfigOptionDef::enum_def, format_wxstr(), from_u8(), Slic3r::ConfigOptionDef::label, Slic3r::ConfigOptionBoolsTempl< NULLABLE >::nil_value(), Slic3r::ConfigOptionDef::opt_key, and Slic3r::ConfigOptionDef::type.

Referenced by show_substitutions_info(), and show_substitutions_info().

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

◆ add_correct_opts_to_options_list()

template<class T >
void Slic3r::GUI::add_correct_opts_to_options_list ( const std::string &  opt_key,
std::map< std::string, int > &  map,
Tab tab,
const int &  value 
)
665{
666 T *opt_cur = static_cast<T*>(tab->m_config->option(opt_key));
667 for (size_t i = 0; i < opt_cur->values.size(); i++)
668 map.emplace(opt_key + "#" + std::to_string(i), value);
669}
ConfigOption * option(const t_config_option_key &opt_key, bool create=false)
Definition Config.hpp:2169
DynamicPrintConfig * m_config
Definition Tab.hpp:283

References add_correct_opts_to_options_list(), Slic3r::GUI::Tab::m_config, and Slic3r::ConfigBase::option().

Referenced by add_correct_opts_to_options_list().

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

◆ add_default_image()

static void Slic3r::GUI::add_default_image ( wxImageList *  img_list,
bool  is_system,
wxWindow *  parent_win 
)
static
224{
225 wxBitmapBundle* bmp_bndl = get_bmp_bundle("cog", IMG_PX_CNT);
226#ifdef __APPLE__
227 wxBitmap bmp = bmp_bndl->GetBitmap(bmp_bndl->GetDefaultSize() * mac_max_scaling_factor());
228#else
229 wxBitmap bmp = bmp_bndl->GetBitmapFor(parent_win);
230#endif
231
232 bmp = bmp.ConvertToDisabled();
233 if (is_system) {
234 wxImage image = bmp.ConvertToImage();
235 if (image.IsOk() && image.GetWidth() != 0 && image.GetHeight() != 0) {
236 add_lock(image, parent_win);
237#ifdef __APPLE__
238 bmp = wxBitmap(std::move(image), -1, mac_max_scaling_factor());
239#else
240 bmp = wxBitmap(std::move(image));
241#endif
242 }
243 }
244
245 img_list->Add(bmp);
246};
double mac_max_scaling_factor()
Definition MacDarkMode.mm:24
static void add_lock(wxImage &image, wxWindow *parent_win)
Definition GalleryDialog.cpp:178
wxBitmapBundle * get_bmp_bundle(const std::string &bmp_name_in, int px_cnt, const std::string &new_color)
Definition wxExtensions.cpp:420

References add_lock(), get_bmp_bundle(), IMG_PX_CNT, and mac_max_scaling_factor().

+ Here is the call graph for this function:

◆ add_lock()

static void Slic3r::GUI::add_lock ( wxImage &  image,
wxWindow *  parent_win 
)
static
179{
180 wxBitmapBundle* bmp_bndl = get_bmp_bundle("lock", 22);
181#ifdef __APPLE__
182 wxBitmap bmp = bmp_bndl->GetBitmap(bmp_bndl->GetDefaultSize() * mac_max_scaling_factor());
183#else
184 wxBitmap bmp = bmp_bndl->GetBitmapFor(parent_win);
185#endif
186
187 wxImage lock_image = bmp.ConvertToImage();
188 if (!lock_image.IsOk() || lock_image.GetWidth() == 0 || lock_image.GetHeight() == 0)
189 return;
190
191 auto lock_px_data = (uint8_t*)lock_image.GetData();
192 auto lock_a_data = (uint8_t*)lock_image.GetAlpha();
193 int lock_width = lock_image.GetWidth();
194 int lock_height = lock_image.GetHeight();
195
196 auto px_data = (uint8_t*)image.GetData();
197 auto a_data = (uint8_t*)image.GetAlpha();
198
199 int width = image.GetWidth();
200 int height = image.GetHeight();
201
202 size_t beg_x = width - lock_width;
203 size_t beg_y = height - lock_height;
204 for (size_t x = 0; x < (size_t)lock_width; ++x) {
205 for (size_t y = 0; y < (size_t)lock_height; ++y) {
206 const size_t lock_idx = (x + y * lock_width);
207 if (lock_a_data && lock_a_data[lock_idx] == 0)
208 continue;
209
210 const size_t idx = (beg_x + x + (beg_y + y) * width);
211 if (a_data)
212 a_data[idx] = lock_a_data[lock_idx];
213
214 const size_t idx_rgb = (beg_x + x + (beg_y + y) * width) * 3;
215 const size_t lock_idx_rgb = (x + y * lock_width) * 3;
216 px_data[idx_rgb] = lock_px_data[lock_idx_rgb];
217 px_data[idx_rgb + 1] = lock_px_data[lock_idx_rgb + 1];
218 px_data[idx_rgb + 2] = lock_px_data[lock_idx_rgb + 2];
219 }
220 }
221}
unsigned __int8 uint8_t
Definition unistd.h:77

References get_bmp_bundle(), and mac_max_scaling_factor().

Referenced by add_default_image().

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

◆ add_menus()

void Slic3r::GUI::add_menus ( wxMenuBar *  menu,
int  event_preferences_changed,
int  event_language_change 
)

◆ add_msg_content()

static void Slic3r::GUI::add_msg_content ( wxWindow *  parent,
wxBoxSizer *  content_sizer,
wxString  msg,
bool  monospaced_font = false,
bool  is_marked_msg = false 
)
static
118{
119 wxHtmlWindow* html = new wxHtmlWindow(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO);
120
121 // count lines in the message
122 int msg_lines = 0;
123 if (!monospaced_font) {
124 int line_len = 55;// count of symbols in one line
125 int start_line = 0;
126 for (auto i = msg.begin(); i != msg.end(); ++i) {
127 if (*i == '\n') {
128 int cur_line_len = i - msg.begin() - start_line;
129 start_line = i - msg.begin();
130 if (cur_line_len == 0 || line_len > cur_line_len)
131 msg_lines++;
132 else
133 msg_lines += std::lround((double)(cur_line_len) / line_len);
134 }
135 }
136 msg_lines++;
137 }
138
139 wxFont font = wxGetApp().normal_font();//wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
140 wxFont monospace = wxGetApp().code_font();
141 wxColour text_clr = wxGetApp().get_label_clr_default();
142 wxColour bgr_clr = parent->GetBackgroundColour();
143
144#ifdef __APPLE__
145 // On macOS 10.13 and older the background color returned by wxWidgets
146 // is wrong, which leads to https://github.com/prusa3d/PrusaSlicer/issues/7603
147 // and https://github.com/prusa3d/PrusaSlicer/issues/3775. wxSYS_COLOUR_WINDOW
148 // may not match the window background exactly, but it seems to never end up
149 // as black on black.
150
151 if (wxPlatformInfo::Get().GetOSMajorVersion() == 10
152 && wxPlatformInfo::Get().GetOSMinorVersion() < 14)
153 bgr_clr = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW);
154#endif
155
156 auto text_clr_str = encode_color(ColorRGB(text_clr.Red(), text_clr.Green(), text_clr.Blue()));
157 auto bgr_clr_str = encode_color(ColorRGB(bgr_clr.Red(), bgr_clr.Green(), bgr_clr.Blue()));
158 const int font_size = font.GetPointSize();
159 int size[] = { font_size, font_size, font_size, font_size, font_size, font_size, font_size };
160 html->SetFonts(font.GetFaceName(), monospace.GetFaceName(), size);
161 html->SetBorders(2);
162
163 // calculate html page size from text
164 wxSize page_size;
165 int em = wxGetApp().em_unit();
166 if (!wxGetApp().mainframe) {
167 // If mainframe is nullptr, it means that GUI_App::on_init_inner() isn't completed
168 // (We just show information dialog about configuration version now)
169 // And as a result the em_unit value wasn't created yet
170 // So, calculate it from the scale factor of Dialog
171#if defined(__WXGTK__)
172 // Linux specific issue : get_dpi_for_window(this) still doesn't responce to the Display's scale in new wxWidgets(3.1.3).
173 // So, initialize default width_unit according to the width of the one symbol ("m") of the currently active font of this window.
174 em = std::max<size_t>(10, parent->GetTextExtent("m").x - 1);
175#else
176 double scale_factor = (double)get_dpi_for_window(parent) / (double)DPI_DEFAULT;
177 em = std::max<size_t>(10, 10.0f * scale_factor);
178#endif // __WXGTK__
179 }
180
181 // if message containes the table
182 if (msg.Contains("<tr>")) {
183 int lines = msg.Freq('\n') + 1;
184 int pos = 0;
185 while (pos < (int)msg.Len() && pos != wxNOT_FOUND) {
186 pos = msg.find("<tr>", pos + 1);
187 lines += 2;
188 }
189 int page_height = std::min(int(font.GetPixelSize().y+2) * lines, 68 * em);
190 page_size = wxSize(68 * em, page_height);
191 }
192 else {
193 wxClientDC dc(parent);
194 wxSize msg_sz = dc.GetMultiLineTextExtent(msg);
195 page_size = wxSize(std::min(msg_sz.GetX() + 2 * em, 68 * em),
196 std::min(msg_sz.GetY() + 2 * em, 68 * em));
197 }
198 html->SetMinSize(page_size);
199
200 std::string msg_escaped = xml_escape(into_u8(msg), is_marked_msg);
201 boost::replace_all(msg_escaped, "\r\n", "<br>");
202 boost::replace_all(msg_escaped, "\n", "<br>");
203 if (monospaced_font)
204 // Code formatting will be preserved. This is useful for reporting errors from the placeholder parser.
205 msg_escaped = std::string("<pre><code>") + msg_escaped + "</code></pre>";
206 html->SetPage(format_wxstr("<html>"
207 "<body bgcolor=%1% link=%2%>"
208 "<font color=%2%>"
209 "%3%"
210 "</font>"
211 "</body>"
212 "</html>",
213 bgr_clr_str, text_clr_str, from_u8(msg_escaped)));
214
215 html->Bind(wxEVT_HTML_LINK_CLICKED, [parent](wxHtmlLinkEvent& event) {
216 wxGetApp().open_browser_with_warning_dialog(event.GetLinkInfo().GetHref(), parent, false);
217 event.Skip(false);
218 });
219
220 content_sizer->Add(html, 1, wxEXPAND);
221 wxGetApp().UpdateDarkUI(html);
222}
wxString format_wxstr(const char *fmt, TArgs &&... args)
Definition format.hpp:42
int get_dpi_for_window(const wxWindow *window)
Definition GUI_Utils.cpp:80
std::string into_u8(const wxString &str)
Definition GUI.cpp:442
Vec3d pos(const Pt &p)
Definition ReprojectPointsOnMesh.hpp:14
std::string encode_color(const ColorRGB &color)
Definition Color.cpp:369
std::string xml_escape(std::string text, bool is_marked)
Definition utils.cpp:934
constexpr auto size(const C &c) -> decltype(c.size())
Definition span.hpp:183
#define wxEVT_HTML_LINK_CLICKED
Definition wxinit.h:22

References DPI_DEFAULT, Slic3r::encode_color(), format_wxstr(), from_u8(), get_dpi_for_window(), into_u8(), wxEVT_HTML_LINK_CLICKED, and Slic3r::xml_escape().

Referenced by Slic3r::GUI::ErrorDialog::ErrorDialog(), Slic3r::GUI::InfoDialog::InfoDialog(), and Slic3r::GUI::WarningDialog::WarningDialog().

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

◆ add_options_into_line()

static void Slic3r::GUI::add_options_into_line ( ConfigOptionsGroupShp optgroup,
const std::vector< SamePair< std::string > > &  prefixes,
const std::string &  optkey 
)
static
5105{
5106 auto opt = optgroup->get_option(prefixes.front().first + optkey);
5107 Line line{ opt.opt.label, "" };
5108 line.full_width = 1;
5109 for (auto &prefix : prefixes) {
5110 opt = optgroup->get_option(prefix.first + optkey);
5111 opt.opt.label = prefix.second;
5112 opt.opt.width = 12; // TODO
5113 line.append_option(opt);
5114 }
5115 optgroup->append_line(line);
5116}
Represents option lines.
Definition OptionsGroup.hpp:56
wxString label
Definition OptionsGroup.hpp:59

References Slic3r::GUI::Line::label.

Referenced by Slic3r::GUI::TabSLAPrint::build_sla_support_params().

+ Here is the caller graph for this function:

◆ add_row_to_table()

static void Slic3r::GUI::add_row_to_table ( std::function< void(void)>  col_1 = nullptr,
std::function< void(void)>  col_2 = nullptr 
)
static
1681{
1682 assert(col_1 != nullptr && col_2 != nullptr);
1685 col_1();
1687 col_2();
1688}
IMGUI_API void TableNextRow(ImGuiTableRowFlags row_flags=0, float min_row_height=0.0f)
Definition imgui_tables.cpp:1657
IMGUI_API bool TableSetColumnIndex(int column_n)
Definition imgui_tables.cpp:1869

References ImGui::TableNextRow(), and ImGui::TableSetColumnIndex().

Referenced by add_strings_row_to_table(), and Slic3r::GUI::GLGizmoMeasure::on_render_input_window().

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

◆ add_strings_row_to_table()

static void Slic3r::GUI::add_strings_row_to_table ( ImGuiWrapper imgui,
const std::string &  col_1,
const ImVec4 col_1_color,
const std::string &  col_2,
const ImVec4 col_2_color 
)
static
1691{
1692 add_row_to_table([&]() { imgui.text_colored(col_1_color, col_1); }, [&]() { imgui.text_colored(col_2_color, col_2); });
1693};
static void text_colored(const ImVec4 &color, const char *label)
Definition ImGuiWrapper.cpp:563
static void add_row_to_table(std::function< void(void)> col_1=nullptr, std::function< void(void)> col_2=nullptr)
Definition GLGizmoMeasure.cpp:1680

References add_row_to_table(), and Slic3r::GUI::ImGuiWrapper::text_colored().

Referenced by Slic3r::GUI::GLCanvas3D::_picking_pass(), Slic3r::GUI::GLGizmoMeasure::on_render_input_window(), and Slic3r::GUI::GCodeViewer::render_legend().

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

◆ all_vertices_inside()

template<typename Fn >
bool Slic3r::GUI::all_vertices_inside ( const GLModel::Geometry geometry,
Fn  fn 
)
inline
1104{
1105 const size_t position_stride_floats = geometry.position_stride_floats(geometry.format);
1106 const size_t position_offset_floats = geometry.position_offset_floats(geometry.format);
1107 assert(position_stride_floats == 3);
1108 if (geometry.vertices.empty() || position_stride_floats != 3)
1109 return false;
1110
1111 for (auto it = geometry.vertices.begin(); it != geometry.vertices.end(); ) {
1112 it += position_offset_floats;
1113 if (!fn({ *it, *(it + 1), *(it + 2) }))
1114 return false;
1115 it += (geometry.vertex_stride_floats(geometry.format) - position_offset_floats - position_stride_floats);
1116 }
1117 return true;
1118}
static size_t position_offset_floats(const Format &format)
Definition GLModel.cpp:306
static size_t vertex_stride_floats(const Format &format)
Definition GLModel.cpp:268
std::vector< float > vertices
Definition GLModel.hpp:66
static size_t position_stride_floats(const Format &format)
Definition GLModel.cpp:286
Format format
Definition GLModel.hpp:65

References Slic3r::GUI::GLModel::Geometry::format, Slic3r::GUI::GLModel::Geometry::position_offset_floats(), Slic3r::GUI::GLModel::Geometry::position_stride_floats(), Slic3r::GUI::GLModel::Geometry::vertex_stride_floats(), and Slic3r::GUI::GLModel::Geometry::vertices.

Referenced by contains().

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

◆ append_bool_option()

static void Slic3r::GUI::append_bool_option ( std::shared_ptr< ConfigOptionsGroup optgroup,
const std::string &  opt_key,
const std::string &  label,
const std::string &  tooltip,
bool  def_val,
ConfigOptionMode  mode = comSimple 
)
static
156{
157 ConfigOptionDef def = {opt_key, coBool};
158 def.label = label;
159 def.tooltip = tooltip;
160 def.mode = mode;
161 def.set_default_value(new ConfigOptionBool{ def_val });
162 Option option(def, opt_key);
163 optgroup->append_single_option_line(option);
164
165 // fill data to the Search Dialog
166 wxGetApp().sidebar().get_searcher().add_key(opt_key, Preset::TYPE_PREFERENCES, optgroup->config_category(), L("Preferences"));
167}
Definition Config.hpp:1349
std::string tooltip
Definition Config.hpp:1922
void set_default_value(const ConfigOption *ptr)
Definition Config.hpp:1827
ConfigOptionMode mode
Definition Config.hpp:1951
Definition getopt.h:102
#define L(s)
Definition I18N.hpp:18

References Slic3r::coBool, L, Slic3r::ConfigOptionDef::label, Slic3r::ConfigOptionDef::mode, Slic3r::ConfigOptionDef::set_default_value(), Slic3r::ConfigOptionDef::tooltip, and Slic3r::Preset::TYPE_PREFERENCES.

Referenced by Slic3r::GUI::PreferencesDialog::build().

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

◆ append_enum_option()

template<typename EnumType >
static void Slic3r::GUI::append_enum_option ( std::shared_ptr< ConfigOptionsGroup optgroup,
const std::string &  opt_key,
const std::string &  label,
const std::string &  tooltip,
const ConfigOption def_val,
std::initializer_list< std::pair< std::string_view, std::string_view > >  enum_values,
ConfigOptionMode  mode = comSimple 
)
static
177{
178 ConfigOptionDef def = {opt_key, coEnum };
179 def.label = label;
180 def.tooltip = tooltip;
181 def.mode = mode;
182 def.set_enum<EnumType>(enum_values);
183
184 def.set_default_value(def_val);
185 Option option(def, opt_key);
186 optgroup->append_single_option_line(option);
187
188 // fill data to the Search Dialog
189 wxGetApp().sidebar().get_searcher().add_key(opt_key, Preset::TYPE_PREFERENCES, optgroup->config_category(), L("Preferences"));
190}
void set_enum(std::initializer_list< std::string_view > il)
Definition Config.hpp:2000

References Slic3r::coEnum, L, Slic3r::ConfigOptionDef::label, Slic3r::ConfigOptionDef::mode, Slic3r::ConfigOptionDef::set_default_value(), Slic3r::ConfigOptionDef::set_enum(), Slic3r::ConfigOptionDef::tooltip, and Slic3r::Preset::TYPE_PREFERENCES.

+ Here is the call graph for this function:

◆ append_preferences_option_to_searcher()

static void Slic3r::GUI::append_preferences_option_to_searcher ( std::shared_ptr< ConfigOptionsGroup optgroup,
const std::string &  opt_key,
const wxString &  label 
)
static
195{
196 // fill data to the Search Dialog
197 wxGetApp().sidebar().get_searcher().add_key(opt_key, Preset::TYPE_PREFERENCES, optgroup->config_category(), L("Preferences"));
198 // apply sercher
199 wxGetApp().sidebar().get_searcher().append_preferences_option(Line(opt_key, label, ""));
200}

References L, and Slic3r::Preset::TYPE_PREFERENCES.

Referenced by Slic3r::GUI::PreferencesDialog::create_downloader_path_sizer(), Slic3r::GUI::PreferencesDialog::create_settings_font_widget(), Slic3r::GUI::PreferencesDialog::create_settings_mode_color_widget(), Slic3r::GUI::PreferencesDialog::create_settings_mode_widget(), and Slic3r::GUI::PreferencesDialog::create_settings_text_color_widget().

+ Here is the caller graph for this function:

◆ append_root_node()

static bool Slic3r::GUI::append_root_node ( ObjectDataViewModelNode parent_node,
ObjectDataViewModelNode **  root_node,
const ItemType  root_type 
)
static
493{
494 const int inst_root_id = get_root_idx(parent_node, root_type);
495
496 *root_node = inst_root_id < 0 ?
497 new ObjectDataViewModelNode(parent_node, root_type) :
498 parent_node->GetNthChild(inst_root_id);
499
500 if (inst_root_id < 0) {
501 if ((root_type&itInstanceRoot) ||
502 ( (root_type&itLayerRoot) && get_root_idx(parent_node, itInstanceRoot)<0) )
503 parent_node->Append(*root_node);
504 else if (root_type&itLayerRoot)
505 parent_node->Insert(*root_node, static_cast<unsigned int>(get_root_idx(parent_node, itInstanceRoot)));
506 return true;
507 }
508
509 return false;
510}
Definition ObjectDataViewModel.hpp:64
void Insert(ObjectDataViewModelNode *child, unsigned int n)
Definition ObjectDataViewModel.hpp:153
void Append(ObjectDataViewModelNode *child)
Definition ObjectDataViewModel.hpp:159
static int get_root_idx(ObjectDataViewModelNode *parent_node, const ItemType root_type)
Definition ObjectDataViewModel.cpp:316

References Slic3r::GUI::ObjectDataViewModelNode::Append(), get_root_idx(), Slic3r::GUI::ObjectDataViewModelNode::GetNthChild(), Slic3r::GUI::ObjectDataViewModelNode::Insert(), itInstanceRoot, and itLayerRoot.

Referenced by Slic3r::GUI::ObjectDataViewModel::AddRoot().

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

◆ assign_logical_beds()

void Slic3r::GUI::assign_logical_beds ( std::vector< arrangement::ArrangePolygon > &  items,
const arrangement::ArrangeBed bed,
double  stride 
)
437{
438 // The strides have to be removed from the fixed items. For the
439 // arrangeable (selected) items bed_idx is ignored and the
440 // translation is irrelevant.
441 coord_t bedx = bounding_box(bed).min.x();
442 for (auto &itm : items) {
443 auto bedidx = std::max(arrangement::UNARRANGED,
444 static_cast<int>(std::floor(
445 (get_extents(itm.transformed_poly()).min.x() - bedx) /
446 stride)));
447
448 itm.bed_idx = bedidx;
449
450 if (bedidx >= 0)
451 itm.translation.x() -= bedidx * stride;
452 }
453}
PointType min
Definition BoundingBox.hpp:16
int32_t coord_t
Definition libslic3r.h:39
BoundingBox get_extents(const ExPolygon &expolygon)
Definition ExPolygon.cpp:352

References Slic3r::bounding_box(), Slic3r::get_extents(), Slic3r::BoundingBoxBase< PointType, APointsType >::min, and Slic3r::arrangement::UNARRANGED.

Referenced by Slic3r::GUI::ArrangeJob::prepare(), and Slic3r::GUI::FillBedJob::prepare().

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

◆ bed_stride()

double Slic3r::GUI::bed_stride ( const Plater plater)
373 {
374 double bedwidth = plater->build_volume().bounding_volume().size().x();
375 return scaled<double>((1. + LOGICAL_BED_GAP) * bedwidth);
376}
PointType size() const
Definition BoundingBox.cpp:153
const BoundingBoxf3 & bounding_volume() const
Definition BuildVolume.hpp:54
const BuildVolume & build_volume() const
Definition Plater.cpp:7535

References Slic3r::BuildVolume::bounding_volume(), Slic3r::GUI::Plater::build_volume(), LOGICAL_BED_GAP, plater(), and Slic3r::BoundingBox3Base< PointType >::size().

Referenced by get_arrange_poly(), Slic3r::GUI::ArrangeJob::prepare(), and Slic3r::GUI::FillBedJob::prepare().

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

◆ bold()

static wxString Slic3r::GUI::bold ( const wxString &  str)
static
263{
264 return wxString::Format("<b>%s</b>", str);
265};

Referenced by add_config_substitutions().

+ Here is the caller graph for this function:

◆ bold_string()

static wxString Slic3r::GUI::bold_string ( const wxString &  str)
static
268{
269 return wxString::Format("<b>\"%s\"</b>", str);
270};

Referenced by add_config_substitutions(), and show_substitutions_info().

+ Here is the caller graph for this function:

◆ break_to_debugger()

void Slic3r::GUI::break_to_debugger ( )
71{
72 #ifdef _WIN32
73 if (IsDebuggerPresent())
74 DebugBreak();
75 #endif /* _WIN32 */
76}

◆ brim_offset()

static coord_t Slic3r::GUI::brim_offset ( const PrintObject po,
const ModelInstance inst 
)
static
189{
190 const BrimType brim_type = po.config().brim_type.value;
191 const float brim_separation = po.config().brim_separation.getFloat();
192 const float brim_width = po.config().brim_width.getFloat();
193 const bool has_outer_brim = brim_type == BrimType::btOuterOnly ||
194 brim_type == BrimType::btOuterAndInner;
195
196 // How wide is the brim? (in scaled units)
197 return has_outer_brim ? scaled(brim_width + brim_separation) : 0;
198}
const PrintObjectConfig & config() const
Definition Print.hpp:246
BrimType
Definition PrintConfig.hpp:117
BoundingBox scaled(const BoundingBoxf &bb)
Definition BoundingBox.hpp:240

References Slic3r::btOuterAndInner, Slic3r::btOuterOnly, Slic3r::PrintObject::config(), and Slic3r::scaled().

Referenced by get_arrange_poly().

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

◆ buffer_id()

static unsigned char Slic3r::GUI::buffer_id ( EMoveType  type)
static
44 {
45 return static_cast<unsigned char>(type) - static_cast<unsigned char>(EMoveType::Retract);
46}

References Slic3r::Retract.

Referenced by Slic3r::GUI::GCodeViewer::can_export_toolpaths(), Slic3r::GUI::GCodeViewer::export_toolpaths_to_obj(), Slic3r::GUI::GCodeViewer::is_toolpath_move_type_visible(), Slic3r::GUI::GCodeViewer::load_toolpaths(), Slic3r::GUI::GCodeViewer::refresh(), Slic3r::GUI::GCodeViewer::refresh_render_paths(), Slic3r::GUI::GCodeViewer::render_legend(), Slic3r::GUI::GCodeViewer::render_toolpaths(), and Slic3r::GUI::GCodeViewer::set_toolpath_move_type_visible().

+ Here is the caller graph for this function:

◆ buffer_type()

static EMoveType Slic3r::GUI::buffer_type ( unsigned char  id)
static
48 {
49 return static_cast<EMoveType>(static_cast<unsigned char>(EMoveType::Retract) + id);
50}
EMoveType
Definition GCodeProcessor.hpp:22

References Slic3r::Retract.

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

+ Here is the caller graph for this function:

◆ button()

bool Slic3r::GUI::button ( const IconManager::Icon activ,
const IconManager::Icon hover,
const IconManager::Icon disable,
bool  disabled = false 
)

Use icon as button with 3 states activ hover and disabled.

Parameters
activNot disabled not hovered image
hoverHovered image
disableDisabled image
Returns
True when click on enabled, otherwise False
196{
197 if (disabled) {
198 draw(disable);
199 return false;
200 }
201 return clickable(activ, hover);
202}
void draw(const IconManager::Icon &icon, const ImVec2 &size, const ImVec4 &tint_col, const ImVec4 &border_col)
Draw imgui image with icon.
Definition IconManager.cpp:164
bool clickable(const IconManager::Icon &icon, const IconManager::Icon &icon_hover)
Draw icon which change on hover.
Definition IconManager.cpp:179

References clickable(), and draw().

Referenced by Slic3r::GUI::GLGizmoEmboss::draw_advanced(), priv::draw_button(), Slic3r::GUI::ObjectLayers::sys_color_changed(), and Slic3r::GUI::ObjectManipulation::update_mirror_buttons_visibility().

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

◆ calc_scale()

static std::optional< double > Slic3r::GUI::calc_scale ( const Matrix3d from,
const Matrix3d to,
const Vec3d dir 
)
static
15{
16 Vec3d from_dir = from * dir;
17 Vec3d to_dir = to * dir;
18 double from_scale_sq = from_dir.squaredNorm();
19 double to_scale_sq = to_dir.squaredNorm();
20 if (is_approx(from_scale_sq, to_scale_sq, 1e-3))
21 return {}; // no scale
22 return sqrt(from_scale_sq / to_scale_sq);
23}
EIGEN_DEVICE_FUNC const SqrtReturnType sqrt() const
Definition ArrayCwiseUnaryOps.h:152
constexpr bool is_approx(Number value, Number test_value, Number precision=EPSILON)
Definition libslic3r.h:271

References Slic3r::is_approx(), and sqrt().

Referenced by on_mouse_surface_drag().

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

◆ calc_surface_offset()

std::optional< Vec3d > Slic3r::GUI::calc_surface_offset ( const Selection selection,
RaycastManager raycast_manager 
)

Calculate translation of volume onto surface of model.

Parameters
selectionMust contain only one selected volume, Transformation of current instance
raycast_managerAABB trees of object. Actualize object
Returns
Offset of volume in volume coordinate
237 {
238 const GLVolume *gl_volume_ptr = get_selected_gl_volume(selection);
239 if (gl_volume_ptr == nullptr)
240 return {};
241 const GLVolume& gl_volume = *gl_volume_ptr;
242
243 const ModelObjectPtrs &objects = selection.get_model()->objects;
244 const ModelVolume* volume = get_model_volume(gl_volume, objects);
245 if (volume == nullptr)
246 return {};
247
248 const ModelInstance* instance = get_model_instance(gl_volume, objects);
249 if (instance == nullptr)
250 return {};
251
252 // Move object on surface
253 auto cond = RaycastManager::SkipVolume(volume->id().id);
254 raycast_manager.actualize(*instance, &cond);
255
256 Transform3d to_world = world_matrix_fixed(gl_volume, selection.get_model()->objects);
257 Vec3d point = to_world * Vec3d::Zero();
258 Vec3d direction = to_world.linear() * (-Vec3d::UnitZ());
259
260 // ray in direction of text projection(from volume zero to z-dir)
261 std::optional<RaycastManager::Hit> hit_opt = raycast_manager.closest_hit(point, direction, &cond);
262
263 // Try to find closest point when no hit object in emboss direction
264 if (!hit_opt.has_value()) {
265 std::optional<RaycastManager::ClosePoint> close_point_opt = raycast_manager.closest(point);
266
267 // It should NOT appear. Closest point always exists.
268 assert(close_point_opt.has_value());
269 if (!close_point_opt.has_value())
270 return {};
271
272 // It is no neccesary to move with origin by very small value
273 if (close_point_opt->squared_distance < EPSILON)
274 return {};
275
276 const RaycastManager::ClosePoint &close_point = *close_point_opt;
277 Transform3d hit_tr = raycast_manager.get_transformation(close_point.tr_key);
278 Vec3d hit_world = hit_tr * close_point.point;
279 Vec3d offset_world = hit_world - point; // vector in world
280 Vec3d offset_volume = to_world.inverse().linear() * offset_world;
281 return offset_volume;
282 }
283
284 // It is no neccesary to move with origin by very small value
285 const RaycastManager::Hit &hit = *hit_opt;
286 if (hit.squared_distance < EPSILON)
287 return {};
288 Transform3d hit_tr = raycast_manager.get_transformation(hit.tr_key);
289 Vec3d hit_world = hit_tr * hit.position;
290 Vec3d offset_world = hit_world - point; // vector in world
291 // TIP: It should be close to only z move
292 Vec3d offset_volume = to_world.inverse().linear() * offset_world;
293 return offset_volume;
294}
Definition 3DScene.hpp:50
void actualize(const ModelObject &object, const ISkip *skip=nullptr, Meshes *meshes=nullptr)
Actualize raycasters + transformation Detection of removed object Detection of removed instance Detec...
Definition RaycastManager.cpp:25
Transform3d get_transformation(const TrKey &tr_key) const
Getter on transformation from hitted volume to world.
Definition RaycastManager.cpp:221
std::optional< Hit > closest_hit(const Vec3d &point, const Vec3d &direction, const ISkip *skip=nullptr) const
Unproject Ray(point direction) on mesh to find closest hit of surface in given direction NOTE: It ins...
Definition RaycastManager.cpp:164
std::optional< ClosePoint > closest(const Vec3d &point, const ISkip *skip=nullptr) const
Search of closest point.
Definition RaycastManager.cpp:195
Model * get_model() const
Definition Selection.hpp:206
ModelObjectPtrs objects
Definition Model.hpp:1254
Definition Model.hpp:753
static constexpr double EPSILON
Definition libslic3r.h:51
Transform3d world_matrix_fixed(const GLVolume &gl_volume, const ModelObjectPtrs &objects)
Get transformation to world.
Definition SurfaceDrag.cpp:296
GLVolume * get_selected_gl_volume(const GLCanvas3D &canvas)
Definition GLCanvas3D.cpp:7927
Eigen::Transform< double, 3, Eigen::Affine, Eigen::DontAlign > Transform3d
Definition Point.hpp:81
Eigen::Matrix< double, 3, 1, Eigen::DontAlign > Vec3d
Definition Point.hpp:52
std::vector< ModelObject * > ModelObjectPtrs
Definition Model.hpp:105
IGL_INLINE void volume(const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedT > &T, Eigen::PlainObjectBase< Derivedvol > &vol)
Definition volume.cpp:15

References Slic3r::GUI::RaycastManager::actualize(), Slic3r::GUI::RaycastManager::closest(), Slic3r::GUI::RaycastManager::closest_hit(), EPSILON, Slic3r::GUI::Selection::get_model(), get_model_instance(), get_model_volume(), get_selected_gl_volume(), Slic3r::GUI::RaycastManager::get_transformation(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::inverse(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::linear(), Slic3r::Model::objects, Slic3r::GUI::RaycastManager::ClosePoint::point, Slic3r::GUI::RaycastManager::SurfacePoint< T >::position, Slic3r::GUI::RaycastManager::Hit::squared_distance, Slic3r::GUI::RaycastManager::Hit::tr_key, Slic3r::GUI::RaycastManager::ClosePoint::tr_key, and world_matrix_fixed().

Referenced by Slic3r::GUI::GLGizmoEmboss::process().

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

◆ call_after_if_active()

static void Slic3r::GUI::call_after_if_active ( std::function< void()>  fn,
GUI_App app = &wxGetApp() 
)
static
23{
24 // check application GUI
25 if (app == nullptr) return;
26 app->CallAfter([fn, app]() {
27 // app must exist because it call this
28 // if (app == nullptr) return;
29 const Plater *plater = app->plater();
30 if (plater == nullptr) return;
31 const GLCanvas3D *canvas = plater->canvas3D();
32 if (canvas == nullptr) return;
33 const GLGizmosManager &mng = canvas->get_gizmos_manager();
34 // check if simplify is still activ gizmo
35 if (mng.get_current_type() != GLGizmosManager::Simplify) return;
36 fn();
37 });
38}
Definition GLCanvas3D.hpp:185
const GLGizmosManager & get_gizmos_manager() const
Definition GLCanvas3D.hpp:764
Definition GLGizmosManager.hpp:63
EType get_current_type() const
Definition GLGizmosManager.hpp:192
Plater * plater()
Definition GUI_App.cpp:2963
Definition Plater.hpp:134
GLCanvas3D * canvas3D()
Definition Plater.cpp:7226

References Slic3r::GUI::Plater::canvas3D(), Slic3r::GUI::GLGizmosManager::get_current_type(), Slic3r::GUI::GLCanvas3D::get_gizmos_manager(), plater(), and Slic3r::GUI::GLGizmosManager::Simplify.

Referenced by Slic3r::GUI::GLGizmoSimplify::process().

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

◆ can_add_volumes_to_object()

static bool Slic3r::GUI::can_add_volumes_to_object ( const ModelObject object)
static
3017{
3018 bool can = object->volumes.size() > 1;
3019
3020 if (can && object->is_cut()) {
3021 int no_connectors_cnt = 0;
3022 for (const ModelVolume* v : object->volumes)
3023 if (!v->is_cut_connector()) {
3024 if (!v->is_model_part())
3025 return true;
3026 no_connectors_cnt++;
3027 }
3028 can = no_connectors_cnt > 1;
3029 }
3030
3031 return can;
3032}
bool is_cut() const
Definition Model.hpp:514
if(!(yy_init))
Definition lexer.c:1190

References Slic3r::ModelObject::is_cut().

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

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

◆ center_on_feature_type_as_string()

static std::string Slic3r::GUI::center_on_feature_type_as_string ( Measure::SurfaceFeatureType  type)
static
85{
86 std::string ret;
87 switch (type) {
88 case Measure::SurfaceFeatureType::Edge: { ret = _u8L("Center of edge"); break; }
89 case Measure::SurfaceFeatureType::Circle: { ret = _u8L("Center of circle"); break; }
90 default: { assert(false); break; }
91 }
92 return ret;
93}
#define _u8L(s)
macro used to mark string used at localization, return same string
Definition SLAPrint.cpp:29

References _u8L, Slic3r::Measure::Circle, and Slic3r::Measure::Edge.

Referenced by Slic3r::GUI::GLGizmoMeasure::on_render_input_window().

+ Here is the caller graph for this function:

◆ change_opt_value()

void Slic3r::GUI::change_opt_value ( DynamicPrintConfig config,
const t_config_option_key opt_key,
const boost::any &  value,
int  opt_index 
)
104{
105 try{
106
107 if (config.def()->get(opt_key)->type == coBools && config.def()->get(opt_key)->nullable) {
108 ConfigOptionBoolsNullable* vec_new = new ConfigOptionBoolsNullable{ boost::any_cast<unsigned char>(value) };
109 config.option<ConfigOptionBoolsNullable>(opt_key)->set_at(vec_new, opt_index, 0);
110 return;
111 }
112
113 const ConfigOptionDef *opt_def = config.def()->get(opt_key);
114 switch (opt_def->type) {
115 case coFloatOrPercent:{
116 std::string str = boost::any_cast<std::string>(value);
117 bool percent = false;
118 if (str.back() == '%') {
119 str.pop_back();
120 percent = true;
121 }
122 double val = std::stod(str); // locale-dependent (on purpose - the input is the actual content of the field)
123 config.set_key_value(opt_key, new ConfigOptionFloatOrPercent(val, percent));
124 break;}
125 case coPercent:
126 config.set_key_value(opt_key, new ConfigOptionPercent(boost::any_cast<double>(value)));
127 break;
128 case coFloat:{
129 double& val = config.opt_float(opt_key);
130 val = boost::any_cast<double>(value);
131 break;
132 }
133 case coFloatsOrPercents:{
134 std::string str = boost::any_cast<std::string>(value);
135 bool percent = false;
136 if (str.back() == '%') {
137 str.pop_back();
138 percent = true;
139 }
140 double val = std::stod(str); // locale-dependent (on purpose - the input is the actual content of the field)
141 ConfigOptionFloatsOrPercents* vec_new = new ConfigOptionFloatsOrPercents({ {val, percent} });
142 config.option<ConfigOptionFloatsOrPercents>(opt_key)->set_at(vec_new, opt_index, opt_index);
143 break;
144 }
145 case coPercents:{
146 ConfigOptionPercents* vec_new = new ConfigOptionPercents{ boost::any_cast<double>(value) };
147 config.option<ConfigOptionPercents>(opt_key)->set_at(vec_new, opt_index, opt_index);
148 break;
149 }
150 case coFloats:{
151 ConfigOptionFloats* vec_new = new ConfigOptionFloats{ boost::any_cast<double>(value) };
152 config.option<ConfigOptionFloats>(opt_key)->set_at(vec_new, opt_index, opt_index);
153 break;
154 }
155 case coString:
156 config.set_key_value(opt_key, new ConfigOptionString(boost::any_cast<std::string>(value)));
157 break;
158 case coStrings:{
159 if (opt_key == "compatible_prints" || opt_key == "compatible_printers" || opt_key == "gcode_substitutions") {
160 config.option<ConfigOptionStrings>(opt_key)->values =
161 boost::any_cast<std::vector<std::string>>(value);
162 }
163 else if (config.def()->get(opt_key)->gui_flags.compare("serialized") == 0) {
164 std::string str = boost::any_cast<std::string>(value);
165 std::vector<std::string> values {};
166 if (!str.empty()) {
167 if (str.back() == ';') str.pop_back();
168 // Split a string to multiple strings by a semi - colon.This is the old way of storing multi - string values.
169 // Currently used for the post_process config value only.
170 boost::split(values, str, boost::is_any_of(";"));
171 if (values.size() == 1 && values[0] == "")
172 values.resize(0);
173 }
174 config.option<ConfigOptionStrings>(opt_key)->values = values;
175 }
176 else{
177 ConfigOptionStrings* vec_new = new ConfigOptionStrings{ boost::any_cast<std::string>(value) };
178 config.option<ConfigOptionStrings>(opt_key)->set_at(vec_new, opt_index, 0);
179 }
180 }
181 break;
182 case coBool:
183 config.set_key_value(opt_key, new ConfigOptionBool(boost::any_cast<bool>(value)));
184 break;
185 case coBools:{
186 ConfigOptionBools* vec_new = new ConfigOptionBools{ boost::any_cast<unsigned char>(value) != 0 };
187 config.option<ConfigOptionBools>(opt_key)->set_at(vec_new, opt_index, 0);
188 break;}
189 case coInt:
190 config.set_key_value(opt_key, new ConfigOptionInt(boost::any_cast<int>(value)));
191 break;
192 case coInts:{
193 ConfigOptionInts* vec_new = new ConfigOptionInts{ boost::any_cast<int>(value) };
194 config.option<ConfigOptionInts>(opt_key)->set_at(vec_new, opt_index, 0);
195 }
196 break;
197 case coEnum:{
198 auto *opt = opt_def->default_value.get()->clone();
199 opt->setInt(boost::any_cast<int>(value));
200 config.set_key_value(opt_key, opt);
201 }
202 break;
203 case coPoints:{
204 if (opt_key == "bed_shape" || opt_key == "thumbnails") {
205 config.option<ConfigOptionPoints>(opt_key)->values = boost::any_cast<std::vector<Vec2d>>(value);
206 break;
207 }
208 ConfigOptionPoints* vec_new = new ConfigOptionPoints{ boost::any_cast<Vec2d>(value) };
209 config.option<ConfigOptionPoints>(opt_key)->set_at(vec_new, opt_index, 0);
210 }
211 break;
212 case coNone:
213 break;
214 default:
215 break;
216 }
217 }
218 catch (const std::exception &e)
219 {
220 wxLogError(format_wxstr("Internal error when changing value for %1%: %2%", opt_key, e.what()));
221 }
222}
double & opt_float(const t_config_option_key &opt_key)
Definition Config.hpp:2281
const ConfigOptionDef * get(const t_config_option_key &opt_key) const
Definition Config.hpp:2069
bool nullable
Definition Config.hpp:1824
std::string gui_flags
Definition Config.hpp:1909
bool set_key_value(const std::string &opt_key, ConfigOption *opt)
Definition Config.hpp:2431
const ConfigDef * def() const override
Definition PrintConfig.hpp:247
ConfigOptionFloatsOrPercentsTempl< false > ConfigOptionFloatsOrPercents
Definition Config.hpp:1196
ConfigOptionBool
Definition PrintConfig.hpp:665
ConfigOptionPercentsTempl< false > ConfigOptionPercents
Definition Config.hpp:1008
ConfigOptionBoolsTempl< false > ConfigOptionBools
Definition Config.hpp:1491
ConfigOptionFloatsTempl< false > ConfigOptionFloats
Definition Config.hpp:716
ConfigOptionIntsTempl< false > ConfigOptionInts
Definition Config.hpp:844
@ coFloatsOrPercents
Definition Config.hpp:182
@ coString
Definition Config.hpp:172
@ coPercents
Definition Config.hpp:178
@ coInts
Definition Config.hpp:170
@ coPoints
Definition Config.hpp:186
@ coInt
Definition Config.hpp:168
@ coNone
Definition Config.hpp:162
@ coFloat
Definition Config.hpp:164
@ coStrings
Definition Config.hpp:174
@ coFloats
Definition Config.hpp:166
@ coPercent
Definition Config.hpp:176

References Slic3r::coBool, Slic3r::coBools, Slic3r::coEnum, Slic3r::coFloat, Slic3r::coFloatOrPercent, Slic3r::coFloats, Slic3r::coFloatsOrPercents, Slic3r::coInt, Slic3r::coInts, Slic3r::coNone, Slic3r::coPercent, Slic3r::coPercents, Slic3r::coPoints, Slic3r::coString, Slic3r::coStrings, Slic3r::DynamicPrintConfig::def(), Slic3r::ConfigOptionDef::default_value, format_wxstr(), Slic3r::ConfigDef::get(), Slic3r::ConfigOptionDef::gui_flags, Slic3r::ConfigOptionDef::nullable, Slic3r::ConfigBase::opt_float(), Slic3r::ConfigBase::option(), Slic3r::DynamicConfig::set_key_value(), and Slic3r::ConfigOptionDef::type.

Referenced by Slic3r::GUI::ConfigOptionsGroup::change_opt_value(), and Slic3r::GUI::Tab::load_key_value().

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

◆ check_dark_mode()

bool Slic3r::GUI::check_dark_mode ( )
155 {
156#if wxCHECK_VERSION(3,1,3)
157 return wxSystemSettings::GetAppearance().IsDark();
158#else
159 const unsigned luma = wxGetApp().get_colour_approx_luma(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
160 return luma < 128;
161#endif
162}

Referenced by Slic3r::GUI::GUI_App::dark_mode().

+ Here is the caller graph for this function:

◆ circular_arrow()

GLModel::Geometry Slic3r::GUI::circular_arrow ( unsigned int  resolution,
float  radius,
float  tip_height,
float  tip_width,
float  stem_width,
float  thickness 
)
1241{
1242 resolution = std::max<unsigned int>(2, resolution);
1243
1244 GLModel::Geometry data;
1245 data.format = { GLModel::Geometry::EPrimitiveType::Triangles, GLModel::Geometry::EVertexLayout::P3N3 };
1246 data.reserve_vertices(8 * (resolution + 1) + 30);
1247 data.reserve_indices((8 * resolution + 16) * 3);
1248
1249 const float half_thickness = 0.5f * thickness;
1250 const float half_stem_width = 0.5f * stem_width;
1251 const float half_tip_width = 0.5f * tip_width;
1252
1253 const float outer_radius = radius + half_stem_width;
1254 const float inner_radius = radius - half_stem_width;
1255 const float step_angle = 0.5f * float(PI) / float(resolution);
1256
1257 // tip
1258 // top face vertices
1259 data.add_vertex(Vec3f(0.0f, outer_radius, half_thickness), (Vec3f)Vec3f::UnitZ());
1260 data.add_vertex(Vec3f(0.0f, radius + half_tip_width, half_thickness), (Vec3f)Vec3f::UnitZ());
1261 data.add_vertex(Vec3f(-tip_height, radius, half_thickness), (Vec3f)Vec3f::UnitZ());
1262 data.add_vertex(Vec3f(0.0f, radius - half_tip_width, half_thickness), (Vec3f)Vec3f::UnitZ());
1263 data.add_vertex(Vec3f(0.0f, inner_radius, half_thickness), (Vec3f)Vec3f::UnitZ());
1264
1265 // top face triangles
1266 data.add_triangle(0, 1, 2);
1267 data.add_triangle(0, 2, 4);
1268 data.add_triangle(4, 2, 3);
1269
1270 // bottom face vertices
1271 data.add_vertex(Vec3f(0.0f, outer_radius, -half_thickness), (Vec3f)(-Vec3f::UnitZ()));
1272 data.add_vertex(Vec3f(0.0f, radius + half_tip_width, -half_thickness), (Vec3f)(-Vec3f::UnitZ()));
1273 data.add_vertex(Vec3f(-tip_height, radius, -half_thickness), (Vec3f)(-Vec3f::UnitZ()));
1274 data.add_vertex(Vec3f(0.0f, radius - half_tip_width, -half_thickness), (Vec3f)(-Vec3f::UnitZ()));
1275 data.add_vertex(Vec3f(0.0f, inner_radius, -half_thickness), (Vec3f)(-Vec3f::UnitZ()));
1276
1277 // bottom face triangles
1278 data.add_triangle(5, 7, 6);
1279 data.add_triangle(5, 9, 7);
1280 data.add_triangle(9, 8, 7);
1281
1282 // side faces vertices
1283 data.add_vertex(Vec3f(0.0f, outer_radius, -half_thickness), (Vec3f)Vec3f::UnitX());
1284 data.add_vertex(Vec3f(0.0f, radius + half_tip_width, -half_thickness), (Vec3f)Vec3f::UnitX());
1285 data.add_vertex(Vec3f(0.0f, outer_radius, half_thickness), (Vec3f)Vec3f::UnitX());
1286 data.add_vertex(Vec3f(0.0f, radius + half_tip_width, half_thickness), (Vec3f)Vec3f::UnitX());
1287
1288 Vec3f normal(-half_tip_width, tip_height, 0.0f);
1289 normal.normalize();
1290 data.add_vertex(Vec3f(0.0f, radius + half_tip_width, -half_thickness), normal);
1291 data.add_vertex(Vec3f(-tip_height, radius, -half_thickness), normal);
1292 data.add_vertex(Vec3f(0.0f, radius + half_tip_width, half_thickness), normal);
1293 data.add_vertex(Vec3f(-tip_height, radius, half_thickness), normal);
1294
1295 normal = { -half_tip_width, -tip_height, 0.0f };
1296 normal.normalize();
1297 data.add_vertex(Vec3f(-tip_height, radius, -half_thickness), normal);
1298 data.add_vertex(Vec3f(0.0f, radius - half_tip_width, -half_thickness), normal);
1299 data.add_vertex(Vec3f(-tip_height, radius, half_thickness), normal);
1300 data.add_vertex(Vec3f(0.0f, radius - half_tip_width, half_thickness), normal);
1301
1302 data.add_vertex(Vec3f(0.0f, radius - half_tip_width, -half_thickness), (Vec3f)Vec3f::UnitX());
1303 data.add_vertex(Vec3f(0.0f, inner_radius, -half_thickness), (Vec3f)Vec3f::UnitX());
1304 data.add_vertex(Vec3f(0.0f, radius - half_tip_width, half_thickness), (Vec3f)Vec3f::UnitX());
1305 data.add_vertex(Vec3f(0.0f, inner_radius, half_thickness), (Vec3f)Vec3f::UnitX());
1306
1307 // side face triangles
1308 for (unsigned int i = 0; i < 4; ++i) {
1309 const unsigned int ii = i * 4;
1310 data.add_triangle(10 + ii, 11 + ii, 13 + ii);
1311 data.add_triangle(10 + ii, 13 + ii, 12 + ii);
1312 }
1313
1314 // stem
1315 // top face vertices
1316 for (unsigned int i = 0; i <= resolution; ++i) {
1317 const float angle = float(i) * step_angle;
1318 data.add_vertex(Vec3f(inner_radius * ::sin(angle), inner_radius * ::cos(angle), half_thickness), (Vec3f)Vec3f::UnitZ());
1319 }
1320
1321 for (unsigned int i = 0; i <= resolution; ++i) {
1322 const float angle = float(i) * step_angle;
1323 data.add_vertex(Vec3f(outer_radius * ::sin(angle), outer_radius * ::cos(angle), half_thickness), (Vec3f)Vec3f::UnitZ());
1324 }
1325
1326 // top face triangles
1327 for (unsigned int i = 0; i < resolution; ++i) {
1328 data.add_triangle(26 + i, 27 + i, 27 + resolution + i);
1329 data.add_triangle(27 + i, 28 + resolution + i, 27 + resolution + i);
1330 }
1331
1332 // bottom face vertices
1333 for (unsigned int i = 0; i <= resolution; ++i) {
1334 const float angle = float(i) * step_angle;
1335 data.add_vertex(Vec3f(inner_radius * ::sin(angle), inner_radius * ::cos(angle), -half_thickness), (Vec3f)(-Vec3f::UnitZ()));
1336 }
1337
1338 for (unsigned int i = 0; i <= resolution; ++i) {
1339 const float angle = float(i) * step_angle;
1340 data.add_vertex(Vec3f(outer_radius * ::sin(angle), outer_radius * ::cos(angle), -half_thickness), (Vec3f)(-Vec3f::UnitZ()));
1341 }
1342
1343 // bottom face triangles
1344 for (unsigned int i = 0; i < resolution; ++i) {
1345 data.add_triangle(28 + 2 * resolution + i, 29 + 3 * resolution + i, 29 + 2 * resolution + i);
1346 data.add_triangle(29 + 2 * resolution + i, 29 + 3 * resolution + i, 30 + 3 * resolution + i);
1347 }
1348
1349 // side faces vertices and triangles
1350 for (unsigned int i = 0; i <= resolution; ++i) {
1351 const float angle = float(i) * step_angle;
1352 const float c = ::cos(angle);
1353 const float s = ::sin(angle);
1354 data.add_vertex(Vec3f(inner_radius * s, inner_radius * c, -half_thickness), Vec3f(-s, -c, 0.0f));
1355 }
1356
1357 for (unsigned int i = 0; i <= resolution; ++i) {
1358 const float angle = float(i) * step_angle;
1359 const float c = ::cos(angle);
1360 const float s = ::sin(angle);
1361 data.add_vertex(Vec3f(inner_radius * s, inner_radius * c, half_thickness), Vec3f(-s, -c, 0.0f));
1362 }
1363
1364 unsigned int first_id = 26 + 4 * (resolution + 1);
1365 for (unsigned int i = 0; i < resolution; ++i) {
1366 const unsigned int ii = first_id + i;
1367 data.add_triangle(ii, ii + 1, ii + resolution + 2);
1368 data.add_triangle(ii, ii + resolution + 2, ii + resolution + 1);
1369 }
1370
1371 data.add_vertex(Vec3f(inner_radius, 0.0f, -half_thickness), (Vec3f)(-Vec3f::UnitY()));
1372 data.add_vertex(Vec3f(outer_radius, 0.0f, -half_thickness), (Vec3f)(-Vec3f::UnitY()));
1373 data.add_vertex(Vec3f(inner_radius, 0.0f, half_thickness), (Vec3f)(-Vec3f::UnitY()));
1374 data.add_vertex(Vec3f(outer_radius, 0.0f, half_thickness), (Vec3f)(-Vec3f::UnitY()));
1375
1376 first_id = 26 + 6 * (resolution + 1);
1377 data.add_triangle(first_id, first_id + 1, first_id + 3);
1378 data.add_triangle(first_id, first_id + 3, first_id + 2);
1379
1380 for (int i = resolution; i >= 0; --i) {
1381 const float angle = float(i) * step_angle;
1382 const float c = ::cos(angle);
1383 const float s = ::sin(angle);
1384 data.add_vertex(Vec3f(outer_radius * s, outer_radius * c, -half_thickness), Vec3f(s, c, 0.0f));
1385 }
1386
1387 for (int i = resolution; i >= 0; --i) {
1388 const float angle = float(i) * step_angle;
1389 const float c = ::cos(angle);
1390 const float s = ::sin(angle);
1391 data.add_vertex(Vec3f(outer_radius * s, outer_radius * c, +half_thickness), Vec3f(s, c, 0.0f));
1392 }
1393
1394 first_id = 30 + 6 * (resolution + 1);
1395 for (unsigned int i = 0; i < resolution; ++i) {
1396 const unsigned int ii = first_id + i;
1397 data.add_triangle(ii, ii + 1, ii + resolution + 2);
1398 data.add_triangle(ii, ii + resolution + 2, ii + resolution + 1);
1399 }
1400
1401 return data;
1402}
EIGEN_DEVICE_FUNC const CosReturnType cos() const
Definition ArrayCwiseUnaryOps.h:202
EIGEN_DEVICE_FUNC const SinReturnType sin() const
Definition ArrayCwiseUnaryOps.h:220
static constexpr double PI
Definition libslic3r.h:58
Eigen::Matrix< float, 3, 1, Eigen::DontAlign > Vec3f
Definition Point.hpp:49
double angle(const Eigen::MatrixBase< Derived > &v1, const Eigen::MatrixBase< Derived2 > &v2)
Definition Point.hpp:112
constexpr auto data(C &c) -> decltype(c.data())
Definition span.hpp:195
Definition GLModel.hpp:26

References Slic3r::angle(), cos(), Slic3r::GUI::GLModel::Geometry::P3N3, PI, sin(), and Slic3r::GUI::GLModel::Geometry::Triangles.

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

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

◆ clickable()

bool Slic3r::GUI::clickable ( const IconManager::Icon icon,
const IconManager::Icon icon_hover 
)

Draw icon which change on hover.

Parameters
iconDraw when no hover
icon_hoverDraw when hover
Returns
True when click, otherwise False
180{
181 // check of hover
182 float cursor_x = ImGui::GetCursorPosX();
184 ImGui::SameLine(cursor_x);
185 if (ImGui::IsItemHovered()) {
186 // redraw image
187 draw(icon_hover);
188 } else {
189 // redraw normal image
190 draw(icon);
191 }
192 return ImGui::IsItemClicked();
193}
IMGUI_API float GetCursorPosX()
Definition imgui.cpp:7499
IMGUI_API bool IsItemClicked(ImGuiMouseButton mouse_button=0)
Definition imgui.cpp:4882
IMGUI_API void SameLine(float offset_from_start_x=0.0f, float spacing=-1.0f)
Definition imgui.cpp:7455
IMGUI_API bool IsItemHovered(ImGuiHoveredFlags flags=0)
Definition imgui.cpp:3149
static void draw_transparent_icon(const IconManager::Icon &icon)
Definition IconManager.cpp:140

References draw(), priv::draw_transparent_icon(), ImGui::GetCursorPosX(), ImGui::IsItemClicked(), ImGui::IsItemHovered(), and ImGui::SameLine().

Referenced by button(), Slic3r::GUI::GLGizmoEmboss::draw_bold_button(), and Slic3r::GUI::GLGizmoEmboss::draw_italic_button().

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

◆ color_string()

static void Slic3r::GUI::color_string ( wxString &  str,
const std::string &  color 
)
static
67{
68#if defined(SUPPORTS_MARKUP) && !defined(__APPLE__)
69 str = from_u8((boost::format("<span color=\"%1%\">%2%</span>") % color % into_u8(str)).str());
70#endif
71}

References from_u8(), and into_u8().

Referenced by Slic3r::GUI::ModelNode::ModelNode(), Slic3r::GUI::DiffModel::AddOption(), and Slic3r::GUI::DiffModel::AddPreset().

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

◆ combochecklist_get_flags()

unsigned int Slic3r::GUI::combochecklist_get_flags ( wxComboCtrl *  comboCtrl)
408{
409 unsigned int flags = 0;
410
411 wxCheckListBoxComboPopup* popup = wxDynamicCast(comboCtrl->GetPopupControl(), wxCheckListBoxComboPopup);
412 if (popup != nullptr) {
413 for (unsigned int i = 0; i < popup->GetCount(); ++i) {
414 if (popup->IsChecked(i))
415 flags |= 1 << i;
416 }
417 }
418
419 return flags;
420}
Definition wxExtensions.hpp:72

◆ combochecklist_set_flags()

void Slic3r::GUI::combochecklist_set_flags ( wxComboCtrl *  comboCtrl,
unsigned int  flags 
)
423{
424 wxCheckListBoxComboPopup* popup = wxDynamicCast(comboCtrl->GetPopupControl(), wxCheckListBoxComboPopup);
425 if (popup != nullptr) {
426 for (unsigned int i = 0; i < popup->GetCount(); ++i) {
427 popup->Check(i, (flags & (1 << i)) != 0);
428 }
429 }
430}

◆ composite_id_match()

static bool Slic3r::GUI::composite_id_match ( const GLVolume::CompositeID id1,
const GLVolume::CompositeID id2 
)
static
1157{
1158 return id1.object_id == id2.object_id && id1.instance_id == id2.instance_id;
1159}
int instance_id
Definition 3DScene.hpp:141
int object_id
Definition 3DScene.hpp:134

References Slic3r::GLVolume::CompositeID::instance_id, and Slic3r::GLVolume::CompositeID::object_id.

◆ concat_strings()

static std::string Slic3r::GUI::concat_strings ( const std::set< std::string > &  strings,
const std::string &  delim = "\n" 
)
static
304{
305 return std::accumulate(
306 strings.begin(), strings.end(), std::string(""),
307 [delim](const std::string &s, const std::string &name) {
308 return s + name + delim;
309 });
310}

Referenced by Slic3r::GUI::ArrangeJob::finalize().

+ Here is the caller graph for this function:

◆ CONFIG_UPDATE_WIKI_URL()

static const std::string Slic3r::GUI::CONFIG_UPDATE_WIKI_URL ( "https://github.com/prusa3d/PrusaSlicer/wiki/Slic3r-PE-1.40-configuration-update"  )
static

Referenced by Slic3r::GUI::MsgDataLegacy::MsgDataLegacy().

+ Here is the caller graph for this function:

◆ constraint_id()

static int Slic3r::GUI::constraint_id ( int  grabber_id)
static
58{
59 static const std::vector<int> id_map = { 1, 0, 3, 2, 5, 4, 8, 9, 6, 7 };
60 return (0 <= grabber_id && grabber_id < (int)id_map.size()) ? id_map[grabber_id] : -1;
61}

Referenced by Slic3r::GUI::GLGizmoScale3D::on_mouse(), and Slic3r::GUI::GLGizmoScale3D::on_start_dragging().

+ Here is the caller graph for this function:

◆ contains()

bool Slic3r::GUI::contains ( const BuildVolume volume,
const GLModel model,
bool  ignore_bottom 
)
1121{
1122 static constexpr const double epsilon = BuildVolume::BedEpsilon;
1123 switch (volume.type()) {
1124 case BuildVolume::Type::Rectangle:
1125 {
1126 BoundingBox3Base<Vec3d> build_volume = volume.bounding_volume().inflated(epsilon);
1127 if (volume.max_print_height() == 0.0)
1128 build_volume.max.z() = std::numeric_limits<double>::max();
1129 if (ignore_bottom)
1130 build_volume.min.z() = -std::numeric_limits<double>::max();
1131 const BoundingBoxf3& model_box = model.get_bounding_box();
1132 return build_volume.contains(model_box.min) && build_volume.contains(model_box.max);
1133 }
1134 case BuildVolume::Type::Circle:
1135 {
1136 const Geometry::Circled& circle = volume.circle();
1137 const Vec2f c = unscaled<float>(circle.center);
1138 const float r = unscaled<double>(circle.radius) + float(epsilon);
1139 const float r2 = sqr(r);
1140 return volume.max_print_height() == 0.0 ?
1141 all_vertices_inside(model.get_geometry(), [c, r2](const Vec3f& p) { return (to_2d(p) - c).squaredNorm() <= r2; }) :
1142
1143 all_vertices_inside(model.get_geometry(), [c, r2, z = volume.max_print_height() + epsilon](const Vec3f& p) { return (to_2d(p) - c).squaredNorm() <= r2 && p.z() <= z; });
1144 }
1145 case BuildVolume::Type::Convex:
1146 //FIXME doing test on convex hull until we learn to do test on non-convex polygons efficiently.
1147 case BuildVolume::Type::Custom:
1148 return volume.max_print_height() == 0.0 ?
1149 all_vertices_inside(model.get_geometry(), [&volume](const Vec3f& p) { return Geometry::inside_convex_polygon(volume.top_bottom_convex_hull_decomposition_bed(), to_2d(p).cast<double>()); }) :
1150 all_vertices_inside(model.get_geometry(), [&volume, z = volume.max_print_height() + epsilon](const Vec3f& p) { return Geometry::inside_convex_polygon(volume.top_bottom_convex_hull_decomposition_bed(), to_2d(p).cast<double>()) && p.z() <= z; });
1151 default:
1152 return true;
1153 }
1154}
Definition BoundingBox.hpp:87
bool contains(const PointType &point) const
Definition BoundingBox.hpp:130
PointType max
Definition BoundingBox.hpp:17
Definition BoundingBox.hpp:221
const Geometry & get_geometry() const
Definition GLModel.hpp:221
const BoundingBoxf3 & get_bounding_box() const
Definition GLModel.hpp:245
constexpr double epsilon()
Definition DoubleSlider.hpp:28
bool all_vertices_inside(const GLModel::Geometry &geometry, Fn fn)
Definition GLModel.cpp:1103
max_print_height((ConfigOptionFloat, display_width))((ConfigOptionFloat
Eigen::Matrix< typename Derived::Scalar, 2, 1, Eigen::DontAlign > to_2d(const Eigen::MatrixBase< Derived > &ptN)
Definition Point.hpp:121
constexpr T sqr(T x)
Definition libslic3r.h:258
Definition Circle.hpp:62
Vector center
Definition Circle.hpp:65
Scalar radius
Definition Circle.hpp:66

References all_vertices_inside(), Slic3r::BuildVolume::BedEpsilon, Slic3r::Geometry::Circle< Vector >::center, Slic3r::BuildVolume::Circle, Slic3r::BoundingBox3Base< PointType >::contains(), Slic3r::BuildVolume::Convex, Slic3r::BuildVolume::Custom, Slic3r::GUI::GLModel::get_bounding_box(), Slic3r::GUI::GLModel::get_geometry(), Slic3r::BoundingBoxBase< PointType, APointsType >::max, Slic3r::BoundingBoxBase< PointType, APointsType >::min, Slic3r::Geometry::Circle< Vector >::radius, Slic3r::BuildVolume::Rectangle, and Slic3r::sqr().

+ Here is the call graph for this function:

◆ convert_input()

static double Slic3r::GUI::convert_input ( int  coord_byte_low,
int  coord_byte_high,
double  deadzone 
)
static
1144{
1145 int value = coord_byte_low | (coord_byte_high << 8);
1146 if (value >= 32768)
1147 value = value - 65536;
1148 double ret = (double)value / 350.0;
1149 return (std::abs(ret) > deadzone) ? ret : 0.0;
1150}

Referenced by Slic3r::GUI::Mouse3DController::handle_packet_rotation(), and Slic3r::GUI::Mouse3DController::handle_packet_translation().

+ Here is the caller graph for this function:

◆ create_combochecklist()

void Slic3r::GUI::create_combochecklist ( wxComboCtrl *  comboCtrl,
const std::string &  text,
const std::string &  items 
)
362{
363 if (comboCtrl == nullptr)
364 return;
365 wxGetApp().UpdateDarkUI(comboCtrl);
366
368 if (popup != nullptr) {
369 // FIXME If the following line is removed, the combo box popup list will not react to mouse clicks.
370 // On the other side, with this line the combo box popup cannot be closed by clicking on the combo button on Windows 10.
371 comboCtrl->UseAltPopupWindow();
372
373 int max_width = 0;
374
375 // the following line messes up the popup size the first time it is shown on wxWidgets 3.1.3
376// comboCtrl->EnablePopupAnimation(false);
377#ifdef _WIN32
378 popup->SetFont(comboCtrl->GetFont());
379#endif // _WIN32
380 comboCtrl->SetPopupControl(popup);
381 wxString title = from_u8(text);
382 max_width = std::max(max_width, 60 + comboCtrl->GetTextExtent(title).x);
383 popup->SetStringValue(title);
384 popup->Bind(wxEVT_CHECKLISTBOX, [popup](wxCommandEvent& evt) { popup->OnCheckListBox(evt); });
385 popup->Bind(wxEVT_LISTBOX, [popup](wxCommandEvent& evt) { popup->OnListBoxSelection(evt); });
386 popup->Bind(wxEVT_KEY_DOWN, [popup](wxKeyEvent& evt) { popup->OnKeyEvent(evt); });
387 popup->Bind(wxEVT_KEY_UP, [popup](wxKeyEvent& evt) { popup->OnKeyEvent(evt); });
388
389 std::vector<std::string> items_str;
390 boost::split(items_str, items, boost::is_any_of("|"), boost::token_compress_off);
391
392 // each item must be composed by 2 parts
393 assert(items_str.size() %2 == 0);
394
395 for (size_t i = 0; i < items_str.size(); i += 2) {
396 wxString label = from_u8(items_str[i]);
397 max_width = std::max(max_width, 60 + popup->GetTextExtent(label).x);
398 popup->Append(label);
399 popup->Check(i / 2, items_str[i + 1] == "1");
400 }
401
402 comboCtrl->SetMinClientSize(wxSize(max_width, -1));
403 wxGetApp().UpdateDarkUI(popup);
404 }
405}
virtual void OnKeyEvent(wxKeyEvent &evt)
Definition wxExtensions.cpp:223
virtual void SetStringValue(const wxString &value)
Definition wxExtensions.cpp:186
void OnCheckListBox(wxCommandEvent &evt)
Definition wxExtensions.cpp:255
void OnListBoxSelection(wxCommandEvent &evt)
Definition wxExtensions.cpp:282

References from_u8(), wxCheckListBoxComboPopup::OnCheckListBox(), wxCheckListBoxComboPopup::OnKeyEvent(), wxCheckListBoxComboPopup::OnListBoxSelection(), and wxCheckListBoxComboPopup::SetStringValue().

+ Here is the call graph for this function:

◆ create_freq_settings_popupmenu()

static void Slic3r::GUI::create_freq_settings_popupmenu ( wxMenu *  menu,
const bool  is_object_settings,
wxDataViewItem  item 
)
static
372{
373 // Add default settings bundles
375
376 const int extruders_cnt = extruders_count();
377
378 for (auto& category : bundle) {
379 if (is_improper_category(category.first, extruders_cnt, is_object_settings))
380 continue;
381
382 append_menu_item(menu, wxID_ANY, _(category.first), "",
383 [menu, item, is_object_settings, bundle](wxCommandEvent& event) {
384 wxString category_name = menu->GetLabel(event.GetId());
385 std::vector<std::string> options;
386 for (auto& category : bundle)
387 if (category_name == _(category.first)) {
388 options = category.second;
389 break;
390 }
391 if (options.empty())
392 return;
393 // Because of we couldn't edited layer_height for ItVolume from settings list,
394 // correct options according to the selected item type : remove "layer_height" option
395 if (!is_object_settings && category_name == _("Layers and Perimeters")) {
396 const auto layer_height_it = std::find(options.begin(), options.end(), "layer_height");
397 if (layer_height_it != options.end())
398 options.erase(layer_height_it);
399 }
400
401 obj_list()->add_category_to_settings_from_frequent(options, item);
402 },
403 SettingsFactory::get_category_bitmap(category.first), menu,
404 []() { return true; }, plater());
405 }
406#if 0
407 // Add "Quick" settings bundles
408 const SettingsFactory::Bundle& bundle_quick = printer_technology() == ptFFF ? m_freq_settings_fff : m_freq_settings_sla;
409
410 for (auto& category : bundle_quick) {
411 if (is_improper_category(category.first, extruders_cnt))
412 continue;
413
414 append_menu_item(menu, wxID_ANY, format_wxstr(_L("Quick Add Settings (%s)"), _(it.first)), "",
415 [menu, item, is_object_settings, bundle](wxCommandEvent& event) {
416 wxString category_name = menu->GetLabel(event.GetId());
417 std::vector<std::string> options;
418 for (auto& category : bundle)
419 if (category_name == from_u8((boost::format(_L("Quick Add Settings (%s)")) % _(category.first)).str())) {
420 options = category.second;
421 break;
422 }
423 if (options.empty())
424 return;
425 // Because of we couldn't edited layer_height for ItVolume from settings list,
426 // correct options according to the selected item type : remove "layer_height" option
427 if (!is_object_settings) {
428 const auto layer_height_it = std::find(options.begin(), options.end(), "layer_height");
429 if (layer_height_it != options.end())
430 options.erase(layer_height_it);
431 }
433 },
434 SettingsFactory::get_category_bitmap(category.first), menu,
435 [this]() { return true; }, plater());
436 }
437#endif
438}
void add_category_to_settings_from_frequent(const std::vector< std::string > &category_options, wxDataViewItem item)
Definition GUI_ObjectList.cpp:1420
static int extruders_count()
Definition GUI_Factories.cpp:35
static ObjectList * obj_list()
Definition GUI_Factories.cpp:179
static Plater * plater()
Definition GUI_Factories.cpp:174
static SettingsFactory::Bundle FREQ_SETTINGS_BUNDLE_FFF
Definition GUI_Factories.cpp:52
static SettingsFactory::Bundle FREQ_SETTINGS_BUNDLE_SLA
Definition GUI_Factories.cpp:63
static bool is_improper_category(const std::string &category, const int extruders_cnt, const bool is_object_settings=true)
Definition GUI_Factories.cpp:40
@ ptFFF
Definition Config.hpp:207
printer_technology((ConfigOptionPoints, bed_shape))((ConfigOptionFloat
std::map< std::string, std::vector< std::string > > Bundle
Definition GUI_Factories.hpp:25

References _, Slic3r::GUI::ObjectList::add_category_to_settings_from_frequent(), append_menu_item(), extruders_count(), FREQ_SETTINGS_BUNDLE_FFF, FREQ_SETTINGS_BUNDLE_SLA, Slic3r::GUI::SettingsFactory::get_category_bitmap(), if(), is_improper_category(), obj_list(), plater(), printer_technology(), and Slic3r::ptFFF.

Referenced by Slic3r::GUI::MenuFactory::append_menu_item_settings().

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

◆ create_mesh()

static TriangleMesh Slic3r::GUI::create_mesh ( const std::string &  type_name,
const BoundingBoxf3 bb 
)
static
1696{
1697 const double side = wxGetApp().plater()->canvas3D()->get_size_proportional_to_max_bed_size(0.1);
1698
1700 if (type_name == "Box")
1701 // Sitting on the print bed, left front front corner at (0, 0).
1702 mesh = its_make_cube(side, side, side);
1703 else if (type_name == "Cylinder")
1704 // Centered around 0, sitting on the print bed.
1705 // The cylinder has the same volume as the box above.
1706 mesh = its_make_cylinder(0.564 * side, side);
1707 else if (type_name == "Sphere")
1708 // Centered around 0, half the sphere below the print bed, half above.
1709 // The sphere has the same volume as the box above.
1710 mesh = its_make_sphere(0.62 * side, PI / 18);
1711 else if (type_name == "Slab")
1712 // Sitting on the print bed, left front front corner at (0, 0).
1713 mesh = its_make_cube(bb.size().x() * 1.5, bb.size().y() * 1.5, bb.size().z() * 0.5);
1714 return TriangleMesh(mesh);
1715}
Definition TriangleMesh.hpp:88
indexed_triangle_set its_make_sphere(double radius, double fa)
Definition TriangleMesh.cpp:1092
indexed_triangle_set its_make_cube(double xd, double yd, double zd)
Definition TriangleMesh.cpp:921
indexed_triangle_set its_make_cylinder(double r, double h, double fa)
Definition TriangleMesh.cpp:955
Definition stl.h:157

References Slic3r::its_make_cube(), Slic3r::its_make_cylinder(), Slic3r::its_make_sphere(), PI, and Slic3r::BoundingBox3Base< PointType >::size().

Referenced by Slic3r::GUI::ObjectList::load_generic_subobject(), and Slic3r::GUI::ObjectList::load_shape_object().

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

◆ create_meshes()

RaycastManager::Meshes Slic3r::GUI::create_meshes ( GLCanvas3D canvas,
const RaycastManager::AllowVolumes condition 
)

Use scene Raycasters and prepare data for actualize RaycasterManager.

Parameters
canvascontain Scene raycasters
conditionLimit for scene casters
Returns
Meshes
317{
318 SceneRaycaster::EType type = SceneRaycaster::EType::Volume;
319 auto scene_casters = canvas.get_raycasters_for_picking(type);
320 if (scene_casters == nullptr)
321 return {};
322 const std::vector<std::shared_ptr<SceneRaycasterItem>> &casters = *scene_casters;
323
324 const GLVolumePtrs &gl_volumes = canvas.get_volumes().volumes;
325 const ModelObjectPtrs &objects = canvas.get_model()->objects;
326
328 for (const std::shared_ptr<SceneRaycasterItem> &caster : casters) {
329 int index = SceneRaycaster::decode_id(type, caster->get_id());
330 if (index < 0)
331 continue;
332 auto index_ = static_cast<size_t>(index);
333 if(index_ >= gl_volumes.size())
334 continue;
335 const GLVolume *gl_volume = gl_volumes[index_];
336 if (gl_volume == nullptr)
337 continue;
338 const ModelVolume *volume = get_model_volume(*gl_volume, objects);
339 if (volume == nullptr)
340 continue;
341 size_t id = volume->id().id;
342 if (condition.skip(id))
343 continue;
344 auto mesh = std::make_unique<AABBMesh>(caster->get_raycaster()->get_aabb_mesh());
345 meshes.emplace_back(std::make_pair(id, std::move(mesh)));
346 }
347 return meshes;
348}
GLVolumePtrs volumes
Definition 3DScene.hpp:381
const GLVolumeCollection & get_volumes() const
Definition GLCanvas3D.hpp:739
const Model * get_model() const
Definition GLCanvas3D.hpp:759
std::vector< std::shared_ptr< SceneRaycasterItem > > * get_raycasters_for_picking(SceneRaycaster::EType type)
Definition GLCanvas3D.hpp:727
bool skip(const size_t &model_volume_id) const override
Condition to not process model volume.
Definition RaycastManager.hpp:105
std::vector< Mesh > Meshes
Definition RaycastManager.hpp:24
static int decode_id(EType type, int id)
Definition SceneRaycaster.cpp:289
EType
Definition SceneRaycaster.hpp:41
const ModelVolume * get_model_volume(const GLVolume &v, const Model &model)
Definition GLCanvas3D.cpp:7869
std::vector< GLVolume * > GLVolumePtrs
Definition 3DScene.hpp:325

References Slic3r::GUI::SceneRaycaster::decode_id(), Slic3r::GUI::GLCanvas3D::get_model(), get_model_volume(), Slic3r::GUI::GLCanvas3D::get_raycasters_for_picking(), Slic3r::GUI::GLCanvas3D::get_volumes(), Slic3r::Model::objects, Slic3r::GUI::RaycastManager::AllowVolumes::skip(), Slic3r::GUI::SceneRaycaster::Volume, and Slic3r::GLVolumeCollection::volumes.

Referenced by on_mouse_surface_drag(), and priv::start_create_volume_on_surface_job().

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

◆ create_options_tab()

static std::shared_ptr< ConfigOptionsGroup > Slic3r::GUI::create_options_tab ( const wxString &  title,
wxBookCtrlBase *  tabs 
)
static
124{
125 wxPanel* tab = new wxPanel(tabs, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBK_LEFT | wxTAB_TRAVERSAL);
126 tabs->AddPage(tab, _(title));
127 tab->SetFont(wxGetApp().normal_font());
128
129 wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL);
130 sizer->SetSizeHints(tab);
131 tab->SetSizer(sizer);
132
133 std::shared_ptr<ConfigOptionsGroup> optgroup = std::make_shared<ConfigOptionsGroup>(tab);
134 optgroup->label_width = 40;
135 optgroup->set_config_category_and_type(title, int(Preset::TYPE_PREFERENCES));
136 return optgroup;
137}

References _, and Slic3r::Preset::TYPE_PREFERENCES.

Referenced by Slic3r::GUI::PreferencesDialog::build().

+ Here is the caller graph for this function:

◆ create_settings_popupmenu()

static wxMenu * Slic3r::GUI::create_settings_popupmenu ( wxMenu *  parent_menu,
const bool  is_object_settings,
wxDataViewItem  item 
)
static
278{
279 wxMenu* menu = new wxMenu;
280
281 FullSettingsHierarchy categories;
282 get_full_settings_hierarchy(categories, !is_object_settings);
283
284 auto get_selected_options_for_category = [categories, item](const wxString& category_name) {
285 wxArrayString names;
286 wxArrayInt selections;
287
288 std::vector< std::pair<std::string, bool> > category_options;
289 for (auto& cat : categories) {
290 if (_(cat.first) == category_name) {
291 ModelConfig& config = obj_list()->get_item_config(item);
292 auto opt_keys = config.keys();
293
294 int sel = 0;
295 for (const std::pair<std::string, std::string>& pair : cat.second) {
296 names.Add(_(pair.second));
297 if (find(opt_keys.begin(), opt_keys.end(), pair.first) != opt_keys.end())
298 selections.Add(sel);
299 sel++;
300 category_options.push_back(std::make_pair(pair.first, false));
301 }
302 break;
303 }
304 }
305
306 if (!category_options.empty() &&
307 GetSelectedChoices(selections, _L("Select showing settings"), category_name, names) != -1) {
308 for (auto sel : selections)
309 category_options[sel].second = true;
310 }
311 return category_options;
312
313#if 0
314 if (selections.size() > 0)
315 {
316 // Add selected items to the "Quick menu"
317 SettingsFactory::Bundle& freq_settings = printer_technology() == ptSLA ?
318 m_freq_settings_sla : m_freq_settings_fff;
319 bool changed_existing = false;
320
321 std::vector<std::string> tmp_freq_cat = {};
322
323 for (auto& cat : freq_settings)
324 {
325 if (_(cat.first) == category_name)
326 {
327 std::vector<std::string>& freq_settings_category = cat.second;
328 freq_settings_category.clear();
329 freq_settings_category.reserve(selection_cnt);
330 for (auto sel : selections)
331 freq_settings_category.push_back((*settings_list)[sel].first);
332
333 changed_existing = true;
334 break;
335 }
336 }
337
338 if (!changed_existing)
339 {
340 // Create new "Quick menu" item
341 for (auto& cat : settings_menu)
342 {
343 if (_(cat.first) == category_name)
344 {
345 freq_settings[cat.first] = std::vector<std::string>{};
346
347 std::vector<std::string>& freq_settings_category = freq_settings.find(cat.first)->second;
348 freq_settings_category.reserve(selection_cnt);
349 for (auto sel : selections)
350 freq_settings_category.push_back((*settings_list)[sel].first);
351 break;
352 }
353 }
354 }
355 }
356#endif
357 };
358
359 for (auto cat : categories) {
360 append_menu_item(menu, wxID_ANY, _(cat.first), "",
361 [menu, item, get_selected_options_for_category](wxCommandEvent& event) {
362 std::vector< std::pair<std::string, bool> > category_options = get_selected_options_for_category(menu->GetLabel(event.GetId()));
363 obj_list()->add_category_to_settings_from_selection(category_options, item);
364 }, SettingsFactory::get_category_bitmap(cat.first), parent_menu,
365 []() { return true; }, plater());
366 }
367
368 return menu;
369}
ModelConfig & get_item_config(const wxDataViewItem &item) const
Definition GUI_ObjectList.cpp:557
Definition PrintConfig.hpp:1227
t_config_option_keys keys() const
Definition PrintConfig.hpp:1273
static void get_full_settings_hierarchy(FullSettingsHierarchy &settings_menu, const bool is_part)
Definition GUI_Factories.cpp:196
static int GetSelectedChoices(wxArrayInt &selections, const wxString &message, const wxString &caption, const wxArrayString &choices)
Definition GUI_Factories.cpp:220
std::map< std::string, std::vector< std::pair< std::string, std::string > > > FullSettingsHierarchy
Definition GUI_Factories.cpp:195
@ ptSLA
Definition Config.hpp:209
IGL_INLINE void cat(const int dim, const Eigen::SparseMatrix< Scalar > &A, const Eigen::SparseMatrix< Scalar > &B, Eigen::SparseMatrix< Scalar > &C)
Definition cat.cpp:21

References _, _L, append_menu_item(), Slic3r::GUI::SettingsFactory::get_category_bitmap(), get_full_settings_hierarchy(), Slic3r::GUI::ObjectList::get_item_config(), GetSelectedChoices(), Slic3r::ModelConfig::keys(), obj_list(), plater(), printer_technology(), and Slic3r::ptSLA.

Referenced by Slic3r::GUI::MenuFactory::append_menu_item_settings().

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

◆ create_volumes_name()

static std::string Slic3r::GUI::create_volumes_name ( const std::set< ObjectID > &  ids,
const Selection selection 
)
static
81 {
82 assert(!ids.empty());
83 std::string name;
84 bool is_first = true;
85 for (const ObjectID &id : ids) {
86 if (is_first)
87 is_first = false;
88 else
89 name += " + ";
90
91 const ModelVolume *volume = get_volume(id, selection);
92 assert(volume != nullptr);
93 name += volume->name;
94 }
95 return name;
96}
Definition ObjectID.hpp:21
static float get_volume(stl_file *stl)
Definition util.cpp:276

References get_volume().

Referenced by Slic3r::GUI::GLGizmoSimplify::apply_simplify(), and Slic3r::GUI::GLGizmoSimplify::on_render_input_window().

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

◆ create_word_local_combo()

static choice_ctrl * Slic3r::GUI::create_word_local_combo ( wxWindow *  parent)
static
39{
40 wxSize size(15 * wxGetApp().em_unit(), -1);
41
42 choice_ctrl* temp = nullptr;
43#ifdef __WXOSX__
44 /* wxBitmapComboBox with wxCB_READONLY style return NULL for GetTextCtrl(),
45 * so ToolTip doesn't shown.
46 * Next workaround helps to solve this problem
47 */
48 temp = new wxBitmapComboBox();
49 temp->SetTextCtrlStyle(wxTE_READONLY);
50 temp->Create(parent, wxID_ANY, wxString(""), wxDefaultPosition, size, 0, nullptr);
51#else
52 temp = new choice_ctrl(parent, wxID_ANY, wxString(""), wxDefaultPosition, size, 0, nullptr, wxCB_READONLY | wxBORDER_SIMPLE);
53#endif //__WXOSX__
54
55 temp->SetFont(Slic3r::GUI::wxGetApp().normal_font());
56 if (!wxOSX) temp->SetBackgroundStyle(wxBG_STYLE_PAINT);
57
58 temp->Append(ObjectManipulation::coordinate_type_str(ECoordinatesType::World));
59 temp->Append(ObjectManipulation::coordinate_type_str(ECoordinatesType::Instance));
60 temp->Append(ObjectManipulation::coordinate_type_str(ECoordinatesType::Local));
61 temp->Select((int)ECoordinatesType::World);
62
63 temp->SetToolTip(_L("Select coordinate space, in which the transformation will be performed."));
64 return temp;
65}
#define wxOSX
Definition Field.cpp:26
wxComboBox choice_ctrl
Definition Field.cpp:981
int em_unit(wxWindow *win)
Definition wxExtensions.cpp:388

References _L, Slic3r::GUI::ObjectManipulation::coordinate_type_str(), em_unit(), Instance, Local, World, and wxOSX.

Referenced by Slic3r::GUI::ObjectManipulation::ObjectManipulation().

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

◆ debugged()

bool Slic3r::GUI::debugged ( )
62{
63 #ifdef _WIN32
64 return IsDebuggerPresent() == TRUE;
65 #else
66 return false;
67 #endif /* _WIN32 */
68}
#define TRUE
Definition mesh.c:42

References TRUE.

◆ def_text_color()

static std::string Slic3r::GUI::def_text_color ( )
static
59{
60 wxColour def_colour = wxGetApp().get_label_clr_default();
61 return encode_color(ColorRGB(def_colour.Red(), def_colour.Green(), def_colour.Blue()));
62}
Definition Color.hpp:12

References Slic3r::encode_color().

Referenced by Slic3r::GUI::ModelNode::ModelNode(), Slic3r::GUI::DiffModel::AddOption(), Slic3r::GUI::DiffModel::AddPreset(), and Slic3r::GUI::ModelNode::UpdateEnabling().

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

◆ desktop_open_datadir_folder()

void Slic3r::GUI::desktop_open_datadir_folder ( )
469{
470 boost::filesystem::path path(data_dir());
471 desktop_open_folder(std::move(path));
472}
void desktop_open_folder(const boost::filesystem::path &path)
Definition GUI.cpp:474
const std::string & data_dir()
Definition utils.cpp:206

References Slic3r::data_dir(), and desktop_open_folder().

Referenced by generate_help_menu().

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

◆ desktop_open_folder()

void Slic3r::GUI::desktop_open_folder ( const boost::filesystem::path &  path)
475{
476 if (!boost::filesystem::is_directory(path))
477 return;
478
479 // Execute command to open a file explorer, platform dependent.
480#ifdef _WIN32
481 const wxString widepath = path.wstring();
482 const wchar_t* argv[] = { L"explorer", widepath.GetData(), nullptr };
483 ::wxExecute(const_cast<wchar_t**>(argv), wxEXEC_ASYNC, nullptr);
484#elif __APPLE__
485 const char* argv[] = { "open", path.string().c_str(), nullptr };
486 ::wxExecute(const_cast<char**>(argv), wxEXEC_ASYNC, nullptr);
487#else
488 const char* argv[] = { "xdg-open", path.string().c_str(), nullptr };
489 desktop_execute(argv);
490#endif
491}

References L.

Referenced by desktop_open_datadir_folder(), and Slic3r::AppUpdater::sync_download().

+ Here is the caller graph for this function:

◆ diamond()

GLModel::Geometry Slic3r::GUI::diamond ( unsigned int  resolution)
1499{
1500 resolution = std::max<unsigned int>(4, resolution);
1501
1502 GLModel::Geometry data;
1503 data.format = { GLModel::Geometry::EPrimitiveType::Triangles, GLModel::Geometry::EVertexLayout::P3N3 };
1504 data.reserve_vertices(resolution + 2);
1505 data.reserve_indices((2 * (resolution + 1)) * 3);
1506
1507 const float step = 2.0f * float(PI) / float(resolution);
1508
1509 // vertices
1510 for (unsigned int i = 0; i < resolution; ++i) {
1511 const float ii = float(i) * step;
1512 const Vec3f p = { 0.5f * ::cos(ii), 0.5f * ::sin(ii), 0.0f };
1513 data.add_vertex(p, (Vec3f)p.normalized());
1514 }
1515 Vec3f p = { 0.0f, 0.0f, 0.5f };
1516 data.add_vertex(p, (Vec3f)p.normalized());
1517 p = { 0.0f, 0.0f, -0.5f };
1518 data.add_vertex(p, (Vec3f)p.normalized());
1519
1520 // triangles
1521 // top
1522 for (unsigned int i = 0; i < resolution; ++i) {
1523 data.add_triangle(i + 0, i + 1, resolution);
1524 }
1525 data.add_triangle(resolution - 1, 0, resolution);
1526
1527 // bottom
1528 for (unsigned int i = 0; i < resolution; ++i) {
1529 data.add_triangle(i + 0, resolution + 1, i + 1);
1530 }
1531 data.add_triangle(resolution - 1, resolution + 1, 0);
1532
1533 return data;
1534}

References cos(), Slic3r::GUI::GLModel::Geometry::P3N3, PI, sin(), and Slic3r::GUI::GLModel::Geometry::Triangles.

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

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

◆ disable_screensaver()

void Slic3r::GUI::disable_screensaver ( )
41{
42 #if __APPLE__
43 CFStringRef reasonForActivity = CFSTR("Slic3r");
44 [[maybe_unused]]IOReturn success = IOPMAssertionCreateWithName(kIOPMAssertionTypeNoDisplaySleep,
45 kIOPMAssertionLevelOn, reasonForActivity, &assertionID);
46 // ignore result: success == kIOReturnSuccess
47 #elif _WIN32
48 SetThreadExecutionState(ES_DISPLAY_REQUIRED | ES_CONTINUOUS);
49 #endif
50}

◆ dots()

◆ double_to_string()

wxString Slic3r::GUI::double_to_string ( double const  value,
const int  max_precision 
)
32{
33// Style_NoTrailingZeroes does not work on OSX. It also does not work correctly with some locales on Windows.
34// return wxNumberFormatter::ToString(value, max_precision, wxNumberFormatter::Style_NoTrailingZeroes);
35
36 wxString s = wxNumberFormatter::ToString(value, std::abs(value) < 0.0001 ? 10 : max_precision, wxNumberFormatter::Style_None);
37
38 // The following code comes from wxNumberFormatter::RemoveTrailingZeroes(wxString& s)
39 // with the exception that here one sets the decimal separator explicitely to dot.
40 // If number is in scientific format, trailing zeroes belong to the exponent and cannot be removed.
41 if (s.find_first_of("eE") == wxString::npos) {
42 char dec_sep = is_decimal_separator_point() ? '.' : ',';
43 const size_t posDecSep = s.find(dec_sep);
44 // No decimal point => removing trailing zeroes irrelevant for integer number.
45 if (posDecSep != wxString::npos) {
46 // Find the last character to keep.
47 size_t posLastNonZero = s.find_last_not_of("0");
48 // If it's the decimal separator itself, don't keep it either.
49 if (posLastNonZero == posDecSep)
50 -- posLastNonZero;
51 s.erase(posLastNonZero + 1);
52 // Remove sign from orphaned zero.
53 if (s.compare("-0") == 0)
54 s = "0";
55 }
56 }
57
58 return s;
59}
bool is_decimal_separator_point()
Definition LocalesUtils.cpp:47

References Slic3r::is_decimal_separator_point().

Referenced by Slic3r::GUI::ExtruderSequenceDialog::ExtruderSequenceDialog(), Slic3r::GUI::LayerRangeEditor::LayerRangeEditor(), Slic3r::GUI::PageBuildVolume::PageBuildVolume(), Slic3r::GUI::PageDiameters::PageDiameters(), Slic3r::GUI::BedShape::apply_optgroup_values(), Slic3r::GUI::TextCtrl::BUILD(), Slic3r::GUI::ObjectLayers::create_layer(), focus_event(), Slic3r::GUI::ConfigOptionsGroup::get_config_value(), Slic3r::GUI::BedShape::get_full_name_with_params(), get_string_value(), Slic3r::GUI::Field::get_value_by_opt_type(), Slic3r::DoubleSlider::get_value_to_jump(), Slic3r::GUI::GLGizmoCut3D::render_build_size(), Slic3r::GUI::Choice::set_selection(), Slic3r::GUI::ObjectManipulation::update_if_dirty(), and Slic3r::GUI::ObjectManipulation::update_ui_from_settings().

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

◆ draw()

void Slic3r::GUI::draw ( const IconManager::Icon icon,
const ImVec2 size = ImVec2(0, 0),
const ImVec4 tint_col = ImVec4(1, 1, 1, 1),
const ImVec4 border_col = ImVec4(0, 0, 0, 0) 
)

Draw imgui image with icon.

Parameters
iconPlace in texture
size[optional]Size of image, wen zero than use same size as stored texture
tint_colviz ImGui::Image
border_colviz ImGui::Image
165{
166 // Check input
167 if (!icon.is_valid()) {
168 assert(false);
169 BOOST_LOG_TRIVIAL(warning) << "Drawing invalid Icon.";
170 ImGui::Text("?");
171 return;
172 }
173
174 ImTextureID id = (void *)static_cast<intptr_t>(icon.tex_id);
175 const ImVec2 &s = (size.x < 1 || size.y < 1) ? icon.size : size;
176 ImGui::Image(id, s, icon.tl, icon.br, tint_col, border_col);
177}
void * ImTextureID
Definition imgui.h:205
IMGUI_API void Text(const char *fmt,...) IM_FMTARGS(1)
Definition imgui_widgets.cpp:260
IMGUI_API void Image(ImTextureID user_texture_id, const ImVec2 &size, const ImVec2 &uv0=ImVec2(0, 0), const ImVec2 &uv1=ImVec2(1, 1), const ImVec4 &tint_col=ImVec4(1, 1, 1, 1), const ImVec4 &border_col=ImVec4(0, 0, 0, 0))
Definition imgui_widgets.cpp:1000
Definition imgui.h:245
ImVec2 br
Definition IconManager.hpp:58
ImVec2 size
Definition IconManager.hpp:54
bool is_valid() const
Definition IconManager.hpp:62
ImVec2 tl
Definition IconManager.hpp:57
unsigned int tex_id
Definition IconManager.hpp:61

References Slic3r::GUI::IconManager::Icon::br, ImGui::Image(), Slic3r::GUI::IconManager::Icon::is_valid(), Slic3r::GUI::IconManager::Icon::size, Slic3r::GUI::IconManager::Icon::tex_id, ImGui::Text(), and Slic3r::GUI::IconManager::Icon::tl.

Referenced by button(), clickable(), Slic3r::GUI::GLGizmoEmboss::draw_bold_button(), Slic3r::GUI::GLGizmoEmboss::draw_italic_button(), Slic3r::GUI::GLGizmoEmboss::draw_text_input(), priv::draw_transparent_icon(), and Slic3r::GUI::GLGizmoEmboss::revertible().

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

◆ enable_screensaver()

void Slic3r::GUI::enable_screensaver ( )
53{
54 #if __APPLE__
55 IOPMAssertionRelease(assertionID);
56 #elif _WIN32
57 SetThreadExecutionState(ES_CONTINUOUS);
58 #endif
59}

◆ extruder2str()

static wxString Slic3r::GUI::extruder2str ( int  extruder)
static
3012{
3013 return extruder == 0 ? _L("default") : wxString::Format("%d", extruder);
3014}

References _L.

Referenced by Slic3r::GUI::ObjectList::add_layer_item(), Slic3r::GUI::ObjectList::add_object_to_list(), and Slic3r::GUI::ObjectList::add_volumes_to_object_in_list().

+ Here is the caller graph for this function:

◆ extruders_count() [1/2]

◆ extruders_count() [2/2]

static int Slic3r::GUI::extruders_count ( )
static
63{
64 return wxGetApp().extruders_edited_cnt();
65}

◆ fatal_error()

void Slic3r::GUI::fatal_error ( wxWindow *  parent)
1909{
1910 show_error(parent, "");
1911 // exit 1; // #ys_FIXME
1912}
void show_error(wxWindow *parent, const wxString &message, bool monospaced_font)
Definition GUI.cpp:224

References show_error().

+ Here is the call graph for this function:

◆ file_wildcards() [1/2]

static wxString Slic3r::GUI::file_wildcards ( const FileWildcards data)
static
500{
501 std::string title;
502 std::string mask;
503
504 // Generate cumulative first item
505 for (const std::string_view& ext : data.file_extensions) {
506 if (title.empty()) {
507 title = "*";
508 title += ext;
509 mask = title;
510 }
511 else {
512 title += ", *";
513 title += ext;
514 mask += ";*";
515 mask += ext;
516 }
517 mask += ";*";
518 mask += boost::to_upper_copy(std::string(ext));
519 }
520
521 wxString ret = GUI::format_wxstr("%s (%s)|%s", data.title, title, mask);
522
523 // Adds an item for each of the extensions
524 if (data.file_extensions.size() > 1) {
525 for (const std::string_view& ext : data.file_extensions) {
526 title = "*";
527 title += ext;
528 ret += GUI::format_wxstr("|%s (%s)|%s", data.title, title, title);
529 }
530 }
531
532 return ret;
533}

References format_wxstr().

Referenced by Slic3r::GUI::MainFrame::export_config(), Slic3r::GUI::MainFrame::export_configbundle(), Slic3r::GUI::Plater::export_gcode(), Slic3r::GUI::Plater::priv::get_export_file(), Slic3r::GUI::GUI_App::import_model(), Slic3r::GUI::GUI_App::import_zip(), Slic3r::GUI::MainFrame::load_configbundle(), Slic3r::GUI::GUI_App::load_gcode(), Slic3r::GUI::BedShapePanel::load_model(), Slic3r::GUI::GUI_App::load_project(), Slic3r::GUI::BedShapePanel::load_stl(), Slic3r::GUI::BedShapePanel::load_texture(), Slic3r::GUI::Plater::priv::reload_from_disk(), Slic3r::GUI::MainFrame::repair_stl(), Slic3r::GUI::Plater::priv::replace_with_stl(), sla_wildcards(), and start_new_gcodeviewer_open_file().

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

◆ file_wildcards() [2/2]

wxString Slic3r::GUI::file_wildcards ( FileType  file_type,
const std::string &  custom_extension 
)
548{
549 const FileWildcards& data = file_wildcards_by_type[file_type];
550 std::string title;
551 std::string mask;
552 std::string custom_ext_lower;
553
554 if (! custom_extension.empty()) {
555 // Generate an extension into the title mask and into the list of extensions.
556 custom_ext_lower = boost::to_lower_copy(custom_extension);
557 const std::string custom_ext_upper = boost::to_upper_copy(custom_extension);
558 if (custom_ext_lower == custom_extension) {
559 // Add a lower case version.
560 title = std::string("*") + custom_ext_lower;
561 mask = title;
562 // Add an upper case version.
563 mask += ";*";
564 mask += custom_ext_upper;
565 } else if (custom_ext_upper == custom_extension) {
566 // Add an upper case version.
567 title = std::string("*") + custom_ext_upper;
568 mask = title;
569 // Add a lower case version.
570 mask += ";*";
571 mask += custom_ext_lower;
572 } else {
573 // Add the mixed case version only.
574 title = std::string("*") + custom_extension;
575 mask = title;
576 }
577 }
578
579 for (const std::string_view &ext : data.file_extensions)
580 // Only add an extension if it was not added first as the custom extension.
581 if (ext != custom_ext_lower) {
582 if (title.empty()) {
583 title = "*";
584 title += ext;
585 mask = title;
586 } else {
587 title += ", *";
588 title += ext;
589 mask += ";*";
590 mask += ext;
591 }
592 mask += ";*";
593 mask += boost::to_upper_copy(std::string(ext));
594 }
595
596 return GUI::format_wxstr("%s (%s)|%s", data.title, title, mask);
597}
static const FileWildcards file_wildcards_by_type[FT_SIZE]
Definition GUI_App.cpp:476
Definition GUI_App.cpp:469

References file_wildcards_by_type, and format_wxstr().

Referenced by Slic3r::GUI::GalleryDialog::add_custom_shapes().

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

◆ find_bndl()

wxBitmapBundle * Slic3r::GUI::find_bndl ( const std::string &  bmp_name)
23{
24 if (!m_bitmap_cache)
26
27 return m_bitmap_cache->find_bndl(bmp_name);
28}
Definition BitmapCache.hpp:20
wxBitmapBundle * find_bndl(const std::string &name)
Definition BitmapCache.hpp:27
BitmapCache * m_bitmap_cache
Definition ObjectDataViewModel.cpp:20

References Slic3r::GUI::BitmapCache::find_bndl(), and m_bitmap_cache.

Referenced by Slic3r::GUI::ObjectDataViewModelNode::update_settings_digest_bitmaps(), and Slic3r::GUI::ObjectDataViewModel::UpdateBitmapForNode().

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

◆ find_close_layer_idx()

static int Slic3r::GUI::find_close_layer_idx ( const std::vector< double > &  zs,
double &  z,
double  eps 
)
static
434{
435 if (zs.empty())
436 return -1;
437 auto it_h = std::lower_bound(zs.begin(), zs.end(), z);
438 if (it_h == zs.end()) {
439 auto it_l = it_h;
440 -- it_l;
441 if (z - *it_l < eps)
442 return int(zs.size() - 1);
443 } else if (it_h == zs.begin()) {
444 if (*it_h - z < eps)
445 return 0;
446 } else {
447 auto it_l = it_h;
448 -- it_l;
449 double dist_l = z - *it_l;
450 double dist_h = *it_h - z;
451 if (std::min(dist_l, dist_h) < eps) {
452 return (dist_l < dist_h) ? int(it_l - zs.begin()) : int(it_h - zs.begin());
453 }
454 }
455 return -1;
456}

Referenced by Slic3r::GUI::Preview::update_layers_slider().

+ Here is the caller graph for this function:

◆ find_toplevel_parent()

wxTopLevelWindow * Slic3r::GUI::find_toplevel_parent ( wxWindow *  window)
34{
35 for (; window != nullptr; window = window->GetParent()) {
36 if (window->IsTopLevel()) {
37 return dynamic_cast<wxTopLevelWindow*>(window);
38 }
39 }
40
41 return nullptr;
42}

Referenced by em_unit(), Slic3r::GUI::ObjectList::fix_through_netfabb(), Slic3r::GUI::Plater::priv::load_files(), and Slic3r::GUI::Tab::OnActivate().

+ Here is the caller graph for this function:

◆ focus_event()

static void Slic3r::GUI::focus_event ( wxFocusEvent &  e,
wxTextCtrl *  ctrl,
double  def_value 
)
static
1749{
1750 e.Skip();
1751 wxString str = ctrl->GetValue();
1752
1753 const char dec_sep = is_decimal_separator_point() ? '.' : ',';
1754 const char dec_sep_alt = dec_sep == '.' ? ',' : '.';
1755 // Replace the first incorrect separator in decimal number.
1756 bool was_replaced = str.Replace(dec_sep_alt, dec_sep, false) != 0;
1757
1758 double val = 0.0;
1759 if (!str.ToDouble(&val)) {
1760 if (val == 0.0)
1761 val = def_value;
1762 ctrl->SetValue(double_to_string(val));
1763 show_error(nullptr, _L("Invalid numeric input."));
1764 // On Windows, this SetFocus creates an invisible marker.
1765 //ctrl->SetFocus();
1766 }
1767 else if (was_replaced)
1768 ctrl->SetValue(double_to_string(val));
1769}
wxString double_to_string(double const value, const int max_precision)
Definition Field.cpp:31

References _L, double_to_string(), Slic3r::is_decimal_separator_point(), and show_error().

Referenced by Slic3r::GUI::PageDiameters::PageDiameters().

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

◆ format() [1/3]

template<typename... TArgs>
std::string Slic3r::GUI::format ( const char *  fmt,
TArgs &&...  args 
)
inline
56 {
57 return Slic3r::format(fmt, std::forward<TArgs>(args)...);
58}
std::string format(const char *fmt, TArgs &&... args)
Definition format.hpp:44

References Slic3r::format().

Referenced by Slic3r::GUI::AppUpdateDownloadDialog::AppUpdateDownloadDialog(), Slic3r::CurlGlobalInit::CurlGlobalInit(), Slic3r::GUI::GLCanvas3D::_init_undoredo_toolbar(), Slic3r::GUI::GUI_App::add_config_menu(), Slic3r::GUI::GLGizmoSimplify::add_simplify_suggestion_notification(), Slic3r::GUI::NotificationManager::UpdatedItemsInfoNotification::add_type(), Slic3r::GUI::GLModel::Geometry::add_vertex(), Slic3r::GUI::GLModel::Geometry::add_vertex(), Slic3r::GUI::GLModel::Geometry::add_vertex(), Slic3r::GUI::GLModel::Geometry::add_vertex(), Slic3r::GUI::GLModel::Geometry::add_vertex(), Slic3r::GUI::GUI_App::app_updater(), Slic3r::GUI::GUI_App::check_older_app_config(), Slic3r::PresetHints::cooling_description(), Slic3r::GUI::Config::copy_config_dir_single_level(), Slic3r::anonymous_namespace{PresetUpdater.cpp}::copy_file_fix(), Slic3r::GUI::GLGizmoEmboss::create_notification_not_valid_font(), Slic3r::AppUpdater::priv::download_file(), Slic3r::GUI::ImGuiWrapper::drag_optional_float(), Slic3r::GUI::GLGizmoEmboss::draw_delete_style_button(), Slic3r::GUI::GLGizmoEmboss::draw_style_list(), Slic3r::GUI::GLGizmoEmboss::draw_style_rename_popup(), Slic3r::GUI::GLGizmoEmboss::draw_style_save_button(), Slic3r::GUI::GLModel::Geometry::extract_normal_3(), Slic3r::GUI::GLModel::Geometry::extract_position_2(), Slic3r::GUI::GLModel::Geometry::extract_position_3(), Slic3r::GUI::GLModel::Geometry::extract_tex_coord_2(), Slic3r::GUI::Emboss::CreateFontStyleImagesJob::finalize(), Slic3r::GUI::ArrangeJob::finalize(), Slic3r::BackgroundSlicingProcess::finalize_gcode(), Slic3r::SlicingProcessCompletedEvent::format_error_message(), Slic3r::GUI::AppUpdateDownloadDialog::get_download_path(), Slic3r::PresetUpdater::priv::get_missing_resource(), Slic3r::PresetUpdater::priv::get_or_copy_missing_resource(), Slic3r::GUI::FileGet::priv::get_perform(), get_primitive_mode(), Slic3r::Repetier::get_printers(), Slic3r::PrusaLink::get_storage(), Slic3r::GUI::GLGizmoMmuSegmentation::handle_snapshot_action_name(), Slic3r::GUI::GLModel::Geometry::has_normal(), Slic3r::GUI::GLModel::Geometry::has_position(), Slic3r::GUI::GLModel::Geometry::has_tex_coord(), Slic3r::AppUpdater::priv::http_get_file(), Slic3r::GUI::GUI_App::init_app_config(), Slic3r::GUI::ImGuiWrapper::input_optional_float(), Slic3r::PresetUpdater::install_bundles_rsrc_or_cache_vendor(), Slic3r::GUI::BundleMap::load(), Slic3r::GUI::Plater::priv::load_files(), Slic3r::GUI::HintDatabase::load_hints_from_file(), Slic3r::GUI::GUI_App::load_language(), Slic3r::GUI::GLModel::Geometry::normal_offset_floats(), Slic3r::GUI::GLModel::Geometry::normal_stride_floats(), Slic3r::GUI::GLGizmoSimplify::on_render_input_window(), Slic3r::GUI::Plater::priv::on_slicing_update(), Slic3r::GUI::DownloaderUtils::Worker::perform_register(), Slic3r::GUI::GLModel::Geometry::position_offset_floats(), Slic3r::GUI::GLModel::Geometry::position_stride_floats(), Slic3r::BackgroundSlicingProcess::prepare_upload(), Slic3r::GUI::Plater::preview_zip_archive(), Slic3r::BackgroundSlicingProcess::process_sla(), Slic3r::GUI::GLModel::Geometry::remove_vertex(), Slic3r::GUI::GCodeViewer::render_legend(), Slic3r::GUI::ConfigWizard::priv::select_default_materials_for_printer_models(), Slic3r::PrusaConnect::set_http_post_header_args(), Slic3r::GUI::GLModel::Geometry::set_vertex(), show_notification_extruders_limit_exceeded(), sla_wildcards(), Slic3r::GUI::ImGuiWrapper::slider_float(), Slic3r::GUI::ImGuiWrapper::slider_float(), Slic3r::GUI::ImGuiWrapper::slider_float(), Slic3r::GUI::ImGuiWrapper::slider_optional_float(), Slic3r::GUI::ImGuiWrapper::slider_optional_int(), Slic3r::GUI::Downloader::start_download(), Slic3r::GUI::PrintHostSendDialog::storage(), Slic3r::GUI::GLModel::Geometry::tex_coord_offset_floats(), Slic3r::GUI::GLModel::Geometry::tex_coord_stride_floats(), Slic3r::GUI::Preview::update_layers_slider(), priv::update_volume(), Slic3r::AppUpdater::priv::version_check(), and Slic3r::GUI::GLModel::Geometry::vertex_stride_floats().

+ Here is the call graph for this function:

◆ format() [2/3]

template<typename... TArgs>
std::string Slic3r::GUI::format ( const std::string &  fmt,
TArgs &&...  args 
)
inline
60 {
61 return Slic3r::format(fmt, std::forward<TArgs>(args)...);
62}

References Slic3r::format().

+ Here is the call graph for this function:

◆ format() [3/3]

template<typename... TArgs>
std::string Slic3r::GUI::format ( const wxString &  fmt,
TArgs &&...  args 
)
inline
64 {
65 return Slic3r::format(fmt.ToUTF8().data(), std::forward<TArgs>(args)...);
66}

References Slic3r::format().

+ Here is the call graph for this function:

◆ format_double()

static std::string Slic3r::GUI::format_double ( double  value)
static
45{
46 char buf[1024];
47 sprintf(buf, "%.3f", value);
48 return std::string(buf);
49}

Referenced by Slic3r::GUI::GLGizmoMeasure::on_render_input_window(), and Slic3r::GUI::GLGizmoMeasure::render_dimensioning().

+ Here is the caller graph for this function:

◆ format_reason()

static wxString Slic3r::GUI::format_reason ( const Config::Snapshot::Reason  reason)
static
18{
19 switch (reason) {
20 case Config::Snapshot::SNAPSHOT_UPGRADE:
21 return wxString(_(L("Upgrade")));
22 case Config::Snapshot::SNAPSHOT_DOWNGRADE:
23 return wxString(_(L("Downgrade")));
24 case Config::Snapshot::SNAPSHOT_BEFORE_ROLLBACK:
25 return wxString(_(L("Before roll back")));
26 case Config::Snapshot::SNAPSHOT_USER:
27 return wxString(_(L("User")));
28 case Config::Snapshot::SNAPSHOT_UNKNOWN:
29 default:
30 return wxString(_(L("Unknown")));
31 }
32}

References _, L, Slic3r::GUI::Config::Snapshot::SNAPSHOT_BEFORE_ROLLBACK, Slic3r::GUI::Config::Snapshot::SNAPSHOT_DOWNGRADE, Slic3r::GUI::Config::Snapshot::SNAPSHOT_UNKNOWN, Slic3r::GUI::Config::Snapshot::SNAPSHOT_UPGRADE, and Slic3r::GUI::Config::Snapshot::SNAPSHOT_USER.

Referenced by generate_html_row().

+ Here is the caller graph for this function:

◆ format_vec3()

static std::string Slic3r::GUI::format_vec3 ( const Vec3d v)
static
52{
53 char buf[1024];
54 sprintf(buf, "X: %.3f, Y: %.3f, Z: %.3f", v.x(), v.y(), v.z());
55 return std::string(buf);
56}

Referenced by Slic3r::GUI::GLGizmoMeasure::on_render_input_window().

+ Here is the caller graph for this function:

◆ format_wxstr() [1/3]

template<typename... TArgs>
wxString Slic3r::GUI::format_wxstr ( const char *  fmt,
TArgs &&...  args 
)
inline
42 {
43 boost::format message(fmt);
44 return wxString::FromUTF8(Slic3r::internal::format::format_recursive(message, std::forward<TArgs>(args)...).c_str());
45}
std::string format_recursive(boost::format &message)
Definition format.hpp:30

References Slic3r::internal::format::format_recursive(), and format_wxstr().

Referenced by Slic3r::GUI::AboutDialog::AboutDialog(), Slic3r::GUI::AppUpdateDownloadDialog::AppUpdateDownloadDialog(), Slic3r::GUI::CopyrightsDialog::CopyrightsDialog(), Slic3r::IPListDialog::IPListDialog(), Slic3r::GUI::LoadProjectsDialog::LoadProjectsDialog(), Slic3r::GUI::MsgDataLegacy::MsgDataLegacy(), Slic3r::GUI::MsgNoAppUpdates::MsgNoAppUpdates(), Slic3r::GUI::ObjectManipulation::ObjectManipulation(), Slic3r::GUI::PageDownloader::PageDownloader(), Slic3r::GUI::PagePrinters::PagePrinters(), Slic3r::GUI::PageWelcome::PageWelcome(), Slic3r::GUI::PrinterPicker::PrinterPicker(), Slic3r::GUI::ProjectDropDialog::ProjectDropDialog(), Slic3r::GUI::SendSystemInfoDialog::SendSystemInfoDialog(), Slic3r::GUI::SysInfoDialog::SysInfoDialog(), Slic3r::GUI::GLCanvas3D::_render_arrange_menu(), add_config_substitutions(), add_msg_content(), Slic3r::GUI::MenuFactory::append_menu_item_settings(), Slic3r::GUI::UnsavedChangesDialog::build(), change_opt_value(), Slic3r::GUI::GUI_App::check_older_app_config(), Slic3r::GUI::GUI_App::check_print_host_queue(), Slic3r::GUI::Tab::compatible_widget_create(), Slic3r::PresetUpdater::config_update(), Slic3r::GUI::Tab::create_preset_tab(), Slic3r::GUI::PreferencesDialog::create_settings_font_widget(), Slic3r::GUI::PresetComboBox::del_physical_printer(), Slic3r::GUI::Tab::delete_preset(), Slic3r::GUI::GLGizmoEmboss::draw_delete_style_button(), Slic3r::GUI::GLGizmoEmboss::draw_font_list(), Slic3r::GUI::GLGizmoEmboss::draw_style_list(), Slic3r::GUI::Plater::export_3mf(), file_wildcards(), file_wildcards(), format_wxstr(), format_wxstr(), format_wxstr(), generate_html_row(), generic_exception_handle(), Slic3r::GUI::CopyrightsDialog::get_html_text(), Slic3r::GUI::ObjectList::get_mesh_errors_info(), Slic3r::GUI::FileGet::priv::get_perform(), Slic3r::PrusaLink::get_storage(), Slic3r::AstroBox::get_test_failed_msg(), Slic3r::Duet::get_test_failed_msg(), Slic3r::FlashAir::get_test_failed_msg(), Slic3r::MKS::get_test_failed_msg(), Slic3r::Moonraker::get_test_failed_msg(), Slic3r::OctoPrint::get_test_failed_msg(), Slic3r::PrusaLink::get_test_failed_msg(), Slic3r::PrusaConnect::get_test_failed_msg(), Slic3r::SL1Host::get_test_failed_msg(), Slic3r::Repetier::get_test_failed_msg(), Slic3r::GUI::Field::get_value_by_opt_type(), GUI_Run(), ModeButton::Init(), Slic3r::GUI::OpenGLManager::init_gl(), Slic3r::GUI::Plater::priv::load_files(), Slic3r::GUI::GalleryDialog::load_files(), Slic3r::GUI::PrintHostQueueDialog::on_error(), Slic3r::GUI::Downloader::on_error(), Slic3r::GUI::GLGizmoFdmSupports::on_render_input_window(), Slic3r::GUI::PhysicalPrinterDialog::OnOK(), Slic3r::GUI::GUI_App::open_browser_with_warning_dialog(), Slic3r::PresetUpdater::priv::perform_updates(), Slic3r::GUI::Plater::preview_zip_archive(), Slic3r::GUI::GLGizmoCut3D::render_input_window_warning(), Slic3r::GUI::Plater::priv::save_project_if_dirty(), Slic3r::GUI::PageMaterials::set_compatible_printers_html_window(), Slic3r::GUI::GUI_App::show_downloader_registration_dialog(), Slic3r::GUI::UnsavedChangesDialog::show_info_line(), Slic3r::GUI::Sidebar::show_info_sizer(), show_substitutions_info(), show_substitutions_info(), show_warning(), Slic3r::AstroBox::test(), Slic3r::OctoPrint::test(), Slic3r::PrusaLink::test(), Slic3r::Repetier::test(), Slic3r::PrusaLink::test_with_method_check(), Slic3r::GUI::ObjectList::toggle_printable_state(), Slic3r::GUI::Plater::priv::undo_redo_to(), Slic3r::GUI::UnsavedChangesDialog::update(), Slic3r::GUI::TabSLAPrint::update_description_lines(), Slic3r::GUI::TabFilament::update_extruder_combobox(), Slic3r::GUI::PhysicalPrinterDialog::update_full_printer_names(), Slic3r::GUI::SavePresetDialog::update_info_for_edit_ph_printer(), Slic3r::GUI::ConfigManipulation::update_print_fff_config(), Slic3r::GUI::ObjectSettings::update_settings_list(), Slic3r::GUI::Sidebar::update_sliced_info_sizer(), Slic3r::OctoPrint::upload(), Slic3r::GUI::Tab::validate_custom_gcode(), and Slic3r::GUI::Plater::priv::warnings_dialog().

+ Here is the call graph for this function:

◆ format_wxstr() [2/3]

template<typename... TArgs>
wxString Slic3r::GUI::format_wxstr ( const std::string &  fmt,
TArgs &&...  args 
)
inline
47 {
48 boost::format message(fmt);
49 return wxString::FromUTF8(Slic3r::internal::format::format_recursive(message, std::forward<TArgs>(args)...).c_str());
50}

References Slic3r::internal::format::format_recursive(), and format_wxstr().

+ Here is the call graph for this function:

◆ format_wxstr() [3/3]

template<typename... TArgs>
wxString Slic3r::GUI::format_wxstr ( const wxString &  fmt,
TArgs &&...  args 
)
inline
52 {
53 return format_wxstr(fmt.ToUTF8().data(), std::forward<TArgs>(args)...);
54}

References format_wxstr().

+ Here is the call graph for this function:

◆ from_path()

wxString Slic3r::GUI::from_path ( const boost::filesystem::path &  path)
449{
450#ifdef _WIN32
451 return wxString(path.string<std::wstring>());
452#else
453 return from_u8(path.string<std::string>());
454#endif
455}

References from_u8().

Referenced by Slic3r::GUI::PrintHostQueueDialog::append_job(), Slic3r::GUI::Plater::export_3mf(), Slic3r::GUI::Plater::export_gcode(), Slic3r::GUI::Plater::priv::get_export_file(), Slic3r::GUI::Plater::priv::load_files(), Slic3r::GUI::Plater::load_files(), Slic3r::GUI::ObjectList::load_modifier(), Slic3r::GUI::Plater::preview_zip_archive(), Slic3r::GUI::Plater::priv::set_project_filename(), and Slic3r::GUI::MainFrame::update_title().

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

◆ from_u8()

wxString Slic3r::GUI::from_u8 ( const std::string &  str)
438{
439 return wxString::FromUTF8(str.c_str());
440}

References from_u8().

Referenced by Slic3r::GUI::AboutDialogLogo::AboutDialogLogo(), Slic3r::GUI::LoadProjectsDialog::LoadProjectsDialog(), Slic3r::GUI::MsgUpdateConfig::MsgUpdateConfig(), Slic3r::GUI::MsgUpdateForced::MsgUpdateForced(), Slic3r::GUI::MsgUpdateSlic3r::MsgUpdateSlic3r(), Slic3r::GUI::ObjectList::ObjectList(), Slic3r::GUI::PhysicalPrinterDialog::PhysicalPrinterDialog(), Slic3r::GUI::PrinterPicker::PrinterPicker(), Slic3r::GUI::PrintHostSendDialog::PrintHostSendDialog(), Slic3r::GUI::ProjectDropDialog::ProjectDropDialog(), Slic3r::GUI::SLAImportDialog::SLAImportDialog(), Slic3r::GUI::Plater::TakeSnapshot::TakeSnapshot(), Slic3r::GUI::Plater::TakeSnapshot::TakeSnapshot(), Slic3r::GUI::GUI_App::add_config_menu(), add_config_substitutions(), Slic3r::GUI::GalleryDialog::add_custom_shapes(), Slic3r::GUI::SavePresetDialog::add_info_for_edit_ph_printer(), add_msg_content(), Slic3r::GUI::SubstitutionManager::add_substitution(), Slic3r::GUI::ObjectList::add_volumes_to_object_in_list(), Slic3r::GUI::DataList< T, D >::append(), apply_extruder_selector(), Slic3r::GUI::GLGizmoFdmSupports::auto_generate(), Slic3r::GUI::Choice::BUILD(), Slic3r::GUI::StaticText::BUILD(), Slic3r::GUI::PhysicalPrinterDialog::build_printhost_settings(), Slic3r::GUI::GalleryDialog::change_thumbnail(), Slic3r::GUI::ConfigWizard::priv::check_and_install_missing_materials(), Slic3r::GUI::GUI_App::check_printer_presets(), color_string(), Slic3r::GUI::Tab::compatible_widget_create(), create_combochecklist(), Slic3r::GUI::OptionsGroup::create_single_option_line(), Slic3r::GUI::Tab::delete_preset(), Slic3r::AppUpdater::priv::download_file(), Slic3r::GUI::ObjectList::fix_through_netfabb(), from_path(), Slic3r::GUI::BitmapCache::from_png(), from_u8(), generate_thumbnail_from_model(), Slic3r::GUI::ConfigOptionsGroup::get_config_value(), Slic3r::GUI::Plater::priv::get_export_file(), Slic3r::Repetier::get_groups(), Slic3r::GUI::GalleryDialog::get_input_files(), get_item_name(), Slic3r::GUI::FileGet::priv::get_perform(), Slic3r::GUI::PresetComboBox::get_preset_name(), Slic3r::GUI::PlaterPresetComboBox::get_preset_name(), Slic3r::GUI::TabPresetComboBox::get_preset_name(), get_preset_name_with_suffix(), Slic3r::Repetier::get_printers(), get_string_value(), Slic3r::DoubleSlider::Control::get_tooltip(), Slic3r::GUI::Field::get_tooltip_text(), Slic3r::GUI::Field::get_value_by_opt_type(), Slic3r::GUI::GUI_App::import_model(), Slic3r::GUI::GUI_App::import_zip(), Slic3r::GUI::SavePresetDialog::Item::init_input_name_ctrl(), Slic3r::GUI::MainFrame::init_menubar_as_editor(), Slic3r::GUI::GUI_App::load_language(), Slic3r::GUI::BitmapCache::load_png(), make_string_bold(), Slic3r::GUI::Choice::msw_rescale(), Slic3r::GUI::GUI_App::on_init_inner(), Slic3r::BonjourDialog::on_reply(), Slic3r::GUI::PhysicalPrinterDialog::OnOK(), Slic3r::GUI::anonymous_namespace{Downloader.cpp}::open_folder(), Slic3r::GUI::anonymous_namespace{NotificationManager.cpp}::open_folder(), Slic3r::AppUpdater::priv::parse_version_string(), Slic3r::GUI::GUI_App::post_init(), Slic3r::GUI::Plater::preview_zip_archive(), Slic3r::GUI::Plater::priv::reload_from_disk(), Slic3r::GUI::ObjectList::rename_item(), Slic3r::GUI::Tab::rename_preset(), Slic3r::GUI::Plater::priv::replace_volume_with_stl(), Slic3r::GUI::Plater::priv::replace_with_stl(), Slic3r::GUI::Plater::priv::save_project_if_dirty(), show_substitutions_info(), start_new_gcodeviewer_open_file(), Slic3r::GUI::Config::take_config_snapshot_cancel_on_error(), Slic3r::GUI::Config::take_config_snapshot_report_error(), Slic3r::Moonraker::test(), Slic3r::OctoPrint::test(), Slic3r::PrusaLink::test(), Slic3r::PrusaLink::test_with_method_check(), Slic3r::GUI::ObjectList::toggle_printable_state(), Slic3r::GUI::SavePresetDialog::Item::update(), Slic3r::GUI::PlaterPresetComboBox::update(), Slic3r::GUI::TabPresetComboBox::update(), Slic3r::GUI::TabPrint::update_description_lines(), Slic3r::GUI::TabFilament::update_description_lines(), Slic3r::GUI::TabPresetComboBox::update_dirty(), Slic3r::GUI::PresetForPrinter::update_full_printer_name(), Slic3r::GUI::Tab::update_preset_description_line(), Slic3r::GUI::PhysicalPrinterDialog::update_printers(), Slic3r::GUI::Sidebar::update_sliced_info_sizer(), Slic3r::GUI::DiffPresetDialog::update_tree(), Slic3r::GUI::UnsavedChangesDialog::update_tree(), Slic3r::GUI::TabFilament::update_volumetric_flow_preset_hints(), Slic3r::GUI::ModelNode::UpdateEnabling(), and Slic3r::GUI::Plater::priv::warnings_dialog().

+ Here is the call graph for this function:

◆ generate_help_menu()

static wxMenu * Slic3r::GUI::generate_help_menu ( )
static
1148{
1149 wxMenu* helpMenu = new wxMenu();
1150 append_menu_item(helpMenu, wxID_ANY, _L("Prusa 3D &Drivers"), _L("Open the Prusa3D drivers download page in your browser"),
1151 [](wxCommandEvent&) { wxGetApp().open_web_page_localized("https://www.prusa3d.com/downloads"); });
1152 append_menu_item(helpMenu, wxID_ANY, _L("Software &Releases"), _L("Open the software releases page in your browser"),
1153 [](wxCommandEvent&) { wxGetApp().open_browser_with_warning_dialog("https://github.com/prusa3d/PrusaSlicer/releases", nullptr, false); });
1154//# my $versioncheck = $self->_append_menu_item($helpMenu, "Check for &Updates...", "Check for new Slic3r versions", sub{
1155//# wxTheApp->check_version(1);
1156//# });
1157//# $versioncheck->Enable(wxTheApp->have_version_check);
1158 append_menu_item(helpMenu, wxID_ANY, wxString::Format(_L("%s &Website"), SLIC3R_APP_NAME),
1159 wxString::Format(_L("Open the %s website in your browser"), SLIC3R_APP_NAME),
1160 [](wxCommandEvent&) { wxGetApp().open_web_page_localized("https://www.prusa3d.com/slicerweb"); });
1161// append_menu_item(helpMenu, wxID_ANY, wxString::Format(_L("%s &Manual"), SLIC3R_APP_NAME),
1162// wxString::Format(_L("Open the %s manual in your browser"), SLIC3R_APP_NAME),
1163// [this](wxCommandEvent&) { wxGetApp().open_browser_with_warning_dialog("http://manual.slic3r.org/"); });
1164 helpMenu->AppendSeparator();
1165 append_menu_item(helpMenu, wxID_ANY, _L("System &Info"), _L("Show system information"),
1166 [](wxCommandEvent&) { wxGetApp().system_info(); });
1167 append_menu_item(helpMenu, wxID_ANY, _L("Show &Configuration Folder"), _L("Show user configuration folder (datadir)"),
1168 [](wxCommandEvent&) { Slic3r::GUI::desktop_open_datadir_folder(); });
1169 append_menu_item(helpMenu, wxID_ANY, _L("Report an I&ssue"), wxString::Format(_L("Report an issue on %s"), SLIC3R_APP_NAME),
1170 [](wxCommandEvent&) { wxGetApp().open_browser_with_warning_dialog("https://github.com/prusa3d/slic3r/issues/new", nullptr, false); });
1171 if (wxGetApp().is_editor())
1172 append_menu_item(helpMenu, wxID_ANY, wxString::Format(_L("&About %s"), SLIC3R_APP_NAME), _L("Show about dialog"),
1173 [](wxCommandEvent&) { Slic3r::GUI::about(); });
1174 else
1175 append_menu_item(helpMenu, wxID_ANY, wxString::Format(_L("&About %s"), GCODEVIEWER_APP_NAME), _L("Show about dialog"),
1176 [](wxCommandEvent&) { Slic3r::GUI::about(); });
1177 append_menu_item(helpMenu, wxID_ANY, _L("Show Tip of the Day")
1178#if 0//debug
1179 + "\tCtrl+Shift+T"
1180#endif
1181 ,_L("Opens Tip of the day notification in bottom right corner or shows another tip if already opened."),
1182 [](wxCommandEvent&) { wxGetApp().plater()->get_notification_manager()->push_hint_notification(false); });
1183 helpMenu->AppendSeparator();
1184 append_menu_item(helpMenu, wxID_ANY, _L("Keyboard Shortcuts") + sep + "&?", _L("Show the list of the keyboard shortcuts"),
1185 [](wxCommandEvent&) { wxGetApp().keyboard_shortcuts(); });
1186#if ENABLE_THUMBNAIL_GENERATOR_DEBUG
1187 helpMenu->AppendSeparator();
1188 append_menu_item(helpMenu, wxID_ANY, "DEBUG gcode thumbnails", "DEBUG ONLY - read the selected gcode file and generates png for the contained thumbnails",
1189 [](wxCommandEvent&) { wxGetApp().gcode_thumbnails_debug(); });
1190#endif // ENABLE_THUMBNAIL_GENERATOR_DEBUG
1191
1192 return helpMenu;
1193}
#define GCODEVIEWER_APP_NAME
Definition libslic3r.h:5
void about()
Definition GUI.cpp:462
void desktop_open_datadir_folder()
Definition GUI.cpp:468

References _L, about(), append_menu_item(), desktop_open_datadir_folder(), GCODEVIEWER_APP_NAME, and sep.

Referenced by Slic3r::GUI::MainFrame::init_menubar_as_editor(), and Slic3r::GUI::MainFrame::init_menubar_as_gcodeviewer().

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

◆ generate_html_page()

static wxString Slic3r::GUI::generate_html_page ( const Config::SnapshotDB snapshot_db,
const wxString &  on_snapshot 
)
static
103{
104 bool dark_mode = wxGetApp().dark_mode();
105 wxString text =
106 "<html>"
107 "<body bgcolor=\"" + get_color(wxGetApp().get_window_default_clr()/*wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)*/) + "\" cellspacing=\"2\" cellpadding=\"0\" border=\"0\" link=\"#800000\">"
108 "<font color=\"" + get_color(wxGetApp().get_label_clr_default()) + "\">";
109 text += "<table style=\"width:100%\">";
110 for (size_t i_row = 0; i_row < snapshot_db.snapshots().size(); ++ i_row) {
111 const Config::Snapshot &snapshot = snapshot_db.snapshots()[snapshot_db.snapshots().size() - i_row - 1];
112 text += generate_html_row(snapshot, i_row & 1, snapshot.id == on_snapshot, dark_mode);
113 }
114 text +=
115 "</table>"
116 "</font>"
117 "</body>"
118 "</html>";
119 return text;
120}
const std::vector< Snapshot > & snapshots() const
Definition Snapshot.hpp:120
Definition Snapshot.hpp:32
std::string id
Definition Snapshot.hpp:59
static wxString generate_html_row(const Config::Snapshot &snapshot, bool row_even, bool snapshot_active, bool dark_mode)
Definition ConfigSnapshotDialog.cpp:39
static std::string get_color(wxColour colour)
Definition ConfigSnapshotDialog.cpp:34

References generate_html_row(), get_color(), Slic3r::GUI::Config::Snapshot::id, and Slic3r::GUI::Config::SnapshotDB::snapshots().

Referenced by Slic3r::GUI::ConfigSnapshotDialog::ConfigSnapshotDialog().

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

◆ generate_html_row()

static wxString Slic3r::GUI::generate_html_row ( const Config::Snapshot snapshot,
bool  row_even,
bool  snapshot_active,
bool  dark_mode 
)
static
40{
41 // Start by declaring a row with an alternating background color.
42 wxString text = "<tr bgcolor=\"";
43 text += snapshot_active ?
44 dark_mode ? "#208a20" : "#B3FFCB" :
45 (row_even ? get_color(wxGetApp().get_window_default_clr()/*wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)*/) : dark_mode ? "#656565" : "#D5D5D5" );
46 text += "\">";
47 text += "<td>";
48
49 static const constexpr char *LOCALE_TIME_FMT = "%x %X";
50 wxString datetime = wxDateTime(snapshot.time_captured).Format(LOCALE_TIME_FMT);
51
52 // Format the row header.
53 text += wxString("<font size=\"5\"><b>") + (snapshot_active ? _(L("Active")) + ": " : "") +
54 datetime + ": " + format_reason(snapshot.reason);
55
56 if (! snapshot.comment.empty())
57 text += " (" + wxString::FromUTF8(snapshot.comment.data()) + ")";
58 text += "</b></font><br>";
59 // End of row header.
60 text += _(L("PrusaSlicer version")) + ": " + snapshot.slic3r_version_captured.to_string() + "<br>";
61 bool has_fff = ! snapshot.print.empty() || ! snapshot.filaments.empty();
62 bool has_sla = ! snapshot.sla_print.empty() || ! snapshot.sla_material.empty();
63 if (has_fff || ! has_sla) {
64 text += _(L("print")) + ": " + snapshot.print + "<br>";
65 text += _(L("filaments")) + ": " + snapshot.filaments.front() + "<br>";
66 }
67 if (has_sla) {
68 text += _(L("SLA print")) + ": " + snapshot.sla_print + "<br>";
69 text += _(L("SLA material")) + ": " + snapshot.sla_material + "<br>";
70 }
71 text += _(L("printer")) + ": " + (snapshot.physical_printer.empty() ? snapshot.printer : snapshot.physical_printer) + "<br>";
72
73 bool compatible = true;
74 for (const Config::Snapshot::VendorConfig &vc : snapshot.vendor_configs) {
75 text += _(L("vendor")) + ": " + vc.name +", " + _(L("version")) + ": " + vc.version.config_version.to_string() +
76 ", " + _(L("min PrusaSlicer version")) + ": " + vc.version.min_slic3r_version.to_string();
77 if (vc.version.max_slic3r_version != Semver::inf())
78 text += ", " + _(L("max PrusaSlicer version")) + ": " + vc.version.max_slic3r_version.to_string();
79 text += "<br>";
80 for (const auto& model : vc.models_variants_installed) {
81 text += _(L("model")) + ": " + model.first + ", " + _(L("variants")) + ": ";
82 for (const std::string &variant : model.second) {
83 if (&variant != &*model.second.begin())
84 text += ", ";
85 text += variant;
86 }
87 text += "<br>";
88 }
89 if (! vc.version.is_current_slic3r_supported()) { compatible = false; }
90 }
91
92 if (! compatible) {
93 text += "<p align=\"right\">" + format_wxstr(_L("Incompatible with this %s"), SLIC3R_APP_NAME) + "</p>";
94 }
95 else if (! snapshot_active)
96 text += "<p align=\"right\"><a href=\"" + snapshot.id + "\">" + _L("Activate") + "</a></p>";
97 text += "</td>";
98 text += "</tr>";
99 return text;
100}
std::string physical_printer
Definition Snapshot.hpp:75
std::string sla_material
Definition Snapshot.hpp:73
std::string sla_print
Definition Snapshot.hpp:71
std::string print
Definition Snapshot.hpp:70
Semver slic3r_version_captured
Definition Snapshot.hpp:62
std::string printer
Definition Snapshot.hpp:74
Reason reason
Definition Snapshot.hpp:65
std::string comment
Definition Snapshot.hpp:64
std::time_t time_captured
Definition Snapshot.hpp:60
std::vector< std::string > filaments
Definition Snapshot.hpp:72
std::string to_string() const
Definition Semver.hpp:153
static wxString format_reason(const Config::Snapshot::Reason reason)
Definition ConfigSnapshotDialog.cpp:17

References _, _L, Slic3r::GUI::Config::Snapshot::comment, Slic3r::GUI::Config::Snapshot::filaments, format_reason(), format_wxstr(), get_color(), Slic3r::GUI::Config::Snapshot::id, Slic3r::Semver::inf(), L, Slic3r::GUI::Config::Snapshot::physical_printer, Slic3r::GUI::Config::Snapshot::print, Slic3r::GUI::Config::Snapshot::printer, Slic3r::GUI::Config::Snapshot::reason, Slic3r::GUI::Config::Snapshot::sla_material, Slic3r::GUI::Config::Snapshot::sla_print, Slic3r::GUI::Config::Snapshot::slic3r_version_captured, Slic3r::GUI::Config::Snapshot::time_captured, Slic3r::Semver::to_string(), and Slic3r::GUI::Config::Snapshot::vendor_configs.

Referenced by generate_html_page().

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

◆ generate_system_info_json()

static std::string Slic3r::GUI::generate_system_info_json ( )
static
371{
372 // Calculate hash of username so it is possible to identify duplicates.
373 // The result is mod 10000 so most of the information is lost and it is
374 // not possible to unhash the username. It is more than enough to help
375 // identify duplicate entries.
376 std::string unique_id = get_unique_id();
377
378 // Get system language.
379 std::string sys_language = "Unknown"; // important to init, see the __APPLE__ block.
380 #ifndef __APPLE__
381 // Following apparently does not work on macOS.
382 const wxLanguage lang_system = wxLanguage(wxLocale::GetSystemLanguage());
383 if (lang_system != wxLANGUAGE_UNKNOWN)
384 sys_language = wxLocale::GetLanguageInfo(lang_system)->CanonicalName.ToUTF8().data();
385 #else // __APPLE__
386 CFLocaleRef cflocale = CFLocaleCopyCurrent();
387 CFStringRef value = (CFStringRef)CFLocaleGetValue(cflocale, kCFLocaleLanguageCode);
388 char temp[10] = "";
389 CFStringGetCString(value, temp, 10, kCFStringEncodingUTF8);
390 sys_language = temp;
391 CFRelease(cflocale);
392 #endif
393 // Build a property tree with all the information.
394 namespace pt = boost::property_tree;
395
396 pt::ptree data_node;
397 data_node.put("PrusaSlicerVersion", SLIC3R_VERSION);
398 data_node.put("BuildID", SLIC3R_BUILD_ID);
399 data_node.put("UniqueID", unique_id);
400 data_node.put("Platform", platform_to_string(platform()));
401 data_node.put("PlatformFlavor", platform_flavor_to_string(platform_flavor()));
402 data_node.put("OSDescription", wxPlatformInfo::Get().GetOperatingSystemDescription().ToUTF8().data());
403#ifdef __linux__
404 std::string distro_id = wxGetLinuxDistributionInfo().Id.ToUTF8().data(); // uses lsb-release
405 std::string distro_ver = wxGetLinuxDistributionInfo().Release.ToUTF8().data();
406 if (distro_id.empty()) { // lsb-release probably not available
407 std::map<std::string, std::string> dist_info = parse_lscpu_etc("cat /etc/*release", '=');
408 distro_id = dist_info["ID"];
409 distro_ver = dist_info["VERSION_ID"];
410 }
411 data_node.put("Linux_DistroID", distro_id);
412 data_node.put("Linux_DistroVer", distro_ver);
413 data_node.put("Linux_Wayland", wxGetEnv("WAYLAND_DISPLAY", nullptr));
414#endif
415 data_node.put("wxWidgets", wxVERSION_NUM_DOT_STRING);
416#ifdef __WXGTK__
417 data_node.put("GTK",
418 #if defined(__WXGTK2__)
419 2
420 #elif defined(__WXGTK3__)
421 3
422 #elif defined(__WXGTK4__)
423 4
424 #elif defined(__WXGTK5__)
425 5
426 #else
427 "Unknown"
428 #endif
429 );
430#endif // __WXGTK__
431 data_node.put("SystemLanguage", sys_language);
432 data_node.put("TranslationLanguage: ", wxGetApp().app_config->get("translation_language"));
433
434
435 pt::ptree hw_node;
436 {
437 hw_node.put("ArchName", wxPlatformInfo::Get().GetBitnessName());
438 size_t num = std::round(Slic3r::total_physical_memory()/107374100.);
439 hw_node.put("RAM_GiB", std::to_string(num / 10) + "." + std::to_string(num % 10));
440 }
441
442 // Now get some CPU info:
443 pt::ptree cpu_node;
444#ifdef _WIN32
445 std::map<std::string, std::string> cpu_info = get_cpu_info_from_registry();
446 cpu_node.put("Cores", cpu_info["Cores"]);
447 cpu_node.put("Model", cpu_info["Model"]);
448 cpu_node.put("Vendor", cpu_info["Vendor"]);
449#elif __APPLE__
450 std::map<std::string, std::string> sysctl = parse_lscpu_etc("sysctl -a", ':');
451 cpu_node.put("Cores", sysctl["hw.ncpu"]);
452 cpu_node.put("Model", sysctl["machdep.cpu.brand_string"]);
453 cpu_node.put("Vendor", sysctl["machdep.cpu.vendor"]);
454#else // linux/BSD
455 std::map<std::string, std::string> lscpu = parse_lscpu_etc("cat /proc/cpuinfo", ':');
456 if (auto ncpu_it = lscpu.find("processor"); ncpu_it != lscpu.end()) {
457 std::string& ncpu = ncpu_it->second;
458 if (int num=0; std::from_chars(ncpu.data(), ncpu.data() + ncpu.size(), num).ec != std::errc::invalid_argument)
459 ncpu = std::to_string(num + 1);
460 }
461 cpu_node.put("Cores", lscpu["processor"]);
462 cpu_node.put("Model", lscpu["model name"]);
463 cpu_node.put("Vendor", lscpu["vendor_id"]);
464#endif
465 hw_node.add_child("CPU", cpu_node);
466
467 pt::ptree monitors_node;
468 for (int i=0; i<int(wxDisplay::GetCount()); ++i) {
469 wxDisplay display(i);
470 pt::ptree monitor_node; // Create an unnamed node containing the value
471 monitor_node.put("width", display.GetGeometry().GetWidth());
472 monitor_node.put("height", display.GetGeometry().GetHeight());
473
474 // Only get the scaling on Win, it is not reliable on other platforms.
475 #if defined(_WIN32) && wxCHECK_VERSION(3, 1, 2)
476 double scaling = display.GetPPI().GetWidth() / 96.;
477 std::stringstream ss;
478 ss << std::setprecision(3) << scaling;
479 monitor_node.put("scaling", ss.str() );
480 #endif
481 monitors_node.push_back(std::make_pair("", monitor_node));
482 }
483 hw_node.add_child("Monitors", monitors_node);
484 data_node.add_child("Hardware", hw_node);
485
486#ifdef _WIN32
487 {
488 pt::ptree blacklisted_node;
489 std::vector<std::wstring> blacklisted_libraries;
490 BlacklistedLibraryCheck::get_instance().get_blacklisted(blacklisted_libraries);
491 for (const std::wstring& wstr : blacklisted_libraries) {
492 std::string utf8 = boost::nowide::narrow(wstr);
493 if (size_t last_bs_pos = utf8.find_last_of("\\"); last_bs_pos < utf8.size() - 1) {
494 // Remove anything before last backslash so we don't send the path to the DLL.
495 utf8.erase(0, last_bs_pos + 1);
496 }
497 pt::ptree node; // Create an unnamed node containing the value
498 node.put("", utf8);
499 blacklisted_node.push_back(std::make_pair("", node)); // Add this node to the list.
500 }
501 if (! blacklisted_libraries.empty())
502 data_node.add_child("Blacklisted libraries", blacklisted_node);
503 }
504#endif // _WIN32
505
506 pt::ptree opengl_node;
507 opengl_node.put("Version", OpenGLManager::get_gl_info().get_version_string());
508 opengl_node.put("GLSLVersion", OpenGLManager::get_gl_info().get_glsl_version_string());
509 opengl_node.put("Vendor", OpenGLManager::get_gl_info().get_vendor());
510 opengl_node.put("Renderer", OpenGLManager::get_gl_info().get_renderer());
511 // Generate list of OpenGL extensions:
512#if ENABLE_GL_CORE_PROFILE
513 std::vector<std::string> extensions_list = OpenGLManager::get_gl_info().get_extensions_list();
514#else
515 std::string extensions_str = gl_get_string_safe(GL_EXTENSIONS, "");
516 std::vector<std::string> extensions_list;
517 boost::split(extensions_list, extensions_str, boost::is_any_of(" "), boost::token_compress_off);
518#endif // ENABLE_GL_CORE_PROFILE
519 std::sort(extensions_list.begin(), extensions_list.end());
520 pt::ptree extensions_node;
521 for (const std::string& s : extensions_list) {
522 if (s.empty())
523 continue;
524 pt::ptree ext_node; // Create an unnamed node containing the value
525 ext_node.put("", s);
526 extensions_node.push_back(std::make_pair("", ext_node)); // Add this node to the list.
527 }
528 opengl_node.add_child("Extensions", extensions_node);
529 data_node.add_child("OpenGL", opengl_node);
530
531 pt::ptree root;
532 root.add_child("data", data_node);
533
534 // Now go through all the values and trim leading/trailing whitespace.
535 // Some CPU names etc apparently have trailing spaces...
536 std::function<void(pt::ptree&)> remove_whitespace;
537 remove_whitespace = [&remove_whitespace](pt::ptree& t) -> void
538 {
539 if (t.empty()) // Trim whitespace
540 boost::algorithm::trim(t.data());
541 else
542 for (auto it = t.begin(); it != t.end(); ++it)
543 remove_whitespace(it->second);
544 };
545 remove_whitespace(root);
546
547 // Serialize the tree into JSON and return it.
548 std::stringstream ss;
549 pt::write_json(ss, root);
550 return ss.str();
551}
typedef void(GLAPIENTRYP _GLUfuncptr)(void)
static std::string get_unique_id()
Definition SendSystemInfoDialog.cpp:279
static std::map< std::string, std::string > parse_lscpu_etc(const std::string &name, char delimiter)
Definition SendSystemInfoDialog.cpp:250
std::string gl_get_string_safe(GLenum param, const std::string &default_value)
Definition OpenGLManager.cpp:34
PlatformFlavor platform_flavor()
Definition Platform.cpp:103
std::string platform_flavor_to_string(PlatformFlavor pf)
Definition Platform.cpp:126
size_t total_physical_memory()
Definition utils.cpp:1143
std::string platform_to_string(Platform platform)
Definition Platform.cpp:110
Platform platform()
Definition Platform.cpp:98
char * narrow(char *output, size_t output_size, wchar_t const *source)
Convert NULL terminated UTF source string to NULL terminated output string of size at most output_siz...
Definition convert.hpp:73

References Slic3r::GUI::OpenGLManager::get_gl_info(), Slic3r::GUI::OpenGLManager::GLInfo::get_glsl_version_string(), Slic3r::GUI::OpenGLManager::GLInfo::get_renderer(), get_unique_id(), Slic3r::GUI::OpenGLManager::GLInfo::get_vendor(), Slic3r::GUI::OpenGLManager::GLInfo::get_version_string(), gl_get_string_safe(), boost::nowide::narrow(), parse_lscpu_etc(), Slic3r::platform(), Slic3r::platform_flavor(), Slic3r::platform_flavor_to_string(), Slic3r::platform_to_string(), Slic3r::total_physical_memory(), and void().

+ Here is the call graph for this function:

◆ generate_thumbnail_from_model()

static void Slic3r::GUI::generate_thumbnail_from_model ( const std::string &  filename)
static
264{
265 if (!boost::algorithm::iends_with(filename, ".stl") &&
266 !boost::algorithm::iends_with(filename, ".obj")) {
267 BOOST_LOG_TRIVIAL(error) << "Found invalid file type in generate_thumbnail_from_model() [" << filename << "]";
268 return;
269 }
270
271 Model model;
272 try {
273 model = Model::read_from_file(filename);
274 }
275 catch (std::exception&) {
276 BOOST_LOG_TRIVIAL(error) << "Error loading model from " << filename << " in generate_thumbnail_from_model()";
277 return;
278 }
279
280 assert(model.objects.size() == 1);
281 assert(model.objects[0]->volumes.size() == 1);
282 assert(model.objects[0]->instances.size() == 1);
283
284 model.objects[0]->center_around_origin(false);
285 model.objects[0]->ensure_on_bed(false);
286
287 model.center_instances_around_point(to_2d(wxGetApp().plater()->build_volume().bounding_volume().center()));
288
289 GLVolumeCollection volumes;
290 volumes.volumes.push_back(new GLVolume());
291 GLVolume* volume = volumes.volumes.back();
292 volume->model.init_from(model.mesh());
293 volume->set_instance_transformation(model.objects[0]->instances[0]->get_transformation());
294 volume->set_volume_transformation(model.objects[0]->volumes[0]->get_transformation());
295
296 ThumbnailData thumbnail_data;
297 const ThumbnailsParams thumbnail_params = { {}, false, false, false, true };
298 wxGetApp().plater()->canvas3D()->render_thumbnail(thumbnail_data, 256, 256, thumbnail_params, volumes, Camera::EType::Perspective);
299
300 if (thumbnail_data.width == 0 || thumbnail_data.height == 0)
301 return;
302
303 wxImage image(thumbnail_data.width, thumbnail_data.height);
304 image.InitAlpha();
305
306 for (unsigned int r = 0; r < thumbnail_data.height; ++r) {
307 unsigned int rr = (thumbnail_data.height - 1 - r) * thumbnail_data.width;
308 for (unsigned int c = 0; c < thumbnail_data.width; ++c) {
309 unsigned char* px = (unsigned char*)thumbnail_data.pixels.data() + 4 * (rr + c);
310 image.SetRGB((int)c, (int)r, px[0], px[1], px[2]);
311 image.SetAlpha((int)c, (int)r, px[3]);
312 }
313 }
314
315 fs::path out_path = fs::path(filename);
316 out_path.replace_extension("png");
317 image.SaveFile(from_u8(out_path.string()), wxBITMAP_TYPE_PNG);
318}
Definition Model.hpp:1248
bool center_instances_around_point(const Vec2d &point)
Definition Model.cpp:360
TriangleMesh mesh() const
Definition Model.cpp:382
static char error[256]
Definition tga.cpp:50

References Slic3r::Model::center_instances_around_point(), error, from_u8(), Slic3r::ThumbnailData::height, Slic3r::Model::mesh(), Slic3r::Model::objects, Slic3r::GUI::Camera::Perspective, Slic3r::ThumbnailData::pixels, plater(), Slic3r::Model::read_from_file(), Slic3r::to_2d(), Slic3r::GLVolumeCollection::volumes, and Slic3r::ThumbnailData::width.

+ Here is the call graph for this function:

◆ generic_exception_handle()

static void Slic3r::GUI::generic_exception_handle ( )
static
753{
754 // Note: Some wxWidgets APIs use wxLogError() to report errors, eg. wxImage
755 // - see https://docs.wxwidgets.org/3.1/classwx_image.html#aa249e657259fe6518d68a5208b9043d0
756 //
757 // wxLogError typically goes around exception handling and display an error dialog some time
758 // after an error is logged even if exception handling and OnExceptionInMainLoop() take place.
759 // This is why we use wxLogError() here as well instead of a custom dialog, because it accumulates
760 // errors if multiple have been collected and displays just one error message for all of them.
761 // Otherwise we would get multiple error messages for one missing png, for example.
762 //
763 // If a custom error message window (or some other solution) were to be used, it would be necessary
764 // to turn off wxLogError() usage in wx APIs, most notably in wxImage
765 // - see https://docs.wxwidgets.org/trunk/classwx_image.html#aa32e5d3507cc0f8c3330135bc0befc6a
766
767 try {
768 throw;
769 } catch (const std::bad_alloc& ex) {
770 // bad_alloc in main thread is most likely fatal. Report immediately to the user (wxLogError would be delayed)
771 // and terminate the app so it is at least certain to happen now.
772 wxString errmsg = wxString::Format(_L("%s has encountered an error. It was likely caused by running out of memory. "
773 "If you are sure you have enough RAM on your system, this may also be a bug and we would "
774 "be glad if you reported it.\n\nThe application will now terminate."), SLIC3R_APP_NAME);
775 wxMessageBox(errmsg + "\n\n" + wxString(ex.what()), _L("Fatal error"), wxOK | wxICON_ERROR);
776 BOOST_LOG_TRIVIAL(error) << boost::format("std::bad_alloc exception: %1%") % ex.what();
777 std::terminate();
778 } catch (const boost::io::bad_format_string& ex) {
779 wxString errmsg = _L("PrusaSlicer has encountered a localization error. "
780 "Please report to PrusaSlicer team, what language was active and in which scenario "
781 "this issue happened. Thank you.\n\nThe application will now terminate.");
782 wxMessageBox(errmsg + "\n\n" + wxString(ex.what()), _L("Critical error"), wxOK | wxICON_ERROR);
783 BOOST_LOG_TRIVIAL(error) << boost::format("Uncaught exception: %1%") % ex.what();
784 std::terminate();
785 throw;
786 } catch (const std::exception& ex) {
787 wxLogError(format_wxstr(_L("Internal error: %1%"), ex.what()));
788 BOOST_LOG_TRIVIAL(error) << boost::format("Uncaught exception: %1%") % ex.what();
789 throw;
790 }
791}

References _L, error, and format_wxstr().

Referenced by Slic3r::GUI::GUI_App::OnExceptionInMainLoop(), and Slic3r::GUI::GUI_App::OnInit().

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

◆ get_app_config()

◆ get_arrange_params()

arrangement::ArrangeParams Slic3r::GUI::get_arrange_params ( Plater p)
405{
406 const GLCanvas3D::ArrangeSettings &settings =
408
410 params.allow_rotations = settings.enable_rotation;
411 params.min_obj_distance = scaled(settings.distance);
412 params.min_bed_distance = scaled(settings.distance_from_bed);
413
414 arrangement::Pivots pivot = arrangement::Pivots::Center;
415
416 int pivot_max = static_cast<int>(arrangement::Pivots::TopRight);
417 if (settings.alignment < 0) {
418 pivot = arrangement::Pivots::Center;
419 } else if (settings.alignment > pivot_max) {
420 // means it should be random
421 std::random_device rd{};
422 std::mt19937 rng(rd());
423 std::uniform_int_distribution<std::mt19937::result_type> dist(0, pivot_max);
424 pivot = static_cast<arrangement::Pivots>(dist(rng));
425 } else {
426 pivot = static_cast<arrangement::Pivots>(settings.alignment);
427 }
428
429 params.alignment = pivot;
430
431 return params;
432}
int alignment
Definition GLCanvas3D.hpp:468
bool enable_rotation
Definition GLCanvas3D.hpp:467
ArrangeSettings get_arrange_settings() const
Definition GLCanvas3D.hpp:609
float distance_from_bed
Definition GLCanvas3D.hpp:463
float distance
Definition GLCanvas3D.hpp:462
Definition GLCanvas3D.hpp:461
Pivots
Definition Arrange.hpp:126
Definition Arrange.hpp:130
coord_t min_obj_distance
The minimum distance which is allowed for any pair of items on the print bed in any direction.
Definition Arrange.hpp:134
coord_t min_bed_distance
The minimum distance of any object from bed edges.
Definition Arrange.hpp:137
Pivots alignment
Final alignment of the merged pile after arrangement.
Definition Arrange.hpp:149
bool allow_rotations
Definition Arrange.hpp:146

References Slic3r::arrangement::ArrangeParams::alignment, Slic3r::GUI::GLCanvas3D::ArrangeSettings::alignment, Slic3r::arrangement::ArrangeParams::allow_rotations, Slic3r::GUI::Plater::canvas3D(), Slic3r::arrangement::Center, Slic3r::Geometry::dist(), Slic3r::GUI::GLCanvas3D::ArrangeSettings::distance, Slic3r::GUI::GLCanvas3D::ArrangeSettings::distance_from_bed, Slic3r::GUI::GLCanvas3D::ArrangeSettings::enable_rotation, Slic3r::GUI::GLCanvas3D::get_arrange_settings(), Slic3r::arrangement::ArrangeParams::min_bed_distance, Slic3r::arrangement::ArrangeParams::min_obj_distance, Slic3r::scaled(), and Slic3r::arrangement::TopRight.

Referenced by Slic3r::GUI::ArrangeJob::process(), and Slic3r::GUI::FillBedJob::process().

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

◆ get_arrange_poly() [1/3]

template<>
arrangement::ArrangePolygon Slic3r::GUI::get_arrange_poly ( ModelInstance inst,
const Plater plater 
)
381{
382 auto ap = get_arrange_poly(PtrWrapper{inst}, plater);
383
384 auto obj_id = inst->get_object()->id();
385 if (plater->printer_technology() == ptSLA) {
386 const SLAPrintObject *po =
388
389 if (po) {
390 update_arrangepoly_slaprint(ap, *po, *inst);
391 }
392 } else {
393 const PrintObject *po =
395
396 if (po) {
397 ap.inflation = brim_offset(*po, *inst);
398 }
399 }
400
401 return ap;
402}
PrinterTechnology printer_technology() const
Definition Plater.cpp:7269
const SLAPrint & sla_print() const
Definition Plater.cpp:5226
const Print & fff_print() const
Definition Plater.cpp:5224
ModelObject * get_object() const
Definition Model.hpp:1130
ObjectID id() const
Definition ObjectID.hpp:55
const PrintObject * get_print_object_by_model_object_id(ObjectID object_id) const
Definition Print.hpp:603
const SLAPrintObject * get_print_object_by_model_object_id(ObjectID object_id) const
Definition SLAPrint.hpp:471
Definition SLAPrint.hpp:88
static coord_t brim_offset(const PrintObject &po, const ModelInstance &inst)
Definition ArrangeJob.cpp:188
Slic3r::arrangement::ArrangePolygon get_arrange_poly(const Model &model)
Definition ModelArrange.cpp:40
Definition ArrangeJob.hpp:70

References brim_offset(), Slic3r::GUI::Plater::fff_print(), get_arrange_poly(), Slic3r::ModelInstance::get_object(), Slic3r::Print::get_print_object_by_model_object_id(), Slic3r::SLAPrint::get_print_object_by_model_object_id(), Slic3r::ObjectBase::id(), plater(), Slic3r::GUI::Plater::printer_technology(), Slic3r::ptSLA, Slic3r::GUI::Plater::sla_print(), and update_arrangepoly_slaprint().

Referenced by get_arrange_poly(), Slic3r::GUI::ArrangeJob::get_arrange_poly_(), get_wipe_tower_arrangepoly(), Slic3r::GUI::FillBedJob::prepare(), and Slic3r::GUI::ArrangeJob::prepare_selected().

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

◆ get_arrange_poly() [2/3]

template<>
arrangement::ArrangePolygon Slic3r::GUI::get_arrange_poly ( ModelInstance inst,
const Plater plater 
)
381{
382 auto ap = get_arrange_poly(PtrWrapper{inst}, plater);
383
384 auto obj_id = inst->get_object()->id();
385 if (plater->printer_technology() == ptSLA) {
386 const SLAPrintObject *po =
388
389 if (po) {
390 update_arrangepoly_slaprint(ap, *po, *inst);
391 }
392 } else {
393 const PrintObject *po =
395
396 if (po) {
397 ap.inflation = brim_offset(*po, *inst);
398 }
399 }
400
401 return ap;
402}

References brim_offset(), Slic3r::GUI::Plater::fff_print(), get_arrange_poly(), Slic3r::ModelInstance::get_object(), Slic3r::Print::get_print_object_by_model_object_id(), Slic3r::SLAPrint::get_print_object_by_model_object_id(), Slic3r::ObjectBase::id(), plater(), Slic3r::GUI::Plater::printer_technology(), Slic3r::ptSLA, Slic3r::GUI::Plater::sla_print(), and update_arrangepoly_slaprint().

Referenced by get_arrange_poly(), Slic3r::GUI::ArrangeJob::get_arrange_poly_(), get_wipe_tower_arrangepoly(), Slic3r::GUI::FillBedJob::prepare(), and Slic3r::GUI::ArrangeJob::prepare_selected().

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

◆ get_arrange_poly() [3/3]

template<class T >
arrangement::ArrangePolygon Slic3r::GUI::get_arrange_poly ( obj,
const Plater plater 
)
89{
91
92 ArrangePolygon ap = obj.get_arrange_polygon();
93 ap.setter = [obj, plater](const ArrangePolygon &p) {
94 if (p.is_arranged()) {
95 Vec2d t = p.translation.cast<double>();
96 t.x() += p.bed_idx * bed_stride(plater);
97 T{obj}.apply_arrange_result(t, p.rotation);
98 }
99 };
100
101 return ap;
102}
double bed_stride(const Plater *plater)
Definition ArrangeJob.cpp:373
Input/Output structure for the arrange() function. The poly field will not be modified during arrange...
Definition Arrange.hpp:93
std::function< void(const ArrangePolygon &)> setter
Optional setter function which can store arbitrary data in its closure.
Definition Arrange.hpp:106

References bed_stride(), plater(), and Slic3r::arrangement::ArrangePolygon::setter.

+ Here is the call graph for this function:

◆ get_bitmap_size()

static wxSize Slic3r::GUI::get_bitmap_size ( const wxBitmapBundle *  bmp,
wxWindow *  parent 
)
static
23{
24#ifdef __WIN32__
25 return bmp->GetBitmapFor(parent).GetSize();
26#else
27 return bmp->GetDefaultSize();
28#endif
29}

Referenced by Slic3r::GUI::OG_CustomCtrl::OG_CustomCtrl(), Slic3r::GUI::OG_CustomCtrl::CtrlLine::draw_act_bmps(), Slic3r::GUI::OG_CustomCtrl::CtrlLine::draw_blinking_bmp(), Slic3r::GUI::OG_CustomCtrl::CtrlLine::draw_mode_bmp(), Slic3r::GUI::OG_CustomCtrl::CtrlLine::msw_rescale(), and Slic3r::GUI::OG_CustomCtrl::msw_rescale().

+ Here is the caller graph for this function:

◆ get_color() [1/2]

static ColorRGBA Slic3r::GUI::get_color ( Axis  axis)
static
2229{
2230 return AXES_COLOR[axis];
2231}

References AXES_COLOR.

◆ get_color() [2/2]

static std::string Slic3r::GUI::get_color ( wxColour  colour)
static
35{
36 return encode_color(ColorRGB(colour.Red(), colour.Green(), colour.Blue()));
37};

References Slic3r::encode_color().

Referenced by generate_html_page(), generate_html_row(), Slic3r::GUI::Selection::render_sidebar_position_hints(), Slic3r::GUI::Selection::render_sidebar_rotation_hints(), and Slic3r::GUI::Selection::render_sidebar_scale_hints().

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

◆ get_cursor_height()

static float Slic3r::GUI::get_cursor_height ( )
static
804{
805 float ret = 16.0f;
806#ifdef _WIN32
807 // see: https://forums.codeguru.com/showthread.php?449040-get-the-system-current-cursor-size
808 // this code is not perfect because it returns a maximum height equal to 31 even if the cursor bitmap shown on screen is bigger
809 // but at least it gives the same result as wxWidgets in the settings tabs
810 ICONINFO ii;
811 if (::GetIconInfo((HICON)GetCursor(), &ii) != 0) {
812 BITMAP bitmap;
813 ::GetObject(ii.hbmMask, sizeof(BITMAP), &bitmap);
814 const int width = bitmap.bmWidth;
815 const int height = (ii.hbmColor == nullptr) ? bitmap.bmHeight / 2 : bitmap.bmHeight;
816 HDC dc = ::CreateCompatibleDC(nullptr);
817 if (dc != nullptr) {
818 if (::SelectObject(dc, ii.hbmMask) != nullptr) {
819 for (int i = 0; i < width; ++i) {
820 for (int j = 0; j < height; ++j) {
821 if (::GetPixel(dc, i, j) != RGB(255, 255, 255)) {
822 if (ret < float(j))
823 ret = float(j);
824 }
825 }
826 }
827 ::DeleteDC(dc);
828 }
829 }
830 ::DeleteObject(ii.hbmColor);
831 ::DeleteObject(ii.hbmMask);
832 }
833#endif // _WIN32
834 return ret;
835}

Referenced by Slic3r::GUI::GLCanvas3D::Tooltip::set_text().

+ Here is the caller graph for this function:

◆ get_default_font()

wxFont Slic3r::GUI::get_default_font ( const wxWindow *  window)
inline
56{ return get_default_font_for_dpi(window, get_dpi_for_window(window)); }
wxFont get_default_font_for_dpi(const wxWindow *window, int dpi)
Definition GUI_Utils.cpp:131

References get_default_font_for_dpi(), and get_dpi_for_window().

Referenced by Slic3r::GUI::AboutDialog::AboutDialog(), Slic3r::GUI::ConfigSnapshotDialog::ConfigSnapshotDialog(), Slic3r::GUI::CopyrightsDialog::CopyrightsDialog(), Slic3r::GUI::SysInfoDialog::SysInfoDialog(), Slic3r::GUI::SplashScreen::init_constant_text(), Slic3r::GUI::ConfigSnapshotDialog::on_dpi_changed(), and Slic3r::GUI::SysInfoDialog::on_dpi_changed().

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

◆ get_default_font_for_dpi()

wxFont Slic3r::GUI::get_default_font_for_dpi ( const wxWindow *  window,
int  dpi 
)
132{
133#ifdef _WIN32
134 // First try to load the font with the Windows 10 specific way.
135 struct SystemParametersInfoForDpi_t { typedef BOOL (WINAPI *FN)(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni, UINT dpi); };
136 static auto SystemParametersInfoForDpi_fn = winapi_get_function<SystemParametersInfoForDpi_t>(L"User32.dll", "SystemParametersInfoForDpi");
137 if (SystemParametersInfoForDpi_fn != nullptr) {
138 NONCLIENTMETRICS nm;
139 memset(&nm, 0, sizeof(NONCLIENTMETRICS));
140 nm.cbSize = sizeof(NONCLIENTMETRICS);
141 if (SystemParametersInfoForDpi_fn(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &nm, 0, dpi))
142 return wxFont(wxNativeFontInfo(nm.lfMessageFont, window));
143 }
144 // Then try to guesstimate the font DPI scaling on Windows 8.
145 // Let's hope that the font returned by the SystemParametersInfo(), which is used by wxWidgets internally, makes sense.
146 int dpi_primary = get_dpi_for_window(nullptr);
147 if (dpi_primary != dpi) {
148 // Rescale the font.
149 return wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).Scaled(float(dpi) / float(dpi_primary));
150 }
151#endif
152 return wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
153}

References get_dpi_for_window(), and L.

Referenced by Slic3r::GUI::DPIAware< P >::DPIAware(), get_default_font(), and Slic3r::GUI::PageMaterials::set_compatible_printers_html_window().

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

◆ get_dir()

static fs::path Slic3r::GUI::get_dir ( bool  sys_dir)
static
249{
250 return fs::absolute(fs::path(sys_dir ? sys_shapes_dir() : custom_shapes_dir())).make_preferred();
251}
std::string custom_shapes_dir()
Definition utils.cpp:211
const std::string & sys_shapes_dir()
Definition utils.cpp:191

References Slic3r::custom_shapes_dir(), and Slic3r::sys_shapes_dir().

Referenced by Slic3r::GUI::GalleryDialog::change_thumbnail(), Slic3r::GUI::GalleryDialog::del_custom_shapes(), get_dir_path(), Slic3r::GUI::GalleryDialog::load_files(), and Slic3r::GUI::GalleryDialog::load_label_icon_list().

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

◆ get_dir_path()

static std::string Slic3r::GUI::get_dir_path ( bool  sys_dir)
static
254{
255 fs::path dir = get_dir(sys_dir);
256#ifdef __WXMSW__
257 return dir.string() + "\\";
258#else
259 return dir.string() + "/";
260#endif
261}
static fs::path get_dir(bool sys_dir)
Definition GalleryDialog.cpp:248

References get_dir().

Referenced by Slic3r::GUI::GalleryDialog::get_input_files(), and Slic3r::GUI::GalleryDialog::load_label_icon_list().

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

◆ get_dpi_for_window()

int Slic3r::GUI::get_dpi_for_window ( const wxWindow *  window)
81{
82#ifdef _WIN32
83 enum MONITOR_DPI_TYPE_ {
84 // This enum is inlined here to avoid build-time dependency
85 MDT_EFFECTIVE_DPI_ = 0,
86 MDT_ANGULAR_DPI_ = 1,
87 MDT_RAW_DPI_ = 2,
88 MDT_DEFAULT_ = MDT_EFFECTIVE_DPI_,
89 };
90
91 // Need strong types for winapi_get_function() to work
92 struct GetDpiForWindow_t { typedef HRESULT (WINAPI *FN)(HWND hwnd); };
93 struct GetDpiForMonitor_t { typedef HRESULT (WINAPI *FN)(HMONITOR hmonitor, MONITOR_DPI_TYPE_ dpiType, UINT *dpiX, UINT *dpiY); };
94
95 static auto GetDpiForWindow_fn = winapi_get_function<GetDpiForWindow_t>(L"User32.dll", "GetDpiForWindow");
96 static auto GetDpiForMonitor_fn = winapi_get_function<GetDpiForMonitor_t>(L"Shcore.dll", "GetDpiForMonitor");
97
98 // Desktop Window is the window of the primary monitor.
99 const HWND hwnd = (window == nullptr) ? ::GetDesktopWindow() : window->GetHandle();
100
101 if (GetDpiForWindow_fn != nullptr) {
102 // We're on Windows 10, we have per-screen DPI settings
103 return GetDpiForWindow_fn(hwnd);
104 } else if (GetDpiForMonitor_fn != nullptr) {
105 // We're on Windows 8.1, we have per-system DPI
106 // Note: MonitorFromWindow() is available on all Windows.
107
108 const HMONITOR monitor = MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST);
109 UINT dpiX;
110 UINT dpiY;
111 return GetDpiForMonitor_fn(monitor, MDT_EFFECTIVE_DPI_, &dpiX, &dpiY) == S_OK ? dpiX : DPI_DEFAULT;
112 } else {
113 // We're on Windows earlier than 8.1, use DC
114
115 const HDC hdc = GetDC(hwnd);
116 if (hdc == NULL) { return DPI_DEFAULT; }
117 return GetDeviceCaps(hdc, LOGPIXELSX);
118 }
119#elif defined __linux__
120 // TODO
121 return DPI_DEFAULT;
122#elif defined __APPLE__
123 // TODO
124 return DPI_DEFAULT;
125#else // freebsd and others
126 // TODO
127 return DPI_DEFAULT;
128#endif
129}

References DPI_DEFAULT, and L.

Referenced by Slic3r::GUI::DPIAware< P >::DPIAware(), add_msg_content(), get_default_font(), get_default_font_for_dpi(), Slic3r::GUI::Emboss::StyleManager::init_style_images(), Slic3r::GUI::SplashScreen::scale_font(), Slic3r::GUI::PageMaterials::set_compatible_printers_html_window(), Slic3r::DoubleSlider::Control::Ruler::update_dpi(), and Slic3r::GUI::MainFrame::update_layout().

+ Here is the caller graph for this function:

◆ get_dragging_half_size()

static double Slic3r::GUI::get_dragging_half_size ( double  size)
static
658{
659 return get_half_size(size) * 1.25;
660}
static double get_half_size(double size)
Definition GLGizmoCut.cpp:652

References get_half_size().

Referenced by Slic3r::GUI::GLGizmoBase::Grabber::render(), and Slic3r::GUI::GLGizmoCut3D::render_cut_plane_grabbers().

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

◆ get_extruder_id_for_volumes()

static std::vector< int > Slic3r::GUI::get_extruder_id_for_volumes ( const ModelObject model_object)
static
80{
81 std::vector<int> extruders_idx;
82 extruders_idx.reserve(model_object.volumes.size());
83 for (const ModelVolume *model_volume : model_object.volumes) {
84 if (!model_volume->is_model_part())
85 continue;
86
87 extruders_idx.emplace_back(model_volume->extruder_id());
88 }
89
90 return extruders_idx;
91}
ModelVolumePtrs volumes
Definition Model.hpp:337

References Slic3r::ModelObject::volumes.

Referenced by Slic3r::GUI::GLGizmoMmuSegmentation::data_changed(), and Slic3r::GUI::GLGizmoMmuSegmentation::init_model_triangle_selectors().

+ Here is the caller graph for this function:

◆ get_extruders_colors()

static std::vector< ColorRGBA > Slic3r::GUI::get_extruders_colors ( )
static
61{
62 std::vector<std::string> colors = Slic3r::GUI::wxGetApp().plater()->get_extruder_colors_from_plater_config();
63 std::vector<ColorRGBA> ret;
64 decode_colors(colors, ret);
65 return ret;
66}
bool decode_colors(const std::vector< std::string > &colors_in, std::vector< ColorRGB > &colors_out)
Definition Color.cpp:349

References Slic3r::decode_colors().

Referenced by Slic3r::GUI::GLGizmoMmuSegmentation::data_changed(), Slic3r::GUI::GLGizmoMmuSegmentation::init_extruders_data(), and Slic3r::GUI::GLGizmoMmuSegmentation::update_from_model_object().

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

◆ get_extruders_names()

static std::vector< std::string > Slic3r::GUI::get_extruders_names ( )
static
69{
70 size_t extruders_count = wxGetApp().extruders_edited_cnt();
71 std::vector<std::string> extruders_out;
72 extruders_out.reserve(extruders_count);
73 for (size_t extruder_idx = 1; extruder_idx <= extruders_count; ++extruder_idx)
74 extruders_out.emplace_back(_u8L("Extruder") + " " + std::to_string(extruder_idx));
75
76 return extruders_out;
77}

References _u8L, and extruders_count().

Referenced by Slic3r::GUI::GLGizmoMmuSegmentation::init_extruders_data().

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

◆ get_feature_offset()

static Vec3d Slic3r::GUI::get_feature_offset ( const Measure::SurfaceFeature feature)
static
171{
172 Vec3d ret;
173 switch (feature.get_type())
174 {
175 case Measure::SurfaceFeatureType::Circle:
176 {
177 const auto [center, radius, normal] = feature.get_circle();
178 ret = center;
179 break;
180 }
181 case Measure::SurfaceFeatureType::Edge:
182 {
183 std::optional<Vec3d> p = feature.get_extra_point();
184 assert(p.has_value());
185 ret = *p;
186 break;
187 }
188 case Measure::SurfaceFeatureType::Point:
189 {
190 ret = feature.get_point();
191 break;
192 }
193 default: { assert(false); }
194 }
195
196 return ret;
197}
std::optional< Vec3d > get_extra_point() const
Definition Measure.hpp:53
std::tuple< Vec3d, double, Vec3d > get_circle() const
Definition Measure.hpp:47
Vec3d get_point() const
Definition Measure.hpp:41
SurfaceFeatureType get_type() const
Definition Measure.hpp:38

References Slic3r::Measure::Circle, Slic3r::Measure::Edge, Slic3r::Measure::SurfaceFeature::get_circle(), Slic3r::Measure::SurfaceFeature::get_extra_point(), Slic3r::Measure::SurfaceFeature::get_point(), Slic3r::Measure::SurfaceFeature::get_type(), and Slic3r::Measure::Point.

Referenced by Slic3r::GUI::GLGizmoMeasure::on_mouse(), and Slic3r::GUI::GLGizmoMeasure::on_render().

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

◆ get_first_added_preset()

static std::string Slic3r::GUI::get_first_added_preset ( const std::map< std::string, std::string > &  old_data,
const std::map< std::string, std::string > &  new_data 
)
static
3008{
3009 std::set<std::string> diff = get_new_added_presets(old_data, new_data);
3010 if (diff.empty())
3011 return std::string();
3012 return *diff.begin();
3013}
static std::set< std::string > get_new_added_presets(const std::map< std::string, std::string > &old_data, const std::map< std::string, std::string > &new_data)
Definition ConfigWizard.cpp:2987
Slic3r::Polygons diff(const Slic3r::Polygon &subject, const Slic3r::Polygon &clip, ApplySafetyOffset do_safety_offset)
Definition ClipperUtils.cpp:672

References Slic3r::diff(), and get_new_added_presets().

Referenced by Slic3r::GUI::ConfigWizard::priv::apply_config().

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

◆ get_first_hovered_gl_volume()

GLVolume * Slic3r::GUI::get_first_hovered_gl_volume ( const GLCanvas3D canvas)
7914 {
7915 int hovered_id_signed = canvas.get_first_hover_volume_idx();
7916 if (hovered_id_signed < 0)
7917 return nullptr;
7918
7919 size_t hovered_id = static_cast<size_t>(hovered_id_signed);
7920 const GLVolumePtrs &volumes = canvas.get_volumes().volumes;
7921 if (hovered_id >= volumes.size())
7922 return nullptr;
7923
7924 return volumes[hovered_id];
7925}
int get_first_hover_volume_idx() const
Definition GLCanvas3D.hpp:904

References Slic3r::GUI::GLCanvas3D::get_first_hover_volume_idx(), get_first_hovered_gl_volume(), Slic3r::GUI::GLCanvas3D::get_volumes(), and Slic3r::GLVolumeCollection::volumes.

Referenced by Slic3r::GUI::GLGizmoEmboss::create_volume(), and get_first_hovered_gl_volume().

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

◆ get_full_label()

static wxString Slic3r::GUI::get_full_label ( std::string  opt_key,
const DynamicPrintConfig config 
)
static
1073{
1074 opt_key = get_pure_opt_key(opt_key);
1075
1076 if (config.option(opt_key)->is_nil())
1077 return _L("N/A");
1078
1079 const ConfigOptionDef* opt = config.def()->get(opt_key);
1080 return opt->full_label.empty() ? opt->label : opt->full_label;
1081}
std::string full_label
Definition Config.hpp:1915
virtual bool is_nil() const
Definition Config.hpp:282
static std::string get_pure_opt_key(std::string opt_key)
Definition UnsavedChangesDialog.cpp:591

References _L, Slic3r::DynamicPrintConfig::def(), Slic3r::ConfigOptionDef::full_label, Slic3r::ConfigDef::get(), get_pure_opt_key(), Slic3r::ConfigOption::is_nil(), Slic3r::ConfigOptionDef::label, and Slic3r::ConfigBase::option().

Referenced by Slic3r::GUI::DiffPresetDialog::update_tree().

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

◆ get_full_settings_hierarchy()

static void Slic3r::GUI::get_full_settings_hierarchy ( FullSettingsHierarchy settings_menu,
const bool  is_part 
)
static
197{
198 auto options = SettingsFactory::get_options(is_part);
199
200 const int extruders_cnt = extruders_count();
201
202 DynamicPrintConfig config;
203 for (auto& option : options)
204 {
205 auto const opt = config.def()->get(option);
206 auto category = opt->category;
207 if (is_improper_category(category, extruders_cnt, !is_part))
208 continue;
209
210 const std::string& label = !opt->full_label.empty() ? opt->full_label : opt->label;
211 std::pair<std::string, std::string> option_label(option, label);
212 std::vector< std::pair<std::string, std::string> > new_category;
213 auto& cat_opt_label = settings_menu.find(category) == settings_menu.end() ? new_category : settings_menu.at(category);
214 cat_opt_label.push_back(option_label);
215 if (cat_opt_label.size() == 1)
216 settings_menu[category] = cat_opt_label;
217 }
218}
std::string category
Definition Config.hpp:1920
Definition PrintConfig.hpp:212

References Slic3r::ConfigOptionDef::category, Slic3r::DynamicPrintConfig::def(), extruders_count(), Slic3r::ConfigDef::get(), Slic3r::GUI::SettingsFactory::get_options(), and is_improper_category().

Referenced by create_settings_popupmenu().

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

◆ get_grabber_mean_size()

static double Slic3r::GUI::get_grabber_mean_size ( const BoundingBoxf3 bb)
static
648{
649 return (bb.size().x() + bb.size().y() + bb.size().z()) / 30.;
650}

References Slic3r::BoundingBox3Base< PointType >::size().

Referenced by Slic3r::GUI::GLGizmoCut3D::init_picking_models(), Slic3r::GUI::GLGizmoCut3D::render_cut_plane_grabbers(), and Slic3r::GUI::GLGizmoCut3D::update_raycasters_for_picking_transform().

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

◆ get_half_size()

static double Slic3r::GUI::get_half_size ( double  size)
static
653{
654 return std::max(size * 0.35, 0.05);
655}

Referenced by get_dragging_half_size(), Slic3r::GUI::GLGizmoBase::Grabber::get_dragging_half_size(), Slic3r::GUI::GLGizmoBase::Grabber::render(), Slic3r::GUI::GLGizmoCut3D::render_cut_plane_grabbers(), and Slic3r::GUI::GLGizmoCut3D::update_raycasters_for_picking_transform().

+ Here is the caller graph for this function:

◆ get_icon_name()

static std::string Slic3r::GUI::get_icon_name ( Preset::Type  type,
PrinterTechnology  pt 
)
static
54 {
55 return pt == ptSLA && type == Preset::TYPE_PRINTER ? "sla_printer" : type_icon_names.at(type);
56}
static const std::map< Preset::Type, std::string > type_icon_names
Definition UnsavedChangesDialog.cpp:46

References Slic3r::ptSLA, type_icon_names, and Slic3r::Preset::TYPE_PRINTER.

Referenced by Slic3r::GUI::DiffModel::AddPreset().

+ Here is the caller graph for this function:

◆ get_id_from_opt_key()

static size_t Slic3r::GUI::get_id_from_opt_key ( std::string  opt_key)
static
1063{
1064 int pos = opt_key.find("#");
1065 if (pos > 0) {
1066 boost::erase_head(opt_key, pos + 1);
1067 return static_cast<size_t>(atoi(opt_key.c_str()));
1068 }
1069 return 0;
1070}

Referenced by get_string_value().

+ Here is the caller graph for this function:

◆ get_index_type()

static GLenum Slic3r::GUI::get_index_type ( const GLModel::Geometry data)
static
745{
746 switch (data.index_type)
747 {
748 default:
749 case GLModel::Geometry::EIndexType::UINT: { return GL_UNSIGNED_INT; }
750 case GLModel::Geometry::EIndexType::USHORT: { return GL_UNSIGNED_SHORT; }
751 case GLModel::Geometry::EIndexType::UBYTE: { return GL_UNSIGNED_BYTE; }
752 }
753}

References Slic3r::GUI::GLModel::Geometry::UBYTE, Slic3r::GUI::GLModel::Geometry::UINT, and Slic3r::GUI::GLModel::Geometry::USHORT.

Referenced by Slic3r::GUI::GLModel::render(), and Slic3r::GUI::GLModel::render_instanced().

+ Here is the caller graph for this function:

◆ get_info_klipper_string()

static wxString Slic3r::GUI::get_info_klipper_string ( )
static
2382{
2383 return _L("Emitting machine limits to G-code is not supported with Klipper G-code flavor.\n"
2384 "The option was switched to \"Use for time estimate\".");
2385}

References _L, and get_info_klipper_string().

Referenced by Slic3r::GUI::TabPrinter::build_fff(), Slic3r::GUI::TabPrinter::build_kinematics_page(), and get_info_klipper_string().

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

◆ get_item_name()

static wxString Slic3r::GUI::get_item_name ( const std::string &  name,
const bool  is_text_volume 
)
static
670{
671 return (is_text_volume ? _L("Text") + " - " : "") + from_u8(name);
672}

References _L, and from_u8().

Referenced by Slic3r::GUI::ObjectList::add_object_to_list(), Slic3r::GUI::ObjectList::add_volumes_to_object_in_list(), Slic3r::GUI::ObjectList::del_subobject_from_object(), Slic3r::GUI::ObjectList::update_name_in_list(), and Slic3r::GUI::ObjectList::update_name_in_model().

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

◆ get_main_info()

std::string Slic3r::GUI::get_main_info ( bool  format_as_html)
35{
36 std::stringstream out;
37
38 std::string b_start = format_as_html ? "<b>" : "";
39 std::string b_end = format_as_html ? "</b>" : "";
40 std::string line_end = format_as_html ? "<br>" : "\n";
41
42 if (!format_as_html)
43 out << b_start << (wxGetApp().is_editor() ? SLIC3R_APP_NAME : GCODEVIEWER_APP_NAME) << b_end << line_end;
44 out << b_start << "Version: " << b_end << SLIC3R_VERSION << line_end;
45
46 std::string build_id = SLIC3R_BUILD_ID;
47 if (! wxGetApp().is_editor())
48 boost::replace_first(build_id, SLIC3R_APP_NAME, GCODEVIEWER_APP_NAME);
49 out << b_start << "Build: " << b_end << build_id << line_end;
50
51 out << line_end;
52 out << b_start << "Operating System: " << b_end << wxPlatformInfo::Get().GetOperatingSystemFamilyName() << line_end;
53 out << b_start << "System Architecture: " << b_end << wxPlatformInfo::Get().GetBitnessName() << line_end;
54 out << b_start <<
55#if defined _WIN32
56 "Windows Version: "
57#else
58 // Hopefully some kind of unix / linux.
59 "System Version: "
60#endif
61 << b_end << wxPlatformInfo::Get().GetOperatingSystemDescription() << line_end;
62 out << b_start << "Total RAM size [MB]: " << b_end << Slic3r::format_memsize_MB(Slic3r::total_physical_memory());
63
64 return out.str();
65}
std::string format_memsize_MB(size_t n)
Definition utils.cpp:1044

References Slic3r::format_memsize_MB(), GCODEVIEWER_APP_NAME, and Slic3r::total_physical_memory().

Referenced by Slic3r::GUI::SysInfoDialog::SysInfoDialog(), and Slic3r::GUI::SysInfoDialog::onCopyToClipboard().

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

◆ get_max_layer_height()

static double Slic3r::GUI::get_max_layer_height ( const int  extruder_idx)
static
3406{
3407 const DynamicPrintConfig& config = wxGetApp().preset_bundle->printers.get_edited_preset().config;
3408 int extruder_idx_zero_based = std::max(0, extruder_idx - 1);
3409 double max_layer_height = config.opt_float("max_layer_height", extruder_idx_zero_based);
3410
3411 // In case max_layer_height is set to zero, it should default to 75 % of nozzle diameter:
3412 if (max_layer_height < EPSILON)
3413 max_layer_height = 0.75 * config.opt_float("nozzle_diameter", extruder_idx_zero_based);
3414
3415 return max_layer_height;
3416}

References EPSILON, and Slic3r::ConfigBase::opt_float().

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

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

◆ get_mem_info()

std::string Slic3r::GUI::get_mem_info ( bool  format_as_html)
68{
69 std::stringstream out;
70
71 std::string b_start = format_as_html ? "<b>" : "";
72 std::string b_end = format_as_html ? "</b>" : "";
73 std::string line_end = format_as_html ? "<br>" : "\n";
74
75 std::string mem_info_str = log_memory_info(true);
76 std::istringstream mem_info(mem_info_str);
77 std::string value;
78 while (std::getline(mem_info, value, ':')) {
79 out << b_start << (value+": ") << b_end;
80 std::getline(mem_info, value, ';');
81 out << value << line_end;
82 }
83
84 const Slic3r::UndoRedo::Stack &stack = wxGetApp().plater()->undo_redo_stack_main();
85 out << b_start << "RAM size reserved for the Undo / Redo stack: " << b_end << Slic3r::format_memsize_MB(stack.get_memory_limit()) << line_end;
86 out << b_start << "RAM size occupied by the Undo / Redo stack: " << b_end << Slic3r::format_memsize_MB(stack.memsize()) << line_end << line_end;
87
88 return out.str();
89}
Definition UndoRedo.hpp:101
size_t memsize() const
Definition UndoRedo.cpp:1250
size_t get_memory_limit() const
Definition UndoRedo.cpp:1249
std::string log_memory_info(bool ignore_loglevel)
Definition utils.cpp:1073

References Slic3r::format_memsize_MB(), Slic3r::UndoRedo::Stack::get_memory_limit(), Slic3r::log_memory_info(), and Slic3r::UndoRedo::Stack::memsize().

Referenced by Slic3r::GUI::SysInfoDialog::SysInfoDialog().

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

◆ get_min_layer_height()

static double Slic3r::GUI::get_min_layer_height ( const int  extruder_idx)
static
3400{
3401 const DynamicPrintConfig& config = wxGetApp().preset_bundle->printers.get_edited_preset().config;
3402 return config.opt_float("min_layer_height", std::max(0, extruder_idx - 1));
3403}

References Slic3r::ConfigBase::opt_float().

Referenced by Slic3r::GUI::ObjectList::add_layer_range_after_current(), Slic3r::GUI::ObjectList::can_add_new_range_after_current(), and Slic3r::GUI::ObjectList::edit_layer_range().

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

◆ get_model_instance() [1/3]

ModelInstance * Slic3r::GUI::get_model_instance ( const GLVolume gl_volume,
const Model model 
)
7952 {
7953 return get_model_instance(gl_volume, model.objects);
7954}
ModelInstance * get_model_instance(const GLVolume &gl_volume, const Model &model)
Definition GLCanvas3D.cpp:7952

References get_model_instance(), and Slic3r::Model::objects.

Referenced by calc_surface_offset(), get_model_instance(), get_model_instance(), get_model_instance(), and on_mouse_surface_drag().

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

◆ get_model_instance() [2/3]

ModelInstance * Slic3r::GUI::get_model_instance ( const GLVolume gl_volume,
const ModelObject object 
)
7963 {
7964 if (gl_volume.instance_idx() < 0)
7965 return nullptr;
7966 size_t instance_idx = static_cast<size_t>(gl_volume.instance_idx());
7967 if (instance_idx >= object.instances.size())
7968 return nullptr;
7969 return object.instances[instance_idx];
7970}
int instance_idx() const
Definition 3DScene.hpp:278

References get_model_instance(), and Slic3r::GLVolume::instance_idx().

+ Here is the call graph for this function:

◆ get_model_instance() [3/3]

ModelInstance * Slic3r::GUI::get_model_instance ( const GLVolume gl_volume,
const ModelObjectPtrs objects 
)
7956 {
7957 if (gl_volume.instance_idx() < 0)
7958 return nullptr;
7959 ModelObject *object = get_model_object(gl_volume, objects);
7960 return get_model_instance(gl_volume, *object);
7961}
Definition Model.hpp:328
ModelObject * get_model_object(const GLVolume &gl_volume, const Model &model)
Definition GLCanvas3D.cpp:7939

References get_model_instance(), get_model_object(), and Slic3r::GLVolume::instance_idx().

+ Here is the call graph for this function:

◆ get_model_object() [1/2]

ModelObject * Slic3r::GUI::get_model_object ( const GLVolume gl_volume,
const Model model 
)
7939 {
7940 return get_model_object(gl_volume, model.objects);
7941}

References get_model_object(), and Slic3r::Model::objects.

Referenced by get_model_instance(), get_model_object(), get_model_object(), and on_mouse_surface_drag().

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

◆ get_model_object() [2/2]

ModelObject * Slic3r::GUI::get_model_object ( const GLVolume gl_volume,
const ModelObjectPtrs objects 
)
7943 {
7944 if (gl_volume.object_idx() < 0)
7945 return nullptr;
7946 size_t objext_idx = static_cast<size_t>(gl_volume.object_idx());
7947 if (objext_idx >= objects.size())
7948 return nullptr;
7949 return objects[objext_idx];
7950}
int object_idx() const
Definition 3DScene.hpp:276

References get_model_object(), and Slic3r::GLVolume::object_idx().

+ Here is the call graph for this function:

◆ get_model_volume() [1/4]

const ModelVolume * Slic3r::GUI::get_model_volume ( const GLVolume v,
const Model model 
)
7870{
7871 const ModelVolume * ret = nullptr;
7872
7873 if (v.object_idx() < (int)model.objects.size()) {
7874 const ModelObject *obj = model.objects[v.object_idx()];
7875 if (v.volume_idx() < (int)obj->volumes.size())
7876 ret = obj->volumes[v.volume_idx()];
7877 }
7878
7879 return ret;
7880}
int volume_idx() const
Definition 3DScene.hpp:277

References get_model_volume(), Slic3r::GLVolume::object_idx(), Slic3r::Model::objects, Slic3r::GLVolume::volume_idx(), and Slic3r::ModelObject::volumes.

Referenced by priv::apply_camera_dir(), calc_surface_offset(), create_meshes(), priv::find_closest_volume(), get_model_volume(), get_model_volume(), get_model_volume(), get_model_volume(), get_selected_volume(), Slic3r::GUI::GLGizmoEmboss::on_mouse(), Slic3r::GUI::GLGizmoEmboss::on_mouse_change_selection(), on_mouse_surface_drag(), Slic3r::GUI::GLGizmoEmboss::on_render(), Slic3r::GUI::GLGizmoEmboss::on_render_input_window(), Slic3r::GUI::GLGizmoEmboss::set_volume_by_selection(), and world_matrix_fixed().

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

◆ get_model_volume() [2/4]

ModelVolume * Slic3r::GUI::get_model_volume ( const GLVolume v,
const ModelObject object 
)
7891 {
7892 if (v.volume_idx() < 0)
7893 return nullptr;
7894
7895 size_t volume_idx = static_cast<size_t>(v.volume_idx());
7896 if (volume_idx >= object.volumes.size())
7897 return nullptr;
7898
7899 return object.volumes[volume_idx];
7900}

References get_model_volume(), and Slic3r::GLVolume::volume_idx().

+ Here is the call graph for this function:

◆ get_model_volume() [3/4]

ModelVolume * Slic3r::GUI::get_model_volume ( const GLVolume v,
const ModelObjectPtrs objects 
)
7903{
7904 if (v.object_idx() < 0)
7905 return nullptr;
7906 size_t objext_idx = static_cast<size_t>(v.object_idx());
7907 if (objext_idx >= objects.size())
7908 return nullptr;
7909 if (objects[objext_idx] == nullptr)
7910 return nullptr;
7911 return get_model_volume(v, *objects[objext_idx]);
7912}

References get_model_volume(), and Slic3r::GLVolume::object_idx().

+ Here is the call graph for this function:

◆ get_model_volume() [4/4]

const ModelVolume * Slic3r::GUI::get_model_volume ( const ObjectID volume_id,
const ModelObjectPtrs objects 
)
7883{
7884 for (const ModelObject *obj : objects)
7885 for (const ModelVolume *vol : obj->volumes)
7886 if (vol->id() == volume_id)
7887 return vol;
7888 return nullptr;
7889}

References get_model_volume().

+ Here is the call graph for this function:

◆ get_new_added_presets()

static std::set< std::string > Slic3r::GUI::get_new_added_presets ( const std::map< std::string, std::string > &  old_data,
const std::map< std::string, std::string > &  new_data 
)
static
2988{
2989 auto get_aliases = [](const std::map<std::string, std::string>& data) {
2990 std::set<std::string> old_aliases;
2991 for (auto item : data) {
2992 const std::string& name = item.first;
2993 size_t pos = name.find("@");
2994 old_aliases.emplace(pos == std::string::npos ? name : name.substr(0, pos-1));
2995 }
2996 return old_aliases;
2997 };
2998
2999 std::set<std::string> old_aliases = get_aliases(old_data);
3000 std::set<std::string> new_aliases = get_aliases(new_data);
3001 std::set<std::string> diff;
3002 std::set_difference(new_aliases.begin(), new_aliases.end(), old_aliases.begin(), old_aliases.end(), std::inserter(diff, diff.begin()));
3003
3004 return diff;
3005}

References Slic3r::diff(), and Slic3r::GUI::ConfigWizard::name().

Referenced by get_first_added_preset().

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

◆ get_option_label()

static std::string Slic3r::GUI::get_option_label ( BedShape::Parameter  param)
static
29{
30 switch (param) {
31 case BedShape::Parameter::RectSize : return L("Size");
32 case BedShape::Parameter::RectOrigin: return L("Origin");
33 case BedShape::Parameter::Diameter : return L("Diameter");
34 default: assert(false); return {};
35 }
36}

References Slic3r::GUI::BedShape::Diameter, L, Slic3r::GUI::BedShape::RectOrigin, and Slic3r::GUI::BedShape::RectSize.

Referenced by Slic3r::GUI::BedShape::append_option_line(), and Slic3r::GUI::BedShape::get_full_name_with_params().

+ Here is the caller graph for this function:

◆ get_preset_collection()

static PresetCollection * Slic3r::GUI::get_preset_collection ( Preset::Type  type,
PresetBundle preset_bundle = nullptr 
)
static
1450 {
1451 if (!preset_bundle)
1452 preset_bundle = wxGetApp().preset_bundle;
1453 return type == Preset::Type::TYPE_PRINT ? &preset_bundle->prints :
1454 type == Preset::Type::TYPE_SLA_PRINT ? &preset_bundle->sla_prints :
1455 type == Preset::Type::TYPE_FILAMENT ? &preset_bundle->filaments :
1456 type == Preset::Type::TYPE_SLA_MATERIAL ? &preset_bundle->sla_materials :
1457 type == Preset::Type::TYPE_PRINTER ? &preset_bundle->printers :
1458 nullptr;
1459}
PresetCollection sla_prints
Definition PresetBundle.hpp:47
PrinterPresetCollection printers
Definition PresetBundle.hpp:52
PresetCollection sla_materials
Definition PresetBundle.hpp:49
PresetCollection prints
Definition PresetBundle.hpp:46
PresetCollection filaments
Definition PresetBundle.hpp:48

References Slic3r::Preset::TYPE_FILAMENT, Slic3r::Preset::TYPE_PRINT, Slic3r::Preset::TYPE_PRINTER, Slic3r::Preset::TYPE_SLA_MATERIAL, and Slic3r::Preset::TYPE_SLA_PRINT.

Referenced by Slic3r::GUI::DiffPresetDialog::create_buttons(), Slic3r::GUI::DiffPresetDialog::create_presets_sizer(), Slic3r::GUI::DiffPresetDialog::update_compatibility(), and Slic3r::GUI::DiffPresetDialog::update_tree().

+ Here is the caller graph for this function:

◆ get_preset_name_with_suffix()

static wxString Slic3r::GUI::get_preset_name_with_suffix ( const Preset preset)
static
237{
238 return from_u8(preset.name + Preset::suffix_modified());
239}
std::string name
Definition Preset.hpp:147

References from_u8(), Slic3r::Preset::name, and Slic3r::Preset::suffix_modified().

Referenced by Slic3r::GUI::PresetComboBox::update().

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

◆ get_primitive_mode()

static GLenum Slic3r::GUI::get_primitive_mode ( const GLModel::Geometry::Format format)
static
730{
731 switch (format.type)
732 {
733 case GLModel::Geometry::EPrimitiveType::Points: { return GL_POINTS; }
734 default:
735 case GLModel::Geometry::EPrimitiveType::Triangles: { return GL_TRIANGLES; }
736 case GLModel::Geometry::EPrimitiveType::TriangleStrip: { return GL_TRIANGLE_STRIP; }
737 case GLModel::Geometry::EPrimitiveType::TriangleFan: { return GL_TRIANGLE_FAN; }
738 case GLModel::Geometry::EPrimitiveType::Lines: { return GL_LINES; }
739 case GLModel::Geometry::EPrimitiveType::LineStrip: { return GL_LINE_STRIP; }
740 case GLModel::Geometry::EPrimitiveType::LineLoop: { return GL_LINE_LOOP; }
741 }
742}
#define GL_TRIANGLE_FAN
Definition glu-libtess.h:77
#define GL_TRIANGLES
Definition glu-libtess.h:75
#define GL_LINE_LOOP
Definition glu-libtess.h:74
#define GL_TRIANGLE_STRIP
Definition glu-libtess.h:76

References format(), GL_LINE_LOOP, GL_TRIANGLE_FAN, GL_TRIANGLE_STRIP, GL_TRIANGLES, Slic3r::GUI::GLModel::Geometry::LineLoop, Slic3r::GUI::GLModel::Geometry::Lines, Slic3r::GUI::GLModel::Geometry::LineStrip, Slic3r::GUI::GLModel::Geometry::Points, Slic3r::GUI::GLModel::Geometry::TriangleFan, Slic3r::GUI::GLModel::Geometry::Triangles, and Slic3r::GUI::GLModel::Geometry::TriangleStrip.

Referenced by Slic3r::GUI::GLModel::render(), and Slic3r::GUI::GLModel::render_instanced().

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

◆ get_pure_opt_key()

static std::string Slic3r::GUI::get_pure_opt_key ( std::string  opt_key)
static
592{
593 const int pos = opt_key.find("#");
594 if (pos > 0)
595 boost::erase_tail(opt_key, opt_key.size() - pos);
596 return opt_key;
597}

Referenced by get_full_label(), get_string_value(), Slic3r::GUI::DiffViewCtrl::options(), and Slic3r::GUI::DiffViewCtrl::selected_options().

+ Here is the caller graph for this function:

◆ get_readers_wildcard()

std::string Slic3r::GUI::get_readers_wildcard ( )
30{
31 std::string ret;
32
33 auto registry = registered_sla_archives();
34
35 for (const ArchiveEntry &entry : registry) {
36 if (!entry.rdfactoryfn)
37 continue;
38
39 ret += into_u8(_(entry.desc));
40 ret += " (";
41 std::vector<std::string> extensions = get_extensions(entry);
42 for (const std::string &ext : extensions) {
43 ret += "*.";
44 ret += ext;
45 ret += ", ";
46 }
47 // remove last ", "
48 if (!extensions.empty()) {
49 ret.pop_back();
50 ret.pop_back();
51 }
52
53 ret += ")|";
54
55 for (std::string ext : extensions) {
56 boost::algorithm::to_lower(ext);
57 ret += "*.";
58 ret += ext;
59 ret += ";";
60
61 boost::algorithm::to_upper(ext);
62 ret += "*.";
63 ret += ext;
64 ret += ";";
65 }
66
67 // remove last ';'
68 if (!extensions.empty())
69 ret.pop_back();
70
71 ret += "|";
72 }
73
74 if (ret.back() == '|')
75 ret.pop_back();
76
77 return ret;
78}
const std::set< ArchiveEntry > & registered_sla_archives()
Definition SLAArchiveFormatRegistry.cpp:95
std::vector< std::string > get_extensions(const ArchiveEntry &entry)
Definition SLAArchiveFormatRegistry.cpp:100
Definition SLAArchiveFormatRegistry.hpp:23

References _, Slic3r::get_extensions(), into_u8(), and Slic3r::registered_sla_archives().

Referenced by Slic3r::GUI::SLAImportDialog::SLAImportDialog().

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

◆ get_root_idx()

static int Slic3r::GUI::get_root_idx ( ObjectDataViewModelNode parent_node,
const ItemType  root_type 
)
static
317{
318 // because of istance_root and layers_root are at the end of the list, so
319 // start locking from the end
320 for (int root_idx = parent_node->GetChildCount() - 1; root_idx >= 0; root_idx--)
321 {
322 // if there is SettingsItem or VolumeItem, then RootItems don't exist in current ObjectItem
323 if (parent_node->GetNthChild(root_idx)->GetType() & (itSettings | itVolume))
324 break;
325 if (parent_node->GetNthChild(root_idx)->GetType() & root_type)
326 return root_idx;
327 }
328
329 return -1;
330}
ObjectDataViewModelNode * GetNthChild(unsigned int n)
Definition ObjectDataViewModel.hpp:149
ItemType GetType() const
Definition ObjectDataViewModel.hpp:192
size_t GetChildCount() const
Definition ObjectDataViewModel.hpp:179

References Slic3r::GUI::ObjectDataViewModelNode::GetChildCount(), Slic3r::GUI::ObjectDataViewModelNode::GetNthChild(), Slic3r::GUI::ObjectDataViewModelNode::GetType(), itSettings, and itVolume.

Referenced by Slic3r::GUI::ObjectDataViewModel::AddLayersChild(), Slic3r::GUI::ObjectDataViewModel::AddVolumeChild(), append_root_node(), and Slic3r::GUI::ObjectDataViewModel::DeleteLastInstance().

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

◆ get_selected_gl_volume() [1/2]

GLVolume * Slic3r::GUI::get_selected_gl_volume ( const GLCanvas3D canvas)
7927 {
7928 const GLVolume *gl_volume = get_selected_gl_volume(canvas.get_selection());
7929 if (gl_volume == nullptr)
7930 return nullptr;
7931
7932 const GLVolumePtrs &gl_volumes = canvas.get_volumes().volumes;
7933 for (GLVolume *v : gl_volumes)
7934 if (v->composite_id == gl_volume->composite_id)
7935 return v;
7936 return nullptr;
7937}
const Selection & get_selection() const
Definition GLCanvas3D.hpp:761

References Slic3r::GLVolume::composite_id, get_selected_gl_volume(), Slic3r::GUI::GLCanvas3D::get_selection(), Slic3r::GUI::GLCanvas3D::get_volumes(), and Slic3r::GLVolumeCollection::volumes.

Referenced by calc_surface_offset(), Slic3r::GUI::GLGizmoEmboss::draw_advanced(), get_selected_gl_volume(), get_selected_volume(), Slic3r::GUI::GLGizmoEmboss::on_mouse_for_translate(), on_mouse_surface_drag(), Slic3r::GUI::GLGizmoEmboss::on_stop_dragging(), Slic3r::GUI::GLGizmoEmboss::set_volume_by_selection(), and world_matrix_fixed().

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

◆ get_selected_gl_volume() [2/2]

const GLVolume * Slic3r::GUI::get_selected_gl_volume ( const Selection selection)
2968{
2969 int object_idx = selection.get_object_idx();
2970 // is more object selected?
2971 if (object_idx == -1)
2972 return nullptr;
2973
2974 const auto &list = selection.get_volume_idxs();
2975 // is more volumes selected?
2976 if (list.size() != 1)
2977 return nullptr;
2978
2979 unsigned int volume_idx = *list.begin();
2980 return selection.get_volume(volume_idx);
2981}
int get_object_idx() const
Definition Selection.cpp:641
const IndicesList & get_volume_idxs() const
Definition Selection.hpp:290
const GLVolume * get_volume(unsigned int volume_idx) const
Definition Selection.cpp:663

References Slic3r::GUI::Selection::get_object_idx(), Slic3r::GUI::Selection::get_volume(), and Slic3r::GUI::Selection::get_volume_idxs().

+ Here is the call graph for this function:

◆ get_selected_volume()

ModelVolume * Slic3r::GUI::get_selected_volume ( const Selection selection)
2959{
2960 const GLVolume *gl_volume = get_selected_gl_volume(selection);
2961 if (gl_volume == nullptr)
2962 return nullptr;
2963 const ModelObjectPtrs &objects = selection.get_model()->objects;
2964 return get_model_volume(*gl_volume, objects);
2965}

References Slic3r::GUI::Selection::get_model(), get_model_volume(), get_selected_gl_volume(), and Slic3r::Model::objects.

Referenced by Slic3r::GUI::GLGizmoEmboss::draw_advanced().

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

◆ get_selection() [1/2]

static const Selection & Slic3r::GUI::get_selection ( )
static
190{
191 return plater()->canvas3D()->get_selection();
192}

References Slic3r::GUI::Plater::canvas3D(), Slic3r::GUI::GLCanvas3D::get_selection(), and plater().

Referenced by Slic3r::GUI::MenuFactory::append_menu_item_settings(), Slic3r::GUI::DiffPresetDialog::create_presets_sizer(), Slic3r::GUI::DiffPresetDialog::get_left_preset_name(), Slic3r::GUI::DiffPresetDialog::get_right_preset_name(), Slic3r::GUI::ObjectList::load_shape_object_from_gallery(), and Slic3r::GUI::DiffPresetDialog::update_tree().

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

◆ get_selection() [2/2]

static std::string Slic3r::GUI::get_selection ( PresetComboBox preset_combo)
static
1465{
1466 return into_u8(preset_combo->GetString(preset_combo->GetSelection()));
1467}

References into_u8().

+ Here is the call graph for this function:

◆ get_skirt_offset()

coord_t Slic3r::GUI::get_skirt_offset ( const Plater plater)
214 {
215 float skirt_inset = 0.f;
216 // Try to subtract the skirt from the bed shape so we don't arrange outside of it.
217 if (plater->printer_technology() == ptFFF && plater->fff_print().has_skirt()) {
218 const auto& print = plater->fff_print();
219 if (!print.objects().empty()) {
220 skirt_inset = print.config().skirts.value * print.skirt_flow().width() +
221 print.config().skirt_distance.value;
222 }
223 }
224
225 return scaled(skirt_inset);
226}
bool has_skirt() const
Definition Print.cpp:375
const PrintConfig & config() const
Definition Print.hpp:597

References Slic3r::Print::config(), Slic3r::GUI::Plater::fff_print(), Slic3r::Print::has_skirt(), plater(), Slic3r::GUI::Plater::printer_technology(), Slic3r::ptFFF, and Slic3r::scaled().

Referenced by Slic3r::GUI::ArrangeJob::process(), and Slic3r::GUI::FillBedJob::process().

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

◆ get_string_value()

static wxString Slic3r::GUI::get_string_value ( std::string  opt_key,
const DynamicPrintConfig config 
)
static
1084{
1085 size_t opt_idx = get_id_from_opt_key(opt_key);
1086 opt_key = get_pure_opt_key(opt_key);
1087
1088 if (config.option(opt_key)->is_nil())
1089 return _L("N/A");
1090
1091 wxString out;
1092
1093 const ConfigOptionDef* opt = config.def()->get(opt_key);
1094 bool is_nullable = opt->nullable;
1095
1096 switch (opt->type) {
1097 case coInt:
1098 return from_u8((boost::format("%1%") % config.opt_int(opt_key)).str());
1099 case coInts: {
1100 if (is_nullable) {
1101 auto values = config.opt<ConfigOptionIntsNullable>(opt_key);
1102 if (opt_idx < values->size())
1103 return from_u8((boost::format("%1%") % values->get_at(opt_idx)).str());
1104 }
1105 else {
1106 auto values = config.opt<ConfigOptionInts>(opt_key);
1107 if (opt_idx < values->size())
1108 return from_u8((boost::format("%1%") % values->get_at(opt_idx)).str());
1109 }
1110 return _L("Undef");
1111 }
1112 case coBool:
1113 return config.opt_bool(opt_key) ? "true" : "false";
1114 case coBools: {
1115 if (is_nullable) {
1116 auto values = config.opt<ConfigOptionBoolsNullable>(opt_key);
1117 if (opt_idx < values->size())
1118 return values->get_at(opt_idx) ? "true" : "false";
1119 }
1120 else {
1121 auto values = config.opt<ConfigOptionBools>(opt_key);
1122 if (opt_idx < values->size())
1123 return values->get_at(opt_idx) ? "true" : "false";
1124 }
1125 return _L("Undef");
1126 }
1127 case coPercent:
1128 return from_u8((boost::format("%1%%%") % int(config.optptr(opt_key)->getFloat())).str());
1129 case coPercents: {
1130 if (is_nullable) {
1131 auto values = config.opt<ConfigOptionPercentsNullable>(opt_key);
1132 if (opt_idx < values->size())
1133 return from_u8((boost::format("%1%%%") % values->get_at(opt_idx)).str());
1134 }
1135 else {
1136 auto values = config.opt<ConfigOptionPercents>(opt_key);
1137 if (opt_idx < values->size())
1138 return from_u8((boost::format("%1%%%") % values->get_at(opt_idx)).str());
1139 }
1140 return _L("Undef");
1141 }
1142 case coFloat:
1143 return double_to_string(config.opt_float(opt_key));
1144 case coFloats: {
1145 if (is_nullable) {
1146 auto values = config.opt<ConfigOptionFloatsNullable>(opt_key);
1147 if (opt_idx < values->size())
1148 return double_to_string(values->get_at(opt_idx));
1149 }
1150 else {
1151 auto values = config.opt<ConfigOptionFloats>(opt_key);
1152 if (opt_idx < values->size())
1153 return double_to_string(values->get_at(opt_idx));
1154 }
1155 return _L("Undef");
1156 }
1157 case coString:
1158 return from_u8(config.opt_string(opt_key));
1159 case coStrings: {
1160 const ConfigOptionStrings* strings = config.opt<ConfigOptionStrings>(opt_key);
1161 if (strings) {
1162 if (opt_key == "compatible_printers" || opt_key == "compatible_prints") {
1163 if (strings->empty())
1164 return _L("All");
1165 for (size_t id = 0; id < strings->size(); id++)
1166 out += from_u8(strings->get_at(id)) + "\n";
1167 out.RemoveLast(1);
1168 return out;
1169 }
1170 if (opt_key == "gcode_substitutions") {
1171 if (!strings->empty())
1172 for (size_t id = 0; id < strings->size(); id += 4)
1173 out += from_u8(strings->get_at(id)) + ";\t" +
1174 from_u8(strings->get_at(id + 1)) + ";\t" +
1175 from_u8(strings->get_at(id + 2)) + ";\t" +
1176 from_u8(strings->get_at(id + 3)) + ";\n";
1177 return out;
1178 }
1179 if (!strings->empty() && opt_idx < strings->values.size())
1180 return from_u8(strings->get_at(opt_idx));
1181 }
1182 break;
1183 }
1184 case coFloatOrPercent: {
1185 const ConfigOptionFloatOrPercent* opt = config.opt<ConfigOptionFloatOrPercent>(opt_key);
1186 if (opt)
1187 out = double_to_string(opt->value) + (opt->percent ? "%" : "");
1188 return out;
1189 }
1190 case coFloatsOrPercents: {
1192 if (opt) {
1193 const auto val = opt->get_at(opt_idx);
1194 out = double_to_string(val.value) + (val.percent ? "%" : "");
1195 }
1196 return out;
1197 }
1198 case coEnum: {
1199 auto opt = config.option_def(opt_key)->enum_def->enum_to_label(config.option(opt_key)->getInt());
1200 return opt.has_value() ? _(from_u8(*opt)) : _L("Undef");
1201 }
1202 case coPoints: {
1203 if (opt_key == "bed_shape") {
1204 BedShape shape(*config.option<ConfigOptionPoints>(opt_key));
1205 return shape.get_full_name_with_params();
1206 }
1207 if (opt_key == "thumbnails")
1208 return get_thumbnails_string(config.option<ConfigOptionPoints>(opt_key)->values);
1209
1210 Vec2d val = config.opt<ConfigOptionPoints>(opt_key)->get_at(opt_idx);
1211 return from_u8((boost::format("[%1%]") % ConfigOptionPoint(val).serialize()).str());
1212 }
1213 default:
1214 break;
1215 }
1216 return out;
1217}
void serialize(Archive &ar, FacenamesSerializer &t, const std::uint32_t version)
Definition GLGizmoEmboss.cpp:1562
int & opt_int(const t_config_option_key &opt_key)
Definition Config.hpp:2286
const ConfigOptionDef * option_def(const t_config_option_key &opt_key) const
Definition Config.hpp:2203
T * opt(const t_config_option_key &opt_key, bool create=false)
Definition Config.hpp:2196
bool opt_bool(const t_config_option_key &opt_key) const
Definition Config.hpp:2296
std::string & opt_string(const t_config_option_key &opt_key, bool create=false)
Definition Config.hpp:2276
virtual double getFloat() const
Definition Config.hpp:271
virtual int getInt() const
Definition Config.hpp:270
Definition Config.hpp:761
const ConfigOption * optptr(const t_config_option_key &opt_key) const override
Definition Config.cpp:1106
wxString get_thumbnails_string(const std::vector< Vec2d > &values)
Definition Field.cpp:61
static size_t get_id_from_opt_key(std::string opt_key)
Definition UnsavedChangesDialog.cpp:1062
ConfigOptionPercentsTempl< true > ConfigOptionPercentsNullable
Definition Config.hpp:1009
Eigen::Matrix< double, 2, 1, Eigen::DontAlign > Vec2d
Definition Point.hpp:51
ConfigOptionFloatsTempl< true > ConfigOptionFloatsNullable
Definition Config.hpp:717
ConfigOptionBoolsTempl< true > ConfigOptionBoolsNullable
Definition Config.hpp:1492
@ coFloatOrPercent
Definition Config.hpp:180

References _, _L, Slic3r::coBool, Slic3r::coBools, Slic3r::coEnum, Slic3r::coFloat, Slic3r::coFloatOrPercent, Slic3r::coFloats, Slic3r::coFloatsOrPercents, Slic3r::coInt, Slic3r::coInts, Slic3r::coPercent, Slic3r::coPercents, Slic3r::coPoints, Slic3r::coString, Slic3r::coStrings, Slic3r::DynamicPrintConfig::def(), double_to_string(), Slic3r::ConfigOptionVector< T >::empty(), Slic3r::ConfigOptionDef::enum_def, from_u8(), Slic3r::ConfigDef::get(), Slic3r::ConfigOptionBoolsTempl< NULLABLE >::get_at(), Slic3r::ConfigOptionVector< T >::get_at(), Slic3r::GUI::BedShape::get_full_name_with_params(), get_id_from_opt_key(), get_pure_opt_key(), get_thumbnails_string(), Slic3r::ConfigOption::getFloat(), Slic3r::ConfigOption::getInt(), Slic3r::ConfigOption::is_nil(), Slic3r::ConfigOptionDef::nullable, Slic3r::ConfigBase::opt(), Slic3r::ConfigBase::opt_bool(), Slic3r::ConfigBase::opt_float(), Slic3r::ConfigBase::opt_int(), Slic3r::ConfigBase::opt_string(), Slic3r::ConfigBase::option(), Slic3r::ConfigBase::option_def(), Slic3r::DynamicConfig::optptr(), Slic3r::ConfigOptionFloatOrPercent::percent, serialize(), Slic3r::ConfigOptionVector< T >::size(), Slic3r::ConfigOptionDef::type, Slic3r::ConfigOptionSingle< T >::value, and Slic3r::ConfigOptionVector< T >::values.

Referenced by Slic3r::GUI::DiffPresetDialog::update_tree(), and Slic3r::GUI::UnsavedChangesDialog::update_tree().

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

◆ get_thumbnails_string()

wxString Slic3r::GUI::get_thumbnails_string ( const std::vector< Vec2d > &  values)
62{
63 wxString ret_str;
64 for (size_t i = 0; i < values.size(); ++ i) {
65 const Vec2d& el = values[i];
66 ret_str += wxString::Format((i == 0) ? "%ix%i" : ", %ix%i", int(el[0]), int(el[1]));
67 }
68 return ret_str;
69}

Referenced by Slic3r::GUI::TextCtrl::BUILD(), Slic3r::GUI::ConfigOptionsGroup::get_config_value(), get_string_value(), and Slic3r::GUI::Field::get_value_by_opt_type().

+ Here is the caller graph for this function:

◆ get_unique_id()

static std::string Slic3r::GUI::get_unique_id ( )
static
280{
281 std::vector<unsigned char> unique;
282
283#ifdef _WIN32
284 // On Windows, get the MAC address of a network adaptor (preferably Ethernet
285 // or IEEE 802.11 wireless
286
287 DWORD dwBufLen = sizeof(IP_ADAPTER_INFO);
288 PIP_ADAPTER_INFO AdapterInfo = (PIP_ADAPTER_INFO)malloc(dwBufLen);
289
290 if (GetAdaptersInfo(AdapterInfo, &dwBufLen) == ERROR_BUFFER_OVERFLOW) {
291 free(AdapterInfo);
292 AdapterInfo = (IP_ADAPTER_INFO*)malloc(dwBufLen);
293 }
294 if (GetAdaptersInfo(AdapterInfo, &dwBufLen) == NO_ERROR) {
295 const IP_ADAPTER_INFO* pAdapterInfo = AdapterInfo;
296 std::vector<std::vector<unsigned char>> macs;
297 bool ethernet_seen = false;
298 while (pAdapterInfo) {
299 macs.emplace_back();
300 for (unsigned char i = 0; i < pAdapterInfo->AddressLength; ++i)
301 macs.back().emplace_back(pAdapterInfo->Address[i]);
302 // Prefer Ethernet and IEEE 802.11 wireless
303 if (! ethernet_seen) {
304 if ((pAdapterInfo->Type == MIB_IF_TYPE_ETHERNET && (ethernet_seen = true))
305 || pAdapterInfo->Type == IF_TYPE_IEEE80211)
306 std::swap(macs.front(), macs.back());
307 }
308 pAdapterInfo = pAdapterInfo->Next;
309 }
310 if (! macs.empty())
311 unique = macs.front();
312 }
313 free(AdapterInfo);
314#elif __APPLE__
315 constexpr int buf_size = 100;
316 char buf[buf_size] = "";
317 memset(&buf, 0, sizeof(buf));
318 io_registry_entry_t ioRegistryRoot = IORegistryEntryFromPath(kIOMasterPortDefault, "IOService:/");
319 if (ioRegistryRoot != MACH_PORT_NULL) {
320 CFStringRef uuidCf = (CFStringRef)IORegistryEntryCreateCFProperty(ioRegistryRoot, CFSTR(kIOPlatformUUIDKey), kCFAllocatorDefault, 0);
321 IOObjectRelease(ioRegistryRoot);
322 CFStringGetCString(uuidCf, buf, buf_size, kCFStringEncodingMacRoman);
323 CFRelease(uuidCf);
324 }
325 // Now convert the string to std::vector<unsigned char>.
326 for (char* c = buf; *c != 0; ++c)
327 unique.emplace_back((unsigned char)(*c));
328#else // Linux/BSD
329 constexpr size_t max_len = 100;
330 char cline[max_len] = "";
331 FILE* fp = popen("cat /etc/machine-id", "r");
332 if (fp != NULL) {
333 // Maybe the only way to silence -Wunused-result on gcc...
334 // cline is simply not modified on failure, who cares.
335 [[maybe_unused]]auto dummy = fgets(cline, max_len, fp);
336 pclose(fp);
337 }
338 // Now convert the string to std::vector<unsigned char>.
339 for (char* c = cline; *c != 0; ++c)
340 unique.emplace_back((unsigned char)(*c));
341#endif
342
343 // In case that we did not manage to get the unique info, just return an empty
344 // string, so it is easily detectable and not masked by the hashing.
345 if (unique.empty())
346 return "";
347
348 // We should have a unique vector<unsigned char>. Append a long prime to be
349 // absolutely safe against unhashing.
350 uint64_t prime = 1171432692373;
351 size_t beg = unique.size();
352 unique.resize(beg + 8);
353 memcpy(&unique[beg], &prime, 8);
354
355 // Compute an MD5 hash and convert to std::string.
356 using boost::uuids::detail::md5;
357 md5 hash;
358 md5::digest_type digest;
359 hash.process_bytes(unique.data(), unique.size());
360 hash.get_digest(digest);
361 const unsigned char* charDigest = reinterpret_cast<const unsigned char*>(&digest);
362 std::string result;
363 boost::algorithm::hex(charDigest, charDigest + sizeof(md5::digest_type), std::back_inserter(result));
364 return result;
365}
void * malloc(YYSIZE_T)
void free(void *)
IGL_INLINE void unique(const std::vector< T > &A, std::vector< T > &C, std::vector< size_t > &IA, std::vector< size_t > &IC)
Definition unique.cpp:21
unsigned __int64 uint64_t
Definition unistd.h:80

References free(), and malloc().

Referenced by generate_system_info_json().

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

◆ get_volume()

static ModelVolume * Slic3r::GUI::get_volume ( const ObjectID id,
const Selection selection 
)
static
68 {
69 const Selection::IndicesList &volume_ids = selection.get_volume_idxs();
70 const ModelObjectPtrs &model_objects = selection.get_model()->objects;
71 for (auto volume_id : volume_ids) {
72 const GLVolume *selected_volume = selection.get_volume(volume_id);
73 const GLVolume::CompositeID &cid = selected_volume->composite_id;
74 ModelObject *obj = model_objects[cid.object_id];
75 ModelVolume *volume = obj->volumes[cid.volume_id];
76 if (id == volume->id()) return volume;
77 }
78 return nullptr;
79}
CompositeID composite_id
Definition 3DScene.hpp:147
std::set< unsigned int > IndicesList
Definition Selection.hpp:33
Definition 3DScene.hpp:130
int volume_id
Definition 3DScene.hpp:139

References Slic3r::GLVolume::composite_id, Slic3r::GUI::Selection::get_model(), Slic3r::GUI::Selection::get_volume(), Slic3r::GUI::Selection::get_volume_idxs(), Slic3r::GLVolume::CompositeID::object_id, Slic3r::Model::objects, Slic3r::GLVolume::CompositeID::volume_id, and Slic3r::ModelObject::volumes.

Referenced by Slic3r::GUI::GLGizmoSimplify::apply_simplify(), priv::check(), create_volumes_name(), Slic3r::GUI::GLGizmoSimplify::process(), and priv::update_volume().

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

◆ get_volume_ids()

static std::set< ObjectID > Slic3r::GUI::get_volume_ids ( const Selection selection)
static
41{
42 const Selection::IndicesList &volume_ids = selection.get_volume_idxs();
43 const ModelObjectPtrs &model_objects = selection.get_model()->objects;
44 std::set<ObjectID> result;
45 for (auto volume_id : volume_ids) {
46 const GLVolume *selected_volume = selection.get_volume(volume_id);
47 assert(selected_volume != nullptr);
48
49 const GLVolume::CompositeID &cid = selected_volume->composite_id;
50
51 assert(cid.object_id >= 0);
52 assert(model_objects.size() > static_cast<size_t>(cid.object_id));
53
54 const ModelObject *obj = model_objects[cid.object_id];
55 const ModelVolume *volume = obj->volumes[cid.volume_id];
56 const ObjectID & id = volume->id();
57
58 // prevent selection of volume without inidces
59 if (volume->mesh().its.indices.empty()) continue;
60
61 assert(result.find(id) == result.end());
62 result.insert(id);
63 }
64 return result;
65}

References Slic3r::GLVolume::composite_id, Slic3r::GUI::Selection::get_model(), Slic3r::GUI::Selection::get_volume(), Slic3r::GUI::Selection::get_volume_idxs(), Slic3r::GLVolume::CompositeID::object_id, Slic3r::Model::objects, Slic3r::GLVolume::CompositeID::volume_id, and Slic3r::ModelObject::volumes.

Referenced by Slic3r::GUI::GLGizmoSimplify::on_render(), and Slic3r::GUI::GLGizmoSimplify::on_render_input_window().

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

◆ get_volume_min_z()

static double Slic3r::GUI::get_volume_min_z ( const GLVolume volume)
static
34{
35 return volume.transformed_convex_hull_bounding_box().min.z();
36}

Referenced by Slic3r::GUI::ObjectManipulation::ObjectManipulation(), and Slic3r::GUI::ObjectManipulation::update_reset_buttons_visibility().

+ Here is the caller graph for this function:

◆ get_warning_icon_name()

static std::string Slic3r::GUI::get_warning_icon_name ( const TriangleMeshStats stats)
static
422{
423 return stats.manifold() ? (stats.repaired() ? "exclamation_manifold" : "") : "exclamation";
424}
bool manifold() const
Definition TriangleMesh.hpp:83
bool repaired() const
Definition TriangleMesh.hpp:84

References Slic3r::TriangleMeshStats::manifold(), and Slic3r::TriangleMeshStats::repaired().

Referenced by Slic3r::GUI::ObjectList::add_object_to_list(), Slic3r::GUI::ObjectList::add_volumes_to_object_in_list(), Slic3r::GUI::ObjectList::del_subobject_item(), Slic3r::GUI::ObjectList::delete_from_model_and_list(), Slic3r::GUI::ObjectList::get_mesh_errors_info(), and Slic3r::GUI::ObjectList::update_item_error_icon().

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

◆ get_wipe_tower()

static WipeTower Slic3r::GUI::get_wipe_tower ( const Plater plater)
static
63{
64 return WipeTower{plater.canvas3D()->get_wipe_tower_info()};
65}
WipeTowerInfo get_wipe_tower_info() const
Definition GLCanvas3D.cpp:4454
Definition ArrangeJob.cpp:26

References Slic3r::GUI::Plater::canvas3D(), Slic3r::GUI::GLCanvas3D::get_wipe_tower_info(), and plater().

Referenced by get_wipe_tower_arrangepoly(), and Slic3r::GUI::ArrangeJob::prepare_selected().

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

◆ get_wipe_tower_arrangepoly()

std::optional< arrangement::ArrangePolygon > Slic3r::GUI::get_wipe_tower_arrangepoly ( const Plater plater)
366{
367 if (auto wti = get_wipe_tower(plater))
368 return get_arrange_poly(wti, &plater);
369
370 return {};
371}
static WipeTower get_wipe_tower(const Plater &plater)
Definition ArrangeJob.cpp:62

References get_arrange_poly(), get_wipe_tower(), and plater().

Referenced by Slic3r::GUI::FillBedJob::prepare(), and Slic3r::GUI::ArrangeJob::prepare_all().

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

◆ get_wraped_wxString()

wxString Slic3r::GUI::get_wraped_wxString ( const wxString &  in,
size_t  line_len 
)
310{
311 wxString out;
312
313 for (size_t i = 0; i < in.size();) {
314 // Overwrite the character (space or newline) starting at ibreak?
315 bool overwrite = false;
316 // UTF8 representation of wxString.
317 // Where to break the line, index of character at the start of a UTF-8 sequence.
318 size_t ibreak = size_t(-1);
319 // Overwrite the character at ibreak (it is a whitespace) or not?
320 size_t j = i;
321 for (size_t cnt = 0; j < in.size();) {
322 if (bool newline = in[j] == '\n'; in[j] == ' ' || in[j] == '\t' || newline) {
323 // Overwrite the whitespace.
324 ibreak = j ++;
325 overwrite = true;
326 if (newline)
327 break;
328 } else if (in[j] == '/'
329#ifdef _WIN32
330 || in[j] == '\\'
331#endif // _WIN32
332 ) {
333 // Insert after the slash.
334 ibreak = ++ j;
335 overwrite = false;
336 } else
337 j += get_utf8_sequence_length(in.c_str() + j, in.size() - j);
338 if (++ cnt == line_len) {
339 if (ibreak == size_t(-1)) {
340 ibreak = j;
341 overwrite = false;
342 }
343 break;
344 }
345 }
346 if (j == in.size()) {
347 out.append(in.begin() + i, in.end());
348 break;
349 }
350 assert(ibreak != size_t(-1));
351 out.append(in.begin() + i, in.begin() + ibreak);
352 out.append('\n');
353 i = ibreak;
354 if (overwrite)
355 ++ i;
356 }
357
358 return out;
359}

References Slic3r::get_utf8_sequence_length().

Referenced by Slic3r::GUI::LoadProjectsDialog::LoadProjectsDialog(), Slic3r::GUI::ProjectDropDialog::ProjectDropDialog(), and Slic3r::GUI::GLGizmoCut3D::render_cut_plane_input_window().

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

◆ GetNumberFromUser()

static long Slic3r::GUI::GetNumberFromUser ( const wxString &  msg,
const wxString &  prompt,
const wxString &  title,
long  value,
long  min,
long  max,
wxWindow *  parent 
)
static
6218{
6219#ifdef _WIN32
6220 wxNumberEntryDialog dialog(parent, msg, prompt, title, value, min, max, wxDefaultPosition);
6221 wxGetApp().UpdateDlgDarkUI(&dialog);
6222 if (dialog.ShowModal() == wxID_OK)
6223 return dialog.GetValue();
6224
6225 return -1;
6226#else
6227 return wxGetNumberFromUser(msg, prompt, title, value, min, max, parent);
6228#endif
6229}

Referenced by Slic3r::GUI::Plater::set_number_of_copies().

+ Here is the caller graph for this function:

◆ GetSelectedChoices()

static int Slic3r::GUI::GetSelectedChoices ( wxArrayInt &  selections,
const wxString &  message,
const wxString &  caption,
const wxArrayString &  choices 
)
static
224{
225 wxMultiChoiceDialog dialog(nullptr, message, caption, choices);
226 wxGetApp().UpdateDlgDarkUI(&dialog);
227
228 // call this even if selections array is empty and this then (correctly)
229 // deselects the first item which is selected by default
230 dialog.SetSelections(selections);
231
232#ifdef __APPLE__
233 // Improvements for ChoiceListBox: Height of control will restect to items count
234 for (auto child : dialog.GetChildren())
235 if (dynamic_cast<wxListBox*>(child) && !choices.IsEmpty()) {
236 wxClientDC dc(child);
237
238 int height = dc.GetTextExtent(choices[0]).y;
239 int width = 0;
240 for (const auto& string : choices)
241 width = std::max(width, dc.GetTextExtent(string).x);
242
243 // calculate best size of ListBox
244 height += 3 * mac_max_scaling_factor(); // extend height by margins
245 width += 3 * height; // extend width by checkbox width and margins
246
247 // don't make the listbox too tall (limit height to around 10 items)
248 // but don't make it too small neither
249 int list_height = wxMax(height * wxMin(wxMax(choices.Count(), 3), 10), 70);
250 wxSize sz_best = wxSize(width, list_height);
251
252 wxSize sz = child->GetSize();
253 child->SetMinSize(sz_best);
254
255 // extend Dialog size, if calculated best size of ListBox is bigger then its size
256 wxSize dlg_sz = dialog.GetSize();
257 if (int delta_x = sz_best.x - sz.x; delta_x > 0) dlg_sz.x += delta_x;
258 if (int delta_y = sz_best.y - sz.y; delta_y > 0) dlg_sz.y += delta_y;
259 dialog.SetSize(dlg_sz);
260
261 break;
262 }
263#endif
264
265 if (dialog.ShowModal() != wxID_OK)
266 {
267 // NB: intentionally do not clear the selections array here, the caller
268 // might want to preserve its original contents if the dialog was
269 // cancelled
270 return -1;
271 }
272
273 selections = dialog.GetSelections();
274 return static_cast<int>(selections.GetCount());
275}

References mac_max_scaling_factor().

Referenced by create_settings_popupmenu().

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

◆ gl_get_string_safe()

std::string Slic3r::GUI::gl_get_string_safe ( GLenum  param,
const std::string &  default_value 
)
35{
36 const char* value = (const char*)::glGetString(param);
37 glcheck();
38 return std::string((value != nullptr) ? value : default_value);
39}
#define glcheck()
Definition 3DScene.hpp:26

References glcheck.

Referenced by Slic3r::GUI::OpenGLManager::GLInfo::detect(), generate_system_info_json(), and Slic3r::GUI::OpenGLManager::GLInfo::to_string().

+ Here is the caller graph for this function:

◆ GUI_Run()

int Slic3r::GUI::GUI_Run ( GUI_InitParams params)
36{
37#if __APPLE__
38 // On OSX, we use boost::process::spawn() to launch new instances of PrusaSlicer from another PrusaSlicer.
39 // boost::process::spawn() sets SIGCHLD to SIGIGN for the child process, thus if a child PrusaSlicer spawns another
40 // subprocess and the subrocess dies, the child PrusaSlicer will not receive information on end of subprocess
41 // (posix waitpid() call will always fail).
42 // https://jmmv.dev/2008/10/boostprocess-and-sigchld.html
43 // The child instance of PrusaSlicer has to reset SIGCHLD to its default, so that posix waitpid() and similar continue to work.
44 // See GH issue #5507
45 signal(SIGCHLD, SIG_DFL);
46#endif // __APPLE__
47
48 try {
49 GUI::GUI_App* gui = new GUI::GUI_App(params.start_as_gcodeviewer ? GUI::GUI_App::EAppMode::GCodeViewer : GUI::GUI_App::EAppMode::Editor);
50 if (gui->get_app_mode() != GUI::GUI_App::EAppMode::GCodeViewer) {
51 // G-code viewer is currently not performing instance check, a new G-code viewer is started every time.
52 bool gui_single_instance_setting = gui->app_config->get_bool("single_instance");
53 if (Slic3r::instance_check(params.argc, params.argv, gui_single_instance_setting)) {
54 //TODO: do we have delete gui and other stuff?
55 return -1;
56 }
57 }
58
59 GUI::GUI_App::SetInstance(gui);
60 gui->init_params = &params;
61 return wxEntry(params.argc, params.argv);
62 } catch (const Slic3r::Exception &ex) {
63 boost::nowide::cerr << ex.what() << std::endl;
64 wxMessageBox(boost::nowide::widen(ex.what()), _L("PrusaSlicer GUI initialization failed"), wxICON_STOP);
65 } catch (const std::exception &ex) {
66 boost::nowide::cerr << "PrusaSlicer GUI initialization failed: " << ex.what() << std::endl;
67 wxMessageBox(format_wxstr(_L("Fatal error, exception catched: %1%"), ex.what()), _L("PrusaSlicer GUI initialization failed"), wxICON_STOP);
68 }
69
70 // error
71 return 1;
72}
bool get_bool(const std::string &section, const std::string &key) const
Definition AppConfig.hpp:61
Definition Exception.hpp:10
Definition GUI_App.hpp:117
GUI_InitParams * init_params
Definition GUI_App.hpp:317
AppConfig * app_config
Definition GUI_App.hpp:319
EAppMode get_app_mode() const
Definition GUI_App.hpp:183
bool start_as_gcodeviewer
Definition GUI_Init.hpp:32
int argc
Definition GUI_Init.hpp:22
char ** argv
Definition GUI_Init.hpp:23
bool instance_check(int argc, char **argv, bool app_config_single_instance)
Definition InstanceCheck.cpp:306
wchar_t * widen(wchar_t *output, size_t output_size, char const *source)
Convert NULL terminated UTF source string to NULL terminated output string of size at most output_siz...
Definition convert.hpp:95

References _L, Slic3r::GUI::GUI_App::app_config, Slic3r::GUI::GUI_InitParams::argc, Slic3r::GUI::GUI_InitParams::argv, Slic3r::GUI::GUI_App::Editor, format_wxstr(), Slic3r::GUI::GUI_App::GCodeViewer, Slic3r::GUI::GUI_App::get_app_mode(), Slic3r::AppConfig::get_bool(), Slic3r::GUI::GUI_App::init_params, Slic3r::instance_check(), Slic3r::GUI::GUI_InitParams::start_as_gcodeviewer, and boost::nowide::widen().

Referenced by Slic3r::CLI::run().

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

◆ image_button_ex()

static bool Slic3r::GUI::image_button_ex ( ImGuiID  id,
ImTextureID  texture_id,
const ImVec2 size,
const ImVec2 uv0,
const ImVec2 uv1,
const ImVec2 padding,
const ImVec4 bg_col,
const ImVec4 tint_col,
ImGuiButtonFlags  flags 
)
static
713{
714 ImGuiContext& g = *GImGui;
716 if (window->SkipItems)
717 return false;
718
719 const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + size + padding * 2);
720 ImGui::ItemSize(bb);
721 if (!ImGui::ItemAdd(bb, id))
722 return false;
723
724 bool hovered, held;
725 bool pressed = ImGui::ButtonBehavior(bb, id, &hovered, &held, flags);
726
727 // Render
730 ImGui::RenderFrame(bb.Min, bb.Max, col, true, ImClamp((float)ImMin(padding.x, padding.y), 0.0f, g.Style.FrameRounding));
731 if (bg_col.w > 0.0f)
732 window->DrawList->AddRectFilled(bb.Min + padding, bb.Max - padding, ImGui::GetColorU32(bg_col));
733 window->DrawList->AddImage(texture_id, bb.Min + padding, bb.Max - padding, uv0, uv1, ImGui::GetColorU32(tint_col));
734
735 return pressed;
736}
EIGEN_DEVICE_FUNC ColXpr col(Index i)
This is the const version of col().
Definition BlockMethods.h:838
ImGuiContext * GImGui
Definition imgui.cpp:960
unsigned int ImU32
Definition imgui.h:229
@ ImGuiCol_Button
Definition imgui.h:1434
@ ImGuiCol_ButtonHovered
Definition imgui.h:1435
@ ImGuiCol_ButtonActive
Definition imgui.h:1436
static T ImClamp(T v, T mn, T mx)
Definition imgui_internal.h:411
static T ImMin(T lhs, T rhs)
Definition imgui_internal.h:409
ImVec2 CursorPos
Definition imgui_internal.h:1754
IMGUI_API bool ItemAdd(const ImRect &bb, ImGuiID id, const ImRect *nav_bb=NULL, ImGuiItemAddFlags flags=0)
Definition imgui.cpp:7390
IMGUI_API ImU32 GetColorU32(ImGuiCol idx, float alpha_mul=1.0f)
Definition imgui.cpp:2429
IMGUI_API void RenderFrame(ImVec2 p_min, ImVec2 p_max, ImU32 fill_col, bool border=true, float rounding=0.0f)
Definition imgui.cpp:2834
IMGUI_API bool ButtonBehavior(const ImRect &bb, ImGuiID id, bool *out_hovered, bool *out_held, ImGuiButtonFlags flags=0)
Definition imgui_widgets.cpp:488
ImGuiWindow * GetCurrentWindow()
Definition imgui_internal.h:2280
IMGUI_API void ItemSize(const ImVec2 &size, float text_baseline_y=-1.0f)
Definition imgui.cpp:7349
IMGUI_API void RenderNavHighlight(const ImRect &bb, ImGuiID id, ImGuiNavHighlightFlags flags=ImGuiNavHighlightFlags_TypeDefault)
Definition imgui.cpp:2859
IMGUI_API void AddRectFilled(const ImVec2 &p_min, const ImVec2 &p_max, ImU32 col, float rounding=0.0f, ImDrawFlags flags=0)
Definition imgui_draw.cpp:1388
IMGUI_API void AddImage(ImTextureID user_texture_id, const ImVec2 &p_min, const ImVec2 &p_max, const ImVec2 &uv_min=ImVec2(0, 0), const ImVec2 &uv_max=ImVec2(1, 1), ImU32 col=IM_COL32_WHITE)
Definition imgui_draw.cpp:1598
Definition imgui_internal.h:1351
ImGuiStyle Style
Definition imgui_internal.h:1355
float FrameRounding
Definition imgui.h:1734
Definition imgui_internal.h:1807
ImDrawList * DrawList
Definition imgui_internal.h:1883
ImGuiWindowTempData DC
Definition imgui_internal.h:1861
bool SkipItems
Definition imgui_internal.h:1835
Definition imgui_internal.h:471
float y
Definition imgui.h:246
float x
Definition imgui.h:246
float w
Definition imgui.h:259

References ImDrawList::AddImage(), ImDrawList::AddRectFilled(), ImGui::ButtonBehavior(), col(), ImGuiWindowTempData::CursorPos, ImGuiWindow::DC, ImGuiWindow::DrawList, ImGuiStyle::FrameRounding, ImGui::GetColorU32(), ImGui::GetCurrentWindow(), GImGui, ImClamp(), ImGuiCol_Button, ImGuiCol_ButtonActive, ImGuiCol_ButtonHovered, ImMin(), ImGui::ItemAdd(), ImGui::ItemSize(), ImRect::Max, ImRect::Min, ImGui::RenderFrame(), ImGui::RenderNavHighlight(), ImGuiWindow::SkipItems, ImGuiContext::Style, ImVec4::w, ImVec2::x, and ImVec2::y.

Referenced by Slic3r::GUI::ImGuiWrapper::image_button().

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

◆ init_from_angle_arc()

static void Slic3r::GUI::init_from_angle_arc ( GLModel model,
double  angle,
double  radius 
)
static
156{
157 model.reset();
158
159 const float step_angle = float(angle) / float(AngleResolution);
160 const float ex_radius = float(radius);
161
162 GLModel::Geometry init_data;
163 init_data.format = { GLModel::Geometry::EPrimitiveType::LineStrip, GLModel::Geometry::EVertexLayout::P3 };
164 init_data.reserve_vertices(1 + AngleResolution);
165 init_data.reserve_indices(1 + AngleResolution);
166
167 // vertices + indices
168 for (unsigned int i = 0; i <= AngleResolution; ++i) {
169 const float angle = float(i) * step_angle;
170 init_data.add_vertex(Vec3f(::cos(angle) * ex_radius, ::sin(angle) * ex_radius, 0.0f));
171 init_data.add_index(i);
172 }
173
174 model.init_from(std::move(init_data));
175}
void reset()
Definition GLModel.cpp:697
void init_from(Geometry &&data)
Definition GLModel.cpp:485
void reserve_indices(size_t indices_count)
Definition GLModel.hpp:73
void reserve_vertices(size_t vertices_count)
Definition GLModel.hpp:71
void add_index(unsigned int id)
Definition GLModel.cpp:132
void add_vertex(const Vec2f &position)
Definition GLModel.cpp:63

References Slic3r::GUI::GLModel::Geometry::add_index(), Slic3r::GUI::GLModel::Geometry::add_vertex(), Slic3r::angle(), AngleResolution, cos(), Slic3r::GUI::GLModel::Geometry::format, Slic3r::GUI::GLModel::init_from(), Slic3r::GUI::GLModel::Geometry::LineStrip, Slic3r::GUI::GLModel::Geometry::P3, Slic3r::GUI::GLModel::Geometry::reserve_indices(), Slic3r::GUI::GLModel::Geometry::reserve_vertices(), Slic3r::GUI::GLModel::reset(), and sin().

Referenced by Slic3r::GUI::GLGizmoCut3D::init_rendering_items().

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

◆ init_from_circle()

static void Slic3r::GUI::init_from_circle ( GLModel model,
double  radius 
)
static

– #ysFIXME those functions bodies are ported from GizmoRotation

70{
71 GLModel::Geometry init_data;
72 init_data.format = { GLModel::Geometry::EPrimitiveType::LineLoop, GLModel::Geometry::EVertexLayout::P3 };
73 init_data.reserve_vertices(ScaleStepsCount);
74 init_data.reserve_indices(ScaleStepsCount);
75
76 // vertices + indices
77 for (unsigned int i = 0; i < ScaleStepsCount; ++i) {
78 const float angle = float(i * ScaleStepRad);
79 init_data.add_vertex(Vec3f(::cos(angle) * float(radius), ::sin(angle) * float(radius), 0.0f));
80 init_data.add_index(i);
81 }
82
83 model.init_from(std::move(init_data));
84 model.set_color(ColorRGBA::WHITE());
85}
void set_color(const ColorRGBA &color)
Definition GLModel.hpp:234

References Slic3r::GUI::GLModel::Geometry::add_index(), Slic3r::GUI::GLModel::Geometry::add_vertex(), Slic3r::angle(), cos(), Slic3r::GUI::GLModel::Geometry::format, Slic3r::GUI::GLModel::init_from(), Slic3r::GUI::GLModel::Geometry::LineLoop, Slic3r::GUI::GLModel::Geometry::P3, Slic3r::GUI::GLModel::Geometry::reserve_indices(), Slic3r::GUI::GLModel::Geometry::reserve_vertices(), ScaleStepRad, ScaleStepsCount, Slic3r::GUI::GLModel::set_color(), sin(), and Slic3r::ColorRGBA::WHITE().

Referenced by Slic3r::GUI::GLGizmoCut3D::init_rendering_items().

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

◆ init_from_scale()

static void Slic3r::GUI::init_from_scale ( GLModel model,
double  radius 
)
static
89{
90 const float out_radius_long = float(radius) * (1.0f + ScaleLongTooth);
91 const float out_radius_short = float(radius) * (1.0f + 0.5f * ScaleLongTooth);
92
93 GLModel::Geometry init_data;
94 init_data.format = { GLModel::Geometry::EPrimitiveType::Lines, GLModel::Geometry::EVertexLayout::P3 };
95 init_data.reserve_vertices(2 * ScaleStepsCount);
96 init_data.reserve_indices(2 * ScaleStepsCount);
97
98 // vertices + indices
99 for (unsigned int i = 0; i < ScaleStepsCount; ++i) {
100 const float angle = float(i * ScaleStepRad);
101 const float cosa = ::cos(angle);
102 const float sina = ::sin(angle);
103 const float in_x = cosa * float(radius);
104 const float in_y = sina * float(radius);
105 const float out_x = (i % ScaleLongEvery == 0) ? cosa * out_radius_long : cosa * out_radius_short;
106 const float out_y = (i % ScaleLongEvery == 0) ? sina * out_radius_long : sina * out_radius_short;
107
108 // vertices
109 init_data.add_vertex(Vec3f(in_x, in_y, 0.0f));
110 init_data.add_vertex(Vec3f(out_x, out_y, 0.0f));
111
112 // indices
113 init_data.add_line(i * 2, i * 2 + 1);
114 }
115
116 model.init_from(std::move(init_data));
117 model.set_color(ColorRGBA::WHITE());
118}
const float ScaleLongTooth
Definition GLGizmoCut.cpp:42
void add_line(unsigned int id1, unsigned int id2)
Definition GLModel.cpp:137

References Slic3r::GUI::GLModel::Geometry::add_line(), Slic3r::GUI::GLModel::Geometry::add_vertex(), Slic3r::angle(), cos(), Slic3r::GUI::GLModel::Geometry::format, Slic3r::GUI::GLModel::init_from(), Slic3r::GUI::GLModel::Geometry::Lines, Slic3r::GUI::GLModel::Geometry::P3, Slic3r::GUI::GLModel::Geometry::reserve_indices(), Slic3r::GUI::GLModel::Geometry::reserve_vertices(), ScaleLongEvery, ScaleLongTooth, ScaleStepRad, ScaleStepsCount, Slic3r::GUI::GLModel::set_color(), sin(), and Slic3r::ColorRGBA::WHITE().

Referenced by Slic3r::GUI::GLGizmoCut3D::init_rendering_items().

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

◆ init_from_snap_radii()

static void Slic3r::GUI::init_from_snap_radii ( GLModel model,
double  radius 
)
static
122{
123 const float step = 2.0f * float(PI) / float(SnapRegionsCount);
124 const float in_radius = float(radius) / 3.0f;
125 const float out_radius = 2.0f * in_radius;
126
127 GLModel::Geometry init_data;
128 init_data.format = { GLModel::Geometry::EPrimitiveType::Lines, GLModel::Geometry::EVertexLayout::P3 };
129 init_data.reserve_vertices(2 * ScaleStepsCount);
130 init_data.reserve_indices(2 * ScaleStepsCount);
131
132 // vertices + indices
133 for (unsigned int i = 0; i < ScaleStepsCount; ++i) {
134 const float angle = float(i) * step;
135 const float cosa = ::cos(angle);
136 const float sina = ::sin(angle);
137 const float in_x = cosa * in_radius;
138 const float in_y = sina * in_radius;
139 const float out_x = cosa * out_radius;
140 const float out_y = sina * out_radius;
141
142 // vertices
143 init_data.add_vertex(Vec3f(in_x, in_y, 0.0f));
144 init_data.add_vertex(Vec3f(out_x, out_y, 0.0f));
145
146 // indices
147 init_data.add_line(i * 2, i * 2 + 1);
148 }
149
150 model.init_from(std::move(init_data));
151 model.set_color(ColorRGBA::WHITE());
152}

References Slic3r::GUI::GLModel::Geometry::add_line(), Slic3r::GUI::GLModel::Geometry::add_vertex(), Slic3r::angle(), cos(), Slic3r::GUI::GLModel::Geometry::format, Slic3r::GUI::GLModel::init_from(), Slic3r::GUI::GLModel::Geometry::Lines, Slic3r::GUI::GLModel::Geometry::P3, PI, Slic3r::GUI::GLModel::Geometry::reserve_indices(), Slic3r::GUI::GLModel::Geometry::reserve_vertices(), ScaleStepsCount, Slic3r::GUI::GLModel::set_color(), sin(), SnapRegionsCount, and Slic3r::ColorRGBA::WHITE().

Referenced by Slic3r::GUI::GLGizmoCut3D::init_rendering_items().

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

◆ init_plane_data()

static GLModel::Geometry Slic3r::GUI::init_plane_data ( const indexed_triangle_set its,
const std::vector< int > &  triangle_indices 
)
static
96{
97 GLModel::Geometry init_data;
98 init_data.format = { GUI::GLModel::Geometry::EPrimitiveType::Triangles, GLModel::Geometry::EVertexLayout::P3N3 };
99 unsigned int i = 0;
100 for (int idx : triangle_indices) {
101 const Vec3f& v0 = its.vertices[its.indices[idx][0]];
102 const Vec3f& v1 = its.vertices[its.indices[idx][1]];
103 const Vec3f& v2 = its.vertices[its.indices[idx][2]];
104
105 const Vec3f n = (v1 - v0).cross(v2 - v0).normalized();
106 init_data.add_vertex(v0, n);
107 init_data.add_vertex(v1, n);
108 init_data.add_vertex(v2, n);
109 init_data.add_triangle(i, i + 1, i + 2);
110 i += 3;
111 }
112
113 return init_data;
114}
void add_triangle(unsigned int id1, unsigned int id2, unsigned int id3)
Definition GLModel.hpp:97
std::vector< stl_vertex > vertices
Definition stl.h:165
std::vector< stl_triangle_vertex_indices > indices
Definition stl.h:164

References Slic3r::GUI::GLModel::Geometry::add_triangle(), Slic3r::GUI::GLModel::Geometry::add_vertex(), Slic3r::cross(), Slic3r::GUI::GLModel::Geometry::format, indexed_triangle_set::indices, Slic3r::GUI::GLModel::Geometry::P3N3, Slic3r::GUI::GLModel::Geometry::Triangles, and indexed_triangle_set::vertices.

Referenced by Slic3r::GUI::GLGizmoMeasure::on_render(), and Slic3r::GUI::GLGizmoMeasure::update_if_needed().

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

◆ init_torus_data()

static GLModel::Geometry Slic3r::GUI::init_torus_data ( unsigned int  primary_resolution,
unsigned int  secondary_resolution,
const Vec3f center,
float  radius,
float  thickness,
const Vec3f model_axis,
const Transform3f world_trafo 
)
static
118{
119 const unsigned int torus_sector_count = std::max<unsigned int>(4, primary_resolution);
120 const unsigned int section_sector_count = std::max<unsigned int>(4, secondary_resolution);
121 const float torus_sector_step = 2.0f * float(M_PI) / float(torus_sector_count);
122 const float section_sector_step = 2.0f * float(M_PI) / float(section_sector_count);
123
125 data.format = { GLModel::Geometry::EPrimitiveType::Triangles, GLModel::Geometry::EVertexLayout::P3N3 };
126 data.reserve_vertices(torus_sector_count * section_sector_count);
127 data.reserve_indices(torus_sector_count * section_sector_count * 2 * 3);
128
129 // vertices
130 const Transform3f local_to_world_matrix = world_trafo * Geometry::translation_transform(center.cast<double>()).cast<float>() *
131 Eigen::Quaternion<float>::FromTwoVectors(Vec3f::UnitZ(), model_axis);
132 for (unsigned int i = 0; i < torus_sector_count; ++i) {
133 const float section_angle = torus_sector_step * i;
134 const Vec3f radius_dir(std::cos(section_angle), std::sin(section_angle), 0.0f);
135 const Vec3f local_section_center = radius * radius_dir;
136 const Vec3f world_section_center = local_to_world_matrix * local_section_center;
137 const Vec3f local_section_normal = local_section_center.normalized().cross(Vec3f::UnitZ()).normalized();
138 const Vec3f world_section_normal = (Vec3f)(local_to_world_matrix.matrix().block(0, 0, 3, 3) * local_section_normal).normalized();
139 const Vec3f base_v = thickness * radius_dir;
140 for (unsigned int j = 0; j < section_sector_count; ++j) {
141 const Vec3f v = Eigen::AngleAxisf(section_sector_step * j, world_section_normal) * base_v;
142 data.add_vertex(world_section_center + v, (Vec3f)v.normalized());
143 }
144 }
145
146 // triangles
147 for (unsigned int i = 0; i < torus_sector_count; ++i) {
148 const unsigned int ii = i * section_sector_count;
149 const unsigned int ii_next = ((i + 1) % torus_sector_count) * section_sector_count;
150 for (unsigned int j = 0; j < section_sector_count; ++j) {
151 const unsigned int j_next = (j + 1) % section_sector_count;
152 const unsigned int i0 = ii + j;
153 const unsigned int i1 = ii_next + j;
154 const unsigned int i2 = ii_next + j_next;
155 const unsigned int i3 = ii + j_next;
156 data.add_triangle(i0, i1, i2);
157 data.add_triangle(i0, i2, i3);
158 }
159 }
160
161 return data;
162}
#define M_PI
Definition ExtrusionSimulator.cpp:20
EIGEN_DEVICE_FUNC internal::cast_return_type< Transform, Transform< NewScalarType, Dim, Mode, Options > >::type cast() const
Definition Transform.h:632
EIGEN_DEVICE_FUNC const MatrixType & matrix() const
Definition Transform.h:395
The quaternion class used to represent 3D orientations and rotations.
Definition Quaternion.h:233
AngleAxis< float > AngleAxisf
Definition AngleAxis.h:157

References M_PI, Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::matrix(), Slic3r::GUI::GLModel::Geometry::P3N3, Slic3r::Geometry::translation_transform(), and Slic3r::GUI::GLModel::Geometry::Triangles.

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

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

◆ input_optional()

template<typename T , typename Func >
static bool Slic3r::GUI::input_optional ( std::optional< T > &  v,
Func &  f,
std::function< bool(const T &)>  is_default,
const T &  def_val 
)
static
1272{
1273 if (v.has_value()) {
1274 if (f(*v)) {
1275 if (is_default(*v)) v.reset();
1276 return true;
1277 }
1278 } else {
1279 T val = def_val;
1280 if (f(val)) {
1281 if (!is_default(val)) v = val;
1282 return true;
1283 }
1284 }
1285 return false;
1286}

References Slic3r::f().

Referenced by Slic3r::GUI::ImGuiWrapper::drag_optional_float(), Slic3r::GUI::ImGuiWrapper::input_optional_float(), Slic3r::GUI::ImGuiWrapper::input_optional_int(), Slic3r::GUI::ImGuiWrapper::slider_optional_float(), and Slic3r::GUI::ImGuiWrapper::slider_optional_int().

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

◆ into_path()

◆ into_u8()

std::string Slic3r::GUI::into_u8 ( const wxString &  str)
443{
444 auto buffer_utf8 = str.utf8_str();
445 return std::string(buffer_utf8.data());
446}

References into_u8().

Referenced by Slic3r::GUI::AppUpdateDownloadDialog::AppUpdateDownloadDialog(), Slic3r::GUI::Option::Option(), Slic3r::GUI::PhysicalPrinterDialog::PhysicalPrinterDialog(), Slic3r::GUI::GUI_App::add_config_menu(), add_msg_content(), Slic3r::GUI::SubstitutionManager::add_substitution(), Slic3r::GUI::MainFrame::add_to_recent_projects(), Slic3r::GUI::ImGuiWrapper::begin(), Slic3r::GUI::ImGuiWrapper::begin(), Slic3r::GUI::ImGuiWrapper::button(), Slic3r::GUI::ImGuiWrapper::button(), Slic3r::GUI::ImGuiWrapper::button(), Slic3r::GUI::ImGuiWrapper::calc_text_size(), Slic3r::GUI::GalleryDialog::change_thumbnail(), Slic3r::GUI::Plater::check_selected_presets_visibility(), Slic3r::GUI::ImGuiWrapper::checkbox(), Slic3r::GUI::ImGuiWrapper::clipboard_get(), color_string(), Slic3r::GUI::ImGuiWrapper::combo(), Slic3r::GUI::GalleryDialog::deselect(), Slic3r::GUI::PrintHostSendDialog::EndModal(), Slic3r::GUI::Plater::export_3mf(), Slic3r::GUI::Plater::export_amf(), Slic3r::GUI::Plater::export_stl_obj(), Slic3r::GUI::Plater::export_toolpaths_to_obj(), Slic3r::GUI::ModelNode::get_bitmap(), Slic3r::GUI::AppUpdateDownloadDialog::get_download_path(), Slic3r::GUI::RotoptimizeJob::get_method_description(), Slic3r::GUI::RotoptimizeJob::get_method_name(), Slic3r::GUI::PresetForPrinter::get_preset_name(), get_readers_wildcard(), get_selection(), Slic3r::FirmwareDialog::priv::get_serial_port(), Slic3r::PrusaLink::get_storage(), Slic3r::GUI::Choice::get_value(), Slic3r::GUI::Field::get_value_by_opt_type(), Slic3r::GUI::PrintHostSendDialog::group(), Slic3r::GUI::Plater::has_illegal_filename_characters(), Slic3r::GUI::MainFrame::init_menubar_as_editor(), into_u8(), Slic3r::GUI::GalleryDialog::load_files(), Slic3r::GUI::Plater::load_gcode(), Slic3r::GUI::ObjectList::load_generic_subobject(), Slic3r::GUI::HintDatabase::load_hints_from_file(), Slic3r::GUI::GUI_App::load_language(), Slic3r::GUI::ObjectList::load_shape_object(), make_string_bold(), Slic3r::PresetHints::maximum_volumetric_flow_description(), Slic3r::GUI::Choice::msw_rescale(), Slic3r::GUI::GUI_App::on_init_inner(), Slic3r::GUI::GLGizmoMmuSegmentation::on_render_input_window(), Slic3r::GUI::Plater::priv::on_select_preset(), Slic3r::GUI::GUI_App::on_version_read(), Slic3r::GUI::PhysicalPrinterDialog::OnOK(), Slic3r::GUI::DownloaderUtils::Worker::perform_register(), Slic3r::GUI::GUI_App::persist_window_geometry(), Slic3r::GUI::ImGuiWrapper::radio_button(), Slic3r::GUI::Tab::rename_preset(), Slic3r::GUI::GLGizmoCut3D::render_connectors_input_window(), Slic3r::GUI::GLGizmoCut3D::render_cut_plane_input_window(), Slic3r::GUI::GalleryDialog::select(), Slic3r::GUI::PresetComboBox::selection_is_changed_according_to_physical_printers(), Slic3r::GUI::Choice::set_selection(), Slic3r::GUI::Choice::set_value(), Slic3r::GUI::ImGuiWrapper::slider_float(), Slic3r::GUI::ImGuiWrapper::slider_float(), start_new_slicer_or_gcodeviewer(), Slic3r::GUI::ImGuiWrapper::text(), Slic3r::GUI::ImGuiWrapper::text_colored(), Slic3r::GUI::ImGuiWrapper::text_wrapped(), Slic3r::GUI::PresetComboBox::update(), Slic3r::GUI::SavePresetDialog::Item::update(), Slic3r::GUI::PresetComboBox::update(), Slic3r::GUI::ObjectList::update_name_in_model(), Slic3r::GUI::ModelNode::UpdateEnabling(), Slic3r::Moonraker::upload(), Slic3r::OctoPrint::upload_inner_with_host(), and Slic3r::PrusaLink::upload_inner_with_host().

+ Here is the call graph for this function:

◆ is_bad_field()

bool Slic3r::GUI::is_bad_field ( const t_field obj)
inline

Convenience function, accepts a const reference to t_field and checks to see whether or not both wx pointers are null.

245{ return obj->getSizer() == nullptr && obj->getWindow() == nullptr; }

Referenced by is_sizer_field(), and is_window_field().

+ Here is the caller graph for this function:

◆ is_defined_input_value()

template<class T >
bool Slic3r::GUI::is_defined_input_value ( wxWindow *  win,
const ConfigOptionType type 
)
430{
431 if (!win || (static_cast<T*>(win)->GetValue().empty() && type != coString && type != coStrings && type != coPoints))
432 return false;
433 return true;
434}
bool empty(const BoundingBoxBase< PointType, PointsType > &bb)
Definition BoundingBox.hpp:229

References Slic3r::coPoints, Slic3r::coString, Slic3r::coStrings, Slic3r::empty(), and is_defined_input_value().

Referenced by is_defined_input_value().

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

◆ is_feature_with_center()

static bool Slic3r::GUI::is_feature_with_center ( const Measure::SurfaceFeature feature)
static
165{
166 const Measure::SurfaceFeatureType type = feature.get_type();
167 return (type == Measure::SurfaceFeatureType::Circle || (type == Measure::SurfaceFeatureType::Edge && feature.get_extra_point().has_value()));
168}
SurfaceFeatureType
Definition Measure.hpp:21

References Slic3r::Measure::Circle, Slic3r::Measure::Edge, Slic3r::Measure::SurfaceFeature::get_extra_point(), and Slic3r::Measure::SurfaceFeature::get_type().

Referenced by Slic3r::GUI::GLGizmoMeasure::on_mouse(), Slic3r::GUI::GLGizmoMeasure::on_render(), and Slic3r::GUI::GLGizmoMeasure::on_render_input_window().

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

◆ is_improper_category()

static bool Slic3r::GUI::is_improper_category ( const std::string &  category,
const int  extruders_cnt,
const bool  is_object_settings = true 
)
static
41{
42 return category.empty() ||
43 (extruders_cnt == 1 && (category == "Extruders" || category == "Wipe options")) ||
44 (!is_object_settings && category == "Support material");
45}

Referenced by create_freq_settings_popupmenu(), Slic3r::GUI::SettingsFactory::get_bundle(), and get_full_settings_hierarchy().

+ Here is the caller graph for this function:

◆ is_left_handed() [1/2]

static bool Slic3r::GUI::is_left_handed ( const Transform3d m)
static
2557{
2558 return is_left_handed(m.linear());
2559}
EIGEN_DEVICE_FUNC ConstLinearPart linear() const
Definition Transform.h:400
static bool is_left_handed(const Transform3d::ConstLinearPart &m)
Definition Selection.cpp:2551

References is_left_handed(), and Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::linear().

+ Here is the call graph for this function:

◆ is_left_handed() [2/2]

static bool Slic3r::GUI::is_left_handed ( const Transform3d::ConstLinearPart m)
static
2552{
2553 return m.determinant() < 0;
2554}

Referenced by Slic3r::GUI::Plater::export_stl_obj(), is_left_handed(), Slic3r::GUI::GLGizmoPainterBase::render_cursor_sphere(), Slic3r::GUI::GLGizmoPainterBase::render_triangles(), Slic3r::GUI::GLGizmoMmuSegmentation::render_triangles(), and Slic3r::GUI::Selection::synchronize_unselected_instances().

+ Here is the caller graph for this function:

◆ is_point_in_rect()

static bool Slic3r::GUI::is_point_in_rect ( const wxPoint &  pt,
const wxRect &  rect 
)
static
17{
18 return rect.GetLeft() <= pt.x && pt.x <= rect.GetRight() &&
19 rect.GetTop() <= pt.y && pt.y <= rect.GetBottom();
20}

Referenced by Slic3r::GUI::OG_CustomCtrl::OnLeftDown(), and Slic3r::GUI::OG_CustomCtrl::OnMotion().

+ Here is the caller graph for this function:

◆ is_rotation_xy_synchronized() [1/3]

static bool Slic3r::GUI::is_rotation_xy_synchronized ( const Transform3d trafo_from,
const Transform3d trafo_to 
)
static
2620{
2621 return is_rotation_xy_synchronized(trafo_from.linear(), trafo_to.linear());
2622}
static bool is_rotation_xy_synchronized(const Vec3d &rot_xyz_from, const Vec3d &rot_xyz_to)
Definition Selection.cpp:2562

References is_rotation_xy_synchronized(), and Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::linear().

+ Here is the call graph for this function:

◆ is_rotation_xy_synchronized() [2/3]

static bool Slic3r::GUI::is_rotation_xy_synchronized ( const Transform3d::ConstLinearPart trafo_from,
const Transform3d::ConstLinearPart trafo_to 
)
static
2600{
2601 auto rot = trafo_to * trafo_from.inverse();
2602 static constexpr const double eps = EPSILON;
2603 return
2604 // Looks like a rotation around Z: block(0..1, 0..1) + no change of Z component.
2605 is_approx(rot(0, 0), rot(1, 1), eps) &&
2606 is_approx(rot(0, 1), - rot(1, 0), eps) &&
2607 is_approx(rot(2, 2), 1., eps) &&
2608 // Rest should be zeros.
2609 is_approx(rot(0, 2), 0., eps) &&
2610 is_approx(rot(1, 2), 0., eps) &&
2611 is_approx(rot(2, 0), 0., eps) &&
2612 is_approx(rot(2, 1), 0., eps) &&
2613 // Determinant equals 1
2614 is_approx(rot.determinant(), 1., eps) &&
2615 // and finally the rotated X and Y axes shall be perpendicular.
2616 is_approx(rot(0, 0) * rot(0, 1) + rot(1, 0) * rot(1, 1), 0., eps);
2617}

References EPSILON, and Slic3r::is_approx().

+ Here is the call graph for this function:

◆ is_rotation_xy_synchronized() [3/3]

static bool Slic3r::GUI::is_rotation_xy_synchronized ( const Vec3d rot_xyz_from,
const Vec3d rot_xyz_to 
)
static
2563{
2564 const Eigen::AngleAxisd angle_axis(Geometry::rotation_xyz_diff(rot_xyz_from, rot_xyz_to));
2565 const Vec3d axis = angle_axis.axis();
2566 const double angle = angle_axis.angle();
2567 if (std::abs(angle) < 1e-8)
2568 return true;
2569 assert(std::abs(axis.x()) < 1e-8);
2570 assert(std::abs(axis.y()) < 1e-8);
2571 assert(std::abs(std::abs(axis.z()) - 1.) < 1e-8);
2572 return std::abs(axis.x()) < 1e-8 && std::abs(axis.y()) < 1e-8 && std::abs(std::abs(axis.z()) - 1.) < 1e-8;
2573}
Represents a 3D rotation as a rotation angle around an arbitrary 3D axis.
Definition AngleAxis.h:50

References Eigen::AngleAxis< _Scalar >::angle(), Slic3r::angle(), Eigen::AngleAxis< _Scalar >::axis(), and Slic3r::Geometry::rotation_xyz_diff().

Referenced by is_rotation_xy_synchronized(), Slic3r::GUI::Selection::synchronize_unselected_instances(), and verify_instances_rotation_synchronized().

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

◆ is_sizer_field()

bool Slic3r::GUI::is_sizer_field ( const t_field obj)
inline

Covenience function to determine whether this field is a valid sizer field.

251{ return !is_bad_field(obj) && obj->getSizer() != nullptr; }
bool is_bad_field(const t_field &obj)
Convenience function, accepts a const reference to t_field and checks to see whether or not both wx p...
Definition Field.hpp:245

References is_bad_field().

Referenced by Slic3r::GUI::OptionsGroup::activate_line().

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

◆ is_window_field()

bool Slic3r::GUI::is_window_field ( const t_field obj)
inline

Covenience function to determine whether this field is a valid window field.

248{ return !is_bad_field(obj) && obj->getWindow() != nullptr && obj->getSizer() == nullptr; }

References is_bad_field().

Referenced by Slic3r::GUI::OptionsGroup::activate_line().

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

◆ its_make_line()

static GLModel::Geometry Slic3r::GUI::its_make_line ( Vec3f  beg_pos,
Vec3f  end_pos 
)
static
52{
53 GLModel::Geometry init_data;
54 init_data.format = { GLModel::Geometry::EPrimitiveType::Lines, GLModel::Geometry::EVertexLayout::P3 };
55 init_data.reserve_vertices(2);
56 init_data.reserve_indices(2);
57
58 // vertices
59 init_data.add_vertex(beg_pos);
60 init_data.add_vertex(end_pos);
61
62 // indices
63 init_data.add_line(0, 1);
64 return init_data;
65}

References Slic3r::GUI::GLModel::Geometry::add_line(), Slic3r::GUI::GLModel::Geometry::add_vertex(), Slic3r::GUI::GLModel::Geometry::format, Slic3r::GUI::GLModel::Geometry::Lines, Slic3r::GUI::GLModel::Geometry::P3, Slic3r::GUI::GLModel::Geometry::reserve_indices(), and Slic3r::GUI::GLModel::Geometry::reserve_vertices().

Referenced by Slic3r::GUI::GLGizmoCut3D::init_rendering_items(), and Slic3r::GUI::GLGizmoCut3D::render_cut_line().

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

◆ L_str()

wxString Slic3r::GUI::L_str ( const std::string &  str)

Explicitly specify that the source string is already in UTF-8 encoding

6{
8 return wxGetTranslation(wxString(str.c_str(), wxConvUTF8));
9}

◆ libslic3r_translate_callback()

static std::string Slic3r::GUI::libslic3r_translate_callback ( const char *  s)
static
629{ return wxGetTranslation(wxString(s, wxConvUTF8)).utf8_str().data(); }

◆ list_model()

static ObjectDataViewModel * Slic3r::GUI::list_model ( )
static
185{
186 return wxGetApp().obj_list()->GetModel();
187}

Referenced by Slic3r::GUI::MenuFactory::append_menu_item_settings(), and Slic3r::GUI::MenuFactory::multi_selection_menu().

+ Here is the caller graph for this function:

◆ mac_dark_mode()

bool Slic3r::GUI::mac_dark_mode ( )
18{
19 NSString *style = [[NSUserDefaults standardUserDefaults] stringForKey:@"AppleInterfaceStyle"];
20 return style && [style isEqualToString:@"Dark"];
21
22}
#define style
Definition WipeTowerDialog.cpp:68

References style.

Referenced by Slic3r::GUI::GUI_App::dark_mode().

+ Here is the caller graph for this function:

◆ mac_max_scaling_factor()

double Slic3r::GUI::mac_max_scaling_factor ( )
25{
26 double scaling = 1.;
27 if ([NSScreen screens] == nil) {
28 scaling = [[NSScreen mainScreen] backingScaleFactor];
29 } else {
30 for (int i = 0; i < [[NSScreen screens] count]; ++ i)
31 scaling = std::max<double>(scaling, [[[NSScreen screens] objectAtIndex:0] backingScaleFactor]);
32 }
33 return scaling;
34}

Referenced by Slic3r::GUI::BitmapCache::BitmapCache(), add_default_image(), add_lock(), Slic3r::GUI::OpenGLManager::GLInfo::get_max_tex_size(), and GetSelectedChoices().

+ Here is the caller graph for this function:

◆ main_frame_icon()

static wxIcon Slic3r::GUI::main_frame_icon ( GUI_App::EAppMode  app_mode)
static
102{
103#if _WIN32
104 std::wstring path(size_t(MAX_PATH), wchar_t(0));
105 int len = int(::GetModuleFileName(nullptr, path.data(), MAX_PATH));
106 if (len > 0 && len < MAX_PATH) {
107 path.erase(path.begin() + len, path.end());
108 if (app_mode == GUI_App::EAppMode::GCodeViewer) {
109 // Only in case the slicer was started with --gcodeviewer parameter try to load the icon from prusa-gcodeviewer.exe
110 // Otherwise load it from the exe.
111 for (const std::wstring_view exe_name : { std::wstring_view(L"prusa-slicer.exe"), std::wstring_view(L"prusa-slicer-console.exe") })
112 if (boost::iends_with(path, exe_name)) {
113 path.erase(path.end() - exe_name.size(), path.end());
114 path += L"prusa-gcodeviewer.exe";
115 break;
116 }
117 }
118 }
119 return wxIcon(path, wxBITMAP_TYPE_ICO);
120#else // _WIN32
121 return wxIcon(Slic3r::var(app_mode == GUI_App::EAppMode::Editor ? "PrusaSlicer_128px.png" : "PrusaSlicer-gcodeviewer_128px.png"), wxBITMAP_TYPE_PNG);
122#endif // _WIN32
123}
std::string var(const std::string &file_name)
Definition utils.cpp:154

References Slic3r::GUI::GUI_App::Editor, Slic3r::GUI::GUI_App::GCodeViewer, L, and Slic3r::var().

Referenced by Slic3r::GUI::MainFrame::MainFrame().

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

◆ make_string_bold()

static void Slic3r::GUI::make_string_bold ( wxString &  str)
static
74{
75#if defined(SUPPORTS_MARKUP) && !defined(__APPLE__)
76 str = from_u8((boost::format("<b>%1%</b>") % into_u8(str)).str());
77#endif
78}

References from_u8(), and into_u8().

Referenced by Slic3r::GUI::DiffModel::AddOption(), and Slic3r::GUI::DiffModel::AddPreset().

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

◆ msw_rescale_word_local_combo()

void Slic3r::GUI::msw_rescale_word_local_combo ( choice_ctrl combo)
68{
69#ifdef __WXOSX__
70 const wxString selection = combo->GetString(combo->GetSelection());
71
72 /* To correct scaling (set new controll size) of a wxBitmapCombobox
73 * we need to refill control with new bitmaps. So, in our case :
74 * 1. clear control
75 * 2. add content
76 * 3. add scaled "empty" bitmap to the at least one item
77 */
78 combo->Clear();
79 wxSize size(wxDefaultSize);
80 size.SetWidth(15 * wxGetApp().em_unit());
81
82 // Set rescaled min height to correct layout
83 combo->SetMinSize(wxSize(-1, int(1.5f*combo->GetFont().GetPixelSize().y + 0.5f)));
84 // Set rescaled size
85 combo->SetSize(size);
86
87 combo->Append(ObjectManipulation::coordinate_type_str(ECoordinatesType::World));
88 combo->Append(ObjectManipulation::coordinate_type_str(ECoordinatesType::Instance));
89 combo->Append(ObjectManipulation::coordinate_type_str(ECoordinatesType::Local));
90
91 combo->SetValue(selection);
92#else
93#ifdef _WIN32
94 combo->Rescale();
95#endif
96 combo->SetMinSize(wxSize(15 * wxGetApp().em_unit(), -1));
97#endif
98}

References Slic3r::GUI::ObjectManipulation::coordinate_type_str(), em_unit(), Instance, Local, and World.

Referenced by Slic3r::GUI::ObjectManipulation::msw_rescale().

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

◆ na_value()

static wxString Slic3r::GUI::na_value ( bool  for_spin_ctrl = false)
static
201{
202#ifdef __linux__
203 if (for_spin_ctrl)
204 return "";
205#endif
206 return _(L("N/A"));
207}

References _, L, and na_value().

Referenced by Slic3r::GUI::SpinCtrl::get_value(), Slic3r::GUI::Field::get_value_by_opt_type(), na_value(), Slic3r::GUI::TextCtrl::propagate_value(), Slic3r::GUI::TextCtrl::set_na_value(), Slic3r::GUI::SpinCtrl::set_na_value(), Slic3r::GUI::TextCtrl::set_value(), and Slic3r::GUI::SpinCtrl::set_value().

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

◆ obj_list()

static ObjectList * Slic3r::GUI::obj_list ( )
static
180{
181 return wxGetApp().obj_list();
182}

Referenced by Slic3r::GUI::ObjectManipulation::ObjectManipulation(), Slic3r::GUI::MenuFactory::append_menu_item_change_extruder(), Slic3r::GUI::MenuFactory::append_menu_item_change_type(), Slic3r::GUI::MenuFactory::append_menu_item_fix_through_netfabb(), Slic3r::GUI::MenuFactory::append_menu_item_instance_to_object(), Slic3r::GUI::MenuFactory::append_menu_item_invalidate_cut_info(), Slic3r::GUI::MenuFactory::append_menu_item_layers_editing(), Slic3r::GUI::MenuFactory::append_menu_item_merge_to_multipart_object(), Slic3r::GUI::MenuFactory::append_menu_item_printable(), Slic3r::GUI::MenuFactory::append_menu_item_settings(), Slic3r::GUI::MenuFactory::append_menu_item_simplify(), Slic3r::GUI::MenuFactory::append_menu_items_add_volume(), Slic3r::GUI::MenuFactory::append_menu_items_convert_unit(), Slic3r::GUI::MenuFactory::append_menu_items_osx(), Slic3r::GUI::MenuFactory::append_submenu_add_generic(), create_freq_settings_popupmenu(), create_settings_popupmenu(), priv::create_volume(), Slic3r::GUI::GLGizmoEmboss::draw_model_type(), Slic3r::GUI::Emboss::CreateObjectJob::finalize(), Slic3r::GUI::GLGizmoEmboss::init_create(), Slic3r::GUI::MenuFactory::multi_selection_menu(), Slic3r::GUI::GLCanvas3D::on_mouse(), Slic3r::GUI::ObjectManipulation::update_settings_value(), and anonymous_namespace{EmbossJob.cpp}::update_volume_name().

+ Here is the caller graph for this function:

◆ object_contains_negative_volumes()

static bool Slic3r::GUI::object_contains_negative_volumes ( const Model model,
int  obj_id 
)
static
1161 {
1162 return (0 <= obj_id && obj_id < (int)model.objects.size()) ? model.objects[obj_id]->has_negative_volume_mesh() : false;
1163}

References Slic3r::Model::objects.

Referenced by Slic3r::GUI::GLCanvas3D::SLAView::detect_type_from_volumes(), and Slic3r::GUI::GLCanvas3D::SLAView::render_switch_button().

+ Here is the caller graph for this function:

◆ object_has_sla_drain_holes()

static bool Slic3r::GUI::object_has_sla_drain_holes ( const Model model,
int  obj_id 
)
static
1165 {
1166 return (0 <= obj_id && obj_id < (int)model.objects.size()) ? model.objects[obj_id]->has_sla_drain_holes() : false;
1167}

References Slic3r::Model::objects.

Referenced by Slic3r::GUI::GLCanvas3D::SLAView::detect_type_from_volumes().

+ Here is the caller graph for this function:

◆ on_mouse_surface_drag()

bool Slic3r::GUI::on_mouse_surface_drag ( const wxMouseEvent &  mouse_event,
const Camera camera,
std::optional< SurfaceDrag > &  surface_drag,
GLCanvas3D canvas,
RaycastManager raycast_manager,
std::optional< double >  up_limit = {} 
)

Mouse event handler, when move(drag&drop) volume over model surface NOTE: Dragged volume has to be selected. And also has to be hovered on start of dragging.

Parameters
mouse_eventContain type of event and mouse position
cameraActual viewport of camera
surface_dragStructure which keep information about dragging
canvasContain gl_volumes and selection
raycast_managerAABB trees for raycast in object Refresh state inside of function
up_limitWhen set than use correction of up vector
Returns
True when event is processed otherwise false
31{
32 // Fix when leave window during dragging
33 // Fix when click right button
34 if (surface_drag.has_value() && !mouse_event.Dragging()) {
35 // write transformation from UI into model
36 canvas.do_move(L("Surface move"));
37
38 // allow moving with object again
39 canvas.enable_moving(true);
40 canvas.enable_picking(true);
41 surface_drag.reset();
42
43 // only left up is correct
44 // otherwise it is fix state and return false
45 return mouse_event.LeftUp();
46 }
47
48 if (mouse_event.Moving())
49 return false;
50
51 // detect start text dragging
52 if (mouse_event.LeftDown()) {
53 // selected volume
54 GLVolume *gl_volume = get_selected_gl_volume(canvas);
55 if (gl_volume == nullptr)
56 return false;
57
58 // is selected volume closest hovered?
59 const GLVolumePtrs &gl_volumes = canvas.get_volumes().volumes;
60 if (int hovered_idx = canvas.get_first_hover_volume_idx();
61 hovered_idx < 0)
62 return false;
63 else if (auto hovered_idx_ = static_cast<size_t>(hovered_idx);
64 hovered_idx_ >= gl_volumes.size() ||
65 gl_volumes[hovered_idx_] != gl_volume)
66 return false;
67
68 const ModelObjectPtrs &objects = canvas.get_model()->objects;
69 const ModelObject *object = get_model_object(*gl_volume, objects);
70 assert(object != nullptr);
71 if (object == nullptr)
72 return false;
73
74 const ModelInstance *instance = get_model_instance(*gl_volume, *object);
75 const ModelVolume *volume = get_model_volume(*gl_volume, *object);
76 assert(instance != nullptr && volume != nullptr);
77 if (object == nullptr || instance == nullptr || volume == nullptr)
78 return false;
79
80 // allowed drag&drop by canvas for object
81 if (volume->is_the_only_one_part())
82 return false;
83
84 const ModelVolumePtrs &volumes = object->volumes;
85 std::vector<size_t> allowed_volumes_id;
86 if (volumes.size() > 1) {
87 allowed_volumes_id.reserve(volumes.size() - 1);
88 for (auto &v : volumes) {
89 // skip actual selected object
90 if (v->id() == volume->id())
91 continue;
92 // drag only above part not modifiers or negative surface
93 if (!v->is_model_part())
94 continue;
95 allowed_volumes_id.emplace_back(v->id().id);
96 }
97 }
98 RaycastManager::AllowVolumes condition(std::move(allowed_volumes_id));
99 RaycastManager::Meshes meshes = create_meshes(canvas, condition);
100 // initialize raycasters
101 // INFO: It could slows down for big objects
102 // (may be move to thread and do not show drag until it finish)
103 raycast_manager.actualize(*instance, &condition, &meshes);
104
105 // wxCoord == int --> wx/types.h
106 Vec2i mouse_coord(mouse_event.GetX(), mouse_event.GetY());
107 Vec2d mouse_pos = mouse_coord.cast<double>();
108
109 // world_matrix_fixed() without sla shift
110 Transform3d to_world = world_matrix_fixed(*gl_volume, objects);
111
112 // zero point of volume in world coordinate system
113 Vec3d volume_center = to_world.translation();
114 // screen coordinate of volume center
115 Vec2i coor = CameraUtils::project(camera, volume_center);
116 Vec2d mouse_offset = coor.cast<double>() - mouse_pos;
117 Vec2d mouse_offset_without_sla_shift = mouse_offset;
118 if (double sla_shift = gl_volume->get_sla_shift_z(); !is_approx(sla_shift, 0.)) {
119 Transform3d to_world_without_sla_move = instance->get_matrix() * volume->get_matrix();
120 if (volume->text_configuration.has_value() && volume->text_configuration->fix_3mf_tr.has_value())
121 to_world_without_sla_move = to_world_without_sla_move * (*volume->text_configuration->fix_3mf_tr);
122 // zero point of volume in world coordinate system
123 volume_center = to_world_without_sla_move.translation();
124 // screen coordinate of volume center
125 coor = CameraUtils::project(camera, volume_center);
126 mouse_offset_without_sla_shift = coor.cast<double>() - mouse_pos;
127 }
128
129 Transform3d volume_tr = gl_volume->get_volume_transformation().get_matrix();
130
131 if (volume->text_configuration.has_value()) {
132 const TextConfiguration &tc = *volume->text_configuration;
133 // fix baked transformation from .3mf store process
134 if (tc.fix_3mf_tr.has_value())
135 volume_tr = volume_tr * tc.fix_3mf_tr->inverse();
136 }
137
138 Transform3d instance_tr = instance->get_matrix();
139 Transform3d instance_tr_inv = instance_tr.inverse();
140 Transform3d world_tr = instance_tr * volume_tr;
141 std::optional<float> start_angle;
142 if (up_limit.has_value())
143 start_angle = Emboss::calc_up(world_tr, *up_limit);
144 surface_drag = SurfaceDrag{mouse_offset, world_tr, instance_tr_inv, gl_volume, condition, start_angle, true, mouse_offset_without_sla_shift};
145
146 // disable moving with object by mouse
147 canvas.enable_moving(false);
148 canvas.enable_picking(false);
149 return true;
150 }
151
152 // Dragging starts out of window
153 if (!surface_drag.has_value())
154 return false;
155
156 if (mouse_event.Dragging()) {
157 // wxCoord == int --> wx/types.h
158 Vec2i mouse_coord(mouse_event.GetX(), mouse_event.GetY());
159 Vec2d mouse_pos = mouse_coord.cast<double>();
160 Vec2d offseted_mouse = mouse_pos + surface_drag->mouse_offset_without_sla_shift;
161
162 std::optional<RaycastManager::Hit> hit = ray_from_camera(
163 raycast_manager, offseted_mouse, camera, &surface_drag->condition);
164
165 surface_drag->exist_hit = hit.has_value();
166 if (!hit.has_value()) {
167 // cross hair need redraw
168 canvas.set_as_dirty();
169 return true;
170 }
171
172 auto world_linear = surface_drag->world.linear();
173 // Calculate offset: transformation to wanted position
174 {
175 // Reset skew of the text Z axis:
176 // Project the old Z axis into a new Z axis, which is perpendicular to the old XY plane.
177 Vec3d old_z = world_linear.col(2);
178 Vec3d new_z = world_linear.col(0).cross(world_linear.col(1));
179 world_linear.col(2) = new_z * (old_z.dot(new_z) / new_z.squaredNorm());
180 }
181
182 Vec3d text_z_world = world_linear.col(2); // world_linear * Vec3d::UnitZ()
183 auto z_rotation = Eigen::Quaternion<double, Eigen::DontAlign>::FromTwoVectors(text_z_world, hit->normal);
184 Transform3d world_new = z_rotation * surface_drag->world;
185 auto world_new_linear = world_new.linear();
186
187 // Fix direction of up vector to zero initial rotation
188 if(up_limit.has_value()){
189 Vec3d z_world = world_new_linear.col(2);
190 z_world.normalize();
191 Vec3d wanted_up = Emboss::suggest_up(z_world, *up_limit);
192
193 Vec3d y_world = world_new_linear.col(1);
194 auto y_rotation = Eigen::Quaternion<double, Eigen::DontAlign>::FromTwoVectors(y_world, wanted_up);
195
196 world_new = y_rotation * world_new;
197 world_new_linear = world_new.linear();
198 }
199
200 // Edit position from right
201 Transform3d volume_new{Eigen::Translation<double, 3>(surface_drag->instance_inv * hit->position)};
202 volume_new.linear() = surface_drag->instance_inv.linear() * world_new_linear;
203
204 // Check that transformation matrix is valid transformation
205 assert(volume_new.matrix()(0, 0) == volume_new.matrix()(0, 0)); // Check valid transformation not a NAN
206 if (volume_new.matrix()(0, 0) != volume_new.matrix()(0, 0))
207 return true;
208
209 // Check that scale in world did not changed
210 assert(!calc_scale(world_linear, world_new_linear, Vec3d::UnitY()).has_value());
211 assert(!calc_scale(world_linear, world_new_linear, Vec3d::UnitZ()).has_value());
212
213 const ModelVolume *volume = get_model_volume(*surface_drag->gl_volume, canvas.get_model()->objects);
214 if (volume != nullptr && volume->text_configuration.has_value()) {
215 const TextConfiguration &tc = *volume->text_configuration;
216 // fix baked transformation from .3mf store process
217 if (tc.fix_3mf_tr.has_value())
218 volume_new = volume_new * (*tc.fix_3mf_tr);
219
220 // apply move in Z direction and rotation by up vector
221 Emboss::apply_transformation(surface_drag->start_angle, tc.style.prop.distance, volume_new);
222 }
223
224 // Update transformation for all instances
225 for (GLVolume *vol : canvas.get_volumes().volumes) {
226 if (vol->object_idx() != surface_drag->gl_volume->object_idx() || vol->volume_idx() != surface_drag->gl_volume->volume_idx())
227 continue;
228 vol->set_volume_transformation(volume_new);
229 }
230
231 canvas.set_as_dirty();
232 return true;
233 }
234 return false;
235}
double get_sla_shift_z() const
Definition 3DScene.hpp:269
const Geometry::Transformation & get_volume_transformation() const
Definition 3DScene.hpp:241
void enable_picking(bool enable)
Definition GLCanvas3D.cpp:1801
void set_as_dirty()
Definition GLCanvas3D.cpp:1494
void do_move(const std::string &snapshot_type)
Definition GLCanvas3D.cpp:4030
void enable_moving(bool enable)
Definition GLCanvas3D.cpp:1806
const Transform3d & get_matrix() const
Definition Geometry.hpp:437
Definition Model.hpp:1120
const Transform3d & get_matrix() const
Definition Model.hpp:1169
EIGEN_DEVICE_FUNC Transform inverse(TransformTraits traits=(TransformTraits) Mode) const
Definition Transform.h:1202
static EIGEN_DEVICE_FUNC Quaternion FromTwoVectors(const MatrixBase< Derived1 > &a, const MatrixBase< Derived2 > &b)
Represents a translation transformation.
Definition Translation.h:31
static std::optional< double > calc_scale(const Matrix3d &from, const Matrix3d &to, const Vec3d &dir)
Definition SurfaceDrag.cpp:14
RaycastManager::Meshes create_meshes(GLCanvas3D &canvas, const RaycastManager::AllowVolumes &condition)
Use scene Raycasters and prepare data for actualize RaycasterManager.
Definition RaycastManager.cpp:316
std::optional< RaycastManager::Hit > ray_from_camera(const RaycastManager &raycaster, const Vec2d &mouse_pos, const Camera &camera, const RaycastManager::ISkip *skip)
Unproject on mesh by Mesh raycasters.
Definition RaycastManager.cpp:351
std::vector< ModelVolume * > ModelVolumePtrs
Definition Model.hpp:106
Eigen::Matrix< int, 2, 1, Eigen::DontAlign > Vec2i
Definition Point.hpp:39
constexpr double up_limit
Definition GLGizmoEmboss.cpp:113

References Slic3r::GUI::RaycastManager::actualize(), Slic3r::Emboss::apply_transformation(), calc_scale(), Slic3r::Emboss::calc_up(), create_meshes(), Slic3r::FontProp::distance, Slic3r::GUI::GLCanvas3D::do_move(), Slic3r::GUI::GLCanvas3D::enable_moving(), Slic3r::GUI::GLCanvas3D::enable_picking(), Slic3r::TextConfiguration::fix_3mf_tr, Eigen::Quaternion< _Scalar, _Options >::FromTwoVectors(), Slic3r::GUI::GLCanvas3D::get_first_hover_volume_idx(), Slic3r::Geometry::Transformation::get_matrix(), Slic3r::ModelInstance::get_matrix(), Slic3r::GUI::GLCanvas3D::get_model(), get_model_instance(), get_model_object(), get_model_volume(), get_selected_gl_volume(), Slic3r::GLVolume::get_sla_shift_z(), Slic3r::GLVolume::get_volume_transformation(), Slic3r::GUI::GLCanvas3D::get_volumes(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::inverse(), Slic3r::is_approx(), L, Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::linear(), Slic3r::Model::objects, Slic3r::GUI::CameraUtils::project(), Slic3r::EmbossStyle::prop, ray_from_camera(), Slic3r::GUI::GLCanvas3D::set_as_dirty(), Slic3r::TextConfiguration::style, Slic3r::Emboss::suggest_up(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::translation(), Slic3r::GLVolumeCollection::volumes, and world_matrix_fixed().

Referenced by Slic3r::GUI::GLGizmoEmboss::on_mouse_for_translate().

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

◆ on_window_geometry()

void Slic3r::GUI::on_window_geometry ( wxTopLevelWindow *  tlw,
std::function< void()>  callback 
)
45{
46#ifdef _WIN32
47 // On windows, the wxEVT_SHOW is not received if the window is created maximized
48 // cf. https://groups.google.com/forum/#!topic/wx-users/c7ntMt6piRI
49 // OTOH the geometry is available very soon, so we can call the callback right away
50 callback();
51#elif defined __linux__
52 tlw->Bind(wxEVT_SHOW, [=](wxShowEvent &evt) {
53 // On Linux, the geometry is only available after wxEVT_SHOW + CallAfter
54 // cf. https://groups.google.com/forum/?pli=1#!topic/wx-users/fERSXdpVwAI
55 tlw->CallAfter([=]() { callback(); });
56 evt.Skip();
57 });
58#elif defined __APPLE__
59 tlw->Bind(wxEVT_SHOW, [=](wxShowEvent &evt) {
60 callback();
61 evt.Skip();
62 });
63#endif
64}

Referenced by Slic3r::GUI::ConfigWizard::ConfigWizard(), and Slic3r::GUI::GUI_App::persist_window_geometry().

+ Here is the caller graph for this function:

◆ operator<()

bool Slic3r::GUI::operator< ( const DriveData lhs,
const DriveData rhs 
)
inline
31{ return lhs.path < rhs.path; }
std::string path
Definition RemovableDriveManager.hpp:20

References Slic3r::GUI::DriveData::path.

◆ operator<<()

std::ostream & Slic3r::GUI::operator<< ( std::ostream &  os,
const WindowMetrics metrics 
)
287{
288 return os << '(' << metrics.serialize() << ')';
289}
std::string serialize() const
Definition GUI_Utils.cpp:275

References Slic3r::GUI::WindowMetrics::serialize().

+ Here is the call graph for this function:

◆ operator==()

bool Slic3r::GUI::operator== ( const DriveData lhs,
const DriveData rhs 
)
inline
33{ return lhs.path == rhs.path; }

References Slic3r::GUI::DriveData::path.

◆ operator>()

bool Slic3r::GUI::operator> ( const DriveData lhs,
const DriveData rhs 
)
inline
32{ return lhs.path > rhs.path; }

References Slic3r::GUI::DriveData::path.

◆ pad_combo_value_for_config()

static wxString Slic3r::GUI::pad_combo_value_for_config ( const DynamicPrintConfig config)
static
1066{
1067 return config.opt_bool("pad_enable") ? (config.opt_bool("pad_around_object") ? _("Around object") : _("Below object")) : _("None");
1068}

References _, Slic3r::ConfigBase::opt_bool(), and pad_combo_value_for_config().

Referenced by Slic3r::GUI::Tab::on_value_change(), pad_combo_value_for_config(), and Slic3r::GUI::Tab::update_frequently_changed_parameters().

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

◆ parse_lscpu_etc()

static std::map< std::string, std::string > Slic3r::GUI::parse_lscpu_etc ( const std::string &  name,
char  delimiter 
)
static
251{
252 std::map<std::string, std::string> out;
253 constexpr size_t max_len = 1000;
254 char cline[max_len] = "";
255 FILE* fp = popen(name.data(), "r");
256 if (fp != NULL) {
257 while (fgets(cline, max_len, fp) != NULL) {
258 std::string line(cline);
259 line.erase(std::remove_if(line.begin(), line.end(),
260 [](char c) { return c == '\"' || c == '\r' || c == '\n'; }),
261 line.end());
262 size_t pos = line.find(delimiter);
263 if (pos < line.size() - 1) {
264 std::string key = line.substr(0, pos);
265 std::string value = line.substr(pos + 1);
266 boost::trim_all(key); // remove leading and trailing spaces
267 boost::trim_all(value);
268 out[key] = value;
269 }
270 }
271 pclose(fp);
272 }
273 return out;
274}

Referenced by generate_system_info_json().

+ Here is the caller graph for this function:

◆ parse_semver_from_ini()

static boost::optional< Semver > Slic3r::GUI::parse_semver_from_ini ( std::string  path)
static
944{
945 std::ifstream stream(path);
946 std::stringstream buffer;
947 buffer << stream.rdbuf();
948 std::string body = buffer.str();
949 size_t start = body.find("PrusaSlicer ");
950 if (start == std::string::npos)
951 return boost::none;
952 body = body.substr(start + 12);
953 size_t end = body.find_first_of(" \n");
954 if (end < body.size())
955 body.resize(end);
956 return Semver::parse(body);
957}

References Slic3r::Semver::parse().

Referenced by Slic3r::GUI::GUI_App::check_older_app_config().

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

◆ parse_version_string()

static Semver Slic3r::GUI::parse_version_string ( const std::string &  version)
static
130{
131 if (version == "N/A")
132 return Semver::invalid();
133
134 std::vector<std::string> tokens;
135 boost::split(tokens, version, boost::is_any_of(" "), boost::token_compress_on);
136
137 if (tokens.empty())
138 return Semver::invalid();
139
140#if ENABLE_OPENGL_ES
141 const std::string version_container = (tokens.size() > 1 && boost::istarts_with(tokens[1], "ES")) ? tokens[2] : tokens[0];
142#endif // ENABLE_OPENGL_ES
143
144 std::vector<std::string> numbers;
145#if ENABLE_OPENGL_ES
146 boost::split(numbers, version_container, boost::is_any_of("."), boost::token_compress_on);
147#else
148 boost::split(numbers, tokens[0], boost::is_any_of("."), boost::token_compress_on);
149#endif // ENABLE_OPENGL_ES
150
151 unsigned int gl_major = 0;
152 unsigned int gl_minor = 0;
153
154 if (numbers.size() > 0)
155 gl_major = ::atoi(numbers[0].c_str());
156
157 if (numbers.size() > 1)
158 gl_minor = ::atoi(numbers[1].c_str());
159
160 return Semver(gl_major, gl_minor, 0);
161}
Definition Semver.hpp:19
char * version
Definition main.c:59

References Slic3r::Semver::invalid(), and version.

Referenced by Slic3r::GUI::OpenGLManager::GLInfo::detect().

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

◆ plater()

static Plater * Slic3r::GUI::plater ( )
static
175{
176 return wxGetApp().plater();
177}

Referenced by Slic3r::GUI::ObjectManipulation::ObjectManipulation(), Slic3r::GUI::PlaterAfterLoadAutoArrange::PlaterAfterLoadAutoArrange(), Slic3r::GUI::PlaterWorker< WorkerSubclass >::PlaterWorker(), Slic3r::GUI::GLGizmoRotate3D::RotoptimzeWindow::RotoptimzeWindow(), Slic3r::GUI::GLCanvas3D::_picking_pass(), Slic3r::GUI::GLCanvas3D::_refresh_if_shown_on_screen(), Slic3r::GUI::GLGizmosManager::activate_gizmo(), Slic3r::GUI::Selection::add(), Slic3r::GUI::GLGizmoCut3D::add_connector(), Slic3r::GUI::ObjectList::add_layer_range_after_current(), Slic3r::GUI::GLGizmoSimplify::add_simplify_suggestion_notification(), Slic3r::GUI::MenuFactory::append_menu_item_add_text(), Slic3r::GUI::MenuFactory::append_menu_item_delete(), Slic3r::GUI::MenuFactory::append_menu_item_edit_text(), Slic3r::GUI::MenuFactory::append_menu_item_export_stl(), Slic3r::GUI::MenuFactory::append_menu_item_fix_through_netfabb(), Slic3r::GUI::MenuFactory::append_menu_item_instance_to_object(), Slic3r::GUI::MenuFactory::append_menu_item_printable(), Slic3r::GUI::MenuFactory::append_menu_item_reload_from_disk(), Slic3r::GUI::MenuFactory::append_menu_item_replace_with_stl(), Slic3r::GUI::MenuFactory::append_menu_item_scale_selection_to_fit_print_volume(), Slic3r::GUI::MenuFactory::append_menu_item_simplify(), Slic3r::GUI::MenuFactory::append_menu_items_instance_manipulation(), Slic3r::GUI::MenuFactory::append_menu_items_mirror(), Slic3r::GUI::MenuFactory::append_menu_items_split(), Slic3r::GUI::GLGizmoSimplify::apply_simplify(), Slic3r::GUI::GLGizmoFdmSupports::auto_generate(), Slic3r::GUI::GLGizmoSlaSupports::auto_generate(), bed_stride(), call_after_if_active(), Slic3r::GUI::ObjectList::copy(), create_freq_settings_popupmenu(), Slic3r::GUI::MenuFactory::create_part_menu(), create_settings_popupmenu(), priv::create_volume(), Slic3r::GUI::ObjectList::del_from_cut_object(), Slic3r::GUI::ObjectList::del_info_item(), Slic3r::GUI::GLGizmoCut3D::delete_selected_connectors(), Slic3r::GUI::GLGizmoHollow::delete_selected_points(), Slic3r::GUI::GLGizmoSlaSupports::delete_selected_points(), Slic3r::GUI::Mouse3DController::disconnect_device(), Slic3r::GUI::GLGizmosManager::do_render_overlay(), Slic3r::GUI::GLGizmoEmboss::draw_delete_style_button(), Slic3r::GUI::GLGizmoEmboss::draw_font_list(), Slic3r::GUI::GLGizmoEmboss::draw_model_type(), Slic3r::GUI::GLGizmoEmboss::draw_text_input(), Slic3r::GUI::GLGizmoSlaSupports::editing_mode_apply_changes(), Slic3r::GUI::Emboss::CreateObjectJob::finalize(), Slic3r::GUI::ObjectList::fix_cut_selection(), Slic3r::GUI::ObjectList::fix_through_netfabb(), Slic3r::GUI::GLGizmoCut3D::flip_cut_plane(), generate_thumbnail_from_model(), get_arrange_poly(), get_arrange_poly(), get_selection(), get_skirt_offset(), get_wipe_tower(), get_wipe_tower_arrangepoly(), Slic3r::GUI::GLGizmoHollow::gizmo_event(), Slic3r::GUI::GLGizmoPainterBase::gizmo_event(), Slic3r::GUI::GLGizmoSlaSupports::gizmo_event(), Slic3r::GUI::Plater::priv::init_collapse_toolbar(), Slic3r::GUI::ObjectList::load_mesh_object(), Slic3r::GUI::ObjectList::load_shape_object_from_gallery(), Slic3r::GUI::ObjectList::load_shape_object_from_gallery(), Slic3r::GUI::ObjectList::merge(), Slic3r::GUI::MenuFactory::multi_selection_menu(), Slic3r::GUI::GLCanvas3D::on_char(), Slic3r::GUI::GLCanvas3D::on_idle(), Slic3r::GUI::GLGizmoCut3D::on_is_activable(), Slic3r::GUI::GLCanvas3D::on_mouse(), Slic3r::GUI::GLCanvas3D::on_mouse_wheel(), Slic3r::GUI::GLGizmoEmboss::on_render_input_window(), Slic3r::GUI::GLGizmoFdmSupports::on_render_input_window(), Slic3r::GUI::GLGizmoHollow::on_render_input_window(), Slic3r::GUI::GLGizmoMmuSegmentation::on_render_input_window(), Slic3r::GUI::GLGizmoSeam::on_render_input_window(), Slic3r::GUI::GLGizmoSlaSupports::on_render_input_window(), Slic3r::GUI::GLGizmoCut3D::on_start_dragging(), Slic3r::GUI::GLGizmoCut3D::on_stop_dragging(), Slic3r::GUI::GLGizmoHollow::on_stop_dragging(), Slic3r::GUI::GLGizmoSlaSupports::on_stop_dragging(), Slic3r::GUI::ObjectList::OnDrop(), Slic3r::GUI::ObjectList::paste(), Slic3r::GUI::GLGizmoCut3D::perform_cut(), Slic3r::GUI::GLGizmoCut3D::process_cut_line(), Slic3r::GUI::ObjectList::remove(), Slic3r::GUI::GLCanvas3D::render(), Slic3r::GUI::GLGizmoCut3D::render_connectors_input_window(), Slic3r::GUI::GLGizmoPainterBase::render_cursor_circle(), Slic3r::GUI::GLGizmoCut3D::render_cut_line(), Slic3r::GUI::GLGizmoCut3D::render_cut_plane_input_window(), Slic3r::GUI::GLGizmoCut3D::render_line(), Slic3r::GUI::GLGizmoCut3D::render_model(), Slic3r::GUI::GLGizmoCut3D::render_move_center_input(), Slic3r::GUI::GLGizmoSlaBase::reslice_until_step(), Slic3r::GUI::Selection::scale_to_fit_print_volume(), Slic3r::GUI::GLGizmoFdmSupports::select_facets_by_angle(), Slic3r::GUI::GLGizmoCut3D::shift_cut(), Slic3r::GUI::ObjectList::show_context_menu(), Slic3r::GUI::ObjectList::simplify(), Slic3r::GUI::ObjectList::split_instances(), priv::start_create_object_job(), priv::start_create_volume_job(), priv::start_create_volume_on_surface_job(), take_snapshot(), Slic3r::GUI::GLGizmoSlaBase::unproject_on_mesh(), Slic3r::GUI::TabSLAPrint::update(), Slic3r::GUI::ProjectDirtyStateManager::update_from_undo_redo_stack(), Slic3r::GUI::ObjectManipulation::update_if_dirty(), Slic3r::GUI::Preview::update_layers_slider(), Slic3r::GUI::ObjectList::update_selections_on_canvas(), Slic3r::GUI::Emboss::UpdateJob::update_volume(), and priv::update_volume().

◆ point_on_feature_type_as_string()

static std::string Slic3r::GUI::point_on_feature_type_as_string ( Measure::SurfaceFeatureType  type,
int  hover_id 
)
static
72{
73 std::string ret;
74 switch (type) {
75 case Measure::SurfaceFeatureType::Point: { ret = _u8L("Vertex"); break; }
76 case Measure::SurfaceFeatureType::Edge: { ret = _u8L("Point on edge"); break; }
77 case Measure::SurfaceFeatureType::Circle: { ret = _u8L("Point on circle"); break; }
78 case Measure::SurfaceFeatureType::Plane: { ret = _u8L("Point on plane"); break; }
79 default: { assert(false); break; }
80 }
81 return ret;
82}

References _u8L, Slic3r::Measure::Circle, Slic3r::Measure::Edge, Slic3r::Measure::Plane, and Slic3r::Measure::Point.

Referenced by Slic3r::GUI::GLGizmoMeasure::on_render_input_window().

+ Here is the caller graph for this function:

◆ printer_config()

static DynamicPrintConfig & Slic3r::GUI::printer_config ( )
static
58{
59 return wxGetApp().preset_bundle->printers.get_edited_preset().config;
60}

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

+ Here is the caller graph for this function:

◆ printer_technology() [1/2]

static PrinterTechnology Slic3r::GUI::printer_technology ( )
static
31{
32 return wxGetApp().preset_bundle->printers.get_selected_preset().printer_technology();
33}

Referenced by Slic3r::GUI::FreqChangedParams::FreqChangedParams(), Slic3r::GUI::Selection::add(), Slic3r::GUI::ObjectList::add_category_to_settings_from_selection(), Slic3r::GUI::ObjectList::add_layer_root_item(), Slic3r::GUI::ObjectList::add_volumes_to_object_in_list(), Slic3r::GUI::GUI_App::apply_keeped_preset_modifications(), Slic3r::GUI::ObjectList::change_part_type(), Slic3r::GUI::GUI_App::check_and_keep_current_preset_changes(), create_freq_settings_popupmenu(), create_settings_popupmenu(), Slic3r::GUI::ObjectList::delete_from_model_and_list(), Slic3r::GUI::GLGizmoEmboss::draw_model_type(), Slic3r::GUI::GUI_App::get_active_preset_collections(), Slic3r::GUI::SettingsFactory::get_options(), Slic3r::GUI::GUI_App::has_current_preset_changes(), Slic3r::GUI::GUI_App::has_unsaved_preset_changes(), Slic3r::GUI::MainFrame::load_config(), Slic3r::GUI::GUI_App::load_current_presets(), Slic3r::GUI::ObjectList::part_selection_changed(), Slic3r::GUI::ObjectList::paste_layers_into_list(), Slic3r::GUI::GLCanvas3D::reload_scene(), Slic3r::GUI::UnsavedChangesDialog::save(), Slic3r::GUI::Selection::scale_to_fit_print_volume(), Slic3r::GUI::ObjectList::selection_changed(), Slic3r::GUI::ObjectList::show_context_menu(), Slic3r::GUI::UnsavedChangesDialog::update(), Slic3r::GUI::ObjectSettings::update_config_values(), Slic3r::GUI::ObjectList::update_info_items(), Slic3r::GUI::ObjectList::update_object_list_by_printer_technology(), Slic3r::GUI::ObjectList::update_objects_list_extruder_column(), Slic3r::GUI::GUI_App::update_saved_preset_from_current_preset(), and Slic3r::GUI::UnsavedChangesDialog::update_tree().

+ Here is the caller graph for this function:

◆ printer_technology() [2/2]

static PrinterTechnology Slic3r::GUI::printer_technology ( )
static
47{
48 return wxGetApp().preset_bundle->printers.get_selected_preset().printer_technology();
49}

◆ process_key_down()

static void Slic3r::GUI::process_key_down ( ImGuiKey  imgui_key,
std::function< void()>  f 
)
static
1055{
1056 if (ImGui::IsKeyDown(ImGui::GetKeyIndex(imgui_key)))
1057 {
1058 f();
1059 // set KeysDown to false to avoid redundant key down processing
1060 ImGuiContext& g = *GImGui;
1061 g.IO.KeysDown[ImGui::GetKeyIndex(imgui_key)] = false;
1062 }
1063}
IMGUI_API bool IsKeyDown(int user_key_index)
Definition imgui.cpp:4634
IMGUI_API int GetKeyIndex(ImGuiKey imgui_key)
Definition imgui.cpp:4625
ImGuiIO IO
Definition imgui_internal.h:1354
bool KeysDown[512]
Definition imgui.h:1845

References Slic3r::f(), ImGui::GetKeyIndex(), GImGui, ImGuiContext::IO, ImGui::IsKeyDown(), and ImGuiIO::KeysDown.

Referenced by Slic3r::GUI::ImGuiWrapper::search_list().

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

◆ process_mouse_wheel()

static void Slic3r::GUI::process_mouse_wheel ( int &  mouse_wheel)
static
835{
836 if (mouse_wheel > 0)
837 scroll_up();
838 else if (mouse_wheel < 0)
839 scroll_down();
840 mouse_wheel = 0;
841}
static void scroll_down()
Definition ImGuiWrapper.cpp:823
static void scroll_up()
Definition ImGuiWrapper.cpp:811

References scroll_down(), and scroll_up().

Referenced by Slic3r::GUI::GLCanvas3D::on_mouse_wheel(), Slic3r::GUI::ImGuiWrapper::search_list(), and Slic3r::GUI::ImGuiWrapper::undo_redo_list().

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

◆ processed_objects_idxs()

static std::vector< int > Slic3r::GUI::processed_objects_idxs ( const Model model,
const SLAPrint sla_print,
const GLVolumePtrs volumes 
)
static
1137{
1138 std::vector<int> ret;
1139 GLVolumePtrs matching_volumes;
1140 std::copy_if(volumes.begin(), volumes.end(), std::back_inserter(matching_volumes), [](GLVolume* v) {
1141 return v->volume_idx() == -(int)slaposDrillHoles; });
1142 for (const GLVolume* v : matching_volumes) {
1143 const int mo_idx = v->object_idx();
1144 const ModelObject* model_object = (mo_idx < (int)model.objects.size()) ? model.objects[mo_idx] : nullptr;
1145 if (model_object != nullptr && model_object->instances[v->instance_idx()]->is_printable()) {
1146 const SLAPrintObject* print_object = sla_print.get_print_object_by_model_object_id(model_object->id());
1147 if (print_object != nullptr && print_object->get_parts_to_slice().size() > 1)
1148 ret.push_back(mo_idx);
1149 }
1150 }
1151 std::sort(ret.begin(), ret.end());
1152 ret.erase(std::unique(ret.begin(), ret.end()), ret.end());
1153 return ret;
1154};
ModelInstancePtrs instances
Definition Model.hpp:334
std::vector< csg::CSGPart > get_parts_to_slice() const
Definition SLAPrint.cpp:1086

References Slic3r::SLAPrintObject::get_parts_to_slice(), Slic3r::SLAPrint::get_print_object_by_model_object_id(), Slic3r::ObjectBase::id(), Slic3r::GLVolume::instance_idx(), Slic3r::ModelObject::instances, Slic3r::GLVolume::object_idx(), Slic3r::Model::objects, and Slic3r::GUI::GLCanvas3D::sla_print().

Referenced by Slic3r::GUI::GLCanvas3D::SLAView::render_switch_button(), and Slic3r::GUI::GLCanvas3D::SLAView::update_volumes_visibility().

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

◆ queue_job() [1/3]

template<class ProcessFn , class = std::enable_if_t<IsProcessFn<ProcessFn>>>
bool Slic3r::GUI::queue_job ( Worker w,
ProcessFn  fn 
)
82{
83 return queue_job(w, std::move(fn), [](bool, std::exception_ptr &) {});
84}
bool queue_job(Worker &w, ProcessFn fn, FinishFn finishfn)
Definition Worker.hpp:59

References queue_job().

+ Here is the call graph for this function:

◆ queue_job() [2/3]

template<class ProcessFn , class FinishFn , class = std::enable_if_t<IsProcessFn<ProcessFn>>, class = std::enable_if_t<IsFinishFn<FinishFn>>>
bool Slic3r::GUI::queue_job ( Worker w,
ProcessFn  fn,
FinishFn  finishfn 
)
60{
61 struct LambdaJob: Job {
62 ProcessFn fn;
63 FinishFn finishfn;
64
65 LambdaJob(ProcessFn pfn, FinishFn ffn)
66 : fn{std::move(pfn)}, finishfn{std::move(ffn)}
67 {}
68
69 void process(Ctl &ctl) override { fn(ctl); }
70 void finalize(bool canceled, std::exception_ptr &eptr) override
71 {
72 finishfn(canceled, eptr);
73 }
74 };
75
76 auto j = std::make_unique<LambdaJob>(std::move(fn), std::move(finishfn));
77 return w.push(std::move(j));
78}
Definition Job.hpp:15
virtual void finalize(bool, std::exception_ptr &)
Definition Job.hpp:52
virtual void process(Ctl &ctl)=0
virtual bool push(std::unique_ptr< Job > job)=0

Referenced by Slic3r::GUI::GLGizmoEmboss::draw_font_preview(), Slic3r::GUI::Emboss::StyleManager::init_style_images(), Slic3r::GUI::GLGizmoEmboss::process(), queue_job(), replace_job(), priv::start_create_object_job(), and priv::start_create_volume_job().

+ Here is the caller graph for this function:

◆ queue_job() [3/3]

bool Slic3r::GUI::queue_job ( Worker w,
std::unique_ptr< Job j 
)
inline
87{
88 return w.push(std::move(j));
89}

References Slic3r::GUI::Worker::push().

+ Here is the call graph for this function:

◆ ray_from_camera()

std::optional< RaycastManager::Hit > Slic3r::GUI::ray_from_camera ( const RaycastManager raycaster,
const Vec2d mouse_pos,
const Camera camera,
const RaycastManager::ISkip skip 
)

Unproject on mesh by Mesh raycasters.

Parameters
mouse_posPosition of mouse on screen
cameraProjection params
skipDefine which caster will be skipped, null mean no skip
Returns
Position on surface, normal direction in world coorinate
  • key, to know hitted instance and volume
355{
356 Vec3d point;
357 Vec3d direction;
358 CameraUtils::ray_from_screen_pos(camera, mouse_pos, point, direction);
359 return raycaster.first_hit(point, direction, skip);
360}
static void ray_from_screen_pos(const Camera &camera, const Vec2d &position, Vec3d &point, Vec3d &direction)
Create ray(point and direction) for screen coordinate.
Definition CameraUtils.cpp:83
std::optional< Hit > first_hit(const Vec3d &point, const Vec3d &direction, const ISkip *skip=nullptr) const
Unproject on mesh and return closest hit to point in given direction.
Definition RaycastManager.cpp:102

References Slic3r::GUI::RaycastManager::first_hit(), and Slic3r::GUI::CameraUtils::ray_from_screen_pos().

Referenced by on_mouse_surface_drag(), and priv::start_create_volume_on_surface_job().

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

◆ reloadable_volumes()

static std::vector< std::pair< int, int > > Slic3r::GUI::reloadable_volumes ( const Model model,
const Selection selection 
)
static
3639{
3640 std::vector<std::pair<int, int>> ret;
3641 const std::set<unsigned int>& selected_volumes_idxs = selection.get_volume_idxs();
3642 for (unsigned int idx : selected_volumes_idxs) {
3643 const GLVolume& v = *selection.get_volume(idx);
3644 const int o_idx = v.object_idx();
3645 if (0 <= o_idx && o_idx < int(model.objects.size())) {
3646 const ModelObject* obj = model.objects[o_idx];
3647 const int v_idx = v.volume_idx();
3648 if (0 <= v_idx && v_idx < int(obj->volumes.size())) {
3649 const ModelVolume* vol = obj->volumes[v_idx];
3650 if (!vol->source.is_from_builtin_objects && !vol->source.input_file.empty() &&
3651 !fs::path(vol->source.input_file).extension().string().empty())
3652 ret.push_back({ o_idx, v_idx });
3653 }
3654 }
3655 }
3656 return ret;
3657}
Source source
Definition Model.hpp:774
bool is_from_builtin_objects
Definition Model.hpp:766
std::string input_file
Definition Model.hpp:759

References Slic3r::GUI::Selection::get_volume(), Slic3r::GUI::Selection::get_volume_idxs(), Slic3r::ModelVolume::Source::input_file, Slic3r::ModelVolume::Source::is_from_builtin_objects, Slic3r::GUI::Plater::model(), Slic3r::GLVolume::object_idx(), Slic3r::Model::objects, Slic3r::ModelVolume::source, Slic3r::GLVolume::volume_idx(), and Slic3r::ModelObject::volumes.

Referenced by Slic3r::GUI::Plater::priv::can_reload_from_disk(), and Slic3r::GUI::Plater::priv::reload_from_disk().

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

◆ render_extruders_combo()

static void Slic3r::GUI::render_extruders_combo ( const std::string &  label,
const std::vector< std::string > &  extruders,
const std::vector< ColorRGBA > &  extruders_colors,
size_t &  selection_idx 
)
static
216{
217 assert(!extruders_colors.empty());
218 assert(extruders_colors.size() == extruders_colors.size());
219
220 size_t selection_out = selection_idx;
221 // It is necessary to use BeginGroup(). Otherwise, when using SameLine() is called, then other items will be drawn inside the combobox.
223 ImVec2 combo_pos = ImGui::GetCursorScreenPos();
224 if (ImGui::BeginCombo(label.c_str(), "")) {
225 for (size_t extruder_idx = 0; extruder_idx < std::min(extruders.size(), GLGizmoMmuSegmentation::EXTRUDERS_LIMIT); ++extruder_idx) {
226 ImGui::PushID(int(extruder_idx));
227 ImVec2 start_position = ImGui::GetCursorScreenPos();
228
229 if (ImGui::Selectable("", extruder_idx == selection_idx))
230 selection_out = extruder_idx;
231
234 float height = ImGui::GetTextLineHeight();
235 ImGui::GetWindowDrawList()->AddRectFilled(start_position, ImVec2(start_position.x + height + height / 2, start_position.y + height), ImGuiWrapper::to_ImU32(extruders_colors[extruder_idx]));
236 ImGui::GetWindowDrawList()->AddRect(start_position, ImVec2(start_position.x + height + height / 2, start_position.y + height), IM_COL32_BLACK);
237
238 ImGui::SetCursorScreenPos(ImVec2(start_position.x + height + height / 2 + style.FramePadding.x, start_position.y));
239 ImGui::Text("%s", extruders[extruder_idx].c_str());
240 ImGui::PopID();
241 }
242
244 }
245
246 ImVec2 backup_pos = ImGui::GetCursorScreenPos();
248
249 ImGui::SetCursorScreenPos(ImVec2(combo_pos.x + style.FramePadding.x, combo_pos.y + style.FramePadding.y));
251 float height = ImGui::GetTextLineHeight();
252
253 ImGui::GetWindowDrawList()->AddRectFilled(p, ImVec2(p.x + height + height / 2, p.y + height), ImGuiWrapper::to_ImU32(extruders_colors[selection_idx]));
254 ImGui::GetWindowDrawList()->AddRect(p, ImVec2(p.x + height + height / 2, p.y + height), IM_COL32_BLACK);
255
256 ImGui::SetCursorScreenPos(ImVec2(p.x + height + height / 2 + style.FramePadding.x, p.y));
257 ImGui::Text("%s", extruders[selection_out].c_str());
258 ImGui::SetCursorScreenPos(backup_pos);
260
261 selection_idx = selection_out;
262}
#define IM_COL32_BLACK
Definition imgui.h:2179
IMGUI_API void EndGroup()
Definition imgui.cpp:7741
IMGUI_API void PushID(const char *str_id)
Definition imgui.cpp:7018
IMGUI_API void BeginGroup()
Definition imgui.cpp:7714
IMGUI_API void SetCursorScreenPos(const ImVec2 &pos)
Definition imgui.cpp:7484
IMGUI_API void EndCombo()
Definition imgui_widgets.cpp:1674
IMGUI_API ImDrawList * GetWindowDrawList()
Definition imgui.cpp:6926
IMGUI_API bool BeginCombo(const char *label, const char *preview_value, ImGuiComboFlags flags=0)
Definition imgui_widgets.cpp:1555
IMGUI_API float GetTextLineHeight()
Definition imgui.cpp:7639
IMGUI_API void PopID()
Definition imgui.cpp:7072
IMGUI_API ImGuiStyle & GetStyle()
Definition imgui.cpp:2423
IMGUI_API ImVec2 GetCursorScreenPos()
Definition imgui.cpp:7478
IMGUI_API bool Selectable(const char *label, bool selected=false, ImGuiSelectableFlags flags=0, const ImVec2 &size=ImVec2(0, 0))
Definition imgui_widgets.cpp:6016
IMGUI_API void AddRect(const ImVec2 &p_min, const ImVec2 &p_max, ImU32 col, float rounding=0.0f, ImDrawFlags flags=0, float thickness=1.0f)
Definition imgui_draw.cpp:1377
Definition imgui.h:1721

References ImDrawList::AddRect(), ImDrawList::AddRectFilled(), ImGui::BeginCombo(), ImGui::BeginGroup(), ImGui::EndCombo(), ImGui::EndGroup(), Slic3r::GUI::GLGizmoMmuSegmentation::EXTRUDERS_LIMIT, ImGui::GetCursorScreenPos(), ImGui::GetStyle(), ImGui::GetTextLineHeight(), ImGui::GetWindowDrawList(), IM_COL32_BLACK, ImGui::PopID(), ImGui::PushID(), ImGui::SameLine(), ImGui::Selectable(), ImGui::SetCursorScreenPos(), style, ImGui::Text(), Slic3r::GUI::ImGuiWrapper::to_ImU32(), ImVec2::x, and ImVec2::y.

Referenced by Slic3r::GUI::GLGizmoMmuSegmentation::on_render_input_window().

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

◆ replace_job()

template<class... Args>
bool Slic3r::GUI::replace_job ( Worker w,
Args &&...  args 
)
97{
98 w.cancel_all();
99 return queue_job(w, std::forward<Args>(args)...);
100}
virtual void cancel_all()=0

References Slic3r::GUI::Worker::cancel_all(), and queue_job().

Referenced by Slic3r::GUI::GLGizmoRotate3D::RotoptimzeWindow::RotoptimzeWindow(), Slic3r::GUI::Plater::arrange(), Slic3r::GUI::Plater::cut(), Slic3r::GUI::Plater::fill_bed_with_instances(), and Slic3r::GUI::Plater::import_sl1_archive().

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

◆ rescale_children()

static void Slic3r::GUI::rescale_children ( ModelNode parent)
static
526{
527 if (parent->IsContainer()) {
528 for (std::unique_ptr<ModelNode> &child : parent->GetChildren()) {
529 child->UpdateIcons();
530 rescale_children(child.get());
531 }
532 }
533}
bool IsContainer() const
Definition UnsavedChangesDialog.hpp:99
static void rescale_children(ModelNode *parent)
Definition UnsavedChangesDialog.cpp:525

References Slic3r::GUI::ModelNode::GetChildren(), Slic3r::GUI::ModelNode::IsContainer(), and rescale_children().

Referenced by Slic3r::GUI::DiffModel::Rescale(), and rescale_children().

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

◆ round_to_bin()

static float Slic3r::GUI::round_to_bin ( const float  value)
static
55{
56// assert(value >= 0);
57 constexpr float const scale [5] = { 100.f, 1000.f, 10000.f, 100000.f, 1000000.f };
58 constexpr float const invscale [5] = { 0.01f, 0.001f, 0.0001f, 0.00001f, 0.000001f };
59 constexpr float const threshold[5] = { 0.095f, 0.0095f, 0.00095f, 0.000095f, 0.0000095f };
60 // Scaling factor, pointer to the tables above.
61 int i = 0;
62 // While the scaling factor is not yet large enough to get two integer digits after scaling and rounding:
63 for (; value < threshold[i] && i < 4; ++ i) ;
64 // At least on MSVC std::round() calls a complex function, which is pretty expensive.
65 // our fast_round_up is much cheaper and it could be inlined.
66// return std::round(value * scale[i]) * invscale[i];
67 double a = value * scale[i];
68 assert(std::abs(a) < double(std::numeric_limits<int64_t>::max()));
69 return fast_round_up<int64_t>(a) * invscale[i];
70}
int scale(const int val)
Definition WipeTowerDialog.cpp:14

References scale().

Referenced by Slic3r::GUI::GCodeViewer::TBuffer::add_path(), Slic3r::GUI::GCodeViewer::Path::matches(), and Slic3r::GUI::GCodeViewer::refresh().

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

◆ run_wizard()

static void Slic3r::GUI::run_wizard ( ConfigWizard::StartPage  sp)
static
661{
662 wxGetApp().run_wizard(ConfigWizard::RR_USER, sp);
663}

References Slic3r::GUI::ConfigWizard::RR_USER.

Referenced by Slic3r::GUI::PlaterPresetComboBox::OnSelect(), Slic3r::GUI::TabPresetComboBox::OnSelect(), Slic3r::GUI::PlaterPresetComboBox::show_add_menu(), and Slic3r::GUI::PlaterPresetComboBox::show_edit_menu().

+ Here is the caller graph for this function:

◆ save_version()

static void Slic3r::GUI::save_version ( )
static
208{
209 wxGetApp().app_config->set("version_system_info_sent", std::string(SLIC3R_VERSION));
210}

Referenced by Slic3r::GUI::SendSystemInfoDialog::SendSystemInfoDialog().

+ Here is the caller graph for this function:

◆ scene_selection()

◆ scroll_down()

static void Slic3r::GUI::scroll_down ( )
static
824{
825 ImGuiContext& g = *GImGui;
826 ImGuiWindow* window = g.CurrentWindow;
827
828 float item_size_y = window->DC.PrevLineSize.y + g.Style.ItemSpacing.y;
829 float win_top = window->Scroll.y;
830
831 ImGui::SetScrollY(win_top + item_size_y);
832}
ImVec2 PrevLineSize
Definition imgui_internal.h:1760
IMGUI_API void SetScrollY(float scroll_y)
Definition imgui.cpp:7932
ImGuiWindow * CurrentWindow
Definition imgui_internal.h:1380
ImVec2 ItemSpacing
Definition imgui.h:1736
ImVec2 Scroll
Definition imgui_internal.h:1823

References ImGuiContext::CurrentWindow, ImGuiWindow::DC, GImGui, ImGuiStyle::ItemSpacing, ImGuiWindowTempData::PrevLineSize, ImGuiWindow::Scroll, ImGui::SetScrollY(), ImGuiContext::Style, and ImVec2::y.

Referenced by process_mouse_wheel(), and Slic3r::GUI::ImGuiWrapper::search_list().

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

◆ scroll_up()

static void Slic3r::GUI::scroll_up ( )
static
812{
813 ImGuiContext& g = *GImGui;
814 ImGuiWindow* window = g.CurrentWindow;
815
816 float item_size_y = window->DC.PrevLineSize.y + g.Style.ItemSpacing.y;
817 float win_top = window->Scroll.y;
818
819 ImGui::SetScrollY(win_top - item_size_y);
820}

References ImGuiContext::CurrentWindow, ImGuiWindow::DC, GImGui, ImGuiStyle::ItemSpacing, ImGuiWindowTempData::PrevLineSize, ImGuiWindow::Scroll, ImGui::SetScrollY(), ImGuiContext::Style, and ImVec2::y.

Referenced by process_mouse_wheel(), and Slic3r::GUI::ImGuiWrapper::search_list().

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

◆ scroll_y()

static void Slic3r::GUI::scroll_y ( int  hover_id)
static
1030{
1031 if (hover_id < 0)
1032 return;
1033 ImGuiContext& g = *GImGui;
1034 ImGuiWindow* window = g.CurrentWindow;
1035
1036 float item_size_y = window->DC.PrevLineSize.y + g.Style.ItemSpacing.y;
1037 float item_delta = 0.5 * item_size_y;
1038
1039 float item_top = item_size_y * hover_id;
1040 float item_bottom = item_top + item_size_y;
1041
1042 float win_top = window->Scroll.y;
1043 float win_bottom = window->Scroll.y + window->Size.y;
1044
1045 if (item_bottom + item_delta >= win_bottom)
1046 ImGui::SetScrollY(win_top + item_size_y);
1047 else if (item_top - item_delta <= win_top)
1048 ImGui::SetScrollY(win_top - item_size_y);
1049}
ImVec2 Size
Definition imgui_internal.h:1812

References ImGuiContext::CurrentWindow, ImGuiWindow::DC, GImGui, ImGuiStyle::ItemSpacing, ImGuiWindowTempData::PrevLineSize, ImGuiWindow::Scroll, ImGui::SetScrollY(), ImGuiWindow::Size, ImGuiContext::Style, and ImVec2::y.

+ Here is the call graph for this function:

◆ search_string_getter()

static bool Slic3r::GUI::search_string_getter ( int  idx,
const char **  label,
const char **  tooltip 
)
static
4762{
4763 return wxGetApp().plater()->search_string_getter(idx, label, tooltip);
4764}

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

+ Here is the caller graph for this function:

◆ selectable()

static bool Slic3r::GUI::selectable ( const char *  label,
bool  selected,
ImGuiSelectableFlags  flags = 0,
const ImVec2 size_arg = ImVec2(0, 0) 
)
static
878{
880 if (window->SkipItems)
881 return false;
882
883 ImGuiContext& g = *GImGui;
884 const ImGuiStyle& style = g.Style;
885
886 // Submit label or explicit size to ItemSize(), whereas ItemAdd() will submit a larger/spanning rectangle.
887 ImGuiID id = window->GetID(label);
888 ImVec2 label_size = ImGui::CalcTextSize(label, NULL, true);
889 ImVec2 size(size_arg.x != 0.0f ? size_arg.x : label_size.x, size_arg.y != 0.0f ? size_arg.y : label_size.y);
890 ImVec2 pos = window->DC.CursorPos;
891 pos.y += window->DC.CurrLineTextBaseOffset;
892 ImGui::ItemSize(size, 0.0f);
893
894 // Fill horizontal space
895 // We don't support (size < 0.0f) in Selectable() because the ItemSpacing extension would make explicitly right-aligned sizes not visibly match other widgets.
896 const bool span_all_columns = (flags & ImGuiSelectableFlags_SpanAllColumns) != 0;
897 const float min_x = span_all_columns ? window->ParentWorkRect.Min.x : pos.x;
898 const float max_x = span_all_columns ? window->ParentWorkRect.Max.x : window->WorkRect.Max.x;
899 if (size_arg.x == 0.0f || (flags & ImGuiSelectableFlags_SpanAvailWidth))
900 size.x = ImMax(label_size.x, max_x - min_x);
901
902 // Text stays at the submission position, but bounding box may be extended on both sides
903 const ImVec2 text_min = pos;
904 const ImVec2 text_max(min_x + size.x, pos.y + size.y);
905
906 // Selectables are meant to be tightly packed together with no click-gap, so we extend their box to cover spacing between selectable.
907 ImRect bb(min_x, pos.y, text_max.x, text_max.y);
909 {
910 const float spacing_x = span_all_columns ? 0.0f : style.ItemSpacing.x;
911 const float spacing_y = style.ItemSpacing.y;
912 const float spacing_L = IM_FLOOR(spacing_x * 0.50f);
913 const float spacing_U = IM_FLOOR(spacing_y * 0.50f);
914 bb.Min.x -= spacing_L;
915 bb.Min.y -= spacing_U;
916 bb.Max.x += (spacing_x - spacing_L);
917 bb.Max.y += (spacing_y - spacing_U);
918 }
919 //if (g.IO.KeyCtrl) { GetForegroundDrawList()->AddRect(bb.Min, bb.Max, IM_COL32(0, 255, 0, 255)); }
920
921 // Modify ClipRect for the ItemAdd(), faster than doing a PushColumnsBackground/PushTableBackground for every Selectable..
922 const float backup_clip_rect_min_x = window->ClipRect.Min.x;
923 const float backup_clip_rect_max_x = window->ClipRect.Max.x;
924 if (span_all_columns)
925 {
926 window->ClipRect.Min.x = window->ParentWorkRect.Min.x;
927 window->ClipRect.Max.x = window->ParentWorkRect.Max.x;
928 }
929
930 bool item_add;
932 {
933 ImGuiItemFlags backup_item_flags = g.CurrentItemFlags;
935 item_add = ImGui::ItemAdd(bb, id);
936 g.CurrentItemFlags = backup_item_flags;
937 }
938 else
939 {
940 item_add = ImGui::ItemAdd(bb, id);
941 }
942
943 if (span_all_columns)
944 {
945 window->ClipRect.Min.x = backup_clip_rect_min_x;
946 window->ClipRect.Max.x = backup_clip_rect_max_x;
947 }
948
949 if (!item_add)
950 return false;
951
952 // FIXME: We can standardize the behavior of those two, we could also keep the fast path of override ClipRect + full push on render only,
953 // which would be advantageous since most selectable are not selected.
954 if (span_all_columns && window->DC.CurrentColumns)
956 else if (span_all_columns && g.CurrentTable)
958
959 // We use NoHoldingActiveID on menus so user can click and _hold_ on a menu then drag to browse child entries
960 ImGuiButtonFlags button_flags = 0;
964 if (flags & ImGuiSelectableFlags_Disabled) { button_flags |= ImGuiButtonFlags_Disabled; }
967
969 selected = false;
970
971 const bool was_selected = selected;
972 bool hovered, held;
973 bool pressed = ImGui::ButtonBehavior(bb, id, &hovered, &held, button_flags);
974
975 // Update NavId when clicking or when Hovering (this doesn't happen on most widgets), so navigation can be resumed with gamepad/keyboard
976 if (pressed || (hovered && (flags & ImGuiSelectableFlags_SetNavIdOnHover)))
977 {
978 if (!g.NavDisableMouseHover && g.NavWindow == window && g.NavLayer == window->DC.NavLayerCurrent)
979 {
980 ImGui::SetNavID(id, window->DC.NavLayerCurrent, window->DC.NavFocusScopeIdCurrent, ImRect(bb.Min - window->Pos, bb.Max - window->Pos));
981 g.NavDisableHighlight = true;
982 }
983 }
984 if (pressed)
986
989
990 // In this branch, Selectable() cannot toggle the selection so this will never trigger.
991 if (selected != was_selected) //-V547
993
994 // Render
995 if (held && (flags & ImGuiSelectableFlags_DrawHoveredWhenHeld))
996 hovered = true;
997 if (hovered || selected)
998 {
1000 ImGui::RenderFrame(bb.Min, bb.Max, col, false, 0.0f);
1002 }
1003
1004 if (span_all_columns && window->DC.CurrentColumns)
1006 else if (span_all_columns && g.CurrentTable)
1008
1009 // mark a label with a ColorMarkerHovered, if item is hovered
1010 char marked_label[512]; //255 symbols is not enough for translated string (e.t. to Russian)
1011 if (hovered)
1012 sprintf(marked_label, "%c%s", ImGui::ColorMarkerHovered, label);
1013 else
1014 strcpy(marked_label, label);
1015
1017 ImGui::RenderTextClipped(text_min, text_max, marked_label, NULL, &label_size, style.SelectableTextAlign, &bb);
1019
1020 // Automatically close popups
1023
1025 return pressed;
1026}
unsigned int ImGuiID
Definition imgui.h:207
@ ImGuiCol_TextDisabled
Definition imgui.h:1414
@ ImGuiCol_HeaderActive
Definition imgui.h:1439
@ ImGuiCol_Header
Definition imgui.h:1437
@ ImGuiCol_HeaderHovered
Definition imgui.h:1438
@ ImGuiCol_Text
Definition imgui.h:1413
int ImGuiButtonFlags
Definition imgui.h:182
@ ImGuiSelectableFlags_AllowItemOverlap
Definition imgui.h:1036
@ ImGuiSelectableFlags_SpanAllColumns
Definition imgui.h:1033
@ ImGuiSelectableFlags_DontClosePopups
Definition imgui.h:1032
@ ImGuiSelectableFlags_AllowDoubleClick
Definition imgui.h:1034
@ ImGuiSelectableFlags_Disabled
Definition imgui.h:1035
@ ImGuiWindowFlags_Popup
Definition imgui.h:944
ImGuiItemStatusFlags LastItemStatusFlags
Definition imgui_internal.h:1769
float CurrLineTextBaseOffset
Definition imgui_internal.h:1761
@ ImGuiButtonFlags_PressedOnDoubleClick
Definition imgui_internal.h:782
@ ImGuiButtonFlags_NoHoldingActiveId
Definition imgui_internal.h:791
@ ImGuiButtonFlags_PressedOnClickRelease
Definition imgui_internal.h:779
@ ImGuiButtonFlags_PressedOnRelease
Definition imgui_internal.h:781
@ ImGuiButtonFlags_Disabled
Definition imgui_internal.h:788
@ ImGuiButtonFlags_AllowItemOverlap
Definition imgui_internal.h:786
@ ImGuiButtonFlags_PressedOnClick
Definition imgui_internal.h:778
@ ImGuiNavHighlightFlags_NoRounding
Definition imgui_internal.h:903
@ ImGuiNavHighlightFlags_TypeThin
Definition imgui_internal.h:901
@ ImGuiItemFlags_Disabled
Definition imgui_internal.h:725
@ ImGuiItemFlags_NoNavDefaultFocus
Definition imgui_internal.h:727
@ ImGuiItemFlags_SelectableDontClosePopup
Definition imgui_internal.h:728
static T ImMax(T lhs, T rhs)
Definition imgui_internal.h:410
@ ImGuiItemStatusFlags_ToggledSelection
Definition imgui_internal.h:748
#define IMGUI_TEST_ENGINE_ITEM_INFO(_ID, _LABEL, _FLAGS)
Definition imgui_internal.h:2670
ImGuiNavLayer NavLayerCurrent
Definition imgui_internal.h:1774
int ImGuiItemFlags
Definition imgui_internal.h:142
ImGuiOldColumns * CurrentColumns
Definition imgui_internal.h:1789
@ ImGuiSelectableFlags_SpanAvailWidth
Definition imgui_internal.h:812
@ ImGuiSelectableFlags_NoHoldingActiveID
Definition imgui_internal.h:809
@ ImGuiSelectableFlags_SelectOnClick
Definition imgui_internal.h:810
@ ImGuiSelectableFlags_NoPadWithHalfSpacing
Definition imgui_internal.h:815
@ ImGuiSelectableFlags_SetNavIdOnHover
Definition imgui_internal.h:814
@ ImGuiSelectableFlags_DrawHoveredWhenHeld
Definition imgui_internal.h:813
@ ImGuiSelectableFlags_SelectOnRelease
Definition imgui_internal.h:811
#define IM_FLOOR(_VAL)
Definition imgui_internal.h:232
ImGuiID NavFocusScopeIdCurrent
Definition imgui_internal.h:1777
IMGUI_API void SetNavID(ImGuiID id, ImGuiNavLayer nav_layer, ImGuiID focus_scope_id, const ImRect &rect_rel)
Definition imgui.cpp:8580
IMGUI_API void PopColumnsBackground()
Definition imgui_tables.cpp:3762
IMGUI_API void SetItemAllowOverlap()
Definition imgui.cpp:4931
IMGUI_API void PushColumnsBackground()
Definition imgui_tables.cpp:3749
IMGUI_API void TablePopBackgroundChannel()
Definition imgui_tables.cpp:2214
IMGUI_API void TablePushBackgroundChannel()
Definition imgui_tables.cpp:2202
IMGUI_API void PushStyleColor(ImGuiCol idx, ImU32 col)
Definition imgui.cpp:2462
IMGUI_API void MarkItemEdited(ImGuiID id)
Definition imgui.cpp:3114
IMGUI_API ImVec2 CalcTextSize(const char *text, const char *text_end=NULL, bool hide_text_after_double_hash=false, float wrap_width=-1.0f)
Definition imgui.cpp:4524
IMGUI_API void PopStyleColor(int count=1)
Definition imgui.cpp:2482
IMGUI_API void RenderTextClipped(const ImVec2 &pos_min, const ImVec2 &pos_max, const char *text, const char *text_end, const ImVec2 *text_size_if_known, const ImVec2 &align=ImVec2(0, 0), const ImRect *clip_rect=NULL)
Definition imgui.cpp:2737
const char ColorMarkerHovered
Definition imconfig.h:120
IMGUI_API void CloseCurrentPopup()
Definition imgui.cpp:8257
bool NavDisableHighlight
Definition imgui_internal.h:1459
ImGuiNavLayer NavLayer
Definition imgui_internal.h:1455
ImGuiItemFlags CurrentItemFlags
Definition imgui_internal.h:1389
ImGuiTable * CurrentTable
Definition imgui_internal.h:1519
ImGuiWindow * NavWindow
Definition imgui_internal.h:1440
bool NavDisableMouseHover
Definition imgui_internal.h:1460
ImVec2 Pos
Definition imgui_internal.h:1811
ImRect WorkRect
Definition imgui_internal.h:1868
ImGuiID GetID(const char *str, const char *str_end=NULL)
Definition imgui.cpp:2927
ImGuiWindowFlags Flags
Definition imgui_internal.h:1810
ImRect ClipRect
Definition imgui_internal.h:1870
ImRect ParentWorkRect
Definition imgui_internal.h:1869
ImVec2 Max
Definition imgui_internal.h:473
ImVec2 Min
Definition imgui_internal.h:472

References ImGui::ButtonBehavior(), ImGui::CalcTextSize(), ImGuiWindow::ClipRect, ImGui::CloseCurrentPopup(), col(), ImGui::ColorMarkerHovered, ImGuiWindowTempData::CurrentColumns, ImGuiContext::CurrentItemFlags, ImGuiContext::CurrentTable, ImGuiWindowTempData::CurrLineTextBaseOffset, ImGuiWindowTempData::CursorPos, ImGuiWindow::DC, ImGuiWindow::Flags, ImGui::GetColorU32(), ImGui::GetCurrentWindow(), ImGuiWindow::GetID(), GImGui, IM_FLOOR, IMGUI_TEST_ENGINE_ITEM_INFO, ImGuiButtonFlags_AllowItemOverlap, ImGuiButtonFlags_Disabled, ImGuiButtonFlags_NoHoldingActiveId, ImGuiButtonFlags_PressedOnClick, ImGuiButtonFlags_PressedOnClickRelease, ImGuiButtonFlags_PressedOnDoubleClick, ImGuiButtonFlags_PressedOnRelease, ImGuiCol_Header, ImGuiCol_HeaderActive, ImGuiCol_HeaderHovered, ImGuiCol_Text, ImGuiCol_TextDisabled, ImGuiItemFlags_Disabled, ImGuiItemFlags_NoNavDefaultFocus, ImGuiItemFlags_SelectableDontClosePopup, ImGuiItemStatusFlags_ToggledSelection, ImGuiNavHighlightFlags_NoRounding, ImGuiNavHighlightFlags_TypeThin, ImGuiSelectableFlags_AllowDoubleClick, ImGuiSelectableFlags_AllowItemOverlap, ImGuiSelectableFlags_Disabled, ImGuiSelectableFlags_DontClosePopups, ImGuiSelectableFlags_DrawHoveredWhenHeld, ImGuiSelectableFlags_NoHoldingActiveID, ImGuiSelectableFlags_NoPadWithHalfSpacing, ImGuiSelectableFlags_SelectOnClick, ImGuiSelectableFlags_SelectOnRelease, ImGuiSelectableFlags_SetNavIdOnHover, ImGuiSelectableFlags_SpanAllColumns, ImGuiSelectableFlags_SpanAvailWidth, ImGuiWindowFlags_Popup, ImMax(), ImGui::ItemAdd(), ImGui::ItemSize(), ImGuiWindowTempData::LastItemStatusFlags, ImGui::MarkItemEdited(), ImRect::Max, ImRect::Min, ImGuiContext::NavDisableHighlight, ImGuiContext::NavDisableMouseHover, ImGuiWindowTempData::NavFocusScopeIdCurrent, ImGuiContext::NavLayer, ImGuiWindowTempData::NavLayerCurrent, ImGuiContext::NavWindow, ImGuiWindow::ParentWorkRect, ImGui::PopColumnsBackground(), ImGui::PopStyleColor(), ImGuiWindow::Pos, ImGui::PushColumnsBackground(), ImGui::PushStyleColor(), ImGui::RenderFrame(), ImGui::RenderNavHighlight(), ImGui::RenderTextClipped(), ImGui::SetItemAllowOverlap(), ImGui::SetNavID(), ImGuiWindow::SkipItems, ImGuiContext::Style, style, ImGui::TablePopBackgroundChannel(), ImGui::TablePushBackgroundChannel(), ImGuiWindow::WorkRect, ImVec2::x, and ImVec2::y.

Referenced by Slic3r::GUI::GLGizmosManager::get_gizmo_from_mouse(), and Slic3r::GUI::ImGuiWrapper::search_list().

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

◆ set_font_and_background_style()

static void Slic3r::GUI::set_font_and_background_style ( wxWindow *  win,
const wxFont &  font 
)
static
101{
102 win->SetFont(font);
103 win->SetBackgroundStyle(wxBG_STYLE_PAINT);
104}

Referenced by Slic3r::GUI::ManipulationEditor::ManipulationEditor(), Slic3r::GUI::ObjectManipulation::ObjectManipulation(), Slic3r::GUI::ObjectManipulation::update_if_dirty(), and Slic3r::GUI::ObjectManipulation::update_ui_from_settings().

+ Here is the caller graph for this function:

◆ shortkey_alt_prefix()

const std::string & Slic3r::GUI::shortkey_alt_prefix ( )
91{
92 static const std::string str =
93#ifdef __APPLE__
94 "⌥"
95#else
96 "Alt+"
97#endif
98 ;
99 return str;
100}

Referenced by Slic3r::GUI::SlaGizmoHelpDialog::SlaGizmoHelpDialog(), Slic3r::GUI::KBShortcutsDialog::fill_shortcuts(), and Slic3r::GUI::GLGizmoCut3D::on_init().

+ Here is the caller graph for this function:

◆ shortkey_ctrl_prefix()

◆ should_dialog_be_shown()

static bool Slic3r::GUI::should_dialog_be_shown ( )
static
167{
168 std::string last_sent_version = wxGetApp().app_config->get("version_system_info_sent");
169 Semver semver_current(SLIC3R_VERSION);
170 Semver semver_last_sent;
171 if (! last_sent_version.empty())
172 semver_last_sent = Semver(last_sent_version);
173
174 // set whether to show in alpha builds, or only betas/rcs/finals:
175 const bool show_in_alphas = true;
176
177 if (! show_in_alphas && semver_current.prerelease()
178 && std::string(semver_current.prerelease()).find("alpha") != std::string::npos)
179 return false;
180
181 // New version means current > last, but they must differ in more than just patch.
182 bool new_version = ((semver_current.maj() > semver_last_sent.maj())
183 || (semver_current.maj() == semver_last_sent.maj() && semver_current.min() > semver_last_sent.min() ));
184
185 if (! new_version)
186 return false;
187
188 // We might want to check that the internet connection is ready so we don't open the dialog
189 // if it cannot really send any data. Using a dummy HTTP GET request led to
190 // https://forum.prusaprinters.org/forum/prusaslicer/prusaslicer-2-4-0-beta1-is-out/#post-518488.
191 // It might also trigger security softwares, which would look bad and would lead to questions
192 // about what PS is doing. We better use some less intrusive way of checking the connection.
193
194 // As of now, this is only implemented on Win. The other platforms do not check beforehand.
195
196#ifdef _WIN32
197 return check_internet_connection_win();
198#else
199 return true;
200#endif
201}
int min() const
Definition Semver.hpp:104
int maj() const
Definition Semver.hpp:103

References Slic3r::Semver::maj(), Slic3r::Semver::min(), and Slic3r::Semver::prerelease().

Referenced by show_send_system_info_dialog_if_needed().

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

◆ show_error() [1/3]

void Slic3r::GUI::show_error ( wxWindow *  parent,
const char *  message,
bool  monospaced_font 
)
231{
232 assert(message);
233 show_error(parent, wxString::FromUTF8(message), monospaced_font);
234}

References show_error().

+ Here is the call graph for this function:

◆ show_error() [2/3]

void Slic3r::GUI::show_error ( wxWindow *  parent,
const std::string &  message,
bool  monospaced_font = false 
)
inline
47{ show_error(parent, message.c_str(), monospaced_font); }

References show_error().

+ Here is the call graph for this function:

◆ show_error() [3/3]

void Slic3r::GUI::show_error ( wxWindow *  parent,
const wxString &  message,
bool  monospaced_font 
)
225{
226 ErrorDialog msg(parent, message, monospaced_font);
227 msg.ShowModal();
228}
Definition MsgDialog.hpp:61

Referenced by Slic3r::GUI::PageBuildVolume::PageBuildVolume(), Slic3r::GUI::PrintHostQueueDialog::PrintHostQueueDialog(), Slic3r::GUI::GUI_App::add_config_menu(), Slic3r::GUI::PhysicalPrinterDialog::build_printhost_settings(), Slic3r::GUI::GUI_App::catch_error(), Slic3r::GUI::ObjectList::change_part_type(), Slic3r::GUI::GUI_App::check_updates(), priv::create_message(), Slic3r::GUI::ObjectList::del_subobject_from_object(), Slic3r::GUI::Plater::export_3mf(), Slic3r::GUI::MainFrame::export_config(), Slic3r::GUI::MainFrame::export_configbundle(), Slic3r::GUI::Plater::export_gcode(), Slic3r::GUI::Plater::priv::export_gcode(), fatal_error(), Slic3r::GUI::SLAImportJob::finalize(), Slic3r::GUI::ArrangeJob::finalize(), Slic3r::GUI::PlaterWorker< WorkerSubclass >::PlaterJob::finalize(), focus_event(), Slic3r::PresetUpdater::priv::get_config_updates(), Slic3r::GUI::LayerRangeEditor::get_value(), Slic3r::GUI::PointCtrl::get_value(), Slic3r::GUI::Field::get_value_by_opt_type(), Slic3r::PresetUpdater::install_bundles_rsrc_or_cache_vendor(), Slic3r::GUI::MainFrame::load_config_file(), Slic3r::GUI::MainFrame::load_configbundle(), Slic3r::GUI::Plater::priv::load_files(), Slic3r::GUI::Plater::load_gcode(), Slic3r::GUI::BedShapePanel::load_model(), Slic3r::GUI::ObjectList::load_modifier(), Slic3r::GUI::BedShapePanel::load_stl(), Slic3r::GUI::BedShapePanel::load_texture(), Slic3r::GUI::PrintHostQueueDialog::on_error(), Slic3r::GUI::Downloader::on_error(), Slic3r::GUI::GUI_App::on_init_inner(), Slic3r::GUI::Plater::priv::on_process_completed(), Slic3r::GUI::DownloaderUtils::Worker::perform_register(), Slic3r::GUI::Plater::PopupMenu(), Slic3r::GUI::Plater::preview_zip_archive(), Slic3r::GUI::Plater::priv::reload_from_disk(), Slic3r::GUI::Plater::priv::replace_volume_with_stl(), Slic3r::GUI::Plater::send_gcode(), show_error(), show_error(), show_error_id(), Slic3r::GUI::Plater::show_illegal_characters_warning(), Slic3r::GUI::GUI_App::start_download(), Slic3r::GUI::Config::take_config_snapshot_report_error(), and Slic3r::GUI::PhysicalPrinterDialog::update_printers().

+ Here is the caller graph for this function:

◆ show_error_id()

void Slic3r::GUI::show_error_id ( int  id,
const std::string &  message 
)
237{
238 auto *parent = id != 0 ? wxWindow::FindWindowById(id) : nullptr;
239 show_error(parent, message);
240}

References show_error().

+ Here is the call graph for this function:

◆ show_info() [1/3]

void Slic3r::GUI::show_info ( wxWindow *  parent,
const char *  message,
const char *  title 
)
250{
251 assert(message);
252 show_info(parent, wxString::FromUTF8(message), title ? wxString::FromUTF8(title) : wxString());
253}
void show_info(wxWindow *parent, const wxString &message, const wxString &title)
Definition GUI.cpp:242

References show_info().

+ Here is the call graph for this function:

◆ show_info() [2/3]

void Slic3r::GUI::show_info ( wxWindow *  parent,
const std::string &  message,
const std::string &  title = std::string() 
)
inline
51{ show_info(parent, message.c_str(), title.c_str()); }

References show_info().

+ Here is the call graph for this function:

◆ show_info() [3/3]

void Slic3r::GUI::show_info ( wxWindow *  parent,
const wxString &  message,
const wxString &  title 
)
243{
244 //wxMessageDialog msg_wingow(parent, message, wxString(SLIC3R_APP_NAME " - ") + (title.empty() ? _L("Notice") : title), wxOK | wxICON_INFORMATION);
245 MessageDialog msg_wingow(parent, message, wxString(SLIC3R_APP_NAME " - ") + (title.empty() ? _L("Notice") : title), wxOK | wxICON_INFORMATION);
246 msg_wingow.ShowModal();
247}
Definition MsgDialog.hpp:283

References _L.

Referenced by Slic3r::GUI::PhysicalPrinterDialog::build_printhost_settings(), Slic3r::GUI::ObjectList::check_last_selection(), Slic3r::GUI::SLAImportJob::finalize(), Slic3r::GUI::ObjectList::fix_multiselection_conflicts(), Slic3r::GUI::MainFrame::load_configbundle(), Slic3r::GUI::Plater::priv::load_files(), Slic3r::GUI::Plater::priv::load_model_objects(), Slic3r::GUI::GUI_App::may_switch_to_SLA_preset(), Slic3r::GUI::MainFrame::repair_stl(), Slic3r::GUI::GUI_App::save_mode(), show_info(), and show_info().

+ Here is the caller graph for this function:

◆ show_notification_extruders_limit_exceeded()

static void Slic3r::GUI::show_notification_extruders_limit_exceeded ( )
inlinestatic
23{
24 wxGetApp()
25 .plater()
26 ->get_notification_manager()
27 ->push_notification(NotificationType::MmSegmentationExceededExtrudersLimit, NotificationManager::NotificationLevel::PrintInfoNotificationLevel,
28 GUI::format(_L("Your printer has more extruders than the multi-material painting gizmo supports. For this reason, only the "
29 "first %1% extruders will be able to be used for painting."), GLGizmoMmuSegmentation::EXTRUDERS_LIMIT));
30}

References _L, Slic3r::GUI::GLGizmoMmuSegmentation::EXTRUDERS_LIMIT, format(), MmSegmentationExceededExtrudersLimit, and Slic3r::GUI::NotificationManager::PrintInfoNotificationLevel.

Referenced by Slic3r::GUI::GLGizmoMmuSegmentation::data_changed(), and Slic3r::GUI::GLGizmoMmuSegmentation::on_opening().

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

◆ show_send_system_info_dialog_if_needed()

void Slic3r::GUI::show_send_system_info_dialog_if_needed ( )
743{
744 if (wxGetApp().is_gcode_viewer() || ! should_dialog_be_shown())
745 return;
746
747 SendSystemInfoDialog dlg(wxGetApp().mainframe);
748 dlg.ShowModal();
749}
Definition SendSystemInfoDialog.cpp:66
static bool should_dialog_be_shown()
Definition SendSystemInfoDialog.cpp:166

References should_dialog_be_shown().

Referenced by Slic3r::GUI::GUI_App::post_init().

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

◆ show_substitutions_info() [1/2]

void Slic3r::GUI::show_substitutions_info ( const ConfigSubstitutions config_substitutions,
const std::string &  filename 
)
351{
352 wxString changes = "\n";
353 add_config_substitutions(config_substitutions, changes);
354
355 InfoDialog msg(nullptr,
356 format_wxstr(_L("Configuration file \"%1%\" was loaded, however some configuration values were not recognized."), from_u8(filename)),
357 substitution_message(changes), true);
358 msg.ShowModal();
359}
Definition MsgDialog.hpp:310
static wxString substitution_message(const wxString &changes)
Definition GUI.cpp:314
static void add_config_substitutions(const ConfigSubstitutions &conf_substitutions, wxString &changes)
Definition GUI.cpp:272

References _L, add_config_substitutions(), format_wxstr(), from_u8(), and substitution_message().

+ Here is the call graph for this function:

◆ show_substitutions_info() [2/2]

void Slic3r::GUI::show_substitutions_info ( const PresetsConfigSubstitutions presets_config_substitutions)
323{
324 wxString changes;
325
326 auto preset_type_name = [](Preset::Type type) {
327 switch (type) {
328 case Preset::TYPE_PRINT: return _L("Print settings");
329 case Preset::TYPE_SLA_PRINT: return _L("SLA print settings");
330 case Preset::TYPE_FILAMENT: return _L("Filament");
331 case Preset::TYPE_SLA_MATERIAL: return _L("SLA material");
332 case Preset::TYPE_PRINTER: return _L("Printer");
333 case Preset::TYPE_PHYSICAL_PRINTER: return _L("Physical Printer");
334 default: assert(false); return wxString();
335 }
336 };
337
338 for (const PresetConfigSubstitutions& substitution : presets_config_substitutions) {
339 changes += "\n\n" + format_wxstr("%1% : %2%", preset_type_name(substitution.preset_type), bold_string(substitution.preset_name));
340 if (!substitution.preset_file.empty())
341 changes += format_wxstr(" (%1%)", substitution.preset_file);
342
343 add_config_substitutions(substitution.substitutions, changes);
344 }
345
346 InfoDialog msg(nullptr, _L("Configuration bundle was loaded, however some configuration values were not recognized."), substitution_message(changes), true);
347 msg.ShowModal();
348}
Type
Definition Preset.hpp:110

References _L, add_config_substitutions(), bold_string(), format_wxstr(), substitution_message(), Slic3r::Preset::TYPE_FILAMENT, Slic3r::Preset::TYPE_PHYSICAL_PRINTER, Slic3r::Preset::TYPE_PRINT, Slic3r::Preset::TYPE_PRINTER, Slic3r::Preset::TYPE_SLA_MATERIAL, and Slic3r::Preset::TYPE_SLA_PRINT.

Referenced by Slic3r::GUI::GUI_App::add_config_menu(), Slic3r::GUI::SLAImportJob::finalize(), Slic3r::GUI::MainFrame::load_config_file(), Slic3r::GUI::MainFrame::load_configbundle(), Slic3r::GUI::Plater::priv::load_files(), and Slic3r::GUI::GUI_App::post_init().

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

◆ show_warning()

static void Slic3r::GUI::show_warning ( const wxString &  title,
const std::string &  error_file_type 
)
static
461{
462 const wxString msg_text = format_wxstr(_L("It looks like selected %1%-file has an error or is destructed.\n"
463 "We can't load this file"), error_file_type);
464 MessageDialog dialog(nullptr, msg_text, title, wxICON_WARNING | wxOK);
465 dialog.ShowModal();
466}

References _L, format_wxstr(), and show_warning().

Referenced by Slic3r::GUI::GalleryDialog::change_thumbnail(), Slic3r::GUI::GalleryDialog::load_files(), and show_warning().

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

◆ sla_wildcards()

wxString Slic3r::GUI::sla_wildcards ( const char *  formatid)
601{
602 const ArchiveEntry *entry = get_archive_entry(formatid);
603 wxString ret;
604
605 if (entry) {
606 FileWildcards wc;
607 std::string tr_title = I18N::translate_utf8(entry->desc);
608 // TRN %s = type of file
609 tr_title = GUI::format(_u8L("%s files"), tr_title);
610 wc.title = tr_title;
611
612 std::vector<std::string> exts = get_extensions(*entry);
613
614 wc.file_extensions.reserve(exts.size());
615 for (std::string &ext : exts) {
616 ext.insert(ext.begin(), '.');
617 wc.file_extensions.emplace_back(ext);
618 }
619
620 ret = file_wildcards(wc);
621 }
622
623 if (ret.empty())
624 ret = file_wildcards(FT_SL1);
625
626 return ret;
627}
std::string_view title
Definition GUI_App.cpp:470
std::vector< std::string_view > file_extensions
Definition GUI_App.cpp:471
const ArchiveEntry * get_archive_entry(const char *formatid)
Definition SLAArchiveFormatRegistry.cpp:145
const char * desc
Definition SLAArchiveFormatRegistry.hpp:29

References _u8L, Slic3r::ArchiveEntry::desc, Slic3r::GUI::FileWildcards::file_extensions, file_wildcards(), format(), FT_SL1, Slic3r::get_archive_entry(), Slic3r::get_extensions(), Slic3r::GUI::FileWildcards::title, and Slic3r::GUI::I18N::translate_utf8().

Referenced by Slic3r::GUI::Plater::export_gcode().

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

◆ smooth_cylinder()

GLModel::Geometry Slic3r::GUI::smooth_cylinder ( unsigned int  resolution,
float  radius,
float  height 
)
1600{
1601 resolution = std::max<unsigned int>(4, resolution);
1602
1603 const unsigned int sectorCount = resolution;
1604 const float sectorStep = 2.0f * float(M_PI) / float(sectorCount);
1605
1606 GLModel::Geometry data;
1607 data.format = { GLModel::Geometry::EPrimitiveType::Triangles, GLModel::Geometry::EVertexLayout::P3N3 };
1608 data.reserve_vertices(sectorCount * 4 + 2);
1609 data.reserve_indices(sectorCount * 4 * 3);
1610
1611 auto generate_vertices_on_circle = [sectorCount, sectorStep](float radius) {
1612 std::vector<Vec3f> ret;
1613 ret.reserve(sectorCount);
1614 for (unsigned int i = 0; i < sectorCount; ++i) {
1615 // from 0 to 2pi
1616 const float sectorAngle = sectorStep * i;
1617 ret.emplace_back(radius * std::cos(sectorAngle), radius * std::sin(sectorAngle), 0.0f);
1618 }
1619 return ret;
1620 };
1621
1622 const std::vector<Vec3f> base_vertices = generate_vertices_on_circle(radius);
1623 const Vec3f h = height * Vec3f::UnitZ();
1624
1625 // stem vertices
1626 for (unsigned int i = 0; i < sectorCount; ++i) {
1627 const Vec3f& v = base_vertices[i];
1628 const Vec3f n = v.normalized();
1629 data.add_vertex(v, n);
1630 data.add_vertex(v + h, n);
1631 }
1632
1633 // stem triangles
1634 for (unsigned int i = 0; i < sectorCount; ++i) {
1635 unsigned int v1 = i * 2;
1636 unsigned int v2 = (i < sectorCount - 1) ? v1 + 2 : 0;
1637 unsigned int v3 = v2 + 1;
1638 unsigned int v4 = v1 + 1;
1639 data.add_triangle(v1, v2, v3);
1640 data.add_triangle(v1, v3, v4);
1641 }
1642
1643 // bottom cap vertices
1644 Vec3f cap_center = Vec3f::Zero();
1645 unsigned int cap_center_id = data.vertices_count();
1646 Vec3f normal = -Vec3f::UnitZ();
1647
1648 data.add_vertex(cap_center, normal);
1649 for (unsigned int i = 0; i < sectorCount; ++i) {
1650 data.add_vertex(base_vertices[i], normal);
1651 }
1652
1653 // bottom cap triangles
1654 for (unsigned int i = 0; i < sectorCount; ++i) {
1655 data.add_triangle(cap_center_id, (i < sectorCount - 1) ? cap_center_id + i + 2 : cap_center_id + 1, cap_center_id + i + 1);
1656 }
1657
1658 // top cap vertices
1659 cap_center += h;
1660 cap_center_id = data.vertices_count();
1661 normal = -normal;
1662
1663 data.add_vertex(cap_center, normal);
1664 for (unsigned int i = 0; i < sectorCount; ++i) {
1665 data.add_vertex(base_vertices[i] + h, normal);
1666 }
1667
1668 // top cap triangles
1669 for (unsigned int i = 0; i < sectorCount; ++i) {
1670 data.add_triangle(cap_center_id, cap_center_id + i + 1, (i < sectorCount - 1) ? cap_center_id + i + 2 : cap_center_id + 1);
1671 }
1672
1673 return data;
1674}
coord_t height(const BoundingBox &box)
Definition Arrange.cpp:540
Vec< 3, T > normal(const std::array< Vec< 3, T >, 3 > &tri)
Definition Rotfinder.cpp:43

References M_PI, Slic3r::GUI::GLModel::Geometry::P3N3, and Slic3r::GUI::GLModel::Geometry::Triangles.

Referenced by Slic3r::GUI::GLGizmoMeasure::GLGizmoMeasure().

+ Here is the caller graph for this function:

◆ smooth_sphere()

GLModel::Geometry Slic3r::GUI::smooth_sphere ( unsigned int  resolution,
float  radius 
)
1537{
1538 resolution = std::max<unsigned int>(4, resolution);
1539
1540 const unsigned int sectorCount = resolution;
1541 const unsigned int stackCount = resolution;
1542
1543 const float sectorStep = float(2.0 * M_PI / sectorCount);
1544 const float stackStep = float(M_PI / stackCount);
1545
1546 GLModel::Geometry data;
1547 data.format = { GLModel::Geometry::EPrimitiveType::Triangles, GLModel::Geometry::EVertexLayout::P3N3 };
1548 data.reserve_vertices((stackCount - 1) * sectorCount + 2);
1549 data.reserve_indices((2 * (stackCount - 1) * sectorCount) * 3);
1550
1551 // vertices
1552 for (unsigned int i = 0; i <= stackCount; ++i) {
1553 // from pi/2 to -pi/2
1554 const double stackAngle = 0.5 * M_PI - stackStep * i;
1555 const double xy = double(radius) * ::cos(stackAngle);
1556 const double z = double(radius) * ::sin(stackAngle);
1557 if (i == 0 || i == stackCount) {
1558 const Vec3f v(float(xy), 0.0f, float(z));
1559 data.add_vertex(v, (Vec3f)v.normalized());
1560 }
1561 else {
1562 for (unsigned int j = 0; j < sectorCount; ++j) {
1563 // from 0 to 2pi
1564 const double sectorAngle = sectorStep * j;
1565 const Vec3f v(float(xy * std::cos(sectorAngle)), float(xy * std::sin(sectorAngle)), float(z));
1566 data.add_vertex(v, (Vec3f)v.normalized());
1567 }
1568 }
1569 }
1570
1571 // triangles
1572 for (unsigned int i = 0; i < stackCount; ++i) {
1573 // Beginning of current stack.
1574 unsigned int k1 = (i == 0) ? 0 : (1 + (i - 1) * sectorCount);
1575 const unsigned int k1_first = k1;
1576 // Beginning of next stack.
1577 unsigned int k2 = (i == 0) ? 1 : (k1 + sectorCount);
1578 const unsigned int k2_first = k2;
1579 for (unsigned int j = 0; j < sectorCount; ++j) {
1580 // 2 triangles per sector excluding first and last stacks
1581 unsigned int k1_next = k1;
1582 unsigned int k2_next = k2;
1583 if (i != 0) {
1584 k1_next = (j + 1 == sectorCount) ? k1_first : (k1 + 1);
1585 data.add_triangle(k1, k2, k1_next);
1586 }
1587 if (i + 1 != stackCount) {
1588 k2_next = (j + 1 == sectorCount) ? k2_first : (k2 + 1);
1589 data.add_triangle(k1_next, k2, k2_next);
1590 }
1591 k1 = k1_next;
1592 k2 = k2_next;
1593 }
1594 }
1595
1596 return data;
1597}

References cos(), M_PI, Slic3r::GUI::GLModel::Geometry::P3N3, sin(), and Slic3r::GUI::GLModel::Geometry::Triangles.

Referenced by Slic3r::GUI::GLGizmoMeasure::GLGizmoMeasure(), and Slic3r::GUI::GCodeViewer::COG::init().

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

◆ smooth_torus()

GLModel::Geometry Slic3r::GUI::smooth_torus ( unsigned int  primary_resolution,
unsigned int  secondary_resolution,
float  radius,
float  thickness 
)
1677{
1678 const unsigned int torus_sector_count = std::max<unsigned int>(4, primary_resolution);
1679 const float torus_sector_step = 2.0f * float(M_PI) / float(torus_sector_count);
1680 const unsigned int section_sector_count = std::max<unsigned int>(4, secondary_resolution);
1681 const float section_sector_step = 2.0f * float(M_PI) / float(section_sector_count);
1682
1683 GLModel::Geometry data;
1684 data.format = { GLModel::Geometry::EPrimitiveType::Triangles, GLModel::Geometry::EVertexLayout::P3N3 };
1685 data.reserve_vertices(torus_sector_count * section_sector_count);
1686 data.reserve_indices(torus_sector_count * section_sector_count * 2 * 3);
1687
1688 // vertices
1689 for (unsigned int i = 0; i < torus_sector_count; ++i) {
1690 const float section_angle = torus_sector_step * i;
1691 const float csa = std::cos(section_angle);
1692 const float ssa = std::sin(section_angle);
1693 const Vec3f section_center(radius * csa, radius * ssa, 0.0f);
1694 for (unsigned int j = 0; j < section_sector_count; ++j) {
1695 const float circle_angle = section_sector_step * j;
1696 const float thickness_xy = thickness * std::cos(circle_angle);
1697 const float thickness_z = thickness * std::sin(circle_angle);
1698 const Vec3f v(thickness_xy * csa, thickness_xy * ssa, thickness_z);
1699 data.add_vertex(section_center + v, (Vec3f)v.normalized());
1700 }
1701 }
1702
1703 // triangles
1704 for (unsigned int i = 0; i < torus_sector_count; ++i) {
1705 const unsigned int ii = i * section_sector_count;
1706 const unsigned int ii_next = ((i + 1) % torus_sector_count) * section_sector_count;
1707 for (unsigned int j = 0; j < section_sector_count; ++j) {
1708 const unsigned int j_next = (j + 1) % section_sector_count;
1709 const unsigned int i0 = ii + j;
1710 const unsigned int i1 = ii_next + j;
1711 const unsigned int i2 = ii_next + j_next;
1712 const unsigned int i3 = ii + j_next;
1713 data.add_triangle(i0, i1, i2);
1714 data.add_triangle(i0, i2, i3);
1715 }
1716 }
1717
1718 return data;
1719}

References M_PI, Slic3r::GUI::GLModel::Geometry::P3N3, and Slic3r::GUI::GLModel::Geometry::Triangles.

◆ start_new_gcodeviewer()

void Slic3r::GUI::start_new_gcodeviewer ( const wxString *  path_to_open)
157{
158 start_new_slicer_or_gcodeviewer(NewSlicerInstanceType::GCodeViewer, path_to_open, false, false);
159}
static void start_new_slicer_or_gcodeviewer(const NewSlicerInstanceType instance_type, const std::vector< wxString > paths_to_open, bool single_instance, bool delete_after_load)
Definition Process.cpp:36

References GCodeViewer, and start_new_slicer_or_gcodeviewer().

Referenced by Slic3r::GUI::Plater::load_files(), and start_new_gcodeviewer_open_file().

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

◆ start_new_gcodeviewer_open_file()

void Slic3r::GUI::start_new_gcodeviewer_open_file ( wxWindow *  parent)
162{
163 wxFileDialog dialog(parent ? parent : wxGetApp().GetTopWindow(),
164 _L("Open G-code file:"),
165 from_u8(wxGetApp().app_config->get_last_dir()), wxString(),
166 file_wildcards(FT_GCODE), wxFD_OPEN | wxFD_FILE_MUST_EXIST);
167 if (dialog.ShowModal() == wxID_OK) {
168 wxString path = dialog.GetPath();
170 }
171}
wxString file_wildcards(FileType file_type, const std::string &custom_extension)
Definition GUI_App.cpp:547
void start_new_gcodeviewer(const wxString *path_to_open)
Definition Process.cpp:156

References _L, file_wildcards(), from_u8(), FT_GCODE, and start_new_gcodeviewer().

Referenced by Slic3r::GUI::MainFrame::init_menubar_as_editor().

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

◆ start_new_slicer() [1/2]

void Slic3r::GUI::start_new_slicer ( const std::vector< wxString > &  files,
bool  single_instance,
bool  delete_after_load 
)
152{
153 start_new_slicer_or_gcodeviewer(NewSlicerInstanceType::Slicer, files, single_instance, delete_after_load);
154}

References Slicer, and start_new_slicer_or_gcodeviewer().

+ Here is the call graph for this function:

◆ start_new_slicer() [2/2]

void Slic3r::GUI::start_new_slicer ( const wxString *  path_to_open,
bool  single_instance,
bool  delete_after_load 
)
148{
149 start_new_slicer_or_gcodeviewer(NewSlicerInstanceType::Slicer, path_to_open, single_instance, delete_after_load);
150}

References Slicer, and start_new_slicer_or_gcodeviewer().

Referenced by Slic3r::GUI::MainFrame::init_menubar_as_editor(), Slic3r::GUI::MainFrame::init_menubar_as_gcodeviewer(), Slic3r::GUI::Plater::load_files(), and Slic3r::GUI::Plater::preview_zip_archive().

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

◆ start_new_slicer_or_gcodeviewer() [1/2]

static void Slic3r::GUI::start_new_slicer_or_gcodeviewer ( const NewSlicerInstanceType  instance_type,
const std::vector< wxString >  paths_to_open,
bool  single_instance,
bool  delete_after_load 
)
static
37{
38#ifdef _WIN32
39 wxString path;
40 wxFileName::SplitPath(wxStandardPaths::Get().GetExecutablePath(), &path, nullptr, nullptr, wxPATH_NATIVE);
41 path += "\\";
42 path += (instance_type == NewSlicerInstanceType::Slicer) ? "prusa-slicer.exe" : "prusa-gcodeviewer.exe";
43 std::vector<const wchar_t*> args;
44 args.reserve(4);
45 args.emplace_back(path.wc_str());
46 if (!paths_to_open.empty()) {
47 for (const auto& file : paths_to_open)
48 args.emplace_back(file);
49 }
50 if (instance_type == NewSlicerInstanceType::Slicer && single_instance)
51 args.emplace_back(L"--single-instance");
52 if(delete_after_load && !paths_to_open.empty())
53 args.emplace_back(L"--delete-after-load=1");
54
55 args.emplace_back(nullptr);
56 BOOST_LOG_TRIVIAL(info) << "Trying to spawn a new slicer \"" << into_u8(path) << "\"";
57 // Don't call with wxEXEC_HIDE_CONSOLE, PrusaSlicer in GUI mode would just show the splash screen. It would not open the main window though, it would
58 // just hang in the background.
59 if (wxExecute(const_cast<wchar_t**>(args.data()), wxEXEC_ASYNC) <= 0)
60 BOOST_LOG_TRIVIAL(error) << "Failed to spawn a new slicer \"" << into_u8(path);
61#else
62 // Own executable path.
63 boost::filesystem::path bin_path = into_path(wxStandardPaths::Get().GetExecutablePath());
64#if defined(__APPLE__)
65 {
66 // Maybe one day we will be able to run PrusaGCodeViewer, but for now the Apple notarization
67 // process refuses Apps with multiple binaries and Vojtech does not know any workaround.
68 // ((instance_type == NewSlicerInstanceType::Slicer) ? "PrusaSlicer" : "PrusaGCodeViewer");
69 // Just run PrusaSlicer and give it a --gcodeviewer parameter.
70 bin_path = bin_path.parent_path() / "PrusaSlicer";
71 // On Apple the wxExecute fails, thus we use boost::process instead.
72 BOOST_LOG_TRIVIAL(info) << "Trying to spawn a new slicer \"" << bin_path.string() << "\"";
73 try {
74 std::vector<std::string> args;
75 if (instance_type == NewSlicerInstanceType::GCodeViewer)
76 args.emplace_back("--gcodeviewer");
77 if (!paths_to_open.empty()) {
78 for (const auto& file : paths_to_open)
79 args.emplace_back(into_u8(file));
80 }
81 if (instance_type == NewSlicerInstanceType::Slicer && single_instance)
82 args.emplace_back("--single-instance");
83 if (delete_after_load && !paths_to_open.empty())
84 args.emplace_back("--delete-after-load=1");
85 boost::process::spawn(bin_path, args);
86 // boost::process::spawn() sets SIGCHLD to SIGIGN for the child process, thus if a child PrusaSlicer spawns another
87 // subprocess and the subrocess dies, the child PrusaSlicer will not receive information on end of subprocess
88 // (posix waitpid() call will always fail).
89 // https://jmmv.dev/2008/10/boostprocess-and-sigchld.html
90 // The child instance of PrusaSlicer has to reset SIGCHLD to its default, so that posix waitpid() and similar continue to work.
91 // See GH issue #5507
92 }
93 catch (const std::exception& ex) {
94 BOOST_LOG_TRIVIAL(error) << "Failed to spawn a new slicer \"" << bin_path.string() << "\": " << ex.what();
95 }
96 }
97#else // Linux or Unix
98 {
99 std::vector<const char*> args;
100 args.reserve(3);
101#ifdef __linux__
102 static const char* gcodeviewer_param = "--gcodeviewer";
103 {
104 // If executed by an AppImage, start the AppImage, not the main process.
105 // see https://docs.appimage.org/packaging-guide/environment-variables.html#id2
106 const char* appimage_binary = std::getenv("APPIMAGE");
107 if (appimage_binary) {
108 args.emplace_back(appimage_binary);
109 if (instance_type == NewSlicerInstanceType::GCodeViewer)
110 args.emplace_back(gcodeviewer_param);
111 }
112 }
113#endif // __linux__
114 std::string my_path;
115 if (args.empty()) {
116 // Binary path was not set to the AppImage in the Linux specific block above, call the application directly.
117 my_path = (bin_path.parent_path() / ((instance_type == NewSlicerInstanceType::Slicer) ? "prusa-slicer" : "prusa-gcodeviewer")).string();
118 args.emplace_back(my_path.c_str());
119 }
120 std::string to_open;
121 if (!paths_to_open.empty()) {
122 for (const auto& file : paths_to_open) {
123 to_open = into_u8(file);
124 args.emplace_back(to_open.c_str());
125 }
126 }
127 if (instance_type == NewSlicerInstanceType::Slicer && single_instance)
128 args.emplace_back("--single-instance");
129 if (delete_after_load && !paths_to_open.empty())
130 args.emplace_back("--delete-after-load=1");
131 args.emplace_back(nullptr);
132 BOOST_LOG_TRIVIAL(info) << "Trying to spawn a new slicer \"" << args[0] << "\"";
133 if (wxExecute(const_cast<char**>(args.data()), wxEXEC_ASYNC | wxEXEC_MAKE_GROUP_LEADER) <= 0)
134 BOOST_LOG_TRIVIAL(error) << "Failed to spawn a new slicer \"" << args[0];
135 }
136#endif // Linux or Unix
137#endif // Win32
138}

References error, GCodeViewer, into_path(), into_u8(), L, and Slicer.

Referenced by start_new_gcodeviewer(), start_new_slicer(), start_new_slicer(), and start_new_slicer_or_gcodeviewer().

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

◆ start_new_slicer_or_gcodeviewer() [2/2]

static void Slic3r::GUI::start_new_slicer_or_gcodeviewer ( const NewSlicerInstanceType  instance_type,
const wxString *  path_to_open,
bool  single_instance,
bool  delete_after_load 
)
static
140{
141 std::vector<wxString> paths;
142 if (path_to_open != nullptr)
143 paths.emplace_back(path_to_open->wc_str());
144 start_new_slicer_or_gcodeviewer(instance_type, paths, single_instance, delete_after_load);
145}

References start_new_slicer_or_gcodeviewer().

+ Here is the call graph for this function:

◆ stilized_arrow()

GLModel::Geometry Slic3r::GUI::stilized_arrow ( unsigned int  resolution,
float  tip_radius,
float  tip_height,
float  stem_radius,
float  stem_height 
)
1157{
1158 resolution = std::max<unsigned int>(4, resolution);
1159
1160 GLModel::Geometry data;
1161 data.format = { GLModel::Geometry::EPrimitiveType::Triangles, GLModel::Geometry::EVertexLayout::P3N3 };
1162 data.reserve_vertices(6 * resolution + 2);
1163 data.reserve_indices(6 * resolution * 3);
1164
1165 const float angle_step = 2.0f * float(PI) / float(resolution);
1166 std::vector<float> cosines(resolution);
1167 std::vector<float> sines(resolution);
1168
1169 for (unsigned int i = 0; i < resolution; ++i) {
1170 const float angle = angle_step * float(i);
1171 cosines[i] = ::cos(angle);
1172 sines[i] = -::sin(angle);
1173 }
1174
1175 const float total_height = tip_height + stem_height;
1176
1177 // tip vertices/normals
1178 data.add_vertex(Vec3f(0.0f, 0.0f, total_height), (Vec3f)Vec3f::UnitZ());
1179 for (unsigned int i = 0; i < resolution; ++i) {
1180 data.add_vertex(Vec3f(tip_radius * sines[i], tip_radius * cosines[i], stem_height), Vec3f(sines[i], cosines[i], 0.0f));
1181 }
1182
1183 // tip triangles
1184 for (unsigned int i = 0; i < resolution; ++i) {
1185 const unsigned int v3 = (i < resolution - 1) ? i + 2 : 1;
1186 data.add_triangle(0, i + 1, v3);
1187 }
1188
1189 // tip cap outer perimeter vertices
1190 for (unsigned int i = 0; i < resolution; ++i) {
1191 data.add_vertex(Vec3f(tip_radius * sines[i], tip_radius * cosines[i], stem_height), (Vec3f)(-Vec3f::UnitZ()));
1192 }
1193
1194 // tip cap inner perimeter vertices
1195 for (unsigned int i = 0; i < resolution; ++i) {
1196 data.add_vertex(Vec3f(stem_radius * sines[i], stem_radius * cosines[i], stem_height), (Vec3f)(-Vec3f::UnitZ()));
1197 }
1198
1199 // tip cap triangles
1200 for (unsigned int i = 0; i < resolution; ++i) {
1201 const unsigned int v2 = (i < resolution - 1) ? i + resolution + 2 : resolution + 1;
1202 const unsigned int v3 = (i < resolution - 1) ? i + 2 * resolution + 2 : 2 * resolution + 1;
1203 data.add_triangle(i + resolution + 1, v3, v2);
1204 data.add_triangle(i + resolution + 1, i + 2 * resolution + 1, v3);
1205 }
1206
1207 // stem bottom vertices
1208 for (unsigned int i = 0; i < resolution; ++i) {
1209 data.add_vertex(Vec3f(stem_radius * sines[i], stem_radius * cosines[i], stem_height), Vec3f(sines[i], cosines[i], 0.0f));
1210 }
1211
1212 // stem top vertices
1213 for (unsigned int i = 0; i < resolution; ++i) {
1214 data.add_vertex(Vec3f(stem_radius * sines[i], stem_radius * cosines[i], 0.0f), Vec3f(sines[i], cosines[i], 0.0f));
1215 }
1216
1217 // stem triangles
1218 for (unsigned int i = 0; i < resolution; ++i) {
1219 const unsigned int v2 = (i < resolution - 1) ? i + 3 * resolution + 2 : 3 * resolution + 1;
1220 const unsigned int v3 = (i < resolution - 1) ? i + 4 * resolution + 2 : 4 * resolution + 1;
1221 data.add_triangle(i + 3 * resolution + 1, v3, v2);
1222 data.add_triangle(i + 3 * resolution + 1, i + 4 * resolution + 1, v3);
1223 }
1224
1225 // stem cap vertices
1226 data.add_vertex((Vec3f)Vec3f::Zero(), (Vec3f)(-Vec3f::UnitZ()));
1227 for (unsigned int i = 0; i < resolution; ++i) {
1228 data.add_vertex(Vec3f(stem_radius * sines[i], stem_radius * cosines[i], 0.0f), (Vec3f)(-Vec3f::UnitZ()));
1229 }
1230
1231 // stem cap triangles
1232 for (unsigned int i = 0; i < resolution; ++i) {
1233 const unsigned int v3 = (i < resolution - 1) ? i + 5 * resolution + 3 : 5 * resolution + 2;
1234 data.add_triangle(5 * resolution + 1, v3, i + 5 * resolution + 2);
1235 }
1236
1237 return data;
1238}

References Slic3r::angle(), cos(), Slic3r::GUI::GLModel::Geometry::P3N3, PI, sin(), and Slic3r::GUI::GLModel::Geometry::Triangles.

Referenced by Slic3r::GUI::GCodeViewer::SequentialView::Marker::init(), and Slic3r::GUI::CoordAxes::render().

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

◆ stop_current_job()

bool Slic3r::GUI::stop_current_job ( Worker w,
unsigned  timeout_ms = 0 
)
inline
104{
105 w.cancel();
106 return w.wait_for_current_job(timeout_ms);
107}
virtual bool wait_for_current_job(unsigned timeout_ms=0)=0
virtual void cancel()=0

References Slic3r::GUI::Worker::cancel(), and Slic3r::GUI::Worker::wait_for_current_job().

+ Here is the call graph for this function:

◆ stop_queue()

bool Slic3r::GUI::stop_queue ( Worker w,
unsigned  timeout_ms = 0 
)
inline
112{
113 w.cancel_all();
114 return w.wait_for_idle(timeout_ms);
115}
virtual bool wait_for_idle(unsigned timeout_ms=0)=0

References Slic3r::GUI::Worker::cancel_all(), and Slic3r::GUI::Worker::wait_for_idle().

Referenced by Slic3r::GUI::Plater::reslice().

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

◆ straight_arrow()

GLModel::Geometry Slic3r::GUI::straight_arrow ( float  tip_width,
float  tip_height,
float  stem_width,
float  stem_height,
float  thickness 
)
1405{
1406 GLModel::Geometry data;
1407 data.format = { GLModel::Geometry::EPrimitiveType::Triangles, GLModel::Geometry::EVertexLayout::P3N3 };
1408 data.reserve_vertices(42);
1409 data.reserve_indices(72);
1410
1411 const float half_thickness = 0.5f * thickness;
1412 const float half_stem_width = 0.5f * stem_width;
1413 const float half_tip_width = 0.5f * tip_width;
1414 const float total_height = tip_height + stem_height;
1415
1416 // top face vertices
1417 data.add_vertex(Vec3f(half_stem_width, 0.0f, half_thickness), (Vec3f)Vec3f::UnitZ());
1418 data.add_vertex(Vec3f(half_stem_width, stem_height, half_thickness), (Vec3f)Vec3f::UnitZ());
1419 data.add_vertex(Vec3f(half_tip_width, stem_height, half_thickness), (Vec3f)Vec3f::UnitZ());
1420 data.add_vertex(Vec3f(0.0f, total_height, half_thickness), (Vec3f)Vec3f::UnitZ());
1421 data.add_vertex(Vec3f(-half_tip_width, stem_height, half_thickness), (Vec3f)Vec3f::UnitZ());
1422 data.add_vertex(Vec3f(-half_stem_width, stem_height, half_thickness), (Vec3f)Vec3f::UnitZ());
1423 data.add_vertex(Vec3f(-half_stem_width, 0.0f, half_thickness), (Vec3f)Vec3f::UnitZ());
1424
1425 // top face triangles
1426 data.add_triangle(0, 1, 6);
1427 data.add_triangle(6, 1, 5);
1428 data.add_triangle(4, 5, 3);
1429 data.add_triangle(5, 1, 3);
1430 data.add_triangle(1, 2, 3);
1431
1432 // bottom face vertices
1433 data.add_vertex(Vec3f(half_stem_width, 0.0f, -half_thickness), (Vec3f)(-Vec3f::UnitZ()));
1434 data.add_vertex(Vec3f(half_stem_width, stem_height, -half_thickness), (Vec3f)(-Vec3f::UnitZ()));
1435 data.add_vertex(Vec3f(half_tip_width, stem_height, -half_thickness), (Vec3f)(-Vec3f::UnitZ()));
1436 data.add_vertex(Vec3f(0.0f, total_height, -half_thickness), (Vec3f)(-Vec3f::UnitZ()));
1437 data.add_vertex(Vec3f(-half_tip_width, stem_height, -half_thickness), (Vec3f)(-Vec3f::UnitZ()));
1438 data.add_vertex(Vec3f(-half_stem_width, stem_height, -half_thickness), (Vec3f)(-Vec3f::UnitZ()));
1439 data.add_vertex(Vec3f(-half_stem_width, 0.0f, -half_thickness), (Vec3f)(-Vec3f::UnitZ()));
1440
1441 // bottom face triangles
1442 data.add_triangle(7, 13, 8);
1443 data.add_triangle(13, 12, 8);
1444 data.add_triangle(12, 11, 10);
1445 data.add_triangle(8, 12, 10);
1446 data.add_triangle(9, 8, 10);
1447
1448 // side faces vertices
1449 data.add_vertex(Vec3f(half_stem_width, 0.0f, -half_thickness), (Vec3f)Vec3f::UnitX());
1450 data.add_vertex(Vec3f(half_stem_width, stem_height, -half_thickness), (Vec3f)Vec3f::UnitX());
1451 data.add_vertex(Vec3f(half_stem_width, 0.0f, half_thickness), (Vec3f)Vec3f::UnitX());
1452 data.add_vertex(Vec3f(half_stem_width, stem_height, half_thickness), (Vec3f)Vec3f::UnitX());
1453
1454 data.add_vertex(Vec3f(half_stem_width, stem_height, -half_thickness), (Vec3f)(-Vec3f::UnitY()));
1455 data.add_vertex(Vec3f(half_tip_width, stem_height, -half_thickness), (Vec3f)(-Vec3f::UnitY()));
1456 data.add_vertex(Vec3f(half_stem_width, stem_height, half_thickness), (Vec3f)(-Vec3f::UnitY()));
1457 data.add_vertex(Vec3f(half_tip_width, stem_height, half_thickness), (Vec3f)(-Vec3f::UnitY()));
1458
1459 Vec3f normal(tip_height, half_tip_width, 0.0f);
1460 normal.normalize();
1461 data.add_vertex(Vec3f(half_tip_width, stem_height, -half_thickness), normal);
1462 data.add_vertex(Vec3f(0.0f, total_height, -half_thickness), normal);
1463 data.add_vertex(Vec3f(half_tip_width, stem_height, half_thickness), normal);
1464 data.add_vertex(Vec3f(0.0f, total_height, half_thickness), normal);
1465
1466 normal = { -tip_height, half_tip_width, 0.0f };
1467 normal.normalize();
1468 data.add_vertex(Vec3f(0.0f, total_height, -half_thickness), normal);
1469 data.add_vertex(Vec3f(-half_tip_width, stem_height, -half_thickness), normal);
1470 data.add_vertex(Vec3f(0.0f, total_height, half_thickness), normal);
1471 data.add_vertex(Vec3f(-half_tip_width, stem_height, half_thickness), normal);
1472
1473 data.add_vertex(Vec3f(-half_tip_width, stem_height, -half_thickness), (Vec3f)(-Vec3f::UnitY()));
1474 data.add_vertex(Vec3f(-half_stem_width, stem_height, -half_thickness), (Vec3f)(-Vec3f::UnitY()));
1475 data.add_vertex(Vec3f(-half_tip_width, stem_height, half_thickness), (Vec3f)(-Vec3f::UnitY()));
1476 data.add_vertex(Vec3f(-half_stem_width, stem_height, half_thickness), (Vec3f)(-Vec3f::UnitY()));
1477
1478 data.add_vertex(Vec3f(-half_stem_width, stem_height, -half_thickness), (Vec3f)(-Vec3f::UnitX()));
1479 data.add_vertex(Vec3f(-half_stem_width, 0.0f, -half_thickness), (Vec3f)(-Vec3f::UnitX()));
1480 data.add_vertex(Vec3f(-half_stem_width, stem_height, half_thickness), (Vec3f)(-Vec3f::UnitX()));
1481 data.add_vertex(Vec3f(-half_stem_width, 0.0f, half_thickness), (Vec3f)(-Vec3f::UnitX()));
1482
1483 data.add_vertex(Vec3f(-half_stem_width, 0.0f, -half_thickness), (Vec3f)(-Vec3f::UnitY()));
1484 data.add_vertex(Vec3f(half_stem_width, 0.0f, -half_thickness), (Vec3f)(-Vec3f::UnitY()));
1485 data.add_vertex(Vec3f(-half_stem_width, 0.0f, half_thickness), (Vec3f)(-Vec3f::UnitY()));
1486 data.add_vertex(Vec3f(half_stem_width, 0.0f, half_thickness), (Vec3f)(-Vec3f::UnitY()));
1487
1488 // side face triangles
1489 for (unsigned int i = 0; i < 7; ++i) {
1490 const unsigned int ii = i * 4;
1491 data.add_triangle(14 + ii, 15 + ii, 17 + ii);
1492 data.add_triangle(14 + ii, 17 + ii, 16 + ii);
1493 }
1494
1495 return data;
1496}

References Slic3r::GUI::GLModel::Geometry::P3N3, and Slic3r::GUI::GLModel::Geometry::Triangles.

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

+ Here is the caller graph for this function:

◆ string_getter()

static bool Slic3r::GUI::string_getter ( const bool  is_undo,
int  idx,
const char **  out_text 
)
static
4722{
4723 return wxGetApp().plater()->undo_redo_string_getter(is_undo, idx, out_text);
4724}

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

+ Here is the caller graph for this function:

◆ substitution_message()

static wxString Slic3r::GUI::substitution_message ( const wxString &  changes)
static
315{
316 return
317 _L("Most likely the configuration was produced by a newer version of PrusaSlicer or by some PrusaSlicer fork.") + " " +
318 _L("The following values were substituted:") + "\n" + changes + "\n\n" +
319 _L("Review the substitutions and adjust them if needed.");
320}

References _L.

Referenced by show_substitutions_info(), and show_substitutions_info().

+ Here is the caller graph for this function:

◆ suffix() [1/2]

static std::string Slic3r::GUI::suffix ( const Preset preset)
static
222{
223 return (preset.is_dirty ? Preset::suffix_modified() : "");
224}
bool is_dirty
Definition Preset.hpp:140

References Slic3r::Preset::is_dirty, and Slic3r::Preset::suffix_modified().

Referenced by Slic3r::GUI::SavePresetDialog::Item::Item(), Slic3r::GUI::SavePresetDialog::SavePresetDialog(), Slic3r::GUI::SavePresetDialog::AddItem(), Slic3r::GUI::SavePresetDialog::build(), Slic3r::GUI::SavePresetDialog::Item::get_init_preset_name(), Slic3r::GUI::PlaterPresetComboBox::get_preset_name(), Slic3r::GUI::TabPresetComboBox::get_preset_name(), Slic3r::GUI::Emboss::StyleManager::make_unique_name(), Slic3r::GUI::GLGizmoCut3D::render_cut_plane_input_window(), Slic3r::GUI::PlaterPresetComboBox::update(), Slic3r::GUI::TabPresetComboBox::update(), and Slic3r::GUI::TabPresetComboBox::update_dirty().

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

◆ suffix() [2/2]

static std::string Slic3r::GUI::suffix ( Preset preset)
static
227{
228 return (preset->is_dirty ? Preset::suffix_modified() : "");
229}

References Slic3r::Preset::is_dirty, and Slic3r::Preset::suffix_modified().

+ Here is the call graph for this function:

◆ support_combo_value_for_config()

static wxString Slic3r::GUI::support_combo_value_for_config ( const DynamicPrintConfig config,
bool  is_fff 
)
static
1050{
1051 std::string slatree = is_fff ? "" : get_sla_suptree_prefix(config);
1052
1053 const std::string support = is_fff ? "support_material" : "supports_enable";
1054 const std::string buildplate_only = is_fff ? "support_material_buildplate_only" : slatree + "support_buildplate_only";
1055
1056 return
1057 ! config.opt_bool(support) ?
1058 _("None") :
1059 ((is_fff && !config.opt_bool("support_material_auto")) || (!is_fff && config.opt_bool("support_enforcers_only"))) ?
1060 _("For support enforcers only") :
1061 (config.opt_bool(buildplate_only) ? _("Support on build plate only") :
1062 _("Everywhere"));
1063}
std::string get_sla_suptree_prefix(const DynamicPrintConfig &config)
Definition PrintConfig.cpp:4968

References _, Slic3r::get_sla_suptree_prefix(), Slic3r::ConfigBase::opt_bool(), and support_combo_value_for_config().

Referenced by Slic3r::GUI::Tab::on_value_change(), support_combo_value_for_config(), and Slic3r::GUI::Tab::update_frequently_changed_parameters().

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

◆ surface_feature_type_as_string()

static std::string Slic3r::GUI::surface_feature_type_as_string ( Measure::SurfaceFeatureType  type)
static
59{
60 switch (type)
61 {
62 default:
63 case Measure::SurfaceFeatureType::Undef: { return ("No feature"); }
64 case Measure::SurfaceFeatureType::Point: { return _u8L("Vertex"); }
65 case Measure::SurfaceFeatureType::Edge: { return _u8L("Edge"); }
66 case Measure::SurfaceFeatureType::Circle: { return _u8L("Circle"); }
67 case Measure::SurfaceFeatureType::Plane: { return _u8L("Plane"); }
68 }
69}

References _u8L, Slic3r::Measure::Circle, Slic3r::Measure::Edge, Slic3r::Measure::Plane, Slic3r::Measure::Point, and Slic3r::Measure::Undef.

Referenced by Slic3r::GUI::GLGizmoMeasure::on_render_input_window().

+ Here is the caller graph for this function:

◆ synchronize_model_after_cut()

void Slic3r::GUI::synchronize_model_after_cut ( Model model,
const CutObjectBase cut_id 
)
2489{
2490 for (ModelObject* obj : model.objects)
2491 if (obj->is_cut() && obj->cut_id.has_same_id(cut_id) && !obj->cut_id.is_equal(cut_id))
2492 obj->cut_id.copy(cut_id);
2493}

References Slic3r::Model::objects.

Referenced by Slic3r::GUI::GLGizmoCut3D::perform_cut().

+ Here is the caller graph for this function:

◆ take_snapshot()

static void Slic3r::GUI::take_snapshot ( const wxString &  snapshot_name)
static
68{
69 Plater* plater = wxGetApp().plater();
70 if (plater)
71 plater->take_snapshot(snapshot_name);
72}
void take_snapshot(const std::string &snapshot_name)
Definition Plater.cpp:6891

References plater(), and Slic3r::GUI::Plater::take_snapshot().

Referenced by Slic3r::GUI::ObjectList::add_category_to_settings_from_frequent(), Slic3r::GUI::ObjectList::add_category_to_settings_from_selection(), Slic3r::GUI::ObjectList::add_layer_range_after_current(), Slic3r::GUI::ObjectList::change_part_type(), Slic3r::GUI::ObjectList::del_instances_from_object(), Slic3r::GUI::ObjectList::del_layer_from_object(), Slic3r::GUI::ObjectList::del_settings_from_config(), Slic3r::GUI::ObjectList::del_subobject_from_object(), Slic3r::GUI::ObjectList::delete_all_connectors_for_object(), Slic3r::GUI::ObjectList::edit_layer_range(), Slic3r::GUI::ObjectList::invalidate_cut_info_for_object(), Slic3r::GUI::ObjectList::layers_editing(), Slic3r::GUI::ObjectList::load_generic_subobject(), Slic3r::GUI::ObjectList::load_shape_object(), Slic3r::GUI::ObjectList::load_shape_object_from_gallery(), Slic3r::GUI::ObjectList::load_subobject(), Slic3r::GUI::ObjectList::OnDrop(), Slic3r::GUI::ObjectList::set_extruder_for_selected_items(), Slic3r::GUI::ObjectList::split(), Slic3r::GUI::ObjectList::toggle_printable_state(), Slic3r::GUI::ObjectList::update_extruder_in_config(), and Slic3r::GUI::ObjectList::update_name_in_model().

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

◆ to_squared_power_of_two()

static bool Slic3r::GUI::to_squared_power_of_two ( const std::string &  filename,
int  max_size_px,
int &  w,
int &  h 
)
static
379{
380 auto is_power_of_two = [](int v) { return v != 0 && (v & (v - 1)) == 0; };
381 auto upper_power_of_two = [](int v) { v--; v |= v >> 1; v |= v >> 2; v |= v >> 4; v |= v >> 8; v |= v >> 16; v++; return v; };
382
383 int new_w = std::max(w, h);
384 if (!is_power_of_two(new_w))
385 new_w = upper_power_of_two(new_w);
386
387 while (new_w > max_size_px) {
388 new_w /= 2;
389 }
390
391 const int new_h = new_w;
392 const bool ret = (new_w != w || new_h != h);
393 w = new_w;
394 h = new_h;
395 return ret;
396}

Referenced by Slic3r::GUI::GLTexture::load_from_png(), and Slic3r::GUI::GLTexture::load_from_svg().

+ Here is the caller graph for this function:

◆ update_arrangepoly_slaprint()

static void Slic3r::GUI::update_arrangepoly_slaprint ( arrangement::ArrangePolygon ret,
const SLAPrintObject po,
const ModelInstance inst 
)
static
150{
151 // The 1.1 multiplier is a safety gap, as the offset might be bigger
152 // in sharp edges of a polygon, depending on clipper's offset algorithm
153 coord_t pad_infl = 0;
154 {
155 double infl = po.config().pad_enable.getBool() * (
156 po.config().pad_brim_size.getFloat() +
157 po.config().pad_around_object.getBool() *
158 po.config().pad_object_gap.getFloat() );
159
160 pad_infl = scaled(1.1 * infl);
161 }
162
163 auto laststep = po.last_completed_step();
164
165 if (laststep < slaposCount && laststep > slaposSupportTree) {
166 auto omesh = po.get_mesh_to_print();
167 auto &smesh = po.support_mesh();
168
169 Transform3f trafo_instance = inst.get_matrix().cast<float>();
170 trafo_instance = trafo_instance * po.trafo().cast<float>().inverse();
171
172 Polygons polys;
173 polys.reserve(3);
174 auto zlvl = -po.get_elevation();
175
176 if (omesh) {
177 polys.emplace_back(its_convex_hull_2d_above(*omesh, trafo_instance, zlvl));
178 }
179
180 polys.emplace_back(its_convex_hull_2d_above(smesh.its, trafo_instance, zlvl));
181 ret.poly.contour = Geometry::convex_hull(polys);
182 ret.poly.holes = {};
183 }
184
185 ret.inflation = pad_infl;
186}
EIGEN_DEVICE_FUNC const InverseReturnType inverse() const
Definition ArrayCwiseUnaryOps.h:332
Polygon contour
Definition ExPolygon.hpp:35
Polygons holes
Definition ExPolygon.hpp:36
auto last_completed_step() const
Definition PrintBase.hpp:743
const TriangleMesh & support_mesh() const
Definition SLAPrint.cpp:1057
const std::shared_ptr< const indexed_triangle_set > & get_mesh_to_print() const
Definition SLAPrint.cpp:1076
const SLAPrintObjectConfig & config() const
Definition SLAPrint.hpp:99
const Transform3d & trafo() const
Definition SLAPrint.hpp:100
double get_elevation() const
Definition SLAPrint.cpp:969
std::vector< Polygon, PointsAllocator< Polygon > > Polygons
Definition Polygon.hpp:15
Polygon its_convex_hull_2d_above(const indexed_triangle_set &its, const TransformVertex &transform_fn, const float z)
Definition TriangleMesh.cpp:876
ExPolygon poly
Definition Arrange.hpp:94
coord_t inflation
The rotation of the poly in radians.
Definition Arrange.hpp:97

References Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::cast(), Slic3r::SLAPrintObject::config(), Slic3r::ExPolygon::contour, Slic3r::Geometry::convex_hull(), Slic3r::SLAPrintObject::get_elevation(), Slic3r::ModelInstance::get_matrix(), Slic3r::SLAPrintObject::get_mesh_to_print(), Slic3r::ExPolygon::holes, Slic3r::arrangement::ArrangePolygon::inflation, inverse(), Slic3r::its_convex_hull_2d_above(), Slic3r::PrintObjectBaseWithState< PrintType, PrintObjectStepEnumType, COUNT >::last_completed_step(), Slic3r::arrangement::ArrangePolygon::poly, Slic3r::scaled(), Slic3r::slaposSupportTree, Slic3r::SLAPrintObject::support_mesh(), and Slic3r::SLAPrintObject::trafo().

Referenced by get_arrange_poly().

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

◆ update_children()

static void Slic3r::GUI::update_children ( ModelNode parent)
static
322{
323 if (parent->IsContainer()) {
324 bool toggle = parent->IsToggled();
325 for (std::unique_ptr<ModelNode> &child : parent->GetChildren()) {
326 child->Toggle(toggle);
327 child->UpdateEnabling();
328 update_children(child.get());
329 }
330 }
331}
bool IsToggled() const
Definition UnsavedChangesDialog.hpp:100
static void update_children(ModelNode *parent)
Definition UnsavedChangesDialog.cpp:321

References Slic3r::GUI::ModelNode::GetChildren(), Slic3r::GUI::ModelNode::IsContainer(), Slic3r::GUI::ModelNode::IsToggled(), and update_children().

Referenced by update_children(), and Slic3r::GUI::DiffModel::UpdateItemEnabling().

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

◆ update_color()

static void Slic3r::GUI::update_color ( wxColourPickerCtrl *  color_pckr,
const wxColour &  color 
)
static
70{
71 if (color_pckr->GetColour() != color) {
72 color_pckr->SetColour(color);
73 wxPostEvent(color_pckr, wxCommandEvent(wxEVT_COLOURPICKER_CHANGED));
74 }
75}

Referenced by Slic3r::GUI::PreferencesDialog::show().

+ Here is the caller graph for this function:

◆ update_object_cut_id()

void Slic3r::GUI::update_object_cut_id ( CutObjectBase cut_id,
ModelObjectCutAttributes  attributes,
const int  dowels_count 
)
2468{
2469 // we don't save cut information, if result will not contains all parts of initial object
2470 if (!attributes.has(ModelObjectCutAttribute::KeepUpper) ||
2471 !attributes.has(ModelObjectCutAttribute::KeepLower) ||
2472 attributes.has(ModelObjectCutAttribute::InvalidateCutInfo))
2473 return;
2474
2475 if (cut_id.id().invalid())
2476 cut_id.init();
2477 // increase check sum, if it's needed
2478 {
2479 int cut_obj_cnt = -1;
2480 if (attributes.has(ModelObjectCutAttribute::KeepUpper)) cut_obj_cnt++;
2481 if (attributes.has(ModelObjectCutAttribute::KeepLower)) cut_obj_cnt++;
2482 if (attributes.has(ModelObjectCutAttribute::CreateDowels)) cut_obj_cnt+= dowels_count;
2483 if (cut_obj_cnt > 0)
2484 cut_id.increase_check_sum(size_t(cut_obj_cnt));
2485 }
2486}
void increase_check_sum(size_t cnt)
Definition ObjectID.hpp:179
void init()
Definition ObjectID.hpp:171
bool invalid() const
Definition ObjectID.hpp:35
constexpr bool has(option_type t) const
Definition enum_bitmask.hpp:47

References Slic3r::CreateDowels, Slic3r::enum_bitmask< option_type, typename >::has(), Slic3r::ObjectBase::id(), Slic3r::CutObjectBase::increase_check_sum(), Slic3r::CutObjectBase::init(), Slic3r::ObjectID::invalid(), Slic3r::InvalidateCutInfo, Slic3r::KeepLower, and Slic3r::KeepUpper.

Referenced by Slic3r::GUI::GLGizmoCut3D::perform_cut().

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

◆ update_parents()

static void Slic3r::GUI::update_parents ( ModelNode node)
static
334{
335 ModelNode* parent = node->GetParent();
336 if (parent) {
337 bool toggle = false;
338 for (std::unique_ptr<ModelNode> &child : parent->GetChildren()) {
339 if (child->IsToggled()) {
340 toggle = true;
341 break;
342 }
343 }
344 parent->Toggle(toggle);
345 parent->UpdateEnabling();
346 update_parents(parent);
347 }
348}
Definition UnsavedChangesDialog.hpp:37
void UpdateEnabling()
Definition UnsavedChangesDialog.cpp:180
ModelNode * GetParent()
Definition UnsavedChangesDialog.hpp:106
void Toggle(bool toggle=true)
Definition UnsavedChangesDialog.hpp:101

References Slic3r::GUI::ModelNode::GetChildren(), Slic3r::GUI::ModelNode::GetParent(), Slic3r::GUI::ModelNode::Toggle(), update_parents(), and Slic3r::GUI::ModelNode::UpdateEnabling().

Referenced by update_parents(), and Slic3r::GUI::DiffModel::UpdateItemEnabling().

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

◆ update_selection()

static void Slic3r::GUI::update_selection ( wxDataViewItemArray &  sels,
ObjectList::SELECTION_MODE  mode,
ObjectDataViewModel model 
)
static
3278{
3279 if (mode == ObjectList::smInstance)
3280 {
3281 for (auto& item : sels)
3282 {
3283 ItemType type = model->GetItemType(item);
3284 if (type == itObject)
3285 continue;
3286 if (type == itInstanceRoot) {
3287 wxDataViewItem obj_item = model->GetParent(item);
3288 sels.Remove(item);
3289 sels.Add(obj_item);
3290 update_selection(sels, mode, model);
3291 return;
3292 }
3293 if (type == itInstance)
3294 {
3295 wxDataViewItemArray instances;
3296 model->GetChildren(model->GetParent(item), instances);
3297 assert(instances.Count() > 0);
3298 size_t selected_instances_cnt = 0;
3299 for (auto& inst : instances) {
3300 if (sels.Index(inst) == wxNOT_FOUND)
3301 break;
3302 selected_instances_cnt++;
3303 }
3304
3305 if (selected_instances_cnt == instances.Count())
3306 {
3307 wxDataViewItem obj_item = model->GetTopParent(item);
3308 for (auto& inst : instances)
3309 sels.Remove(inst);
3310 sels.Add(obj_item);
3311 update_selection(sels, mode, model);
3312 return;
3313 }
3314 }
3315 else
3316 return;
3317 }
3318 }
3319}
wxDataViewItem GetParent(const wxDataViewItem &item) const override
Definition ObjectDataViewModel.cpp:1448
unsigned int GetChildren(const wxDataViewItem &parent, wxDataViewItemArray &array) const override
Definition ObjectDataViewModel.cpp:1491
wxDataViewItem GetTopParent(const wxDataViewItem &item) const
Definition ObjectDataViewModel.cpp:1464
ItemType GetItemType(const wxDataViewItem &item) const
Definition ObjectDataViewModel.cpp:1552
ItemType
Definition ObjectDataViewModel.hpp:22
static void update_selection(wxDataViewItemArray &sels, ObjectList::SELECTION_MODE mode, ObjectDataViewModel *model)
Definition GUI_ObjectList.cpp:3277

References Slic3r::GUI::ObjectDataViewModel::GetChildren(), Slic3r::GUI::ObjectDataViewModel::GetItemType(), Slic3r::GUI::ObjectDataViewModel::GetParent(), Slic3r::GUI::ObjectDataViewModel::GetTopParent(), itInstance, itInstanceRoot, itObject, Slic3r::GUI::ObjectList::smInstance, and update_selection().

Referenced by Slic3r::GUI::ObjectList::remove(), and update_selection().

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

◆ validate_custom_gcode_cb()

static void Slic3r::GUI::validate_custom_gcode_cb ( Tab tab,
const wxString &  title,
const t_config_option_key opt_key,
const boost::any &  value 
)
static
1831 {
1832 tab->validate_custom_gcodes_was_shown = !Tab::validate_custom_gcode(title, boost::any_cast<std::string>(value));
1833 tab->update_dirty();
1834 tab->on_value_change(opt_key, value);
1835}
void on_value_change(const std::string &opt_key, const boost::any &value)
Definition Tab.cpp:1070
bool validate_custom_gcodes_was_shown
Definition Tab.hpp:390
void update_dirty()
Definition Tab.cpp:856

References Slic3r::GUI::Tab::on_value_change(), Slic3r::GUI::Tab::update_dirty(), validate_custom_gcode_cb(), and Slic3r::GUI::Tab::validate_custom_gcodes_was_shown.

Referenced by Slic3r::GUI::TabPrinter::build_fff(), and validate_custom_gcode_cb().

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

◆ verify_instances_rotation_synchronized()

static void Slic3r::GUI::verify_instances_rotation_synchronized ( const Model model,
const GLVolumePtrs volumes 
)
static
2625{
2626 for (int idx_object = 0; idx_object < int(model.objects.size()); ++idx_object) {
2627 int idx_volume_first = -1;
2628 for (int i = 0; i < (int)volumes.size(); ++i) {
2629 if (volumes[i]->object_idx() == idx_object) {
2630 idx_volume_first = i;
2631 break;
2632 }
2633 }
2634 assert(idx_volume_first != -1); // object without instances?
2635 if (idx_volume_first == -1)
2636 continue;
2637 const Transform3d::ConstLinearPart& rotation0 = volumes[idx_volume_first]->get_instance_transformation().get_matrix().linear();
2638 for (int i = idx_volume_first + 1; i < (int)volumes.size(); ++i)
2639 if (volumes[i]->object_idx() == idx_object && volumes[i]->volume_idx() >= 0) {
2640 const Transform3d::ConstLinearPart& rotation = volumes[i]->get_instance_transformation().get_matrix().linear();
2641 assert(is_rotation_xy_synchronized(rotation, rotation0));
2642 }
2643 }
2644}

References is_rotation_xy_synchronized(), and Slic3r::Model::objects.

Referenced by Slic3r::GUI::Selection::synchronize_unselected_instances().

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

◆ warning_catcher()

void Slic3r::GUI::warning_catcher ( wxWindow *  parent,
const wxString &  message 
)
256{
257 //wxMessageDialog msg(parent, message, _L("Warning"), wxOK | wxICON_WARNING);
258 MessageDialog msg(parent, message, _L("Warning"), wxOK | wxICON_WARNING);
259 msg.ShowModal();
260}

References _L.

Referenced by Slic3r::GUI::PhysicalPrinterDialog::OnOK(), and Slic3r::GUI::Plater::priv::split_object().

+ Here is the caller graph for this function:

◆ world_matrix_fixed() [1/2]

Transform3d Slic3r::GUI::world_matrix_fixed ( const GLVolume gl_volume,
const ModelObjectPtrs objects 
)

Get transformation to world.

  • use fix after store to 3mf when exists
Parameters
gl_volumeScene volume
objectsTo identify Model volume with fix transformation
Returns
Fixed Transformation of gl_volume
297{
298 Transform3d res = gl_volume.world_matrix();
299
300 const ModelVolume *mv = get_model_volume(gl_volume, objects);
301 if (!mv)
302 return res;
303
304 const std::optional<TextConfiguration> &tc = mv->text_configuration;
305 if (!tc.has_value())
306 return res;
307
308 const std::optional<Transform3d> &fix = tc->fix_3mf_tr;
309 if (!fix.has_value())
310 return res;
311
312 return res * fix->inverse();
313}
Transform3d world_matrix() const
Definition 3DScene.cpp:295
std::optional< TextConfiguration > text_configuration
Definition Model.hpp:833

References get_model_volume(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::inverse(), Slic3r::ModelVolume::text_configuration, and Slic3r::GLVolume::world_matrix().

Referenced by priv::apply_camera_dir(), calc_surface_offset(), on_mouse_surface_drag(), and world_matrix_fixed().

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

◆ world_matrix_fixed() [2/2]

Transform3d Slic3r::GUI::world_matrix_fixed ( const Selection selection)

Get transformation to world.

  • use fix after store to 3mf when exists NOTE: when not one volume selected return identity
Parameters
selectionSelected volume
Returns
Fixed Transformation of selected volume in selection
316{
317 const GLVolume *gl_volume = get_selected_gl_volume(selection);
318 assert(gl_volume != nullptr);
319 if (gl_volume == nullptr)
320 return Transform3d::Identity();
321
322 return world_matrix_fixed(*gl_volume, selection.get_model()->objects);
323}

References Slic3r::GUI::Selection::get_model(), get_selected_gl_volume(), Eigen::Transform< double, 3, Eigen::Affine, Eigen::DontAlign >::Identity(), Slic3r::Model::objects, and world_matrix_fixed().

+ Here is the call graph for this function:

◆ WX_DEFINE_ARRAY_PTR()

Slic3r::GUI::WX_DEFINE_ARRAY_PTR ( ObjectDataViewModelNode ,
MyObjectTreeModelNodePtrArray   
)

◆ wxDECLARE_EVENT() [1/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_DIFF_DIALOG_TRANSFER  ,
SimpleEvent   
)

◆ wxDECLARE_EVENT() [2/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_DIFF_DIALOG_UPDATE_PRESETS  ,
SimpleEvent   
)

◆ wxDECLARE_EVENT() [3/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_DPI_CHANGED_SLICER  ,
DpiChangedEvent   
)

◆ wxDECLARE_EVENT() [4/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_DWNLDR_FILE_CANCELED  ,
wxCommandEvent   
)

◆ wxDECLARE_EVENT() [5/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_DWNLDR_FILE_COMPLETE  ,
wxCommandEvent   
)

◆ wxDECLARE_EVENT() [6/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_DWNLDR_FILE_ERROR  ,
wxCommandEvent   
)

◆ wxDECLARE_EVENT() [7/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_DWNLDR_FILE_NAME_CHANGE  ,
wxCommandEvent   
)

◆ wxDECLARE_EVENT() [8/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_DWNLDR_FILE_PAUSED  ,
wxCommandEvent   
)

◆ wxDECLARE_EVENT() [9/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_DWNLDR_FILE_PROGRESS  ,
wxCommandEvent   
)

◆ wxDECLARE_EVENT() [10/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_EJECT_DRIVE_NOTIFICAION_CLICKED  ,
EjectDriveNotificationClickedEvent   
)

◆ wxDECLARE_EVENT() [11/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_EXPORT_GCODE_NOTIFICAION_CLICKED  ,
ExportGcodeNotificationClickedEvent   
)

◆ wxDECLARE_EVENT() [12/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_GLCANVAS_ADAPTIVE_LAYER_HEIGHT_PROFILE  ,
Event< float >   
)

◆ wxDECLARE_EVENT() [13/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_GLCANVAS_ARRANGE  ,
SimpleEvent   
)

◆ wxDECLARE_EVENT() [14/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_GLCANVAS_COLLAPSE_SIDEBAR  ,
SimpleEvent   
)

◆ wxDECLARE_EVENT() [15/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_GLCANVAS_EDIT_COLOR_CHANGE  ,
wxKeyEvent   
)

◆ wxDECLARE_EVENT() [16/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_GLCANVAS_ENABLE_ACTION_BUTTONS  ,
Event< bool >   
)

◆ wxDECLARE_EVENT() [17/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_GLCANVAS_FORCE_UPDATE  ,
SimpleEvent   
)

◆ wxDECLARE_EVENT() [18/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_GLCANVAS_GIZMO_HIGHLIGHTER_TIMER  ,
wxTimerEvent   
)

◆ wxDECLARE_EVENT() [19/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_GLCANVAS_INCREASE_INSTANCES  ,
Event< int >   
)

◆ wxDECLARE_EVENT() [20/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_GLCANVAS_INSTANCE_MOVED  ,
SimpleEvent   
)

◆ wxDECLARE_EVENT() [21/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_GLCANVAS_INSTANCE_ROTATED  ,
SimpleEvent   
)

◆ wxDECLARE_EVENT() [22/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_GLCANVAS_INSTANCE_SCALED  ,
SimpleEvent   
)

◆ wxDECLARE_EVENT() [23/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_GLCANVAS_JUMP_TO  ,
wxKeyEvent   
)

◆ wxDECLARE_EVENT() [24/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_GLCANVAS_MOUSE_DRAGGING_FINISHED  ,
SimpleEvent   
)

◆ wxDECLARE_EVENT() [25/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_GLCANVAS_MOUSE_DRAGGING_STARTED  ,
SimpleEvent   
)

◆ wxDECLARE_EVENT() [26/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_GLCANVAS_MOVE_SLIDERS  ,
wxKeyEvent   
)

◆ wxDECLARE_EVENT() [27/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_GLCANVAS_OBJECT_SELECT  ,
SimpleEvent   
)

◆ wxDECLARE_EVENT() [28/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_GLCANVAS_QUESTION_MARK  ,
SimpleEvent   
)

◆ wxDECLARE_EVENT() [29/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_GLCANVAS_REDO  ,
SimpleEvent   
)

◆ wxDECLARE_EVENT() [30/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_GLCANVAS_RELOAD_FROM_DISK  ,
SimpleEvent   
)

◆ wxDECLARE_EVENT() [31/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_GLCANVAS_REMOVE_OBJECT  ,
SimpleEvent   
)

◆ wxDECLARE_EVENT() [32/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_GLCANVAS_RENDER_TIMER  ,
wxTimerEvent   
)

◆ wxDECLARE_EVENT() [33/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_GLCANVAS_RESET_LAYER_HEIGHT_PROFILE  ,
SimpleEvent   
)

◆ wxDECLARE_EVENT() [34/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_GLCANVAS_RESET_SKEW  ,
SimpleEvent   
)

◆ wxDECLARE_EVENT() [35/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_GLCANVAS_RESETGIZMOS  ,
SimpleEvent   
)

◆ wxDECLARE_EVENT() [36/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_GLCANVAS_RIGHT_CLICK  ,
RBtnEvent   
)

◆ wxDECLARE_EVENT() [37/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_GLCANVAS_SCHEDULE_BACKGROUND_PROCESS  ,
SimpleEvent   
)

◆ wxDECLARE_EVENT() [38/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_GLCANVAS_SELECT_ALL  ,
SimpleEvent   
)

◆ wxDECLARE_EVENT() [39/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_GLCANVAS_SMOOTH_LAYER_HEIGHT_PROFILE  ,
HeightProfileSmoothEvent   
)

◆ wxDECLARE_EVENT() [40/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_GLCANVAS_TAB  ,
SimpleEvent   
)

◆ wxDECLARE_EVENT() [41/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_GLCANVAS_TOOLBAR_HIGHLIGHTER_TIMER  ,
wxTimerEvent   
)

◆ wxDECLARE_EVENT() [42/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_GLCANVAS_UNDO  ,
SimpleEvent   
)

◆ wxDECLARE_EVENT() [43/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_GLCANVAS_UPDATE_BED_SHAPE  ,
SimpleEvent   
)

◆ wxDECLARE_EVENT() [44/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_GLCANVAS_UPDATE_GEOMETRY  ,
Vec3dsEvent< 2 >   
)

◆ wxDECLARE_EVENT() [45/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_GLCANVAS_WIPETOWER_MOVED  ,
Vec3dEvent   
)

◆ wxDECLARE_EVENT() [46/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_GLCANVAS_WIPETOWER_ROTATED  ,
Vec3dEvent   
)

◆ wxDECLARE_EVENT() [47/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_GLTOOLBAR_ADD  ,
SimpleEvent   
)

◆ wxDECLARE_EVENT() [48/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_GLTOOLBAR_ARRANGE  ,
SimpleEvent   
)

◆ wxDECLARE_EVENT() [49/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_GLTOOLBAR_COPY  ,
SimpleEvent   
)

◆ wxDECLARE_EVENT() [50/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_GLTOOLBAR_DELETE  ,
SimpleEvent   
)

◆ wxDECLARE_EVENT() [51/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_GLTOOLBAR_DELETE_ALL  ,
SimpleEvent   
)

◆ wxDECLARE_EVENT() [52/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_GLTOOLBAR_FEWER  ,
SimpleEvent   
)

◆ wxDECLARE_EVENT() [53/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_GLTOOLBAR_LAYERSEDITING  ,
SimpleEvent   
)

◆ wxDECLARE_EVENT() [54/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_GLTOOLBAR_MORE  ,
SimpleEvent   
)

◆ wxDECLARE_EVENT() [55/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_GLTOOLBAR_PASTE  ,
SimpleEvent   
)

◆ wxDECLARE_EVENT() [56/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_GLTOOLBAR_SPLIT_OBJECTS  ,
SimpleEvent   
)

◆ wxDECLARE_EVENT() [57/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_GLTOOLBAR_SPLIT_VOLUMES  ,
SimpleEvent   
)

◆ wxDECLARE_EVENT() [58/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_GLVIEWTOOLBAR_3D  ,
SimpleEvent   
)

◆ wxDECLARE_EVENT() [59/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_GLVIEWTOOLBAR_PREVIEW  ,
SimpleEvent   
)

◆ wxDECLARE_EVENT() [60/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_INDEX_PAGE  ,
wxCommandEvent   
)

◆ wxDECLARE_EVENT() [61/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_INSTANCE_GO_TO_FRONT  ,
InstanceGoToFrontEvent   
)

◆ wxDECLARE_EVENT() [62/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_LOAD_MODEL_OTHER_INSTANCE  ,
LoadFromOtherInstanceEvent   
)

◆ wxDECLARE_EVENT() [63/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_OBJ_LIST_OBJECT_SELECT  ,
SimpleEvent   
)

◆ wxDECLARE_EVENT() [64/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_PRESET_UPDATE_AVAILABLE_CLICKED  ,
PresetUpdateAvailableClickedEvent   
)

◆ wxDECLARE_EVENT() [65/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_PRINTHOST_CANCEL  ,
PrintHostQueueDialog::Event   
)

◆ wxDECLARE_EVENT() [66/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_PRINTHOST_ERROR  ,
PrintHostQueueDialog::Event   
)

◆ wxDECLARE_EVENT() [67/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_PRINTHOST_INFO  ,
PrintHostQueueDialog::Event   
)

◆ wxDECLARE_EVENT() [68/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_PRINTHOST_PROGRESS  ,
PrintHostQueueDialog::Event   
)

◆ wxDECLARE_EVENT() [69/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_REMOVABLE_DRIVE_EJECTED  ,
RemovableDriveEjectEvent   
)

◆ wxDECLARE_EVENT() [70/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_REMOVABLE_DRIVES_CHANGED  ,
RemovableDrivesChangedEvent   
)

◆ wxDECLARE_EVENT() [71/72]

Slic3r::GUI::wxDECLARE_EVENT ( EVT_START_DOWNLOAD_OTHER_INSTANCE  ,
StartDownloadOtherInstanceEvent   
)

◆ wxDECLARE_EVENT() [72/72]

Slic3r::GUI::wxDECLARE_EVENT ( wxCUSTOMEVT_LAST_VOLUME_IS_DELETED  ,
wxCommandEvent   
)

◆ wxDEFINE_EVENT() [1/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_DIFF_DIALOG_TRANSFER  ,
SimpleEvent   
)

◆ wxDEFINE_EVENT() [2/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_DIFF_DIALOG_UPDATE_PRESETS  ,
SimpleEvent   
)

◆ wxDEFINE_EVENT() [3/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_DPI_CHANGED_SLICER  ,
DpiChangedEvent   
)

◆ wxDEFINE_EVENT() [4/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_DWNLDR_FILE_CANCELED  ,
wxCommandEvent   
)

◆ wxDEFINE_EVENT() [5/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_DWNLDR_FILE_COMPLETE  ,
wxCommandEvent   
)

◆ wxDEFINE_EVENT() [6/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_DWNLDR_FILE_ERROR  ,
wxCommandEvent   
)

◆ wxDEFINE_EVENT() [7/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_DWNLDR_FILE_NAME_CHANGE  ,
wxCommandEvent   
)

◆ wxDEFINE_EVENT() [8/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_DWNLDR_FILE_PAUSED  ,
wxCommandEvent   
)

◆ wxDEFINE_EVENT() [9/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_DWNLDR_FILE_PROGRESS  ,
wxCommandEvent   
)

◆ wxDEFINE_EVENT() [10/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_EJECT_DRIVE_NOTIFICAION_CLICKED  ,
EjectDriveNotificationClickedEvent   
)

◆ wxDEFINE_EVENT() [11/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_EXPORT_BEGAN  ,
wxCommandEvent   
)

◆ wxDEFINE_EVENT() [12/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_EXPORT_GCODE_NOTIFICAION_CLICKED  ,
ExportGcodeNotificationClickedEvent   
)

◆ wxDEFINE_EVENT() [13/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_GLCANVAS_ADAPTIVE_LAYER_HEIGHT_PROFILE  ,
Event< float >   
)

◆ wxDEFINE_EVENT() [14/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_GLCANVAS_ARRANGE  ,
SimpleEvent   
)

◆ wxDEFINE_EVENT() [15/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_GLCANVAS_COLLAPSE_SIDEBAR  ,
SimpleEvent   
)

◆ wxDEFINE_EVENT() [16/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_GLCANVAS_EDIT_COLOR_CHANGE  ,
wxKeyEvent   
)

◆ wxDEFINE_EVENT() [17/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_GLCANVAS_ENABLE_ACTION_BUTTONS  ,
Event< bool >   
)

◆ wxDEFINE_EVENT() [18/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_GLCANVAS_FORCE_UPDATE  ,
SimpleEvent   
)

◆ wxDEFINE_EVENT() [19/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_GLCANVAS_GIZMO_HIGHLIGHTER_TIMER  ,
wxTimerEvent   
)

◆ wxDEFINE_EVENT() [20/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_GLCANVAS_INCREASE_INSTANCES  ,
Event< int >   
)

◆ wxDEFINE_EVENT() [21/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_GLCANVAS_INSTANCE_MOVED  ,
SimpleEvent   
)

◆ wxDEFINE_EVENT() [22/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_GLCANVAS_INSTANCE_ROTATED  ,
SimpleEvent   
)

◆ wxDEFINE_EVENT() [23/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_GLCANVAS_INSTANCE_SCALED  ,
SimpleEvent   
)

◆ wxDEFINE_EVENT() [24/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_GLCANVAS_JUMP_TO  ,
wxKeyEvent   
)

◆ wxDEFINE_EVENT() [25/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_GLCANVAS_MOUSE_DRAGGING_FINISHED  ,
SimpleEvent   
)

◆ wxDEFINE_EVENT() [26/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_GLCANVAS_MOUSE_DRAGGING_STARTED  ,
SimpleEvent   
)

◆ wxDEFINE_EVENT() [27/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_GLCANVAS_MOVE_SLIDERS  ,
wxKeyEvent   
)

◆ wxDEFINE_EVENT() [28/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_GLCANVAS_OBJECT_SELECT  ,
SimpleEvent   
)

◆ wxDEFINE_EVENT() [29/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_GLCANVAS_QUESTION_MARK  ,
SimpleEvent   
)

◆ wxDEFINE_EVENT() [30/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_GLCANVAS_REDO  ,
SimpleEvent   
)

◆ wxDEFINE_EVENT() [31/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_GLCANVAS_RELOAD_FROM_DISK  ,
SimpleEvent   
)

◆ wxDEFINE_EVENT() [32/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_GLCANVAS_REMOVE_OBJECT  ,
SimpleEvent   
)

◆ wxDEFINE_EVENT() [33/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_GLCANVAS_RENDER_TIMER  ,
wxTimerEvent   
)

◆ wxDEFINE_EVENT() [34/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_GLCANVAS_RESET_LAYER_HEIGHT_PROFILE  ,
SimpleEvent   
)

◆ wxDEFINE_EVENT() [35/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_GLCANVAS_RESET_SKEW  ,
SimpleEvent   
)

◆ wxDEFINE_EVENT() [36/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_GLCANVAS_RESETGIZMOS  ,
SimpleEvent   
)

◆ wxDEFINE_EVENT() [37/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_GLCANVAS_RIGHT_CLICK  ,
RBtnEvent   
)

◆ wxDEFINE_EVENT() [38/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_GLCANVAS_SCHEDULE_BACKGROUND_PROCESS  ,
SimpleEvent   
)

◆ wxDEFINE_EVENT() [39/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_GLCANVAS_SELECT_ALL  ,
SimpleEvent   
)

◆ wxDEFINE_EVENT() [40/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_GLCANVAS_SMOOTH_LAYER_HEIGHT_PROFILE  ,
HeightProfileSmoothEvent   
)

◆ wxDEFINE_EVENT() [41/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_GLCANVAS_TAB  ,
SimpleEvent   
)

◆ wxDEFINE_EVENT() [42/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_GLCANVAS_TOOLBAR_HIGHLIGHTER_TIMER  ,
wxTimerEvent   
)

◆ wxDEFINE_EVENT() [43/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_GLCANVAS_UNDO  ,
SimpleEvent   
)

◆ wxDEFINE_EVENT() [44/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_GLCANVAS_UPDATE_BED_SHAPE  ,
SimpleEvent   
)

◆ wxDEFINE_EVENT() [45/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_GLCANVAS_UPDATE_GEOMETRY  ,
Vec3dsEvent< 2 >   
)

◆ wxDEFINE_EVENT() [46/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_GLCANVAS_WIPETOWER_MOVED  ,
Vec3dEvent   
)

◆ wxDEFINE_EVENT() [47/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_GLCANVAS_WIPETOWER_ROTATED  ,
Vec3dEvent   
)

◆ wxDEFINE_EVENT() [48/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_GLTOOLBAR_ADD  ,
SimpleEvent   
)

◆ wxDEFINE_EVENT() [49/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_GLTOOLBAR_ARRANGE  ,
SimpleEvent   
)

◆ wxDEFINE_EVENT() [50/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_GLTOOLBAR_COPY  ,
SimpleEvent   
)

◆ wxDEFINE_EVENT() [51/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_GLTOOLBAR_DELETE  ,
SimpleEvent   
)

◆ wxDEFINE_EVENT() [52/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_GLTOOLBAR_DELETE_ALL  ,
SimpleEvent   
)

◆ wxDEFINE_EVENT() [53/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_GLTOOLBAR_FEWER  ,
SimpleEvent   
)

◆ wxDEFINE_EVENT() [54/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_GLTOOLBAR_LAYERSEDITING  ,
SimpleEvent   
)

◆ wxDEFINE_EVENT() [55/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_GLTOOLBAR_MORE  ,
SimpleEvent   
)

◆ wxDEFINE_EVENT() [56/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_GLTOOLBAR_PASTE  ,
SimpleEvent   
)

◆ wxDEFINE_EVENT() [57/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_GLTOOLBAR_SPLIT_OBJECTS  ,
SimpleEvent   
)

◆ wxDEFINE_EVENT() [58/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_GLTOOLBAR_SPLIT_VOLUMES  ,
SimpleEvent   
)

◆ wxDEFINE_EVENT() [59/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_GLVIEWTOOLBAR_3D  ,
SimpleEvent   
)

◆ wxDEFINE_EVENT() [60/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_GLVIEWTOOLBAR_PREVIEW  ,
SimpleEvent   
)

◆ wxDEFINE_EVENT() [61/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_INDEX_PAGE  ,
wxCommandEvent   
)

◆ wxDEFINE_EVENT() [62/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_INSTANCE_GO_TO_FRONT  ,
InstanceGoToFrontEvent   
)

◆ wxDEFINE_EVENT() [63/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_LOAD_MODEL_OTHER_INSTANCE  ,
LoadFromOtherInstanceEvent   
)

◆ wxDEFINE_EVENT() [64/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_OBJ_LIST_OBJECT_SELECT  ,
SimpleEvent   
)

◆ wxDEFINE_EVENT() [65/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_PRESET_UPDATE_AVAILABLE_CLICKED  ,
PresetUpdateAvailableClickedEvent   
)

◆ wxDEFINE_EVENT() [66/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_PRINTER_PICK  ,
PrinterPickerEvent   
)

◆ wxDEFINE_EVENT() [67/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_PRINTHOST_CANCEL  ,
PrintHostQueueDialog::Event   
)

◆ wxDEFINE_EVENT() [68/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_PRINTHOST_ERROR  ,
PrintHostQueueDialog::Event   
)

◆ wxDEFINE_EVENT() [69/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_PRINTHOST_INFO  ,
PrintHostQueueDialog::Event   
)

◆ wxDEFINE_EVENT() [70/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_PRINTHOST_PROGRESS  ,
PrintHostQueueDialog::Event   
)

◆ wxDEFINE_EVENT() [71/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_PROCESS_COMPLETED  ,
SlicingProcessCompletedEvent   
)

◆ wxDEFINE_EVENT() [72/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_REMOVABLE_DRIVE_EJECTED  ,
RemovableDriveEjectEvent   
)

◆ wxDEFINE_EVENT() [73/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_REMOVABLE_DRIVES_CHANGED  ,
RemovableDrivesChangedEvent   
)

◆ wxDEFINE_EVENT() [74/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_SCHEDULE_BACKGROUND_PROCESS  ,
SimpleEvent   
)

◆ wxDEFINE_EVENT() [75/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_SLICING_COMPLETED  ,
wxCommandEvent   
)

◆ wxDEFINE_EVENT() [76/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_SLICING_UPDATE  ,
SlicingStatusEvent   
)

◆ wxDEFINE_EVENT() [77/78]

Slic3r::GUI::wxDEFINE_EVENT ( EVT_START_DOWNLOAD_OTHER_INSTANCE  ,
StartDownloadOtherInstanceEvent   
)

◆ wxDEFINE_EVENT() [78/78]

Slic3r::GUI::wxDEFINE_EVENT ( wxCUSTOMEVT_LAST_VOLUME_IS_DELETED  ,
wxCommandEvent   
)

◆ wxImage_to_wxBitmap_with_alpha()

static wxBitmap Slic3r::GUI::wxImage_to_wxBitmap_with_alpha ( wxImage &&  image,
float  scale = 1.0f 
)
static
45{
46#ifdef __WXGTK2__
47 // Broken alpha workaround
48 wxMemoryOutputStream stream;
49 image.SaveFile(stream, wxBITMAP_TYPE_PNG);
50 wxStreamBuffer *buf = stream.GetOutputStreamBuffer();
51 return wxBitmap::NewFromPNGData(buf->GetBufferStart(), buf->GetBufferSize());
52#else
53#ifdef __APPLE__
54 // This is a c-tor native to Mac OS. We need to let the Mac OS wxBitmap implementation
55 // know that the image may already be scaled appropriately for Retina,
56 // and thereby that it's not supposed to upscale it.
57 // Contrary to intuition, the `scale` argument isn't "please scale this to such and such"
58 // but rather "the wxImage is sized for backing scale such and such".
59 return wxBitmap(std::move(image), -1, scale);
60#else
61 return wxBitmap(std::move(image));
62#endif
63#endif
64}

References scale().

Referenced by Slic3r::GUI::BitmapCache::from_png(), Slic3r::GUI::BitmapCache::insert_bndl(), Slic3r::GUI::BitmapCache::insert_raw_rgba(), Slic3r::GUI::BitmapCache::load_png(), and Slic3r::GUI::BitmapCache::mksolid().

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

Variable Documentation

◆ ABORT_WAIT_MAX_MS

constexpr int Slic3r::GUI::ABORT_WAIT_MAX_MS = 10000
constexpr

◆ ADD_VOLUME_MENU_ITEMS

const constexpr std::array<std::pair<const char *, const char *>, 5> Slic3r::GUI::ADD_VOLUME_MENU_ITEMS
staticconstexpr
Initial value:
= {{
{L("Add part"), "add_part" },
{L("Add negative volume"), "add_negative" },
{L("Add modifier"), "add_modifier"},
{L("Add support blocker"), "support_blocker"},
{L("Add support enforcer"), "support_enforcer"},
}}

Referenced by Slic3r::GUI::MenuFactory::append_menu_item_add_text(), Slic3r::GUI::MenuFactory::append_menu_items_add_volume(), and Slic3r::GUI::MenuFactory::get_volume_bitmaps().

◆ AngleResolution

const unsigned int Slic3r::GUI::AngleResolution = 64

Referenced by init_from_angle_arc().

◆ axes

◆ AXES_COLOR

◆ axes_color_back

const wxString Slic3r::GUI::axes_color_back[] = { "#f5dcdc", "#dcf5dc", "#dcdcf5" }
static

◆ axes_color_text

const wxString Slic3r::GUI::axes_color_text[] = { "#990000", "#009900", "#000099" }
static

◆ BOLD_MARKER_END

const std::string Slic3r::GUI::BOLD_MARKER_END = "</b>"

◆ BOLD_MARKER_START

const std::string Slic3r::GUI::BOLD_MARKER_START = "<b>"

◆ BORDER_W

◆ CIRCLE_ID

const int Slic3r::GUI::CIRCLE_ID = 300
static

◆ CONFIG_KEY_GROUP

const char* Slic3r::GUI::CONFIG_KEY_GROUP = "printhost_group"
static

◆ CONFIG_KEY_PATH

const char* Slic3r::GUI::CONFIG_KEY_PATH = "printhost_path"
static

◆ CONFIG_KEY_STORAGE

const char* Slic3r::GUI::CONFIG_KEY_STORAGE = "printhost_storage"
static

◆ CONNECTOR_DEF_COLOR

const ColorRGBA Slic3r::GUI::CONNECTOR_DEF_COLOR = ColorRGBA(1.0f, 1.0f, 1.0f, 0.5f)
static

◆ CONNECTOR_ERR_COLOR

const ColorRGBA Slic3r::GUI::CONNECTOR_ERR_COLOR = ColorRGBA(1.0f, 0.3f, 0.3f, 0.5f)
static

◆ CONSTRAINED_COLOR

const ColorRGBA Slic3r::GUI::CONSTRAINED_COLOR = ColorRGBA::GRAY()
static

◆ CTRL_STR

const std::string Slic3r::GUI::CTRL_STR
static
Initial value:
=
"Ctrl"

◆ DEFAULT_BASE_COLOR

const ColorRGBA Slic3r::GUI::DEFAULT_BASE_COLOR = { 0.625f, 0.625f, 0.625f, 1.0f }
static

◆ DEFAULT_DRAG_COLOR

const ColorRGBA Slic3r::GUI::DEFAULT_DRAG_COLOR = ColorRGBA::WHITE()
static

◆ DEFAULT_HIGHLIGHT_COLOR

const ColorRGBA Slic3r::GUI::DEFAULT_HIGHLIGHT_COLOR = ColorRGBA::ORANGE()
static

◆ DEFAULT_HOVER_PLANE_COLOR

const Slic3r::ColorRGBA Slic3r::GUI::DEFAULT_HOVER_PLANE_COLOR = { 0.9f, 0.9f, 0.9f, 0.75f }
static

◆ DEFAULT_PLANE_COLOR

const Slic3r::ColorRGBA Slic3r::GUI::DEFAULT_PLANE_COLOR = { 0.9f, 0.9f, 0.9f, 0.5f }
static

◆ DISABLED_COLOR

const ColorRGBA Slic3r::GUI::DISABLED_COLOR = ColorRGBA::DARK_GRAY()
static

◆ DOWEL_COLOR

const ColorRGBA Slic3r::GUI::DOWEL_COLOR = ColorRGBA::DARK_YELLOW()
static

◆ DOWNLOAD_MAX_CHUNK_SIZE

const size_t Slic3r::GUI::DOWNLOAD_MAX_CHUNK_SIZE = 10 * 1024 * 1024

◆ DOWNLOAD_SIZE_LIMIT

const size_t Slic3r::GUI::DOWNLOAD_SIZE_LIMIT = 1024 * 1024 * 1024

◆ EDGE_ID

const int Slic3r::GUI::EDGE_ID = 200
static

◆ extruder_options

const std::vector<std::string> Slic3r::GUI::extruder_options
Initial value:
= {
"min_layer_height", "max_layer_height", "extruder_offset",
"retract_length", "retract_lift", "retract_lift_above", "retract_lift_below",
"retract_speed", "deretract_speed", "retract_restart_extra", "retract_before_travel",
"retract_layer_change", "wipe", "retract_before_wipe",
"retract_length_toolchange", "retract_restart_extra_toolchange",
}

Referenced by Slic3r::GUI::TabPrinter::build_extruder_pages().

◆ file_wildcards_by_type

const FileWildcards Slic3r::GUI::file_wildcards_by_type[FT_SIZE]
static
Initial value:
= {
{ "STL files"sv, { ".stl"sv } },
{ "OBJ files"sv, { ".obj"sv } },
{ "Object files"sv, { ".stl"sv, ".obj"sv } },
{ "STEP files"sv, { ".stp"sv, ".step"sv } },
{ "AMF files"sv, { ".amf"sv, ".zip.amf"sv, ".xml"sv } },
{ "3MF files"sv, { ".3mf"sv } },
{ "G-code files"sv, { ".gcode"sv, ".gco"sv, ".g"sv, ".ngc"sv } },
{ "Known files"sv, { ".stl"sv, ".obj"sv, ".3mf"sv, ".amf"sv, ".zip.amf"sv, ".xml"sv, ".step"sv, ".stp"sv } },
{ "Project files"sv, { ".3mf"sv, ".amf"sv, ".zip.amf"sv } },
{ "Font files"sv, { ".ttc"sv, ".ttf"sv } },
{ "Known files"sv, { ".stl"sv, ".obj"sv } },
{ "INI files"sv, { ".ini"sv } },
{ "SVG files"sv, { ".svg"sv } },
{ "Texture"sv, { ".png"sv, ".svg"sv } },
{ "Masked SLA files"sv, { ".sl1"sv, ".sl1s"sv, ".pwmx"sv } },
{ "Zip files"sv, { ".zip"sv } },
}

Referenced by file_wildcards().

◆ font_icons

const std::map<const wchar_t, std::string> Slic3r::GUI::font_icons
static
Initial value:
= {
{ImGui::PrinterIconMarker , "printer" },
{ImGui::PrinterSlaIconMarker , "sla_printer" },
{ImGui::MinimalizeButton , "notification_minimalize" },
{ImGui::MinimalizeHoverButton , "notification_minimalize_hover" },
{ImGui::RightArrowButton , "notification_right" },
{ImGui::RightArrowHoverButton , "notification_right_hover" },
{ImGui::PreferencesButton , "notification_preferences" },
{ImGui::PreferencesHoverButton, "notification_preferences_hover"},
{ImGui::SliderFloatEditBtnIcon, "edit_button" },
{ImGui::SliderFloatEditBtnPressedIcon, "edit_button_pressed" },
{ImGui::ClipboardBtnIcon , "copy_menu" },
{ImGui::ExpandBtn , "expand_btn" },
{ImGui::CollapseBtn , "collapse_btn" },
{ImGui::RevertButton , "undo" },
{ImGui::WarningMarkerSmall , "notification_warning" },
{ImGui::InfoMarkerSmall , "notification_info" },
{ImGui::PlugMarker , "plug" },
{ImGui::DowelMarker , "dowel" },
}
const wchar_t RightArrowButton
Definition imconfig.h:145
const wchar_t PreferencesButton
Definition imconfig.h:147
const wchar_t WarningMarkerSmall
Definition imconfig.h:184
const wchar_t InfoMarkerSmall
Definition imconfig.h:186
const wchar_t PrinterIconMarker
Definition imconfig.h:128
const wchar_t FilamentIconMarker
Definition imconfig.h:130
const wchar_t MaterialIconMarker
Definition imconfig.h:131
const wchar_t CollapseBtn
Definition imconfig.h:187
const wchar_t ClipboardBtnIcon
Definition imconfig.h:162
const wchar_t DowelMarker
Definition imconfig.h:154
const wchar_t MinimalizeButton
Definition imconfig.h:134
const wchar_t RightArrowHoverButton
Definition imconfig.h:146
const wchar_t PlugMarker
Definition imconfig.h:153
const wchar_t MinimalizeHoverButton
Definition imconfig.h:135
const wchar_t ExpandBtn
Definition imconfig.h:185
const wchar_t SliderFloatEditBtnIcon
Definition imconfig.h:160
const wchar_t PrinterSlaIconMarker
Definition imconfig.h:129
const wchar_t RevertButton
Definition imconfig.h:143
const wchar_t SliderFloatEditBtnPressedIcon
Definition imconfig.h:161
const wchar_t PrintIconMarker
Definition imconfig.h:127
const wchar_t PreferencesHoverButton
Definition imconfig.h:148

Referenced by Slic3r::GUI::ImGuiWrapper::init_font().

◆ font_icons_extra_large

const std::map<const wchar_t, std::string> Slic3r::GUI::font_icons_extra_large
static
Initial value:
= {
{ImGui::ClippyMarker , "notification_clippy" },
}
const wchar_t ClippyMarker
Definition imconfig.h:158

Referenced by Slic3r::GUI::ImGuiWrapper::init_font().

◆ font_icons_large

const std::map<const wchar_t, std::string> Slic3r::GUI::font_icons_large
static

◆ FREQ_SETTINGS_BUNDLE_FFF

SettingsFactory::Bundle Slic3r::GUI::FREQ_SETTINGS_BUNDLE_FFF
static
Initial value:
=
{
{ L("Layers and Perimeters"), { "layer_height" , "perimeters", "top_solid_layers", "bottom_solid_layers" } },
{ L("Infill") , { "fill_density", "fill_pattern" } },
{ L("Support material") , { "support_material", "support_material_auto", "support_material_threshold",
"support_material_pattern", "support_material_interface_pattern", "support_material_buildplate_only",
"support_material_spacing" } },
{ L("Wipe options") , { "wipe_into_infill", "wipe_into_objects" } }
}

Referenced by Slic3r::GUI::MenuFactory::append_menu_item_settings(), and create_freq_settings_popupmenu().

◆ FREQ_SETTINGS_BUNDLE_SLA

SettingsFactory::Bundle Slic3r::GUI::FREQ_SETTINGS_BUNDLE_SLA
static
Initial value:
=
{
{ L("Pad and Support") , { "supports_enable", "pad_enable" } }
}

Referenced by Slic3r::GUI::MenuFactory::append_menu_item_settings(), and create_freq_settings_popupmenu().

◆ GRABBER_COLOR

◆ grey

std::string Slic3r::GUI::grey = "#808080"
static

◆ HOVERED_DOWEL_COLOR

const ColorRGBA Slic3r::GUI::HOVERED_DOWEL_COLOR = ColorRGBA(0.0f, 0.5f, 0.5f, 1.0f)
static

◆ HOVERED_ERR_COLOR

const ColorRGBA Slic3r::GUI::HOVERED_ERR_COLOR = ColorRGBA(1.0f, 0.3f, 0.3f, 1.0f)
static

◆ HOVERED_PLAG_COLOR

const ColorRGBA Slic3r::GUI::HOVERED_PLAG_COLOR = ColorRGBA::CYAN()
static

◆ HYPERTEXT_MARKER_END

const std::string Slic3r::GUI::HYPERTEXT_MARKER_END = "</a>"

◆ HYPERTEXT_MARKER_START

const std::string Slic3r::GUI::HYPERTEXT_MARKER_START = "<a>"

◆ INFO_ITEMS

const std::map<InfoItemType, InfoItemAtributes> Slic3r::GUI::INFO_ITEMS
Initial value:
{
{ InfoItemType::CustomSupports, {L("Paint-on supports"), "fdm_supports_" }, },
{ InfoItemType::CustomSeam, {L("Paint-on seam"), "seam_" }, },
{ InfoItemType::CutConnectors, {L("Cut connectors"), "cut_connectors" }, },
{ InfoItemType::MmuSegmentation, {L("Multimaterial painting"), "mmu_segmentation_"}, },
{ InfoItemType::Sinking, {L("Sinking"), "sinking"}, },
{ InfoItemType::VariableLayerHeight, {L("Variable layer height"), "layers"}, },
}

Referenced by Slic3r::GUI::ObjectDataViewModel::ObjectDataViewModel(), and Slic3r::GUI::ObjectDataViewModel::UpdateBitmaps().

◆ IsFinishFn

template<class Fn >
constexpr bool Slic3r::GUI::IsFinishFn = std::is_invocable_v<Fn, bool, std::exception_ptr&>
constexpr

◆ IsProcessFn

template<class Fn >
constexpr bool Slic3r::GUI::IsProcessFn = std::is_invocable_v<Fn, Job::Ctl&>
constexpr

◆ LayerIcon

constexpr char Slic3r::GUI::LayerIcon[] = "edit_layers_some"
staticconstexpr

◆ LayerRootIcon

constexpr char Slic3r::GUI::LayerRootIcon[] = "edit_layers_all"
staticconstexpr

◆ legacy_preset_map

const std::unordered_map<std::string, std::pair<std::string, std::string> > Slic3r::GUI::legacy_preset_map
static
Initial value:
{{
{ "Original Prusa i3 MK2.ini", std::make_pair("MK2S", "0.4") },
{ "Original Prusa i3 MK2 MM Single Mode.ini", std::make_pair("MK2SMM", "0.4") },
{ "Original Prusa i3 MK2 MM Single Mode 0.6 nozzle.ini", std::make_pair("MK2SMM", "0.6") },
{ "Original Prusa i3 MK2 MultiMaterial.ini", std::make_pair("MK2SMM", "0.4") },
{ "Original Prusa i3 MK2 MultiMaterial 0.6 nozzle.ini", std::make_pair("MK2SMM", "0.6") },
{ "Original Prusa i3 MK2 0.25 nozzle.ini", std::make_pair("MK2S", "0.25") },
{ "Original Prusa i3 MK2 0.6 nozzle.ini", std::make_pair("MK2S", "0.6") },
{ "Original Prusa i3 MK3.ini", std::make_pair("MK3", "0.4") },
}}

Referenced by Slic3r::GUI::ConfigWizard::priv::load_vendors().

◆ LockIcon

◆ LOGICAL_BED_GAP

const constexpr double Slic3r::GUI::LOGICAL_BED_GAP = 1. / 5.
staticconstexpr

Referenced by bed_stride().

◆ LOWER_PART_COLOR

◆ m_bitmap_cache

◆ MODE_PALETTES

std::vector<std::pair<std::string, std::vector<std::string> > > Slic3r::GUI::MODE_PALETTES
static
Initial value:
=
{
{ L("Palette 1 (default)"), { "#00B000", "#FFDC00", "#E70000" } },
{ L("Palette 2"), { "#FC766A", "#B0B8B4", "#184A45" } },
{ L("Palette 3"), { "#567572", "#964F4C", "#696667" } },
{ L("Palette 4"), { "#DA291C", "#56A8CB", "#53A567" } },
{ L("Palette 5"), { "#F65058", "#FBDE44", "#28334A" } },
{ L("Palette 6"), { "#FF3EA5", "#EDFF00", "#00A4CC" } },
{ L("Palette 7"), { "#E95C20", "#006747", "#4F2C1D" } },
{ L("Palette 8"), { "#D9514E", "#2A2B2D", "#2DA8D8" } }
}

Referenced by Slic3r::GUI::ModePaletteComboBox::ModePaletteComboBox(), Slic3r::GUI::GUI_Descriptions::FillSizerWithModeColorDescriptions(), and Slic3r::GUI::ModePaletteComboBox::UpdateSelection().

◆ MODIFIER_COLOR

const ColorRGBA Slic3r::GUI::MODIFIER_COLOR = ColorRGBA(0.75f, 0.75f, 0.75f, 0.5f)
static

◆ NEUTRAL_COLOR

const Slic3r::ColorRGBA Slic3r::GUI::NEUTRAL_COLOR = { 0.5f, 0.5f, 0.5f, 1.0f }
static

◆ none

◆ options_without_field

const std::set<std::string> Slic3r::GUI::options_without_field
static
Initial value:
= {
"compatible_printers",
"compatible_prints",
"bed_shape",
"filament_ramming_parameters",
"gcode_substitutions",
}

Referenced by Slic3r::GUI::OptionsGroup::is_option_without_field().

◆ orange

◆ PLAG_COLOR

const ColorRGBA Slic3r::GUI::PLAG_COLOR = ColorRGBA::YELLOW()
static

◆ PLANE_ID

const int Slic3r::GUI::PLANE_ID = 400
static

◆ POINT_ID

const int Slic3r::GUI::POINT_ID = 100
static

◆ ScaleLongEvery

const unsigned int Slic3r::GUI::ScaleLongEvery = 2

Referenced by init_from_scale().

◆ ScaleLongTooth

const float Slic3r::GUI::ScaleLongTooth = 0.1f

Referenced by init_from_scale().

◆ ScaleStepRad

const float Slic3r::GUI::ScaleStepRad = 2.0f * float(PI) / ScaleStepsCount

◆ ScaleStepsCount

const unsigned int Slic3r::GUI::ScaleStepsCount = 72

◆ SEL_SPHERE_1_ID

◆ SEL_SPHERE_2_ID

◆ SELECTED_1ST_COLOR

const Slic3r::ColorRGBA Slic3r::GUI::SELECTED_1ST_COLOR = { 0.25f, 0.75f, 0.75f, 1.0f }
static

◆ SELECTED_2ND_COLOR

const Slic3r::ColorRGBA Slic3r::GUI::SELECTED_2ND_COLOR = { 0.75f, 0.25f, 0.75f, 1.0f }
static

◆ SELECTED_DOWEL_COLOR

const ColorRGBA Slic3r::GUI::SELECTED_DOWEL_COLOR = ColorRGBA::DARK_GRAY()
static

◆ SELECTED_PLAG_COLOR

const ColorRGBA Slic3r::GUI::SELECTED_PLAG_COLOR = ColorRGBA::GRAY()
static

◆ SEND_SYSTEM_INFO_DOMAIN

const std::string Slic3r::GUI::SEND_SYSTEM_INFO_DOMAIN = "prusa3d.com"
static

◆ SEND_SYSTEM_INFO_URL

const std::string Slic3r::GUI::SEND_SYSTEM_INFO_URL = "https://files." + SEND_SYSTEM_INFO_DOMAIN + "/wp-json/v1/ps"
static

◆ sep

◆ sep_space

const wxString Slic3r::GUI::sep_space = ""
static

◆ SnapRegionsCount

const unsigned int Slic3r::GUI::SnapRegionsCount = 8

◆ TEXT_VOLUME_ICONS

const constexpr std::array<std::pair<const char *, const char *>, 3> Slic3r::GUI::TEXT_VOLUME_ICONS
staticconstexpr
Initial value:
{{
{L("Add text"), "add_text_part"},
{L("Add negative text"), "add_text_negative" },
{L("Add text modifier"), "add_text_modifier"},
}}

Referenced by Slic3r::GUI::MenuFactory::get_text_volume_bitmaps().

◆ TOP_LABELS

std::map<Preset::Type, std::string> Slic3r::GUI::TOP_LABELS
static
Initial value:
=
{
{ Preset::Type::TYPE_PRINT, L("Save print settings as") },
{ Preset::Type::TYPE_SLA_PRINT, L("Save print settings as") },
{ Preset::Type::TYPE_FILAMENT, L("Save filament settings as")},
{ Preset::Type::TYPE_SLA_MATERIAL, L("Save material settings as")},
{ Preset::Type::TYPE_PRINTER, L("Save printer settings as") },
}

Referenced by Slic3r::GUI::SavePresetDialog::Item::Item().

◆ TRIANGLE_BASE

const float Slic3r::GUI::TRIANGLE_BASE = 10.0f
static

◆ TRIANGLE_HEIGHT

const float Slic3r::GUI::TRIANGLE_HEIGHT = TRIANGLE_BASE * 1.618033f
static

◆ type_icon_names

const std::map<Preset::Type, std::string> Slic3r::GUI::type_icon_names
static
Initial value:
= {
{Preset::TYPE_PRINT, "cog" },
{Preset::TYPE_SLA_PRINT, "cog" },
{Preset::TYPE_FILAMENT, "spool" },
{Preset::TYPE_SLA_MATERIAL, "resin" },
{Preset::TYPE_PRINTER, "printer" },
}

Referenced by get_icon_name().

◆ UndefFloat

const float Slic3r::GUI::UndefFloat = -999.f

◆ UndefLabel

const std::string Slic3r::GUI::UndefLabel = " "

◆ UPPER_PART_COLOR

◆ URL_CHANGELOG

const char* Slic3r::GUI::URL_CHANGELOG = "https://files.prusa3d.com/?latest=slicer-stable&lng=%1%"
static

◆ URL_DEV

const char* Slic3r::GUI::URL_DEV = "https://github.com/prusa3d/PrusaSlicer/releases/tag/version_%1%"
static

◆ URL_DOWNLOAD

const char* Slic3r::GUI::URL_DOWNLOAD = "https://www.prusa3d.com/slicerweb&lng=%1%"
static

◆ VOLUME_RAYCASTERS_BASE_ID

◆ WarningIcon

◆ WarningManifoldIcon

constexpr char Slic3r::GUI::WarningManifoldIcon[] = "exclamation_manifold"
staticconstexpr