From fc46d20e8411fe4b67269733f69d8a9dded4a42f Mon Sep 17 00:00:00 2001 From: Andreas Grois Date: Tue, 10 Nov 2015 13:39:56 +0100 Subject: Add angle sets (disjoint ranges) - initial support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit By adding a new angleset class, things get much easier to read. Also, the part of the previous commit that dealt with combining the individual ranges was kind of stupid. Things missing: o) functions to remove angle ranges from a set o) deferred add functions, that allow adding multiple ranges without calling the O(n²) function angleset::combine() in between. --- angleclass.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'angleclass.h') diff --git a/angleclass.h b/angleclass.h index 5b2e99e..8135c0a 100644 --- a/angleclass.h +++ b/angleclass.h @@ -39,19 +39,19 @@ public: angleclass(const double setme); void setval(const double setme); - double getval(); + double getval() const; - angleclass operator+(angleclass other); - angleclass operator-(angleclass other); - angleclass operator*(angleclass other); - angleclass operator/(angleclass other); + angleclass operator+(const angleclass other) const; + angleclass operator-(const angleclass other) const; + angleclass operator*(const angleclass other) const; + angleclass operator/(const angleclass other) const; //beware: these only compare the numeric value of the angle. - bool operator<(angleclass other); - bool operator>(angleclass other); - bool operator<=(angleclass other); - bool operator>=(angleclass other); - bool operator==(angleclass other); - bool operator!=(angleclass other); + bool operator<(const angleclass other) const; + bool operator>(const angleclass other) const; + bool operator<=(const angleclass other) const; + bool operator>=(const angleclass other) const; + bool operator==(const angleclass other) const; + bool operator!=(const angleclass other) const; }; #endif // ANGLECLASS_H -- cgit v1.2.3