Ported same_line() to XS

This commit is contained in:
Alessandro Ranellucci
2013-11-06 19:38:10 +01:00
parent b5aaeb9b12
commit d8e098ab0e
5 changed files with 21 additions and 9 deletions

View File

@@ -54,6 +54,12 @@ Line::point_at(double distance) const
return p;
}
bool
Line::coincides_with(const Line* line) const
{
return this->a.coincides_with(&line->a) && this->b.coincides_with(&line->b);
}
#ifdef SLIC3RXS
void
Line::from_SV(SV* line_sv)

View File

@@ -20,6 +20,7 @@ class Line
double length() const;
Point* midpoint() const;
Point* point_at(double distance) const;
bool coincides_with(const Line* line) const;
#ifdef SLIC3RXS
void from_SV(SV* line_sv);

View File

@@ -46,5 +46,15 @@ Line::rotate(angle, center_sv)
center.from_SV_check(center_sv);
THIS->rotate(angle, &center);
bool
Line::coincides_with(line_sv)
SV* line_sv;
CODE:
Line line;
line.from_SV_check(line_sv);
RETVAL = THIS->coincides_with(&line);
OUTPUT:
RETVAL
%}
};