ExtrusionMultiPath.xsp 1006 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. %module{Slic3r::XS};
  2. %{
  3. #include <xsinit.h>
  4. #include "libslic3r/ExtrusionEntity.hpp"
  5. %}
  6. %name{Slic3r::ExtrusionMultiPath} class ExtrusionMultiPath {
  7. ExtrusionMultiPath();
  8. ~ExtrusionMultiPath();
  9. Clone<ExtrusionMultiPath> clone()
  10. %code{% RETVAL = THIS; %};
  11. void reverse();
  12. Clone<Point> first_point();
  13. Clone<Point> last_point();
  14. void append(ExtrusionPath* path)
  15. %code{% THIS->paths.push_back(*path); %};
  16. double length();
  17. Polygons polygons_covered_by_width();
  18. Polygons polygons_covered_by_spacing();
  19. Clone<Polyline> polyline()
  20. %code{% RETVAL = THIS->as_polyline(); %};
  21. %{
  22. SV*
  23. ExtrusionMultiPath::arrayref()
  24. CODE:
  25. AV* av = newAV();
  26. av_fill(av, THIS->paths.size()-1);
  27. for (ExtrusionPaths::iterator it = THIS->paths.begin(); it != THIS->paths.end(); ++it) {
  28. av_store(av, it - THIS->paths.begin(), perl_to_SV_ref(*it));
  29. }
  30. RETVAL = newRV_noinc((SV*)av);
  31. OUTPUT:
  32. RETVAL
  33. %}
  34. };