Flow.xsp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. %module{Slic3r::XS};
  2. %{
  3. #include <xsinit.h>
  4. #include "libslic3r/Flow.hpp"
  5. %}
  6. %name{Slic3r::Flow} class Flow {
  7. ~Flow();
  8. %name{_new} Flow(float width, float height, float nozzle_diameter);
  9. Clone<Flow> clone()
  10. %code{% RETVAL = THIS; %};
  11. float width();
  12. float height();
  13. float nozzle_diameter();
  14. bool bridge();
  15. float spacing();
  16. int scaled_width();
  17. int scaled_spacing();
  18. double mm3_per_mm();
  19. %{
  20. Flow*
  21. _new_from_width(CLASS, role, width, nozzle_diameter, height)
  22. char* CLASS;
  23. FlowRole role;
  24. std::string width;
  25. float nozzle_diameter;
  26. float height;
  27. CODE:
  28. ConfigOptionFloatOrPercent optwidth;
  29. optwidth.deserialize(width, ForwardCompatibilitySubstitutionRule::Disable);
  30. RETVAL = new Flow(Flow::new_from_config_width(role, optwidth, nozzle_diameter, height, bridge_flow_ratio));
  31. OUTPUT:
  32. RETVAL
  33. %}
  34. };
  35. %package{Slic3r::Flow};
  36. %{
  37. IV
  38. _constant()
  39. ALIAS:
  40. FLOW_ROLE_EXTERNAL_PERIMETER = frExternalPerimeter
  41. FLOW_ROLE_PERIMETER = frPerimeter
  42. FLOW_ROLE_INFILL = frInfill
  43. FLOW_ROLE_SOLID_INFILL = frSolidInfill
  44. FLOW_ROLE_TOP_SOLID_INFILL = frTopSolidInfill
  45. FLOW_ROLE_SUPPORT_MATERIAL = frSupportMaterial
  46. FLOW_ROLE_SUPPORT_MATERIAL_INTERFACE = frSupportMaterialInterface
  47. PROTOTYPE:
  48. CODE:
  49. RETVAL = ix;
  50. OUTPUT: RETVAL
  51. %}