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

« back to all changes in this revision

Viewing changes to xs/xsp/Flow.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 "Flow.hpp"
 
6
%}
 
7
 
 
8
%name{Slic3r::Flow} class Flow {
 
9
    ~Flow();
 
10
    %name{_new} Flow(float width, float spacing, float nozzle_diameter);
 
11
    void set_bridge(bool bridge)
 
12
        %code{% THIS->bridge = bridge; %};
 
13
    Clone<Flow> clone()
 
14
        %code{% RETVAL = THIS; %};
 
15
    
 
16
    float width()
 
17
        %code{% RETVAL = THIS->width; %};
 
18
    float spacing()
 
19
        %code{% RETVAL = THIS->spacing; %};
 
20
    float nozzle_diameter()
 
21
        %code{% RETVAL = THIS->nozzle_diameter; %};
 
22
    bool bridge()
 
23
        %code{% RETVAL = THIS->bridge; %};
 
24
    long scaled_width()
 
25
        %code{% RETVAL = THIS->scaled_width; %};
 
26
    long scaled_spacing()
 
27
        %code{% RETVAL = THIS->scaled_spacing; %};
 
28
    
 
29
    double mm3_per_mm(float height);
 
30
%{
 
31
 
 
32
Flow*
 
33
_new_from_width(CLASS, role, width, nozzle_diameter, height, bridge_flow_ratio)
 
34
    char*           CLASS;
 
35
    FlowRole        role;
 
36
    std::string     width;
 
37
    float           nozzle_diameter;
 
38
    float           height;
 
39
    float           bridge_flow_ratio;
 
40
    CODE:
 
41
        ConfigOptionFloatOrPercent optwidth;
 
42
        optwidth.deserialize(width);
 
43
        RETVAL = new Flow(Flow::new_from_config_width(role, optwidth, nozzle_diameter, height, bridge_flow_ratio));
 
44
    OUTPUT:
 
45
        RETVAL
 
46
 
 
47
Flow*
 
48
_new_from_spacing(CLASS, spacing, nozzle_diameter, height, bridge)
 
49
    char*           CLASS;
 
50
    float           spacing;
 
51
    float           nozzle_diameter;
 
52
    float           height;
 
53
    bool            bridge;
 
54
    CODE:
 
55
        RETVAL = new Flow(Flow::new_from_spacing(spacing, nozzle_diameter, height, bridge));
 
56
    OUTPUT:
 
57
        RETVAL
 
58
 
 
59
%}
 
60
};
 
61
 
 
62
%package{Slic3r::Flow};
 
63
%{
 
64
 
 
65
IV
 
66
_constant()
 
67
  ALIAS:
 
68
    FLOW_ROLE_PERIMETER                     = frPerimeter
 
69
    FLOW_ROLE_INFILL                        = frInfill
 
70
    FLOW_ROLE_SOLID_INFILL                  = frSolidInfill
 
71
    FLOW_ROLE_TOP_SOLID_INFILL              = frTopSolidInfill
 
72
    FLOW_ROLE_SUPPORT_MATERIAL              = frSupportMaterial
 
73
    FLOW_ROLE_SUPPORT_MATERIAL_INTERFACE    = frSupportMaterialInterface
 
74
  PROTOTYPE:
 
75
  CODE:
 
76
    RETVAL = ix;
 
77
  OUTPUT: RETVAL
 
78
 
 
79
%}
 
80