~ubuntu-branches/ubuntu/utopic/slic3r/utopic

« back to all changes in this revision

Viewing changes to xs/xsp/ExtrusionLoop.xsp

  • Committer: Package Import Robot
  • Author(s): Chow Loong Jin
  • Date: 2014-06-17 01:27:26 UTC
  • Revision ID: package-import@ubuntu.com-20140617012726-2wrs4zdo251nr4vg
Tags: upstream-1.1.4+dfsg
ImportĀ upstreamĀ versionĀ 1.1.4+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%module{Slic3r::XS};
 
2
 
 
3
%{
 
4
#include <myinit.h>
 
5
#include "ExtrusionEntity.hpp"
 
6
%}
 
7
 
 
8
%name{Slic3r::ExtrusionLoop} class ExtrusionLoop {
 
9
    ExtrusionLoop();
 
10
    ~ExtrusionLoop();
 
11
    Clone<ExtrusionLoop> clone()
 
12
        %code{% RETVAL = THIS; %};
 
13
    void reverse();
 
14
    bool make_clockwise();
 
15
    bool make_counter_clockwise();
 
16
    Clone<Point> first_point();
 
17
    Clone<Point> last_point();
 
18
    Polygon* polygon()
 
19
        %code{% RETVAL = new Polygon (*THIS); %};
 
20
    void append(ExtrusionPath* path)
 
21
        %code{% THIS->paths.push_back(*path); %};
 
22
    double length();
 
23
    void split_at_vertex(Point* point)
 
24
        %code{% THIS->split_at_vertex(*point); %};
 
25
    void split_at(Point* point)
 
26
        %code{% THIS->split_at(*point); %};
 
27
    ExtrusionPaths clip_end(double distance)
 
28
        %code{% THIS->clip_end(distance, &RETVAL); %};
 
29
    bool has_overhang_point(Point* point)
 
30
        %code{% RETVAL = THIS->has_overhang_point(*point); %};
 
31
%{
 
32
 
 
33
SV*
 
34
ExtrusionLoop::arrayref()
 
35
    CODE:
 
36
        AV* av = newAV();
 
37
        av_fill(av, THIS->paths.size()-1);
 
38
        int i = 0;
 
39
        for (ExtrusionPaths::iterator it = THIS->paths.begin(); it != THIS->paths.end(); ++it) {
 
40
            av_store(av, i++, perl_to_SV_ref(*it));
 
41
        }
 
42
        RETVAL = newRV_noinc((SV*)av);
 
43
    OUTPUT:
 
44
        RETVAL
 
45
 
 
46
ExtrusionLoopRole
 
47
ExtrusionLoop::role(...)
 
48
    CODE:
 
49
        if (items > 1) {
 
50
            THIS->role = (ExtrusionLoopRole)SvUV(ST(1));
 
51
        }
 
52
        RETVAL = THIS->role;
 
53
    OUTPUT:
 
54
        RETVAL
 
55
 
 
56
%}
 
57
};
 
58
 
 
59
%package{Slic3r::ExtrusionLoop};
 
60
%{
 
61
 
 
62
IV
 
63
_constant()
 
64
  ALIAS:
 
65
    EXTRL_ROLE_DEFAULT                      = elrDefault
 
66
    EXTRL_ROLE_EXTERNAL_PERIMETER           = elrExternalPerimeter
 
67
    EXTRL_ROLE_CONTOUR_INTERNAL_PERIMETER   = elrContourInternalPerimeter
 
68
  PROTOTYPE:
 
69
  CODE:
 
70
    RETVAL = ix;
 
71
  OUTPUT: RETVAL
 
72
 
 
73
%}