2018-06-13 14:39:33 +00:00
|
|
|
#ifndef slic3r_GUI_ObjectParts_hpp_
|
|
|
|
#define slic3r_GUI_ObjectParts_hpp_
|
|
|
|
|
2018-06-15 23:21:25 +00:00
|
|
|
class wxWindow;
|
|
|
|
class wxSizer;
|
|
|
|
class wxBoxSizer;
|
|
|
|
class wxString;
|
|
|
|
class wxArrayString;
|
2018-07-23 15:35:50 +00:00
|
|
|
class wxMenu;
|
2018-08-13 08:30:36 +00:00
|
|
|
class wxDataViewEvent;
|
2018-08-15 08:09:05 +00:00
|
|
|
class wxKeyEvent;
|
2018-09-17 13:12:13 +00:00
|
|
|
class wxGLCanvas;
|
|
|
|
class wxBitmap;
|
2018-06-15 23:21:25 +00:00
|
|
|
|
|
|
|
namespace Slic3r {
|
|
|
|
class ModelObject;
|
2018-07-24 10:15:36 +00:00
|
|
|
class Model;
|
2018-06-15 23:21:25 +00:00
|
|
|
|
|
|
|
namespace GUI {
|
2018-09-17 13:12:13 +00:00
|
|
|
//class wxGLCanvas;
|
2018-06-15 23:21:25 +00:00
|
|
|
|
|
|
|
enum ogGroup{
|
|
|
|
ogFrequentlyChangingParameters,
|
|
|
|
ogFrequentlyObjectSettings,
|
2018-07-23 15:35:50 +00:00
|
|
|
ogCurrentSettings
|
|
|
|
// ogObjectSettings,
|
|
|
|
// ogObjectMovers,
|
|
|
|
// ogPartSettings
|
2018-06-15 23:21:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum LambdaTypeIDs{
|
|
|
|
LambdaTypeBox,
|
|
|
|
LambdaTypeCylinder,
|
|
|
|
LambdaTypeSphere,
|
|
|
|
LambdaTypeSlab
|
|
|
|
};
|
|
|
|
|
|
|
|
struct OBJECT_PARAMETERS
|
2018-06-13 14:39:33 +00:00
|
|
|
{
|
2018-06-15 23:21:25 +00:00
|
|
|
LambdaTypeIDs type = LambdaTypeBox;
|
|
|
|
double dim[3];// = { 1.0, 1.0, 1.0 };
|
|
|
|
int cyl_r = 1;
|
|
|
|
int cyl_h = 1;
|
|
|
|
double sph_rho = 1.0;
|
|
|
|
double slab_h = 1.0;
|
|
|
|
double slab_z = 0.0;
|
|
|
|
};
|
|
|
|
|
2018-09-17 13:12:13 +00:00
|
|
|
typedef std::map<std::string, wxBitmap> t_category_icon;
|
|
|
|
inline t_category_icon& get_category_icon();
|
|
|
|
|
2018-06-15 23:21:25 +00:00
|
|
|
void add_collapsible_panes(wxWindow* parent, wxBoxSizer* sizer);
|
2018-07-04 06:54:30 +00:00
|
|
|
void add_objects_list(wxWindow* parent, wxBoxSizer* sizer);
|
2018-07-04 12:52:36 +00:00
|
|
|
void add_object_settings(wxWindow* parent, wxBoxSizer* sizer);
|
2018-06-15 23:21:25 +00:00
|
|
|
void show_collpane_settings(bool expert_mode);
|
|
|
|
|
2018-07-23 15:35:50 +00:00
|
|
|
wxMenu *create_add_settings_popupmenu(bool is_part);
|
|
|
|
wxMenu *create_add_part_popupmenu();
|
2018-07-31 13:31:12 +00:00
|
|
|
wxMenu *create_part_settings_popupmenu();
|
2018-07-23 15:35:50 +00:00
|
|
|
|
2018-06-15 23:21:25 +00:00
|
|
|
// Add object to the list
|
|
|
|
//void add_object(const std::string &name);
|
|
|
|
void add_object_to_list(const std::string &name, ModelObject* model_object);
|
|
|
|
// Delete object from the list
|
|
|
|
void delete_object_from_list();
|
|
|
|
// Delete all objects from the list
|
|
|
|
void delete_all_objects_from_list();
|
|
|
|
// Set count of object on c++ side
|
|
|
|
void set_object_count(int idx, int count);
|
|
|
|
// Unselect all objects in the list on c++ side
|
|
|
|
void unselect_objects();
|
|
|
|
// Select current object in the list on c++ side
|
|
|
|
void select_current_object(int idx);
|
2018-09-17 13:12:13 +00:00
|
|
|
// Select current volume in the list on c++ side
|
|
|
|
void select_current_volume(int idx, int vol_idx);
|
2018-07-04 06:54:30 +00:00
|
|
|
// Remove objects/sub-object from the list
|
|
|
|
void remove();
|
2018-06-15 23:21:25 +00:00
|
|
|
|
2018-06-19 14:24:49 +00:00
|
|
|
void object_ctrl_selection_changed();
|
2018-07-04 06:54:30 +00:00
|
|
|
void object_ctrl_context_menu();
|
2018-08-15 08:09:05 +00:00
|
|
|
void object_ctrl_key_event(wxKeyEvent& event);
|
|
|
|
void object_ctrl_item_value_change(wxDataViewEvent& event);
|
|
|
|
void show_context_menu();
|
2018-09-17 13:12:13 +00:00
|
|
|
bool is_splittable_object(const bool split_part);
|
2018-06-19 14:24:49 +00:00
|
|
|
|
2018-06-18 12:20:29 +00:00
|
|
|
void init_mesh_icons();
|
2018-06-15 23:21:25 +00:00
|
|
|
void set_event_object_selection_changed(const int& event);
|
2018-07-04 06:54:30 +00:00
|
|
|
void set_event_object_settings_changed(const int& event);
|
|
|
|
void set_event_remove_object(const int& event);
|
2018-07-26 08:59:03 +00:00
|
|
|
void set_event_update_scene(const int& event);
|
2018-07-24 10:15:36 +00:00
|
|
|
void set_objects_from_model(Model &model);
|
2018-06-15 23:21:25 +00:00
|
|
|
|
2018-06-14 13:33:42 +00:00
|
|
|
bool is_parts_changed();
|
|
|
|
bool is_part_settings_changed();
|
|
|
|
|
2018-09-17 13:12:13 +00:00
|
|
|
void load_part( ModelObject* model_object,
|
2018-06-14 21:31:15 +00:00
|
|
|
wxArrayString& part_names, const bool is_modifier);
|
|
|
|
|
2018-09-17 13:12:13 +00:00
|
|
|
void load_lambda( ModelObject* model_object,
|
|
|
|
wxArrayString& part_names, const bool is_modifier);
|
|
|
|
void load_lambda( const std::string& type_name);
|
2018-06-14 21:31:15 +00:00
|
|
|
|
2018-09-17 13:12:13 +00:00
|
|
|
void on_btn_load(bool is_modifier = false, bool is_lambda = false);
|
2018-06-18 13:26:09 +00:00
|
|
|
void on_btn_del();
|
2018-07-31 13:31:12 +00:00
|
|
|
void on_btn_split(const bool split_part);
|
2018-06-18 13:26:09 +00:00
|
|
|
void on_btn_move_up();
|
|
|
|
void on_btn_move_down();
|
2018-06-14 21:31:15 +00:00
|
|
|
|
2018-06-14 19:48:06 +00:00
|
|
|
void parts_changed(int obj_idx);
|
2018-06-18 12:20:29 +00:00
|
|
|
void part_selection_changed();
|
2018-07-04 06:54:30 +00:00
|
|
|
|
2018-07-29 10:19:08 +00:00
|
|
|
void update_settings_value();
|
2018-07-04 06:54:30 +00:00
|
|
|
// show/hide "Extruder" column for Objects List
|
|
|
|
void set_extruder_column_hidden(bool hide);
|
2018-07-27 10:26:14 +00:00
|
|
|
// update extruder in current config
|
|
|
|
void update_extruder_in_config(const wxString& selection);
|
2018-09-05 14:22:48 +00:00
|
|
|
// update position values displacements or "gizmos"
|
2018-09-05 13:09:13 +00:00
|
|
|
void update_position_values();
|
2018-09-05 14:22:48 +00:00
|
|
|
void update_position_values(const Vec3d& position);
|
2018-07-29 10:19:08 +00:00
|
|
|
// update scale values after scale unit changing or "gizmos"
|
|
|
|
void update_scale_values();
|
2018-09-05 14:22:48 +00:00
|
|
|
void update_scale_values(double scaling_factor);
|
2018-07-30 08:48:40 +00:00
|
|
|
// update rotation values object selection changing
|
|
|
|
void update_rotation_values();
|
|
|
|
// update rotation value after "gizmos"
|
2018-09-05 14:22:48 +00:00
|
|
|
void update_rotation_value(double angle, Axis axis);
|
2018-09-20 13:00:40 +00:00
|
|
|
#if ENABLE_MODELINSTANCE_3D_ROTATION
|
|
|
|
void update_rotation_value(const Vec3d& rotation);
|
|
|
|
#endif // ENABLE_MODELINSTANCE_3D_ROTATION
|
2018-08-28 13:51:53 +00:00
|
|
|
void set_uniform_scaling(const bool uniform_scale);
|
2018-07-30 10:17:32 +00:00
|
|
|
|
2018-08-13 08:30:36 +00:00
|
|
|
void on_begin_drag(wxDataViewEvent &event);
|
|
|
|
void on_drop_possible(wxDataViewEvent &event);
|
|
|
|
void on_drop(wxDataViewEvent &event);
|
|
|
|
|
2018-08-15 09:18:20 +00:00
|
|
|
// update extruder column for objects_ctrl according to extruders count
|
2018-08-24 14:56:42 +00:00
|
|
|
void update_objects_list_extruder_column(int extruders_count);
|
2018-08-15 09:18:20 +00:00
|
|
|
|
2018-09-17 13:12:13 +00:00
|
|
|
// Create/Update/Reset double slider on 3dPreview
|
|
|
|
void create_double_slider(wxWindow* parent, wxBoxSizer* sizer, wxGLCanvas* canvas);
|
|
|
|
void update_double_slider(bool force_sliders_full_range);
|
|
|
|
void reset_double_slider();
|
|
|
|
// update DoubleSlider after keyDown in canvas
|
|
|
|
void update_double_slider_from_canvas(wxKeyEvent& event);
|
|
|
|
|
|
|
|
void show_manipulation_sizer(const bool is_simple_mode);
|
|
|
|
|
2018-06-13 14:39:33 +00:00
|
|
|
} //namespace GUI
|
|
|
|
} //namespace Slic3r
|
|
|
|
#endif //slic3r_GUI_ObjectParts_hpp_
|