diff options
author | bubnikv <bubnikv@gmail.com> | 2016-09-13 14:30:00 +0300 |
---|---|---|
committer | bubnikv <bubnikv@gmail.com> | 2016-09-13 14:30:00 +0300 |
commit | 620c6c7378c4799980f63794669548c104b9bcea (patch) | |
tree | fc7aea3342539018bb19d27abd1144956eb00b4d /xs/xsp/Point.xsp | |
parent | a5b7f14dfa291039fd6971a356efd011fab84440 (diff) |
Ported from the playground branch. Various documentation and optimization.
Diffstat (limited to 'xs/xsp/Point.xsp')
-rw-r--r-- | xs/xsp/Point.xsp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/xs/xsp/Point.xsp b/xs/xsp/Point.xsp index 60a4864e3..e1467143c 100644 --- a/xs/xsp/Point.xsp +++ b/xs/xsp/Point.xsp @@ -49,6 +49,7 @@ %code{% RETVAL = new Point(THIS->negative()); %}; bool coincides_with_epsilon(Point* point) %code{% RETVAL = THIS->coincides_with_epsilon(*point); %}; + std::string serialize() %code{% char buf[2048]; sprintf(buf, "%d,%d", THIS->x, THIS->y); RETVAL = buf; %}; %{ @@ -86,6 +87,7 @@ Point::coincides_with(point_sv) %code{% RETVAL = THIS->y; %}; long z() %code{% RETVAL = THIS->z; %}; + std::string serialize() %code{% char buf[2048]; sprintf(buf, "%d,%d,%d", THIS->x, THIS->y, THIS->z); RETVAL = buf; %}; }; %name{Slic3r::Pointf} class Pointf { @@ -113,6 +115,7 @@ Point::coincides_with(point_sv) %code{% RETVAL = THIS->negative(); %}; Clone<Pointf> vector_to(Pointf* point) %code{% RETVAL = THIS->vector_to(*point); %}; + std::string serialize() %code{% char buf[2048]; sprintf(buf, "%lf,%lf", THIS->x, THIS->y); RETVAL = buf; %}; }; %name{Slic3r::Pointf3} class Pointf3 { @@ -140,4 +143,5 @@ Point::coincides_with(point_sv) %code{% RETVAL = THIS->negative(); %}; Clone<Pointf3> vector_to(Pointf3* point) %code{% RETVAL = THIS->vector_to(*point); %}; + std::string serialize() %code{% char buf[2048]; sprintf(buf, "%lf,%lf,%lf", THIS->x, THIS->y, THIS->z); RETVAL = buf; %}; }; |