diff options
Diffstat (limited to 'xs/xsp/Model.xsp')
-rw-r--r-- | xs/xsp/Model.xsp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/xs/xsp/Model.xsp b/xs/xsp/Model.xsp index 35b1c01ce..93067ebe3 100644 --- a/xs/xsp/Model.xsp +++ b/xs/xsp/Model.xsp @@ -3,6 +3,7 @@ %{ #include <xsinit.h> #include "libslic3r/Model.hpp" +#include "libslic3r/ModelArrange.hpp" #include "libslic3r/Print.hpp" #include "libslic3r/PrintConfig.hpp" #include "libslic3r/Slicing.hpp" @@ -11,7 +12,7 @@ #include "libslic3r/Format/OBJ.hpp" #include "libslic3r/Format/PRUS.hpp" #include "libslic3r/Format/STL.hpp" -#include "slic3r/GUI/PresetBundle.hpp" +#include "libslic3r/PresetBundle.hpp" %} %name{Slic3r::Model} class Model { @@ -80,9 +81,9 @@ ModelObjectPtrs* objects() %code%{ RETVAL = &THIS->objects; %}; - bool arrange_objects(double dist, BoundingBoxf* bb = NULL); - void duplicate(unsigned int copies_num, double dist, BoundingBoxf* bb = NULL); - void duplicate_objects(unsigned int copies_num, double dist, BoundingBoxf* bb = NULL); + bool arrange_objects(double dist, BoundingBoxf* bb = NULL) %code%{ ArrangeParams ap{scaled(dist)}; if (bb) arrange_objects(*THIS, scaled(*bb), ap); else arrange_objects(*THIS, InfiniteBed{}, ap); %}; + void duplicate(unsigned int copies_num, double dist, BoundingBoxf* bb = NULL) %code%{ ArrangeParams ap{scaled(dist)}; if (bb) duplicate(*THIS, copies_num, scaled(*bb), ap); else duplicate(*THIS, copies_num, InfiniteBed{}, ap); %}; + void duplicate_objects(unsigned int copies_num, double dist, BoundingBoxf* bb = NULL) %code%{ ArrangeParams ap{scaled(dist)}; if (bb) duplicate_objects(*THIS, copies_num, scaled(*bb), ap); else duplicate_objects(*THIS, copies_num, InfiniteBed{}, ap); %}; void duplicate_objects_grid(unsigned int x, unsigned int y, double dist); bool looks_like_multipart_object() const; @@ -117,7 +118,7 @@ load_stl(CLASS, path, object_name) %code%{ RETVAL = THIS->get_model(); %}; Ref<DynamicPrintConfig> config() - %code%{ RETVAL = &THIS->config; %}; + %code%{ RETVAL = &const_cast<DynamicPrintConfig&>(THIS->config.get()); %}; std::string get_attribute(std::string name) %code%{ if (THIS->attributes.find(name) != THIS->attributes.end()) RETVAL = THIS->attributes[name]; %}; @@ -201,7 +202,7 @@ ModelMaterial::attributes() void set_input_file(std::string value) %code%{ THIS->input_file = value; %}; Ref<DynamicPrintConfig> config() - %code%{ RETVAL = &THIS->config; %}; + %code%{ RETVAL = &const_cast<DynamicPrintConfig&>(THIS->config.get()); %}; Ref<Model> model() %code%{ RETVAL = THIS->get_model(); %}; @@ -247,7 +248,7 @@ ModelMaterial::attributes() Ref<ModelMaterial> material(); Ref<DynamicPrintConfig> config() - %code%{ RETVAL = &THIS->config; %}; + %code%{ RETVAL = &const_cast<DynamicPrintConfig&>(THIS->config.get()); %}; Ref<TriangleMesh> mesh() %code%{ RETVAL = &THIS->mesh(); %}; |