Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'xs/xsp/Point.xsp')
-rw-r--r--xs/xsp/Point.xsp42
1 files changed, 21 insertions, 21 deletions
diff --git a/xs/xsp/Point.xsp b/xs/xsp/Point.xsp
index 1d569c4f3..0c3dae321 100644
--- a/xs/xsp/Point.xsp
+++ b/xs/xsp/Point.xsp
@@ -22,13 +22,13 @@
SV* pp()
%code{% RETVAL = to_SV_pureperl(THIS); %};
int x()
- %code{% RETVAL = THIS->x(); %};
+ %code{% RETVAL = (*THIS)(0); %};
int y()
- %code{% RETVAL = THIS->y(); %};
+ %code{% RETVAL = (*THIS)(1); %};
void set_x(int val)
- %code{% THIS->x() = val; %};
+ %code{% (*THIS)(0) = val; %};
void set_y(int val)
- %code{% THIS->y() = val; %};
+ %code{% (*THIS)(1) = val; %};
int nearest_point_index(Points points);
Clone<Point> nearest_point(Points points)
%code{% Point p; THIS->nearest_point(points, &p); RETVAL = p; %};
@@ -52,7 +52,7 @@
%code{% RETVAL = new Point(- *THIS); %};
bool coincides_with_epsilon(Point* point)
%code{% RETVAL = (*THIS) == *point; %};
- std::string serialize() %code{% char buf[2048]; sprintf(buf, "%ld,%ld", THIS->x(), THIS->y()); RETVAL = buf; %};
+ std::string serialize() %code{% char buf[2048]; sprintf(buf, "%ld,%ld", (*THIS)(0), (*THIS)(1)); RETVAL = buf; %};
%{
@@ -85,12 +85,12 @@ Point::coincides_with(point_sv)
Clone<Point3> clone()
%code{% RETVAL = THIS; %};
int x()
- %code{% RETVAL = THIS->x(); %};
+ %code{% RETVAL = (*THIS)(0); %};
int y()
- %code{% RETVAL = THIS->y(); %};
+ %code{% RETVAL = (*THIS)(1); %};
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; %};
+ %code{% RETVAL = (*THIS)(2); %};
+ std::string serialize() %code{% char buf[2048]; sprintf(buf, "%ld,%ld,%ld", (*THIS)(0), (*THIS)(1), (*THIS)(2)); RETVAL = buf; %};
};
%name{Slic3r::Pointf} class Pointf {
@@ -103,13 +103,13 @@ Point::coincides_with(point_sv)
SV* pp()
%code{% RETVAL = to_SV_pureperl(THIS); %};
double x()
- %code{% RETVAL = THIS->x(); %};
+ %code{% RETVAL = (*THIS)(0); %};
double y()
- %code{% RETVAL = THIS->y(); %};
+ %code{% RETVAL = (*THIS)(1); %};
void set_x(double val)
- %code{% THIS->x() = val; %};
+ %code{% (*THIS)(0) = val; %};
void set_y(double val)
- %code{% THIS->y() = val; %};
+ %code{% (*THIS)(1) = val; %};
void translate(double x, double y)
%code{% *THIS += Pointf(x, y); %};
void scale(double factor)
@@ -120,7 +120,7 @@ Point::coincides_with(point_sv)
%code{% RETVAL = new Pointf(- *THIS); %};
Pointf* vector_to(Pointf* point)
%code{% RETVAL = new Pointf(*point - *THIS); %};
- std::string serialize() %code{% char buf[2048]; sprintf(buf, "%lf,%lf", THIS->x(), THIS->y()); RETVAL = buf; %};
+ std::string serialize() %code{% char buf[2048]; sprintf(buf, "%lf,%lf", (*THIS)(0), (*THIS)(1)); RETVAL = buf; %};
};
%name{Slic3r::Pointf3} class Pointf3 {
@@ -129,17 +129,17 @@ Point::coincides_with(point_sv)
Clone<Pointf3> clone()
%code{% RETVAL = THIS; %};
double x()
- %code{% RETVAL = THIS->x(); %};
+ %code{% RETVAL = (*THIS)(0); %};
double y()
- %code{% RETVAL = THIS->y(); %};
+ %code{% RETVAL = (*THIS)(1); %};
double z()
- %code{% RETVAL = THIS->z(); %};
+ %code{% RETVAL = (*THIS)(2); %};
void set_x(double val)
- %code{% THIS->x() = val; %};
+ %code{% (*THIS)(0) = val; %};
void set_y(double val)
- %code{% THIS->y() = val; %};
+ %code{% (*THIS)(1) = val; %};
void set_z(double val)
- %code{% THIS->z() = val; %};
+ %code{% (*THIS)(2) = val; %};
void translate(double x, double y, double z)
%code{% *THIS += Pointf3(x, y, z); %};
void scale(double factor)
@@ -150,5 +150,5 @@ Point::coincides_with(point_sv)
%code{% RETVAL = new Pointf3(- *THIS); %};
Pointf3* vector_to(Pointf3* point)
%code{% RETVAL = new Pointf3(*point - *THIS); %};
- std::string serialize() %code{% char buf[2048]; sprintf(buf, "%lf,%lf,%lf", THIS->x(), THIS->y(), THIS->z()); RETVAL = buf; %};
+ std::string serialize() %code{% char buf[2048]; sprintf(buf, "%lf,%lf,%lf", (*THIS)(0), (*THIS)(1), (*THIS)(2)); RETVAL = buf; %};
};