Store width and height in ExtrusionEntity objects for debugging purposes

This commit is contained in:
Alessandro Ranellucci 2014-04-29 23:15:36 +02:00
parent 78a08e0665
commit 98e40d3fe4
11 changed files with 113 additions and 15 deletions

View file

@ -25,16 +25,20 @@
%{
ExtrusionLoop*
_new(CLASS, polygon_sv, role, mm3_per_mm)
_new(CLASS, polygon_sv, role, mm3_per_mm, width, height)
char* CLASS;
SV* polygon_sv;
ExtrusionRole role;
double mm3_per_mm;
float width;
float height;
CODE:
RETVAL = new ExtrusionLoop ();
RETVAL->polygon.from_SV_check(polygon_sv);
RETVAL->role = role;
RETVAL->mm3_per_mm = mm3_per_mm;
RETVAL->width = width;
RETVAL->height = height;
OUTPUT:
RETVAL
@ -68,5 +72,25 @@ ExtrusionLoop::mm3_per_mm(...)
OUTPUT:
RETVAL
float
ExtrusionLoop::width(...)
CODE:
if (items > 1) {
THIS->width = (float)SvNV(ST(1));
}
RETVAL = THIS->width;
OUTPUT:
RETVAL
float
ExtrusionLoop::height(...)
CODE:
if (items > 1) {
THIS->height = (float)SvNV(ST(1));
}
RETVAL = THIS->height;
OUTPUT:
RETVAL
%}
};

View file

@ -31,16 +31,20 @@
%{
ExtrusionPath*
_new(CLASS, polyline_sv, role, mm3_per_mm)
_new(CLASS, polyline_sv, role, mm3_per_mm, width, height)
char* CLASS;
SV* polyline_sv;
ExtrusionRole role;
double mm3_per_mm;
float width;
float height;
CODE:
RETVAL = new ExtrusionPath ();
RETVAL->polyline.from_SV_check(polyline_sv);
RETVAL->role = role;
RETVAL->mm3_per_mm = mm3_per_mm;
RETVAL->width = width;
RETVAL->height = height;
OUTPUT:
RETVAL
@ -74,6 +78,26 @@ ExtrusionPath::mm3_per_mm(...)
OUTPUT:
RETVAL
float
ExtrusionPath::width(...)
CODE:
if (items > 1) {
THIS->width = (float)SvNV(ST(1));
}
RETVAL = THIS->width;
OUTPUT:
RETVAL
float
ExtrusionPath::height(...)
CODE:
if (items > 1) {
THIS->height = (float)SvNV(ST(1));
}
RETVAL = THIS->height;
OUTPUT:
RETVAL
void
ExtrusionPath::append(...)
CODE: