Finished porting PerimeterGenerator to C++

This commit is contained in:
Alessandro Ranellucci 2015-07-23 15:53:02 +02:00
parent 0e18b094d1
commit b4515cf695
17 changed files with 368 additions and 644 deletions

View file

@ -7,6 +7,7 @@
%name{Slic3r::ExtrusionPath::Collection} class ExtrusionEntityCollection {
%name{_new} ExtrusionEntityCollection();
~ExtrusionEntityCollection();
Clone<ExtrusionEntityCollection> clone()
%code{% RETVAL = THIS->clone(); %};
void reverse();
@ -41,14 +42,6 @@
Polygons grow();
%{
void
ExtrusionEntityCollection::DESTROY()
CODE:
for (ExtrusionEntitiesPtr::iterator it = THIS->entities.begin(); it != THIS->entities.end(); ++it) {
delete *it;
}
delete THIS;
SV*
ExtrusionEntityCollection::arrayref()
CODE:

View file

@ -0,0 +1,34 @@
%module{Slic3r::XS};
%{
#include <myinit.h>
#include "libslic3r/PerimeterGenerator.hpp"
%}
%name{Slic3r::Layer::PerimeterGenerator} class PerimeterGenerator {
PerimeterGenerator(SurfaceCollection* slices, double layer_height, Flow* flow,
PrintRegionConfig* config, PrintObjectConfig* object_config,
PrintConfig* print_config, ExtrusionEntityCollection* loops,
ExtrusionEntityCollection* gap_fill, SurfaceCollection* fill_surfaces)
%code{% RETVAL = new PerimeterGenerator(slices, layer_height, *flow,
config, object_config, print_config, loops, gap_fill, fill_surfaces); %};
~PerimeterGenerator();
void set_lower_slices(ExPolygonCollection* lower_slices)
%code{% THIS->lower_slices = lower_slices; %};
void set_layer_id(int layer_id)
%code{% THIS->layer_id = layer_id; %};
void set_perimeter_flow(Flow* flow)
%code{% THIS->perimeter_flow = *flow; %};
void set_ext_perimeter_flow(Flow* flow)
%code{% THIS->ext_perimeter_flow = *flow; %};
void set_overhang_flow(Flow* flow)
%code{% THIS->overhang_flow = *flow; %};
void set_solid_infill_flow(Flow* flow)
%code{% THIS->solid_infill_flow = *flow; %};
Ref<PrintRegionConfig> config()
%code{% RETVAL = THIS->config; %};
void process();
};

View file

@ -198,6 +198,10 @@ BridgeDetector* O_OBJECT_SLIC3R
Ref<BridgeDetector> O_OBJECT_SLIC3R_T
Clone<BridgeDetector> O_OBJECT_SLIC3R_T
PerimeterGenerator* O_OBJECT_SLIC3R
Ref<PerimeterGenerator> O_OBJECT_SLIC3R_T
Clone<PerimeterGenerator> O_OBJECT_SLIC3R_T
GLVertexArray* O_OBJECT_SLIC3R
Axis T_UV

View file

@ -94,6 +94,12 @@
%typemap{BridgeDetector*};
%typemap{Ref<BridgeDetector>}{simple};
%typemap{Clone<BridgeDetector>}{simple};
%typemap{SurfaceCollection*};
%typemap{Ref<SurfaceCollection>}{simple};
%typemap{Clone<SurfaceCollection>}{simple};
%typemap{PerimeterGenerator*};
%typemap{Ref<PerimeterGenerator>}{simple};
%typemap{Clone<PerimeterGenerator>}{simple};
%typemap{Surface*};
%typemap{Ref<Surface>}{simple};
@ -153,7 +159,6 @@
%typemap{Polygons*};
%typemap{TriangleMesh*};
%typemap{TriangleMeshPtrs};
%typemap{Ref<SurfaceCollection>}{simple};
%typemap{Extruder*};
%typemap{Ref<Extruder>}{simple};
%typemap{Clone<Extruder>}{simple};