Merged with dev

This commit is contained in:
bubnikv 2018-09-12 11:59:02 +02:00
commit 0235f1a821
1491 changed files with 514153 additions and 29226 deletions

29
xs/xsp/AppController.xsp Normal file
View file

@ -0,0 +1,29 @@
%module{Slic3r::XS};
%{
#include <xsinit.h>
#include "slic3r/AppController.hpp"
#include "libslic3r/Model.hpp"
#include "libslic3r/Print.hpp"
#include "slic3r/GUI/ProgressStatusBar.hpp"
%}
%name{Slic3r::PrintController} class PrintController {
PrintController(Print *print);
void slice_to_png();
void slice();
};
%name{Slic3r::AppController} class AppController {
AppController();
PrintController *print_ctl();
void set_model(Model *model);
void set_print(Print *print);
void set_global_progress_indicator(ProgressStatusBar *prs);
void arrange_model();
};

View file

@ -25,11 +25,15 @@
double radius();
Clone<Point> min_point() %code{% RETVAL = THIS->min; %};
Clone<Point> max_point() %code{% RETVAL = THIS->max; %};
int x_min() %code{% RETVAL = THIS->min.x; %};
int x_max() %code{% RETVAL = THIS->max.x; %};
int y_min() %code{% RETVAL = THIS->min.y; %};
int y_max() %code{% RETVAL = THIS->max.y; %};
std::string serialize() %code{% char buf[2048]; sprintf(buf, "%ld,%ld;%ld,%ld", THIS->min.x, THIS->min.y, THIS->max.x, THIS->max.y); RETVAL = buf; %};
int x_min() %code{% RETVAL = THIS->min(0); %};
int x_max() %code{% RETVAL = THIS->max(0); %};
int y_min() %code{% RETVAL = THIS->min(1); %};
int y_max() %code{% RETVAL = THIS->max(1); %};
void set_x_min(double val) %code{% THIS->min(0) = val; %};
void set_x_max(double val) %code{% THIS->max(0) = val; %};
void set_y_min(double val) %code{% THIS->min(1) = val; %};
void set_y_max(double val) %code{% THIS->max(1) = val; %};
std::string serialize() %code{% char buf[2048]; sprintf(buf, "%ld,%ld;%ld,%ld", THIS->min(0), THIS->min(1), THIS->max(0), THIS->max(1)); RETVAL = buf; %};
bool defined() %code{% RETVAL = THIS->defined; %};
%{
@ -52,24 +56,24 @@ new_from_points(CLASS, points)
Clone<BoundingBoxf> clone()
%code{% RETVAL = THIS; %};
void merge(BoundingBoxf* bb) %code{% THIS->merge(*bb); %};
void merge_point(Pointf* point) %code{% THIS->merge(*point); %};
void merge_point(Vec2d* point) %code{% THIS->merge(*point); %};
void scale(double factor);
void translate(double x, double y);
Clone<Pointf> size();
Clone<Pointf> center();
Clone<Vec2d> size();
Clone<Vec2d> center();
double radius();
bool empty() %code{% RETVAL = empty(*THIS); %};
Clone<Pointf> min_point() %code{% RETVAL = THIS->min; %};
Clone<Pointf> max_point() %code{% RETVAL = THIS->max; %};
double x_min() %code{% RETVAL = THIS->min.x; %};
double x_max() %code{% RETVAL = THIS->max.x; %};
double y_min() %code{% RETVAL = THIS->min.y; %};
double y_max() %code{% RETVAL = THIS->max.y; %};
void set_x_min(double val) %code{% THIS->min.x = val; %};
void set_x_max(double val) %code{% THIS->max.x = val; %};
void set_y_min(double val) %code{% THIS->min.y = val; %};
void set_y_max(double val) %code{% THIS->max.y = val; %};
std::string serialize() %code{% char buf[2048]; sprintf(buf, "%lf,%lf;%lf,%lf", THIS->min.x, THIS->min.y, THIS->max.x, THIS->max.y); RETVAL = buf; %};
Clone<Vec2d> min_point() %code{% RETVAL = THIS->min; %};
Clone<Vec2d> max_point() %code{% RETVAL = THIS->max; %};
double x_min() %code{% RETVAL = THIS->min(0); %};
double x_max() %code{% RETVAL = THIS->max(0); %};
double y_min() %code{% RETVAL = THIS->min(1); %};
double y_max() %code{% RETVAL = THIS->max(1); %};
void set_x_min(double val) %code{% THIS->min(0) = val; %};
void set_x_max(double val) %code{% THIS->max(0) = val; %};
void set_y_min(double val) %code{% THIS->min(1) = val; %};
void set_y_max(double val) %code{% THIS->max(1) = val; %};
std::string serialize() %code{% char buf[2048]; sprintf(buf, "%lf,%lf;%lf,%lf", THIS->min(0), THIS->min(1), THIS->max(0), THIS->max(1)); RETVAL = buf; %};
bool defined() %code{% RETVAL = THIS->defined; %};
%{
@ -92,23 +96,23 @@ new_from_points(CLASS, points)
Clone<BoundingBoxf3> clone()
%code{% RETVAL = THIS; %};
void merge(BoundingBoxf3* bb) %code{% THIS->merge(*bb); %};
void merge_point(Pointf3* point) %code{% THIS->merge(*point); %};
void merge_point(Vec3d* point) %code{% THIS->merge(*point); %};
void scale(double factor);
void translate(double x, double y, double z);
void offset(double delta);
bool contains_point(Pointf3* point) %code{% RETVAL = THIS->contains(*point); %};
Clone<Pointf3> size();
Clone<Pointf3> center();
bool contains_point(Vec3d* point) %code{% RETVAL = THIS->contains(*point); %};
Clone<Vec3d> size();
Clone<Vec3d> center();
double radius();
bool empty() %code{% RETVAL = empty(*THIS); %};
Clone<Pointf3> min_point() %code{% RETVAL = THIS->min; %};
Clone<Pointf3> max_point() %code{% RETVAL = THIS->max; %};
double x_min() %code{% RETVAL = THIS->min.x; %};
double x_max() %code{% RETVAL = THIS->max.x; %};
double y_min() %code{% RETVAL = THIS->min.y; %};
double y_max() %code{% RETVAL = THIS->max.y; %};
double z_min() %code{% RETVAL = THIS->min.z; %};
double z_max() %code{% RETVAL = THIS->max.z; %};
std::string serialize() %code{% char buf[2048]; sprintf(buf, "%lf,%lf,%lf;%lf,%lf,%lf", THIS->min.x, THIS->min.y, THIS->min.z, THIS->max.x, THIS->max.y, THIS->max.z); RETVAL = buf; %};
Clone<Vec3d> min_point() %code{% RETVAL = THIS->min; %};
Clone<Vec3d> max_point() %code{% RETVAL = THIS->max; %};
double x_min() %code{% RETVAL = THIS->min(0); %};
double x_max() %code{% RETVAL = THIS->max(0); %};
double y_min() %code{% RETVAL = THIS->min(1); %};
double y_max() %code{% RETVAL = THIS->max(1); %};
double z_min() %code{% RETVAL = THIS->min(2); %};
double z_max() %code{% RETVAL = THIS->max(2); %};
std::string serialize() %code{% char buf[2048]; sprintf(buf, "%lf,%lf,%lf;%lf,%lf,%lf", THIS->min(0), THIS->min(1), THIS->min(2), THIS->max(0), THIS->max(1), THIS->max(2)); RETVAL = buf; %};
bool defined() %code{% RETVAL = THIS->defined; %};
};

View file

@ -74,13 +74,13 @@
static StaticPrintConfig* new_GCodeConfig()
%code{% RETVAL = new GCodeConfig(); %};
static StaticPrintConfig* new_PrintConfig()
%code{% RETVAL = new PrintConfig(); %};
%code{% RETVAL = static_cast<GCodeConfig*>(new PrintConfig()); %};
static StaticPrintConfig* new_PrintObjectConfig()
%code{% RETVAL = new PrintObjectConfig(); %};
static StaticPrintConfig* new_PrintRegionConfig()
%code{% RETVAL = new PrintRegionConfig(); %};
static StaticPrintConfig* new_FullPrintConfig()
%code{% RETVAL = static_cast<PrintObjectConfig*>(new FullPrintConfig()); %};
%code{% RETVAL = static_cast<GCodeConfig*>(new FullPrintConfig()); %};
~StaticPrintConfig();
bool has(t_config_option_key opt_key);
SV* as_hash()
@ -119,7 +119,7 @@
auto config = new FullPrintConfig();
try {
config->load(path);
RETVAL = static_cast<PrintObjectConfig*>(config);
RETVAL = static_cast<GCodeConfig*>(config);
} catch (std::exception& e) {
delete config;
croak("Error extracting configuration from %s:\n%s\n", path, e.what());

View file

@ -23,7 +23,7 @@
try {
THIS->do_export(print, path);
} catch (std::exception& e) {
croak(e.what());
croak("%s\n", e.what());
}
%};
void do_export_w_preview(Print *print, const char *path, GCodePreviewData *preview_data)
@ -31,13 +31,13 @@
try {
THIS->do_export(print, path, preview_data);
} catch (std::exception& e) {
croak(e.what());
croak("%s\n", e.what());
}
%};
Ref<Pointf> origin()
Ref<Vec2d> origin()
%code{% RETVAL = &(THIS->origin()); %};
void set_origin(Pointf* pointf)
void set_origin(Vec2d* pointf)
%code{% THIS->set_origin(*pointf); %};
Ref<Point> last_pos()
%code{% RETVAL = &(THIS->last_pos()); %};

View file

@ -4,11 +4,16 @@
#include <xsinit.h>
#include "slic3r/GUI/GUI.hpp"
#include "slic3r/Utils/ASCIIFolding.hpp"
#include "slic3r/Utils/FixModelByWin10.hpp"
#include "slic3r/Utils/Serial.hpp"
%}
%package{Slic3r::GUI};
void about()
%code{% Slic3r::GUI::about(); %};
void disable_screensaver()
%code{% Slic3r::GUI::disable_screensaver(); %};
@ -16,7 +21,7 @@ void enable_screensaver()
%code{% Slic3r::GUI::enable_screensaver(); %};
std::vector<std::string> scan_serial_ports()
%code{% RETVAL=Slic3r::GUI::scan_serial_ports(); %};
%code{% RETVAL=Slic3r::Utils::scan_serial_ports(); %};
bool debugged()
%code{% RETVAL=Slic3r::GUI::debugged(); %};
@ -24,6 +29,9 @@ bool debugged()
void break_to_debugger()
%code{% Slic3r::GUI::break_to_debugger(); %};
bool is_windows10()
%code{% RETVAL=Slic3r::is_windows10(); %};
void set_wxapp(SV *ui)
%code%{ Slic3r::GUI::set_wxapp((wxApp*)wxPli_sv_2_object(aTHX_ ui, "Wx::App")); %};
@ -35,14 +43,17 @@ void set_tab_panel(SV *ui)
void set_plater(SV *ui)
%code%{ Slic3r::GUI::set_plater((wxPanel*)wxPli_sv_2_object(aTHX_ ui, "Wx::Panel")); %};
void add_debug_menu(SV *ui, int event_language_change)
%code%{ Slic3r::GUI::add_debug_menu((wxMenuBar*)wxPli_sv_2_object(aTHX_ ui, "Wx::MenuBar"), event_language_change); %};
void add_menus(SV *ui, int event_preferences_changed, int event_language_change)
%code%{ Slic3r::GUI::add_menus((wxMenuBar*)wxPli_sv_2_object(aTHX_ ui, "Wx::MenuBar"), event_preferences_changed, event_language_change); %};
void create_preset_tabs(bool no_controller, int event_value_change, int event_presets_changed)
%code%{ Slic3r::GUI::create_preset_tabs(no_controller, event_value_change, event_presets_changed); %};
Ref<TabIface> get_preset_tab(char *name)
void show_error_id(int id, std::string msg)
%code%{ Slic3r::GUI::show_error_id(id, msg); %};
TabIface* get_preset_tab(char *name)
%code%{ RETVAL=Slic3r::GUI::get_preset_tab_iface(name); %};
bool load_language()
@ -57,12 +68,23 @@ int combochecklist_get_flags(SV *ui)
void set_app_config(AppConfig *app_config)
%code%{ Slic3r::GUI::set_app_config(app_config); %};
bool check_unsaved_changes()
%code%{ RETVAL=Slic3r::GUI::check_unsaved_changes(); %};
bool config_wizard_startup(int app_config_exists)
%code%{
RETVAL=Slic3r::GUI::config_wizard_startup(app_config_exists != 0);
%};
void open_preferences_dialog(int preferences_event)
%code%{ Slic3r::GUI::open_preferences_dialog(preferences_event); %};
void set_preset_bundle(PresetBundle *preset_bundle)
%code%{ Slic3r::GUI::set_preset_bundle(preset_bundle); %};
void set_preset_updater(PresetUpdater* updater)
%code%{ Slic3r::GUI::set_preset_updater(updater); %};
void add_frequently_changed_parameters(SV *ui_parent, SV *ui_sizer, SV *ui_p_sizer)
%code%{ Slic3r::GUI::add_frequently_changed_parameters((wxWindow*)wxPli_sv_2_object(aTHX_ ui_parent, "Wx::Window"),
(wxBoxSizer*)wxPli_sv_2_object(aTHX_ ui_sizer, "Wx::BoxSizer"),
@ -71,5 +93,99 @@ void add_frequently_changed_parameters(SV *ui_parent, SV *ui_sizer, SV *ui_p_siz
void set_print_callback_event(Print *print, int id)
%code%{ Slic3r::GUI::set_print_callback_event(print, id); %};
void add_expert_mode_part( SV *ui_parent, SV *ui_sizer,
Model *model,
int event_object_selection_changed,
int event_object_settings_changed,
int event_remove_object,
int event_update_scene)
%code%{ Slic3r::GUI::add_expert_mode_part( (wxWindow*)wxPli_sv_2_object(aTHX_ ui_parent, "Wx::Window"),
(wxBoxSizer*)wxPli_sv_2_object(aTHX_ ui_sizer, "Wx::BoxSizer"),
*model,
event_object_selection_changed,
event_object_settings_changed,
event_remove_object,
event_update_scene); %};
void set_objects_from_perl( SV *ui_parent,
SV *frequently_changed_parameters_sizer,
SV *expert_mode_part_sizer,
SV *scrolled_window_sizer,
SV *btn_export_gcode,
SV *btn_export_stl,
SV *btn_reslice,
SV *btn_print,
SV *btn_send_gcode,
SV *manifold_warning_icon)
%code%{ Slic3r::GUI::set_objects_from_perl(
(wxWindow *)wxPli_sv_2_object(aTHX_ ui_parent, "Wx::Window"),
(wxBoxSizer *)wxPli_sv_2_object(aTHX_ frequently_changed_parameters_sizer, "Wx::BoxSizer"),
(wxBoxSizer *)wxPli_sv_2_object(aTHX_ expert_mode_part_sizer, "Wx::BoxSizer"),
(wxBoxSizer *)wxPli_sv_2_object(aTHX_ scrolled_window_sizer, "Wx::BoxSizer"),
(wxButton *)wxPli_sv_2_object(aTHX_ btn_export_gcode, "Wx::Button"),
(wxButton *)wxPli_sv_2_object(aTHX_ btn_export_stl, "Wx::Button"),
(wxButton *)wxPli_sv_2_object(aTHX_ btn_reslice, "Wx::Button"),
(wxButton *)wxPli_sv_2_object(aTHX_ btn_print, "Wx::Button"),
(wxButton *)wxPli_sv_2_object(aTHX_ btn_send_gcode, "Wx::Button"),
(wxStaticBitmap *)wxPli_sv_2_object(aTHX_ manifold_warning_icon, "Wx::StaticBitmap")); %};
void set_show_print_info(bool show)
%code%{ Slic3r::GUI::set_show_print_info(show); %};
void set_show_manifold_warning_icon(bool show)
%code%{ Slic3r::GUI::set_show_manifold_warning_icon(show); %};
void update_mode()
%code%{ Slic3r::GUI::update_mode(); %};
void add_object_to_list(const char *name, SV *object_model)
%code%{ Slic3r::GUI::add_object_to_list(
name,
(ModelObject *)wxPli_sv_2_object(aTHX_ object_model, "Slic3r::Model::Object") ); %};
void delete_object_from_list()
%code%{ Slic3r::GUI::delete_object_from_list(); %};
void delete_all_objects_from_list()
%code%{ Slic3r::GUI::delete_all_objects_from_list(); %};
void set_object_count(int idx, int count)
%code%{ Slic3r::GUI::set_object_count(idx, count); %};
void unselect_objects()
%code%{ Slic3r::GUI::unselect_objects(); %};
void select_current_object(int idx)
%code%{ Slic3r::GUI::select_current_object(idx); %};
void remove_obj()
%code%{ Slic3r::GUI::remove(); %};
std::string fold_utf8_to_ascii(const char *src)
%code%{ RETVAL = Slic3r::fold_utf8_to_ascii(src); %};
void add_export_option(SV *ui, std::string format)
%code%{ Slic3r::GUI::add_export_option((wxFileDialog*)wxPli_sv_2_object(aTHX_ ui, "Wx::FileDialog"), format); %};
int get_export_option(SV *ui)
%code%{ RETVAL = Slic3r::GUI::get_export_option((wxFileDialog*)wxPli_sv_2_object(aTHX_ ui, "Wx::FileDialog")); %};
void desktop_open_datadir_folder()
%code%{ Slic3r::GUI::desktop_open_datadir_folder(); %};
void fix_model_by_win10_sdk_gui(ModelObject *model_object_src, Print *print, Model *model_dst)
%code%{ Slic3r::fix_model_by_win10_sdk_gui(*model_object_src, *print, *model_dst); %};
void set_3DScene(SV *scene)
%code%{ Slic3r::GUI::set_3DScene((_3DScene *)wxPli_sv_2_object(aTHX_ scene, "Slic3r::Model::3DScene") ); %};
void register_on_request_update_callback(SV* callback)
%code%{ Slic3r::GUI::g_on_request_update_callback.register_callback(callback); %};
void deregister_on_request_update_callback()
%code%{ Slic3r::GUI::g_on_request_update_callback.deregister_callback(); %};
//void create_double_slider(SV *ui_parent, SV *ui_ds)
// %code%{ Slic3r::GUI::create_double_slider( (wxWindow*)wxPli_sv_2_object(aTHX_ ui_parent, "Wx::Window"),
// (wxControl*)wxPli_sv_2_object(aTHX_ ui_ds, "Wx::Control")); %};

View file

@ -8,7 +8,8 @@
GLShader();
~GLShader();
bool load(const char *fragment_shader, const char *vertex_shader);
bool load_from_text(const char *fragment_shader, const char *vertex_shader);
bool load_from_file(const char *fragment_shader, const char *vertex_shader);
void release();
int get_attrib_location(const char *name) const;
@ -54,13 +55,12 @@
int object_idx() const;
int volume_idx() const;
int instance_idx() const;
Clone<Pointf3> origin() const
%code%{ RETVAL = THIS->origin; %};
Clone<Vec3d> origin() const
%code%{ RETVAL = THIS->get_offset(); %};
void translate(double x, double y, double z)
%code%{ THIS->origin.translate(x, y, z); %};
%code%{ THIS->set_offset(THIS->get_offset() + Vec3d(x, y, z)); %};
Clone<BoundingBoxf3> bounding_box() const
%code%{ RETVAL = THIS->bounding_box; %};
Clone<BoundingBoxf3> transformed_bounding_box() const;
bool empty() const;
bool indexed() const;
@ -84,7 +84,7 @@
std::vector<int> load_object(ModelObject *object, int obj_idx, std::vector<int> instance_idxs, std::string color_by, std::string select_by, std::string drag_by, bool use_VBOs);
int load_wipe_tower_preview(int obj_idx, float pos_x, float pos_y, float width, float depth, float height, bool use_VBOs);
int load_wipe_tower_preview(int obj_idx, float pos_x, float pos_y, float width, float depth, float height, float rotation_angle, bool use_VBOs, bool size_unknown, float brim_width);
void erase()
%code{% THIS->clear(); %};
@ -92,10 +92,6 @@
int count()
%code{% RETVAL = THIS->volumes.size(); %};
std::vector<double> get_current_print_zs()
%code{% RETVAL = THIS->get_current_print_zs(); %};
void set_range(double low, double high);
void render_VBOs() const;
@ -104,7 +100,9 @@
void release_geometry();
void set_print_box(float min_x, float min_y, float min_z, float max_x, float max_y, float max_z);
void update_outside_state(DynamicPrintConfig* config, bool all_inside);
void reset_outside_state();
void update_colors_by_extruder(DynamicPrintConfig* config);
bool move_volume_up(int idx)
%code%{
@ -150,104 +148,655 @@ GLVolumeCollection::arrayref()
%package{Slic3r::GUI::_3DScene};
%{
std::string
get_gl_info(format_as_html, extensions)
bool format_as_html;
bool extensions;
CODE:
RETVAL = _3DScene::get_gl_info(format_as_html, extensions);
OUTPUT:
RETVAL
bool
use_VBOs()
CODE:
RETVAL = _3DScene::use_VBOs();
OUTPUT:
RETVAL
bool
add_canvas(canvas)
SV *canvas;
CODE:
RETVAL = _3DScene::add_canvas((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"));
OUTPUT:
RETVAL
bool
remove_canvas(canvas)
SV *canvas;
CODE:
RETVAL = _3DScene::remove_canvas((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"));
OUTPUT:
RETVAL
void
_glew_init()
remove_all_canvases()
CODE:
_3DScene::_glew_init();
_3DScene::remove_all_canvases();
void
set_as_dirty(canvas)
SV *canvas;
CODE:
_3DScene::set_as_dirty((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"));
unsigned int
finalize_legend_texture()
get_volumes_count(canvas)
SV *canvas;
CODE:
RETVAL = _3DScene::finalize_legend_texture();
RETVAL = _3DScene::get_volumes_count((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"));
OUTPUT:
RETVAL
unsigned int
get_legend_texture_width()
void
reset_volumes(canvas)
SV *canvas;
CODE:
RETVAL = _3DScene::get_legend_texture_width();
_3DScene::reset_volumes((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"));
void
deselect_volumes(canvas)
SV *canvas;
CODE:
_3DScene::deselect_volumes((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"));
void
select_volume(canvas, id)
SV *canvas;
unsigned int id;
CODE:
_3DScene::select_volume((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), id);
void
update_volumes_selection(canvas, selections)
SV *canvas;
std::vector<int> selections;
CODE:
_3DScene::update_volumes_selection((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), selections);
int
check_volumes_outside_state(canvas, config)
SV *canvas;
DynamicPrintConfig *config;
CODE:
RETVAL = _3DScene::check_volumes_outside_state((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), config);
OUTPUT:
RETVAL
unsigned int
get_legend_texture_height()
bool
move_volume_up(canvas, id)
SV *canvas;
unsigned int id;
CODE:
RETVAL = _3DScene::get_legend_texture_height();
RETVAL = _3DScene::move_volume_up((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), id);
OUTPUT:
RETVAL
bool
move_volume_down(canvas, id)
SV *canvas;
unsigned int id;
CODE:
RETVAL = _3DScene::move_volume_down((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), id);
OUTPUT:
RETVAL
void
set_objects_selections(canvas, selections)
SV *canvas;
std::vector<int> selections;
CODE:
_3DScene::set_objects_selections((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), selections);
void
set_config(canvas, config)
SV *canvas;
DynamicPrintConfig *config;
CODE:
_3DScene::set_config((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), config);
void
set_print(canvas, print)
SV *canvas;
Print *print;
CODE:
_3DScene::set_print((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), print);
void
set_model(canvas, model)
SV *canvas;
Model *model;
CODE:
_3DScene::set_model((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), model);
void
set_bed_shape(canvas, shape)
SV *canvas;
Pointfs shape;
CODE:
_3DScene::set_bed_shape((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), shape);
void
set_auto_bed_shape(canvas)
SV *canvas;
CODE:
_3DScene::set_auto_bed_shape((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"));
Clone<BoundingBoxf3>
get_volumes_bounding_box(canvas)
SV *canvas;
CODE:
RETVAL = _3DScene::get_volumes_bounding_box((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"));
OUTPUT:
RETVAL
void
set_axes_length(canvas, length)
SV *canvas;
float length;
CODE:
_3DScene::set_axes_length((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), length);
void
set_cutting_plane(canvas, z, polygons)
SV *canvas;
float z;
ExPolygons polygons;
CODE:
_3DScene::set_cutting_plane((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), z, polygons);
void
set_color_by(canvas, value)
SV *canvas;
std::string value;
CODE:
_3DScene::set_color_by((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), value);
void
set_select_by(canvas, value)
SV *canvas;
std::string value;
CODE:
_3DScene::set_select_by((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), value);
void
set_drag_by(canvas, value)
SV *canvas;
std::string value;
CODE:
_3DScene::set_drag_by((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), value);
std::string
get_select_by(canvas)
SV *canvas;
CODE:
RETVAL = _3DScene::get_select_by((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"));
OUTPUT:
RETVAL
bool
is_layers_editing_enabled(canvas)
SV *canvas;
CODE:
RETVAL = _3DScene::is_layers_editing_enabled((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"));
OUTPUT:
RETVAL
bool
is_layers_editing_allowed(canvas)
SV *canvas;
CODE:
RETVAL = _3DScene::is_layers_editing_allowed((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"));
OUTPUT:
RETVAL
bool
is_shader_enabled(canvas)
SV *canvas;
CODE:
RETVAL = _3DScene::is_shader_enabled((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"));
OUTPUT:
RETVAL
bool
is_reload_delayed(canvas)
SV *canvas;
CODE:
RETVAL = _3DScene::is_reload_delayed((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"));
OUTPUT:
RETVAL
void
enable_layers_editing(canvas, enable)
SV *canvas;
bool enable;
CODE:
_3DScene::enable_layers_editing((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), enable);
void
enable_warning_texture(canvas, enable)
SV *canvas;
bool enable;
CODE:
_3DScene::enable_warning_texture((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), enable);
void
enable_legend_texture(canvas, enable)
SV *canvas;
bool enable;
CODE:
_3DScene::enable_legend_texture((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), enable);
void
enable_picking(canvas, enable)
SV *canvas;
bool enable;
CODE:
_3DScene::enable_picking((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), enable);
void
enable_moving(canvas, enable)
SV *canvas;
bool enable;
CODE:
_3DScene::enable_moving((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), enable);
void
enable_gizmos(canvas, enable)
SV *canvas;
bool enable;
CODE:
_3DScene::enable_gizmos((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), enable);
void
enable_shader(canvas, enable)
SV *canvas;
bool enable;
CODE:
_3DScene::enable_shader((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), enable);
void
enable_toolbar(canvas, enable)
SV *canvas;
bool enable;
CODE:
_3DScene::enable_toolbar((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), enable);
void
enable_force_zoom_to_bed(canvas, enable)
SV *canvas;
bool enable;
CODE:
_3DScene::enable_force_zoom_to_bed((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), enable);
void
enable_dynamic_background(canvas, enable)
SV *canvas;
bool enable;
CODE:
_3DScene::enable_dynamic_background((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), enable);
void
allow_multisample(canvas, allow)
SV *canvas;
bool allow;
CODE:
_3DScene::allow_multisample((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), allow);
void
enable_toolbar_item(canvas, item, enable)
SV *canvas;
std::string item;
bool enable;
CODE:
_3DScene::enable_toolbar_item((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), item, enable);
bool
is_toolbar_item_pressed(canvas, item)
SV *canvas;
std::string item;
CODE:
RETVAL = _3DScene::is_toolbar_item_pressed((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), item);
OUTPUT:
RETVAL
void
zoom_to_bed(canvas)
SV *canvas;
CODE:
_3DScene::zoom_to_bed((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"));
void
zoom_to_volumes(canvas)
SV *canvas;
CODE:
_3DScene::zoom_to_volumes((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"));
void
select_view(canvas, direction)
SV *canvas;
std::string direction;
CODE:
_3DScene::select_view((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), direction);
void
set_viewport_from_scene(canvas, other)
SV *canvas;
SV *other;
CODE:
_3DScene::set_viewport_from_scene((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (wxGLCanvas*)wxPli_sv_2_object(aTHX_ other, "Wx::GLCanvas"));
void
update_volumes_colors_by_extruder(canvas)
SV *canvas;
CODE:
_3DScene::update_volumes_colors_by_extruder((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"));
void
update_gizmos_data(canvas)
SV *canvas;
CODE:
_3DScene::update_gizmos_data((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"));
void
render(canvas)
SV *canvas;
CODE:
_3DScene::render((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"));
std::vector<double>
get_current_print_zs(canvas, active_only)
SV *canvas;
bool active_only;
CODE:
RETVAL = _3DScene::get_current_print_zs((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), active_only);
OUTPUT:
RETVAL
void
set_toolpaths_range(canvas, low, high)
SV *canvas;
double low;
double high;
CODE:
_3DScene::set_toolpaths_range((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), low, high);
void
register_on_viewport_changed_callback(canvas, callback)
SV *canvas;
SV *callback;
CODE:
_3DScene::register_on_viewport_changed_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
void
register_on_double_click_callback(canvas, callback)
SV *canvas;
SV *callback;
CODE:
_3DScene::register_on_double_click_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
void
register_on_right_click_callback(canvas, callback)
SV *canvas;
SV *callback;
CODE:
_3DScene::register_on_right_click_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
void
register_on_select_object_callback(canvas, callback)
SV *canvas;
SV *callback;
CODE:
_3DScene::register_on_select_object_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
void
register_on_model_update_callback(canvas, callback)
SV *canvas;
SV *callback;
CODE:
_3DScene::register_on_model_update_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
void
register_on_remove_object_callback(canvas, callback)
SV *canvas;
SV *callback;
CODE:
_3DScene::register_on_remove_object_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
void
register_on_arrange_callback(canvas, callback)
SV *canvas;
SV *callback;
CODE:
_3DScene::register_on_arrange_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
void
register_on_rotate_object_left_callback(canvas, callback)
SV *canvas;
SV *callback;
CODE:
_3DScene::register_on_rotate_object_left_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
void
register_on_rotate_object_right_callback(canvas, callback)
SV *canvas;
SV *callback;
CODE:
_3DScene::register_on_rotate_object_right_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
void
register_on_scale_object_uniformly_callback(canvas, callback)
SV *canvas;
SV *callback;
CODE:
_3DScene::register_on_scale_object_uniformly_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
void
register_on_increase_objects_callback(canvas, callback)
SV *canvas;
SV *callback;
CODE:
_3DScene::register_on_increase_objects_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
void
register_on_decrease_objects_callback(canvas, callback)
SV *canvas;
SV *callback;
CODE:
_3DScene::register_on_decrease_objects_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
void
register_on_instance_moved_callback(canvas, callback)
SV *canvas;
SV *callback;
CODE:
_3DScene::register_on_instance_moved_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
void
register_on_wipe_tower_moved_callback(canvas, callback)
SV *canvas;
SV *callback;
CODE:
_3DScene::register_on_wipe_tower_moved_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
void
register_on_enable_action_buttons_callback(canvas, callback)
SV *canvas;
SV *callback;
CODE:
_3DScene::register_on_enable_action_buttons_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
void
register_on_gizmo_scale_uniformly_callback(canvas, callback)
SV *canvas;
SV *callback;
CODE:
_3DScene::register_on_gizmo_scale_uniformly_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
void
register_on_gizmo_rotate_callback(canvas, callback)
SV *canvas;
SV *callback;
CODE:
_3DScene::register_on_gizmo_rotate_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
void
register_on_gizmo_flatten_callback(canvas, callback)
SV *canvas;
SV *callback;
CODE:
_3DScene::register_on_gizmo_flatten_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
void
register_on_update_geometry_info_callback(canvas, callback)
SV *canvas;
SV *callback;
CODE:
_3DScene::register_on_update_geometry_info_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
void
register_action_add_callback(canvas, callback)
SV *canvas;
SV *callback;
CODE:
_3DScene::register_action_add_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
void
register_action_delete_callback(canvas, callback)
SV *canvas;
SV *callback;
CODE:
_3DScene::register_action_delete_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
void
register_action_deleteall_callback(canvas, callback)
SV *canvas;
SV *callback;
CODE:
_3DScene::register_action_deleteall_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
void
register_action_arrange_callback(canvas, callback)
SV *canvas;
SV *callback;
CODE:
_3DScene::register_action_arrange_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
void
register_action_more_callback(canvas, callback)
SV *canvas;
SV *callback;
CODE:
_3DScene::register_action_more_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
void
register_action_fewer_callback(canvas, callback)
SV *canvas;
SV *callback;
CODE:
_3DScene::register_action_fewer_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
void
register_action_split_callback(canvas, callback)
SV *canvas;
SV *callback;
CODE:
_3DScene::register_action_split_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
void
register_action_cut_callback(canvas, callback)
SV *canvas;
SV *callback;
CODE:
_3DScene::register_action_cut_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
void
register_action_settings_callback(canvas, callback)
SV *canvas;
SV *callback;
CODE:
_3DScene::register_action_settings_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
void
register_action_layersediting_callback(canvas, callback)
SV *canvas;
SV *callback;
CODE:
_3DScene::register_action_layersediting_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
void
register_action_selectbyparts_callback(canvas, callback)
SV *canvas;
SV *callback;
CODE:
_3DScene::register_action_selectbyparts_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
void
reset_legend_texture()
CODE:
_3DScene::reset_legend_texture();
void
generate_warning_texture(std::string msg)
std::vector<int>
load_model_object(canvas, model_object, obj_idx, instance_idxs)
SV *canvas;
ModelObject *model_object;
int obj_idx;
std::vector<int> instance_idxs;
CODE:
_3DScene::generate_warning_texture(msg);
unsigned int
finalize_warning_texture()
CODE:
RETVAL = _3DScene::finalize_warning_texture();
RETVAL = _3DScene::load_object((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), model_object, obj_idx, instance_idxs);
OUTPUT:
RETVAL
unsigned int
get_warning_texture_width()
int
get_first_volume_id(canvas, obj_idx)
SV *canvas;
int obj_idx;
CODE:
RETVAL = _3DScene::get_warning_texture_width();
RETVAL = _3DScene::get_first_volume_id((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), obj_idx);
OUTPUT:
RETVAL
unsigned int
get_warning_texture_height()
std::vector<int>
load_model(canvas, model, obj_idx)
SV *canvas;
Model *model;
int obj_idx;
CODE:
RETVAL = _3DScene::get_warning_texture_height();
RETVAL = _3DScene::load_object((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), model, obj_idx);
OUTPUT:
RETVAL
void
reset_warning_texture()
reload_scene(canvas, force)
SV *canvas;
bool force;
CODE:
_3DScene::reset_warning_texture();
void
_load_print_toolpaths(print, volumes, tool_colors, use_VBOs)
Print *print;
GLVolumeCollection *volumes;
std::vector<std::string> tool_colors;
int use_VBOs;
CODE:
_3DScene::_load_print_toolpaths(print, volumes, tool_colors, use_VBOs != 0);
_3DScene::reload_scene((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), force);
void
_load_print_object_toolpaths(print_object, volumes, tool_colors, use_VBOs)
PrintObject *print_object;
GLVolumeCollection *volumes;
std::vector<std::string> tool_colors;
int use_VBOs;
CODE:
_3DScene::_load_print_object_toolpaths(print_object, volumes, tool_colors, use_VBOs != 0);
void
_load_wipe_tower_toolpaths(print, volumes, tool_colors, use_VBOs)
Print *print;
GLVolumeCollection *volumes;
std::vector<std::string> tool_colors;
int use_VBOs;
CODE:
_3DScene::_load_wipe_tower_toolpaths(print, volumes, tool_colors, use_VBOs != 0);
void
load_gcode_preview(print, preview_data, volumes, str_tool_colors, use_VBOs)
Print *print;
load_gcode_preview(canvas, preview_data, str_tool_colors)
SV *canvas;
GCodePreviewData *preview_data;
GLVolumeCollection *volumes;
std::vector<std::string> str_tool_colors;
int use_VBOs;
CODE:
_3DScene::load_gcode_preview(print, preview_data, volumes, str_tool_colors, use_VBOs != 0);
_3DScene::load_gcode_preview((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), preview_data, str_tool_colors);
void
load_preview(canvas, str_tool_colors)
SV *canvas;
std::vector<std::string> str_tool_colors;
CODE:
_3DScene::load_preview((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), str_tool_colors);
%}

View file

@ -41,4 +41,6 @@
void update_skein_dir(char *dir);
std::string get_last_output_dir(const char *alt = "");
void update_last_output_dir(char *dir);
void reset_selections();
};

View file

@ -12,6 +12,7 @@
bool default() %code%{ RETVAL = THIS->is_default; %};
bool external() %code%{ RETVAL = THIS->is_external; %};
bool system() %code%{ RETVAL = THIS->is_system; %};
bool visible() %code%{ RETVAL = THIS->is_visible; %};
bool dirty() %code%{ RETVAL = THIS->is_dirty; %};
bool compatible() %code%{ RETVAL = THIS->is_compatible; %};
@ -31,7 +32,6 @@
%name{Slic3r::GUI::PresetCollection} class PresetCollection {
Ref<Preset> preset(size_t idx) %code%{ RETVAL = &THIS->preset(idx); %};
Ref<Preset> default_preset() %code%{ RETVAL = &THIS->default_preset(); %};
size_t size() const;
size_t num_visible() const;
std::string name() const;
@ -43,9 +43,6 @@
Ref<Preset> find_preset(char *name, bool first_visible_if_not_found = false) %code%{ RETVAL = THIS->find_preset(name, first_visible_if_not_found); %};
bool current_is_dirty();
std::vector<std::string> current_dirty_options();
void update_tab_ui(SV *ui, bool show_incompatible)
%code%{ auto cb = (wxBitmapComboBox*)wxPli_sv_2_object( aTHX_ ui, "Wx::BitmapComboBox" );
THIS->update_tab_ui(cb, show_incompatible); %};
@ -54,30 +51,6 @@
%code%{ auto cb = (wxBitmapComboBox*)wxPli_sv_2_object( aTHX_ ui, "Wx::BitmapComboBox" );
THIS->update_platter_ui(cb); %};
bool update_dirty_ui(SV *ui)
%code%{ RETVAL = THIS->update_dirty_ui((wxBitmapComboBox*)wxPli_sv_2_object(aTHX_ ui, "Wx::BitmapComboBox")); %};
void select_preset(int idx);
bool select_preset_by_name(char *name) %code%{ RETVAL = THIS->select_preset_by_name(name, true); %};
void discard_current_changes();
void save_current_preset(char *new_name)
%code%{
try {
THIS->save_current_preset(new_name);
} catch (std::exception& e) {
croak("Error saving a preset %s:\n%s\n", new_name, e.what());
}
%};
void delete_current_preset()
%code%{
try {
THIS->delete_current_preset();
} catch (std::exception& e) {
croak("Error deleting a preset file %s:\n%s\n", THIS->get_selected_preset().file.c_str(), e.what());
}
%};
%{
SV*
@ -110,10 +83,10 @@ PresetCollection::arrayref()
croak("Cannot create configuration directories:\n%s\n", e.what());
}
%};
void load_presets()
void load_presets(AppConfig *config)
%code%{
try {
THIS->load_presets();
THIS->load_presets(*config);
} catch (std::exception& e) {
croak("Loading of Slic3r presets from %s failed.\n\n%s\n",
Slic3r::data_dir().c_str(), e.what());
@ -154,20 +127,19 @@ PresetCollection::arrayref()
void set_default_suppressed(bool default_suppressed);
void load_selections (AppConfig *config) %code%{ THIS->load_selections(*config); %};
void export_selections(AppConfig *config) %code%{ THIS->export_selections(*config); %};
void export_selections_pp(PlaceholderParser *pp) %code%{ THIS->export_selections(*pp); %};
Ref<PresetCollection> print() %code%{ RETVAL = &THIS->prints; %};
Ref<PresetCollection> filament() %code%{ RETVAL = &THIS->filaments; %};
Ref<PresetCollection> sla_material() %code%{ RETVAL = &THIS->sla_materials; %};
Ref<PresetCollection> printer() %code%{ RETVAL = &THIS->printers; %};
Ref<DynamicPrintConfig> project_config() %code%{ RETVAL = &THIS->project_config; %};
bool has_defauls_only();
std::vector<std::string> filament_presets() %code%{ RETVAL = THIS->filament_presets; %};
void set_filament_preset(int idx, const char *name);
void update_multi_material_filament_presets();
void update_compatible_with_printer(bool select_other_if_incompatible);
Clone<DynamicPrintConfig> full_config() %code%{ RETVAL = THIS->full_config(); %};
@ -175,15 +147,3 @@ PresetCollection::arrayref()
%code%{ auto cb = (wxBitmapComboBox*)wxPli_sv_2_object(aTHX_ ui, "Wx::BitmapComboBox");
THIS->update_platter_filament_ui(extruder_idx, cb); %};
};
%name{Slic3r::GUI::PresetHints} class PresetHints {
PresetHints();
~PresetHints();
static std::string cooling_description(Preset *preset)
%code%{ RETVAL = PresetHints::cooling_description(*preset); %};
static std::string maximum_volumetric_flow_description(PresetBundle *preset)
%code%{ RETVAL = PresetHints::maximum_volumetric_flow_description(*preset); %};
static std::string recommended_thin_wall_thickness(PresetBundle *preset)
%code%{ RETVAL = PresetHints::recommended_thin_wall_thickness(*preset); %};
};

View file

@ -16,6 +16,7 @@
bool current_preset_is_dirty();
void load_key_value(char* opt_key, char* value);
void OnActivate();
size_t get_selected_preset_item();
std::string title();
Ref<DynamicPrintConfig> get_config();
Ref<PresetCollection> get_presets();

View file

@ -8,7 +8,7 @@
%package{Slic3r::Geometry};
Pointfs arrange(size_t total_parts, Pointf* part, coordf_t dist, BoundingBoxf* bb = NULL)
Pointfs arrange(size_t total_parts, Vec2d* part, coordf_t dist, BoundingBoxf* bb = NULL)
%code{%
Pointfs points;
if (! Slic3r::Geometry::arrange(total_parts, *part, dist, bb, points))

View file

@ -29,7 +29,6 @@
bool parallel_to_line(Line* line)
%code{% RETVAL = THIS->parallel_to(*line); %};
Clone<Point> midpoint();
Clone<Point> point_at(double distance);
Clone<Point> intersection_infinite(Line* other)
%code{%
Point p;
@ -37,8 +36,8 @@
if (!res) CONFESS("Intersection failed");
RETVAL = p;
%};
Clone<Polyline> as_polyline()
%code{% RETVAL = Polyline(*THIS); %};
Polyline* as_polyline()
%code{% RETVAL = new Polyline(THIS->a, THIS->b); %};
Clone<Point> normal();
Clone<Point> vector();
double ccw(Point* point)
@ -70,7 +69,7 @@ Line::coincides_with(line_sv)
CODE:
Line line;
from_SV_check(line_sv, &line);
RETVAL = THIS->coincides_with(line);
RETVAL = (*THIS) == line;
OUTPUT:
RETVAL
@ -79,15 +78,15 @@ Line::coincides_with(line_sv)
%name{Slic3r::Linef3} class Linef3 {
Linef3(Pointf3* a, Pointf3* b)
Linef3(Vec3d* a, Vec3d* b)
%code{% RETVAL = new Linef3(*a, *b); %};
~Linef3();
Clone<Linef3> clone()
%code{% RETVAL = THIS; %};
Ref<Pointf3> a()
Ref<Vec3d> a()
%code{% RETVAL = &THIS->a; %};
Ref<Pointf3> b()
Ref<Vec3d> b()
%code{% RETVAL = &THIS->b; %};
Clone<Pointf3> intersect_plane(double z);
Clone<Vec3d> intersect_plane(double z);
void scale(double factor);
};

View file

@ -81,7 +81,7 @@
bool add_default_instances();
Clone<BoundingBoxf3> bounding_box();
void center_instances_around_point(Pointf* point)
void center_instances_around_point(Vec2d* point)
%code%{ THIS->center_instances_around_point(*point); %};
void translate(double x, double y, double z);
Clone<TriangleMesh> mesh();
@ -95,19 +95,16 @@
void duplicate_objects_grid(unsigned int x, unsigned int y, double dist);
bool looks_like_multipart_object() const;
void convert_multipart_object();
void convert_multipart_object(unsigned int max_extruders);
void print_info() const;
bool fits_print_volume(DynamicPrintConfig* config) const
%code%{ RETVAL = THIS->fits_print_volume(config); %};
bool store_stl(char *path, bool binary)
%code%{ TriangleMesh mesh = THIS->mesh(); RETVAL = Slic3r::store_stl(path, &mesh, binary); %};
bool store_amf(char *path, Print* print)
%code%{ RETVAL = Slic3r::store_amf(path, THIS, print); %};
bool store_3mf(char *path, Print* print)
%code%{ RETVAL = Slic3r::store_3mf(path, THIS, print); %};
bool store_amf(char *path, Print* print, bool export_print_config)
%code%{ RETVAL = Slic3r::store_amf(path, THIS, print, export_print_config); %};
bool store_3mf(char *path, Print* print, bool export_print_config)
%code%{ RETVAL = Slic3r::store_3mf(path, THIS, print, export_print_config); %};
%{
@ -292,9 +289,9 @@ ModelMaterial::attributes()
void set_layer_height_profile(std::vector<double> profile)
%code%{ THIS->layer_height_profile = profile; THIS->layer_height_profile_valid = true; %};
Ref<Pointf3> origin_translation()
Ref<Vec3d> origin_translation()
%code%{ RETVAL = &THIS->origin_translation; %};
void set_origin_translation(Pointf3* point)
void set_origin_translation(Vec3d* point)
%code%{ THIS->origin_translation = *point; %};
bool needed_repair() const;
@ -302,9 +299,10 @@ ModelMaterial::attributes()
int facets_count();
void center_around_origin();
void translate(double x, double y, double z);
void scale_xyz(Pointf3* versor)
void scale_xyz(Vec3d* versor)
%code{% THIS->scale(*versor); %};
void rotate(float angle, Axis axis);
void rotate(float angle, Vec3d* axis)
%code{% THIS->rotate(angle, *axis); %};
void mirror(Axis axis);
Model* cut(double z)
@ -346,7 +344,7 @@ ModelMaterial::attributes()
void set_modifier(bool modifier)
%code%{ THIS->modifier = modifier; %};
size_t split();
size_t split(unsigned int max_extruders);
ModelMaterial* assign_unique_material();
};
@ -360,14 +358,14 @@ ModelMaterial::attributes()
%code%{ RETVAL = THIS->rotation; %};
double scaling_factor()
%code%{ RETVAL = THIS->scaling_factor; %};
Ref<Pointf> offset()
Ref<Vec2d> offset()
%code%{ RETVAL = &THIS->offset; %};
void set_rotation(double val)
%code%{ THIS->rotation = val; THIS->get_object()->invalidate_bounding_box(); %};
void set_scaling_factor(double val)
%code%{ THIS->scaling_factor = val; THIS->get_object()->invalidate_bounding_box(); %};
void set_offset(Pointf *offset)
void set_offset(Vec2d *offset)
%code%{ THIS->offset = *offset; %};
void transform_mesh(TriangleMesh* mesh, bool dont_translate = false) const;

View file

@ -18,7 +18,7 @@
try {
RETVAL = THIS->process(str, 0);
} catch (std::exception& e) {
croak(e.what());
croak("%s\n", e.what());
}
%};
@ -27,7 +27,7 @@
try {
RETVAL = THIS->evaluate_boolean_expression(str, THIS->config());
} catch (std::exception& e) {
croak(e.what());
croak("%s\n", e.what());
}
%};
};

View file

@ -3,6 +3,7 @@
%{
#include <xsinit.h>
#include "libslic3r/Point.hpp"
#include "libslic3r/Line.hpp"
#include "libslic3r/Polygon.hpp"
#include "libslic3r/Polyline.hpp"
%}
@ -12,44 +13,44 @@
~Point();
Clone<Point> clone()
%code{% RETVAL=THIS; %};
void scale(double factor);
void translate(double x, double y);
void scale(double factor)
%code{% *THIS *= factor; %};
void translate(double x, double y)
%code{% *THIS += Point(x, y); %};
SV* arrayref()
%code{% RETVAL = to_SV_pureperl(THIS); %};
SV* pp()
%code{% RETVAL = to_SV_pureperl(THIS); %};
int x()
%code{% RETVAL = THIS->x; %};
%code{% RETVAL = (*THIS)(0); %};
int y()
%code{% RETVAL = THIS->y; %};
%code{% RETVAL = (*THIS)(1); %};
void set_x(int val)
%code{% THIS->x = val; %};
%code{% (*THIS)(0) = val; %};
void set_y(int val)
%code{% THIS->y = val; %};
%code{% (*THIS)(1) = val; %};
int nearest_point_index(Points points);
Clone<Point> nearest_point(Points points)
%code{% Point p; THIS->nearest_point(points, &p); RETVAL = p; %};
double distance_to(Point* point)
%code{% RETVAL = THIS->distance_to(*point); %};
%code{% RETVAL = (*point - *THIS).cast<double>().norm(); %};
double distance_to_line(Line* line)
%code{% RETVAL = THIS->distance_to(*line); %};
%code{% RETVAL = line->distance_to(*THIS); %};
double perp_distance_to_line(Line* line)
%code{% RETVAL = THIS->perp_distance_to(*line); %};
%code{% RETVAL = line->perp_distance_to(*THIS); %};
double ccw(Point* p1, Point* p2)
%code{% RETVAL = THIS->ccw(*p1, *p2); %};
double ccw_angle(Point* p1, Point* p2)
%code{% RETVAL = THIS->ccw_angle(*p1, *p2); %};
Clone<Point> projection_onto_polygon(Polygon* polygon)
Point* projection_onto_polygon(Polygon* polygon)
%code{% RETVAL = new Point(THIS->projection_onto(*polygon)); %};
Clone<Point> projection_onto_polyline(Polyline* polyline)
Point* projection_onto_polyline(Polyline* polyline)
%code{% RETVAL = new Point(THIS->projection_onto(*polyline)); %};
Clone<Point> projection_onto_line(Line* line)
Point* projection_onto_line(Line* line)
%code{% RETVAL = new Point(THIS->projection_onto(*line)); %};
Clone<Point> negative()
%code{% RETVAL = new Point(THIS->negative()); %};
bool coincides_with_epsilon(Point* point)
%code{% RETVAL = THIS->coincides_with_epsilon(*point); %};
std::string serialize() %code{% char buf[2048]; sprintf(buf, "%ld,%ld", THIS->x, THIS->y); RETVAL = buf; %};
Point* negative()
%code{% RETVAL = new Point(- *THIS); %};
std::string serialize() %code{% char buf[2048]; sprintf(buf, "%ld,%ld", (*THIS)(0), (*THIS)(1)); RETVAL = buf; %};
%{
@ -68,7 +69,7 @@ Point::coincides_with(point_sv)
CODE:
Point point;
from_SV_check(point_sv, &point);
RETVAL = THIS->coincides_with(point);
RETVAL = (*THIS) == point;
OUTPUT:
RETVAL
@ -76,72 +77,62 @@ Point::coincides_with(point_sv)
};
%name{Slic3r::Point3} class Point3 {
Point3(int _x = 0, int _y = 0, int _z = 0);
~Point3();
Clone<Point3> clone()
%code{% RETVAL = THIS; %};
int x()
%code{% RETVAL = THIS->x; %};
int y()
%code{% RETVAL = THIS->y; %};
int z()
%code{% RETVAL = THIS->z; %};
std::string serialize() %code{% char buf[2048]; sprintf(buf, "%ld,%ld,%ld", THIS->x, THIS->y, THIS->z); RETVAL = buf; %};
};
%name{Slic3r::Pointf} class Pointf {
Pointf(double _x = 0, double _y = 0);
~Pointf();
Clone<Pointf> clone()
%name{Slic3r::Pointf} class Vec2d {
Vec2d(double _x = 0, double _y = 0);
~Vec2d();
Clone<Vec2d> clone()
%code{% RETVAL = THIS; %};
SV* arrayref()
%code{% RETVAL = to_SV_pureperl(THIS); %};
SV* pp()
%code{% RETVAL = to_SV_pureperl(THIS); %};
double x()
%code{% RETVAL = THIS->x; %};
%code{% RETVAL = (*THIS)(0); %};
double y()
%code{% RETVAL = THIS->y; %};
%code{% RETVAL = (*THIS)(1); %};
void set_x(double val)
%code{% THIS->x = val; %};
%code{% (*THIS)(0) = val; %};
void set_y(double val)
%code{% THIS->y = val; %};
void translate(double x, double y);
void scale(double factor);
void rotate(double angle, Pointf* center)
%code{% THIS->rotate(angle, *center); %};
Clone<Pointf> negative()
%code{% RETVAL = THIS->negative(); %};
Clone<Pointf> vector_to(Pointf* point)
%code{% RETVAL = THIS->vector_to(*point); %};
std::string serialize() %code{% char buf[2048]; sprintf(buf, "%lf,%lf", THIS->x, THIS->y); RETVAL = buf; %};
%code{% (*THIS)(1) = val; %};
void translate(double x, double y)
%code{% *THIS += Vec2d(x, y); %};
void scale(double factor)
%code{% *THIS *= factor; %};
void rotate(double angle, Vec2d* center)
%code{% *THIS = Eigen::Translation2d(*center) * Eigen::Rotation2Dd(angle) * Eigen::Translation2d(- *center) * Eigen::Vector2d((*THIS)(0), (*THIS)(1)); %};
Vec2d* negative()
%code{% RETVAL = new Vec2d(- *THIS); %};
Vec2d* vector_to(Vec2d* point)
%code{% RETVAL = new Vec2d(*point - *THIS); %};
std::string serialize() %code{% char buf[2048]; sprintf(buf, "%lf,%lf", (*THIS)(0), (*THIS)(1)); RETVAL = buf; %};
};
%name{Slic3r::Pointf3} class Pointf3 {
Pointf3(double _x = 0, double _y = 0, double _z = 0);
~Pointf3();
Clone<Pointf3> clone()
%name{Slic3r::Pointf3} class Vec3d {
Vec3d(double _x = 0, double _y = 0, double _z = 0);
~Vec3d();
Clone<Vec3d> clone()
%code{% RETVAL = THIS; %};
double x()
%code{% RETVAL = THIS->x; %};
%code{% RETVAL = (*THIS)(0); %};
double y()
%code{% RETVAL = THIS->y; %};
%code{% RETVAL = (*THIS)(1); %};
double z()
%code{% RETVAL = THIS->z; %};
%code{% RETVAL = (*THIS)(2); %};
void set_x(double val)
%code{% THIS->x = val; %};
%code{% (*THIS)(0) = val; %};
void set_y(double val)
%code{% THIS->y = val; %};
%code{% (*THIS)(1) = val; %};
void set_z(double val)
%code{% THIS->z = val; %};
void translate(double x, double y, double z);
void scale(double factor);
double distance_to(Pointf3* point)
%code{% RETVAL = THIS->distance_to(*point); %};
Clone<Pointf3> negative()
%code{% RETVAL = THIS->negative(); %};
Clone<Pointf3> vector_to(Pointf3* point)
%code{% RETVAL = THIS->vector_to(*point); %};
std::string serialize() %code{% char buf[2048]; sprintf(buf, "%lf,%lf,%lf", THIS->x, THIS->y, THIS->z); RETVAL = buf; %};
%code{% (*THIS)(2) = val; %};
void translate(double x, double y, double z)
%code{% *THIS += Vec3d(x, y, z); %};
void scale(double factor)
%code{% *THIS *= factor; %};
double distance_to(Vec3d* point)
%code{% RETVAL = (*point - *THIS).norm(); %};
Vec3d* negative()
%code{% RETVAL = new Vec3d(- *THIS); %};
Vec3d* vector_to(Vec3d* point)
%code{% RETVAL = new Vec3d(*point - *THIS); %};
std::string serialize() %code{% char buf[2048]; sprintf(buf, "%lf,%lf,%lf", (*THIS)(0), (*THIS)(1), (*THIS)(2)); RETVAL = buf; %};
};

View file

@ -39,7 +39,6 @@
%code{% THIS->triangulate_convex(&RETVAL); %};
Clone<Point> centroid();
Clone<BoundingBox> bounding_box();
std::string wkt();
Points concave_points(double angle);
Points convex_points(double angle);
Clone<Point> point_projection(Point* point)

View file

@ -38,7 +38,6 @@
bool is_straight();
Clone<BoundingBox> bounding_box();
void remove_duplicate_points();
std::string wkt();
%{
Polyline*

View file

@ -44,6 +44,8 @@ _constant()
int region_count()
%code%{ RETVAL = THIS->print()->regions().size(); %};
int region_volumes_count()
%code%{ RETVAL = THIS->region_volumes.size(); %};
Ref<Print> print();
Ref<ModelObject> model_object();
Ref<StaticPrintConfig> config()
@ -53,14 +55,12 @@ _constant()
%code%{ RETVAL = THIS->layer_height_ranges; %};
std::vector<double> layer_height_profile()
%code%{ RETVAL = THIS->layer_height_profile; %};
Ref<Point3> size()
%code%{ RETVAL = &THIS->size; %};
Clone<BoundingBox> bounding_box();
Points _shifted_copies()
%code%{ RETVAL = THIS->_shifted_copies; %};
%code%{ RETVAL = THIS->copies(); %};
bool add_copy(Pointf* point)
bool add_copy(Vec2d* point)
%code%{ RETVAL = THIS->add_copy(*point); %};
bool delete_last_copy();
bool reload_model_instances();
@ -76,17 +76,6 @@ _constant()
bool step_done(PrintObjectStep step)
%code%{ RETVAL = THIS->is_step_done(step); %};
void adjust_layer_height_profile(coordf_t z, coordf_t layer_thickness_delta, coordf_t band_width, int action)
%code%{
THIS->update_layer_height_profile(THIS->model_object()->layer_height_profile);
adjust_layer_height_profile(
THIS->slicing_parameters(), THIS->model_object()->layer_height_profile, z, layer_thickness_delta, band_width, LayerHeightEditActionType(action));
THIS->model_object()->layer_height_profile_valid = true;
THIS->layer_height_profile_valid = false;
%};
void reset_layer_height_profile();
void slice();
};
@ -95,15 +84,17 @@ _constant()
~Print();
Ref<StaticPrintConfig> config()
%code%{ RETVAL = &THIS->config(); %};
%code%{ RETVAL = const_cast<GCodeConfig*>(static_cast<const GCodeConfig*>(&THIS->config())); %};
Ref<PlaceholderParser> placeholder_parser()
%code%{ RETVAL = &THIS->placeholder_parser(); %};
Ref<ExtrusionEntityCollection> skirt()
%code%{ RETVAL = const_cast<ExtrusionEntityCollection*>(&THIS->skirt()); %};
Ref<ExtrusionEntityCollection> brim()
%code%{ RETVAL = const_cast<ExtrusionEntityCollection*>(&THIS->brim()); %};
std::string estimated_print_time()
%code%{ RETVAL = THIS->print_statistics().estimated_print_time; %};
std::string estimated_normal_print_time()
%code%{ RETVAL = THIS->print_statistics().estimated_normal_print_time; %};
std::string estimated_silent_print_time()
%code%{ RETVAL = THIS->print_statistics().estimated_silent_print_time; %};
double total_used_filament()
%code%{ RETVAL = THIS->print_statistics().total_used_filament; %};
double total_extruded_volume()
@ -112,7 +103,6 @@ _constant()
%code%{ RETVAL = THIS->print_statistics().total_weight; %};
double total_cost()
%code%{ RETVAL = THIS->print_statistics().total_cost; %};
PrintObjectPtrs* objects()
%code%{ RETVAL = const_cast<PrintObjectPtrs*>(&THIS->objects()); %};
void clear_objects();
@ -157,9 +147,11 @@ _constant()
try {
RETVAL = THIS->output_filepath(path);
} catch (std::exception& e) {
croak(e.what());
croak("%s\n", e.what());
}
%};
void print_to_png(std::string dirpath);
void add_model_object(ModelObject* model_object, int idx = -1);
bool apply_config(DynamicPrintConfig* config)

View file

@ -0,0 +1,48 @@
%module{Slic3r::XS};
%{
#include <xsinit.h>
#include "slic3r/GUI/ProgressStatusBar.hpp"
%}
%name{Slic3r::GUI::ProgressStatusBar} class ProgressStatusBar {
ProgressStatusBar();
~ProgressStatusBar();
int GetProgress() const
%code%{ RETVAL=THIS->get_progress(); %};
void SetProgress(int val)
%code%{ THIS->set_progress(val); %};
void SetRange(int val = 100)
%code%{ THIS->set_range(val); %};
void ShowProgress(bool show)
%code%{ THIS->show_progress(show); %};
void StartBusy(int val = 100)
%code%{ THIS->start_busy(val); %};
void StopBusy()
%code%{ THIS->stop_busy(); %};
bool IsBusy() const
%code%{ RETVAL=THIS->is_busy(); %};
void Run(int rate)
%code%{ THIS->run(rate); %};
void Embed()
%code%{ THIS->embed(); %};
void SetStatusText(std::string txt)
%code%{ THIS->set_status_text(txt); %};
void ShowCancelButton()
%code%{ THIS->show_cancel_button(); %};
void HideCancelButton()
%code%{ THIS->hide_cancel_button(); %};
};

View file

@ -16,7 +16,7 @@
void repair();
void WriteOBJFile(char* output_file);
void scale(float factor);
void scale_xyz(Pointf3* versor)
void scale_xyz(Vec3d* versor)
%code{% THIS->scale(*versor); %};
void translate(float x, float y, float z);
void rotate_x(float angle);
@ -33,7 +33,7 @@
ExPolygons horizontal_projection();
Clone<Polygon> convex_hull();
Clone<BoundingBoxf3> bounding_box();
Clone<Pointf3> center()
Clone<Vec3d> center()
%code{% RETVAL = THIS->bounding_box().center(); %};
int facets_count();
void reset_repair_stats();
@ -60,14 +60,14 @@ TriangleMesh::ReadFromPerl(vertices, facets)
for (int i = 0; i < stl.stats.number_of_facets; i++) {
AV* facet_av = (AV*)SvRV(*av_fetch(facets_av, i, 0));
stl_facet facet;
facet.normal.x = 0;
facet.normal.y = 0;
facet.normal.z = 0;
facet.normal(0) = 0;
facet.normal(1) = 0;
facet.normal(2) = 0;
for (unsigned int v = 0; v <= 2; v++) {
AV* vertex_av = (AV*)SvRV(*av_fetch(vertices_av, SvIV(*av_fetch(facet_av, v, 0)), 0));
facet.vertex[v].x = SvNV(*av_fetch(vertex_av, 0, 0));
facet.vertex[v].y = SvNV(*av_fetch(vertex_av, 1, 0));
facet.vertex[v].z = SvNV(*av_fetch(vertex_av, 2, 0));
facet.vertex[v](0) = SvNV(*av_fetch(vertex_av, 0, 0));
facet.vertex[v](1) = SvNV(*av_fetch(vertex_av, 1, 0));
facet.vertex[v](2) = SvNV(*av_fetch(vertex_av, 2, 0));
}
facet.extra[0] = 0;
facet.extra[1] = 0;
@ -110,9 +110,9 @@ TriangleMesh::vertices()
AV* vertex = newAV();
av_store(vertices, i, newRV_noinc((SV*)vertex));
av_extend(vertex, 2);
av_store(vertex, 0, newSVnv(THIS->stl.v_shared[i].x));
av_store(vertex, 1, newSVnv(THIS->stl.v_shared[i].y));
av_store(vertex, 2, newSVnv(THIS->stl.v_shared[i].z));
av_store(vertex, 0, newSVnv(THIS->stl.v_shared[i](0)));
av_store(vertex, 1, newSVnv(THIS->stl.v_shared[i](1)));
av_store(vertex, 2, newSVnv(THIS->stl.v_shared[i](2)));
}
RETVAL = newRV_noinc((SV*)vertices);
@ -155,9 +155,9 @@ TriangleMesh::normals()
AV* facet = newAV();
av_store(normals, i, newRV_noinc((SV*)facet));
av_extend(facet, 2);
av_store(facet, 0, newSVnv(THIS->stl.facet_start[i].normal.x));
av_store(facet, 1, newSVnv(THIS->stl.facet_start[i].normal.y));
av_store(facet, 2, newSVnv(THIS->stl.facet_start[i].normal.z));
av_store(facet, 0, newSVnv(THIS->stl.facet_start[i].normal(0)));
av_store(facet, 1, newSVnv(THIS->stl.facet_start[i].normal(1)));
av_store(facet, 2, newSVnv(THIS->stl.facet_start[i].normal(2)));
}
RETVAL = newRV_noinc((SV*)normals);
@ -169,9 +169,9 @@ TriangleMesh::size()
CODE:
AV* size = newAV();
av_extend(size, 2);
av_store(size, 0, newSVnv(THIS->stl.stats.size.x));
av_store(size, 1, newSVnv(THIS->stl.stats.size.y));
av_store(size, 2, newSVnv(THIS->stl.stats.size.z));
av_store(size, 0, newSVnv(THIS->stl.stats.size(0)));
av_store(size, 1, newSVnv(THIS->stl.stats.size(1)));
av_store(size, 2, newSVnv(THIS->stl.stats.size(2)));
RETVAL = newRV_noinc((SV*)size);
OUTPUT:
RETVAL
@ -181,7 +181,7 @@ TriangleMesh::slice(z)
std::vector<double> z
CODE:
// convert doubles to floats
std::vector<float> z_f(z.begin(), z.end());
std::vector<float> z_f = cast<float>(z);
std::vector<ExPolygons> layers;
TriangleMeshSlicer mslicer(THIS);
@ -216,12 +216,12 @@ TriangleMesh::cut(z, upper, lower)
std::vector<double>
TriangleMesh::bb3()
CODE:
RETVAL.push_back(THIS->stl.stats.min.x);
RETVAL.push_back(THIS->stl.stats.min.y);
RETVAL.push_back(THIS->stl.stats.max.x);
RETVAL.push_back(THIS->stl.stats.max.y);
RETVAL.push_back(THIS->stl.stats.min.z);
RETVAL.push_back(THIS->stl.stats.max.z);
RETVAL.push_back(THIS->stl.stats.min(0));
RETVAL.push_back(THIS->stl.stats.min(1));
RETVAL.push_back(THIS->stl.stats.max(0));
RETVAL.push_back(THIS->stl.stats.max(1));
RETVAL.push_back(THIS->stl.stats.min(2));
RETVAL.push_back(THIS->stl.stats.max(2));
OUTPUT:
RETVAL

View file

@ -1,13 +0,0 @@
%module{Slic3r::XS};
%{
#include <xsinit.h>
#include "slic3r/Utils/OctoPrint.hpp"
%}
%name{Slic3r::OctoPrint} class OctoPrint {
OctoPrint(DynamicPrintConfig *config);
~OctoPrint();
void send_gcode(int windowId, int completeEvt, int errorEvt, std::string filename, bool print = false) const;
};

View file

@ -0,0 +1,13 @@
%module{Slic3r::XS};
%{
#include <xsinit.h>
#include "slic3r/Utils/PresetUpdater.hpp"
%}
%name{Slic3r::PresetUpdater} class PresetUpdater {
PresetUpdater(int version_online_event);
void sync(PresetBundle* preset_bundle);
void slic3r_update_notify();
bool config_update();
};

View file

@ -0,0 +1,12 @@
%module{Slic3r::XS};
%{
#include <xsinit.h>
#include "slic3r/Utils/PrintHost.hpp"
%}
%name{Slic3r::PrintHost} class PrintHost {
bool send_gcode(std::string filename) const;
static PrintHost* get_print_host(DynamicPrintConfig *config);
};

View file

@ -66,13 +66,13 @@ Point3* O_OBJECT_SLIC3R
Ref<Point3> O_OBJECT_SLIC3R_T
Clone<Point3> O_OBJECT_SLIC3R_T
Pointf* O_OBJECT_SLIC3R
Ref<Pointf> O_OBJECT_SLIC3R_T
Clone<Pointf> O_OBJECT_SLIC3R_T
Vec2d* O_OBJECT_SLIC3R
Ref<Vec2d> O_OBJECT_SLIC3R_T
Clone<Vec2d> O_OBJECT_SLIC3R_T
Pointf3* O_OBJECT_SLIC3R
Ref<Pointf3> O_OBJECT_SLIC3R_T
Clone<Pointf3> O_OBJECT_SLIC3R_T
Vec3d* O_OBJECT_SLIC3R
Ref<Vec3d> O_OBJECT_SLIC3R_T
Clone<Vec3d> O_OBJECT_SLIC3R_T
Line* O_OBJECT_SLIC3R
Ref<Line> O_OBJECT_SLIC3R_T
@ -216,6 +216,8 @@ Ref<PrintObjectSupportMaterial> O_OBJECT_SLIC3R_T
Clone<PrintObjectSupportMaterial> O_OBJECT_SLIC3R_T
AppConfig* O_OBJECT_SLIC3R
AppController* O_OBJECT_SLIC3R
PrintController* O_OBJECT_SLIC3R
Ref<AppConfig> O_OBJECT_SLIC3R_T
BackgroundSlicingProcess* O_OBJECT_SLIC3R
Ref<BackgroundSlicingProcess> O_OBJECT_SLIC3R_T
@ -233,14 +235,15 @@ PresetCollection* O_OBJECT_SLIC3R
Ref<PresetCollection> O_OBJECT_SLIC3R_T
PresetBundle* O_OBJECT_SLIC3R
Ref<PresetBundle> O_OBJECT_SLIC3R_T
PresetHints* O_OBJECT_SLIC3R
Ref<PresetHints> O_OBJECT_SLIC3R_T
TabIface* O_OBJECT_SLIC3R
Ref<TabIface> O_OBJECT_SLIC3R_T
TabIface* O_OBJECT_SLIC3R
Ref<TabIface> O_OBJECT_SLIC3R_T
ProgressStatusBar* O_OBJECT_SLIC3R
Ref<ProgressStatusBar> O_OBJECT_SLIC3R_T
OctoPrint* O_OBJECT_SLIC3R
Ref<OctoPrint> O_OBJECT_SLIC3R_T
Clone<OctoPrint> O_OBJECT_SLIC3R_T
PresetUpdater* O_OBJECT_SLIC3R
Ref<PresetUpdater> O_OBJECT_SLIC3R_T
PrintHost* O_OBJECT_SLIC3R
Axis T_UV
ExtrusionLoopRole T_UV

View file

@ -22,12 +22,12 @@
%typemap{Point3*};
%typemap{Ref<Point3>}{simple};
%typemap{Clone<Point3>}{simple};
%typemap{Pointf*};
%typemap{Ref<Pointf>}{simple};
%typemap{Clone<Pointf>}{simple};
%typemap{Pointf3*};
%typemap{Ref<Pointf3>}{simple};
%typemap{Clone<Pointf3>}{simple};
%typemap{Vec2d*};
%typemap{Ref<Vec2d>}{simple};
%typemap{Clone<Vec2d>}{simple};
%typemap{Vec3d*};
%typemap{Ref<Vec3d>}{simple};
%typemap{Clone<Vec3d>}{simple};
%typemap{BoundingBox*};
%typemap{Ref<BoundingBox>}{simple};
%typemap{Clone<BoundingBox>}{simple};
@ -210,10 +210,12 @@
%typemap{Ref<PresetCollection>}{simple};
%typemap{PresetBundle*};
%typemap{Ref<PresetBundle>}{simple};
%typemap{PresetUpdater*};
%typemap{Ref<PresetUpdater>}{simple};
%typemap{PresetHints*};
%typemap{Ref<PresetHints>}{simple};
%typemap{TabIface*};
%typemap{Ref<TabIface>}{simple};
%typemap{ProgressStatusBar*};
%typemap{PrintRegionPtrs*};
%typemap{PrintObjectPtrs*};
@ -269,3 +271,6 @@
$CVar = (PrintObjectStep)SvUV($PerlVar);
%};
};
%typemap{AppController*};
%typemap{PrintController*};
%typemap{PrintHost*};