Return a reference to the actual item instead of a clone when accessing contents of a SurfaceCollection

This commit is contained in:
Alessandro Ranellucci 2013-07-15 13:50:53 +02:00
parent f612d4c64e
commit e485f0b130
3 changed files with 12 additions and 3 deletions

View file

@ -6,8 +6,6 @@
%}
%name{Slic3r::Surface} class Surface {
%name{_clone} Surface(Surface& self);
~Surface();
ExPolygon* expolygon()
%code{% const char* CLASS = "Slic3r::ExPolygon::XS"; RETVAL = new ExPolygon(THIS->expolygon); %};
double thickness()
@ -36,6 +34,14 @@ _new(CLASS, expolygon, surface_type, thickness, thickness_layers, bridge_angle,
OUTPUT:
RETVAL
void
Surface::DESTROY()
CODE:
if (!THIS->in_collection) {
delete THIS;
THIS = NULL;
}
SurfaceType
Surface::surface_type(...)
CODE: