Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase all tolerances to 1e-9 #226

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions genlib/p2dpoly.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@
enum { NOAXIS = -1, XAXIS = 0, YAXIS = 1 };

class Point2f;
bool approxeq(const Point2f &p1, const Point2f &p2, double tolerance = 0.0);
bool approxeq(const Point2f &p1, const Point2f &p2, double tolerance = 1e-9);
class QtRegion;
bool intersect_region(const QtRegion &a, const QtRegion &b, double tolerance = 0.0);
bool overlap_x(const QtRegion &a, const QtRegion &b, double tolerance = 0.0);
bool overlap_y(const QtRegion &a, const QtRegion &b, double tolerance = 0.0);
bool intersect_region(const QtRegion &a, const QtRegion &b, double tolerance = 1e-9);
bool overlap_x(const QtRegion &a, const QtRegion &b, double tolerance = 1e-9);
bool overlap_y(const QtRegion &a, const QtRegion &b, double tolerance = 1e-9);
class Line;
bool intersect_line(const Line &a, const Line &b, double tolerance = 0.0);
bool intersect_line_no_touch(const Line &a, const Line &b, double tolerance = 0.0);
int intersect_line_distinguish(const Line &a, const Line &b, double tolerance = 0.0);
int intersect_line_b(const Line &a, const Line &b, double tolerance = 0.0);
Point2f intersection_point(const Line &a, const Line &b, double tolerance = 0.0);
bool intersect_line(const Line &a, const Line &b, double tolerance = 1e-9);
bool intersect_line_no_touch(const Line &a, const Line &b, double tolerance = 1e-9);
int intersect_line_distinguish(const Line &a, const Line &b, double tolerance = 1e-9);
int intersect_line_b(const Line &a, const Line &b, double tolerance = 1e-9);
Point2f intersection_point(const Line &a, const Line &b, double tolerance = 1e-9);

// NaN on Intel:
// Quick mod - TV
Expand Down Expand Up @@ -109,7 +109,7 @@ class Point2f {
friend Point2f pointfromangle(double angle);
// a couple of useful tests
bool intriangle(const Point2f &p1, const Point2f &p2, const Point2f &p3);
bool insegment(const Point2f &key, const Point2f &p2, const Point2f &p3, double tolerance = 0.0);
bool insegment(const Point2f &key, const Point2f &p2, const Point2f &p3, double tolerance = 1e-9);
// for OS transformation (note: accurate only to 5 metres according to OS)
Point2f longlat2os(const Point2f &p);

Expand Down
4 changes: 2 additions & 2 deletions salalib/shapemap.h
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,8 @@ class ShapeMap : public PixelBase {
bool pointInPoly(const Point2f &p, int shaperef) const;
// retrieve lists of polys point intersects:
std::vector<int> pointInPolyList(const Point2f &p) const;
std::vector<int> lineInPolyList(const Line &li, size_t lineref = -1, double tolerance = 0.0) const;
std::vector<int> polyInPolyList(int polyref, double tolerance = 0.0) const;
std::vector<int> lineInPolyList(const Line &li, size_t lineref = -1, double tolerance = 1e-9) const;
std::vector<int> polyInPolyList(int polyref, double tolerance = 1e-9) const;
std::vector<int> shapeInPolyList(const SalaShape &shape);
// helper to make actual test of point in shape:
int testPointInPoly(const Point2f &p, const ShapeRef &shape) const;
Expand Down
4 changes: 2 additions & 2 deletions salalib/spacepix.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ class SpacePixel : public PixelBase {
virtual bool findNextLine(bool &) const;
virtual const Line &getNextLine() const;
//
bool intersect(const Line &l, double tolerance = 0.0);
bool intersect_exclude(const Line &l, double tolerance = 0.0);
bool intersect(const Line &l, double tolerance = 1e-9);
bool intersect_exclude(const Line &l, double tolerance = 1e-9);

void cutLine(Line &l, short dir);

Expand Down