mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-23 14:44:19 -06:00
Refactored signatures of many C++ methods for more efficient and safer style. Includes a bugfix for Point::nearest_point() which was returning a pointer to freed memory. #1961
This commit is contained in:
parent
6201aacf88
commit
ca4d4211c9
30 changed files with 203 additions and 161 deletions
|
@ -53,7 +53,7 @@ Line::reverse()
|
|||
double
|
||||
Line::length() const
|
||||
{
|
||||
return this->a.distance_to(&(this->b));
|
||||
return this->a.distance_to(this->b);
|
||||
}
|
||||
|
||||
Point*
|
||||
|
@ -82,15 +82,15 @@ Line::point_at(double distance) const
|
|||
}
|
||||
|
||||
bool
|
||||
Line::coincides_with(const Line* line) const
|
||||
Line::coincides_with(const Line &line) const
|
||||
{
|
||||
return this->a.coincides_with(&line->a) && this->b.coincides_with(&line->b);
|
||||
return this->a.coincides_with(line.a) && this->b.coincides_with(line.b);
|
||||
}
|
||||
|
||||
double
|
||||
Line::distance_to(const Point* point) const
|
||||
Line::distance_to(const Point &point) const
|
||||
{
|
||||
return point->distance_to(this);
|
||||
return point.distance_to(*this);
|
||||
}
|
||||
|
||||
double
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue