Changed the Slic3r coordinate type from long to int32 to match

the point type on Windows / Linux / OSX
to achieve the same behavior on all the 32 / 64bit systems.
(Windows always treats the long as 32bit int, while Linux treats
long as a 64bit int).
This commit is contained in:
bubnikv 2018-02-12 18:16:10 +01:00
parent adc9e749c4
commit 47d904a628
7 changed files with 22 additions and 42 deletions

View file

@ -25,10 +25,10 @@
double radius();
Clone<Point> min_point() %code{% RETVAL = THIS->min; %};
Clone<Point> max_point() %code{% RETVAL = THIS->max; %};
long x_min() %code{% RETVAL = THIS->min.x; %};
long x_max() %code{% RETVAL = THIS->max.x; %};
long y_min() %code{% RETVAL = THIS->min.y; %};
long y_max() %code{% RETVAL = THIS->max.y; %};
int x_min() %code{% RETVAL = THIS->min.x; %};
int x_max() %code{% RETVAL = THIS->max.x; %};
int y_min() %code{% RETVAL = THIS->min.y; %};
int y_max() %code{% RETVAL = THIS->max.y; %};
std::string serialize() %code{% char buf[2048]; sprintf(buf, "%ld,%ld;%ld,%ld", THIS->min.x, THIS->min.y, THIS->max.x, THIS->max.y); RETVAL = buf; %};
bool defined() %code{% RETVAL = THIS->defined; %};

View file

@ -23,7 +23,7 @@ BridgeDetector*
BridgeDetector::new(expolygon, lower_slices, extrusion_width)
ExPolygon* expolygon;
ExPolygonCollection* lower_slices;
long extrusion_width;
int extrusion_width;
CODE:
RETVAL = new BridgeDetector(*expolygon, *lower_slices, extrusion_width);
OUTPUT:
@ -33,7 +33,7 @@ BridgeDetector*
BridgeDetector::new_expolygons(expolygons, lower_slices, extrusion_width)
ExPolygonCollection* expolygons;
ExPolygonCollection* lower_slices;
long extrusion_width;
int extrusion_width;
CODE:
RETVAL = new BridgeDetector(expolygons->expolygons, *lower_slices, extrusion_width);
OUTPUT:

View file

@ -26,8 +26,8 @@
float spacing();
float spacing_to(Flow* other)
%code{% RETVAL = THIS->spacing(*other); %};
long scaled_width();
long scaled_spacing();
int scaled_width();
int scaled_spacing();
double mm3_per_mm();
%{

View file

@ -8,7 +8,7 @@
%}
%name{Slic3r::Point} class Point {
Point(long _x = 0, long _y = 0);
Point(int _x = 0, int _y = 0);
~Point();
Clone<Point> clone()
%code{% RETVAL=THIS; %};
@ -18,13 +18,13 @@
%code{% RETVAL = to_SV_pureperl(THIS); %};
SV* pp()
%code{% RETVAL = to_SV_pureperl(THIS); %};
long x()
int x()
%code{% RETVAL = THIS->x; %};
long y()
int y()
%code{% RETVAL = THIS->y; %};
void set_x(long val)
void set_x(int val)
%code{% THIS->x = val; %};
void set_y(long val)
void set_y(int val)
%code{% THIS->y = val; %};
int nearest_point_index(Points points);
Clone<Point> nearest_point(Points points)
@ -77,15 +77,15 @@ Point::coincides_with(point_sv)
};
%name{Slic3r::Point3} class Point3 {
Point3(long _x = 0, long _y = 0, long _z = 0);
Point3(int _x = 0, int _y = 0, int _z = 0);
~Point3();
Clone<Point3> clone()
%code{% RETVAL = THIS; %};
long x()
int x()
%code{% RETVAL = THIS->x; %};
long y()
int y()
%code{% RETVAL = THIS->y; %};
long z()
int z()
%code{% RETVAL = THIS->z; %};
std::string serialize() %code{% char buf[2048]; sprintf(buf, "%ld,%ld,%ld", THIS->x, THIS->y, THIS->z); RETVAL = buf; %};
};